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( |
| 12 int process_id, |
| 13 int render_frame_id) { |
| 14 base::AutoLock lock(lock_); |
| 15 |
| 16 std::pair<int, int> key(process_id, render_frame_id); |
| 17 return (pending_transition_frames_.find(key) != |
| 18 pending_transition_frames_.end()); |
| 19 } |
| 20 |
| 21 void TransitionRequestManager::SetHasPendingTransitionRequest( |
| 22 int process_id, |
| 23 int render_frame_id, |
| 24 bool has_pending) { |
| 25 base::AutoLock lock(lock_); |
| 26 |
| 27 std::pair<int, int> key(process_id, render_frame_id); |
| 28 if (has_pending) { |
| 29 pending_transition_frames_.insert(key); |
| 30 } else { |
| 31 pending_transition_frames_.erase(key); |
| 32 } |
| 33 } |
| 34 |
| 35 TransitionRequestManager::TransitionRequestManager() { |
| 36 } |
| 37 |
| 38 TransitionRequestManager::~TransitionRequestManager() { |
| 39 } |
| 40 |
| 41 // static |
| 42 TransitionRequestManager* TransitionRequestManager::GetInstance() { |
| 43 return Singleton<TransitionRequestManager>::get(); |
| 44 } |
| 45 |
| 46 } // namespace content |
OLD | NEW |