Save errno for logging before potentially overwriting it.
[chromium-blink-merge.git] / content / browser / cross_site_request_manager.cc
blob2fa38b185ab3769b48274774c3bc6ba951c8fbe3
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/cross_site_request_manager.h"
7 #include "base/memory/singleton.h"
9 namespace content {
11 bool CrossSiteRequestManager::HasPendingCrossSiteRequest(int renderer_id,
12 int render_view_id) {
13 base::AutoLock lock(lock_);
15 std::pair<int, int> key(renderer_id, render_view_id);
16 return pending_cross_site_views_.find(key) !=
17 pending_cross_site_views_.end();
20 void CrossSiteRequestManager::SetHasPendingCrossSiteRequest(int renderer_id,
21 int render_view_id,
22 bool has_pending) {
23 base::AutoLock lock(lock_);
25 std::pair<int, int> key(renderer_id, render_view_id);
26 if (has_pending) {
27 pending_cross_site_views_.insert(key);
28 } else {
29 pending_cross_site_views_.erase(key);
33 CrossSiteRequestManager::CrossSiteRequestManager() {}
35 CrossSiteRequestManager::~CrossSiteRequestManager() {}
37 // static
38 CrossSiteRequestManager* CrossSiteRequestManager::GetInstance() {
39 return Singleton<CrossSiteRequestManager>::get();
42 } // namespace content