OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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. |
| 4 |
| 5 #include "content/browser/transition_request_manager.h" |
| 6 |
| 7 #include "base/memory/singleton.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 bool TransitionRequestManager::HasPendingTransitionRequest(int process_id, |
| 12 int render_view_id) { |
| 13 base::AutoLock lock(lock_); |
| 14 |
| 15 std::pair<int, int> key(process_id, render_view_id); |
| 16 return pending_transition_views_.find(key) != pending_transition_views_.end(); |
| 17 } |
| 18 |
| 19 void TransitionRequestManager::SetHasPendingTransitionRequest( |
| 20 int process_id, |
| 21 int render_view_id, |
| 22 bool has_pending) { |
| 23 base::AutoLock lock(lock_); |
| 24 |
| 25 std::pair<int, int> key(process_id, render_view_id); |
| 26 if (has_pending) { |
| 27 pending_transition_views_.insert(key); |
| 28 } else { |
| 29 pending_transition_views_.erase(key); |
| 30 } |
| 31 } |
| 32 |
| 33 TransitionRequestManager::TransitionRequestManager() { |
| 34 } |
| 35 |
| 36 TransitionRequestManager::~TransitionRequestManager() { |
| 37 } |
| 38 |
| 39 // static |
| 40 TransitionRequestManager* TransitionRequestManager::GetInstance() { |
| 41 return Singleton<TransitionRequestManager>::get(); |
| 42 } |
| 43 |
| 44 } // namespace content |
OLD | NEW |