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