Chromium Code Reviews| Index: content/browser/transition_request_manager.cc |
| diff --git a/content/browser/transition_request_manager.cc b/content/browser/transition_request_manager.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..22d2c69f618a80d47a34e367623036047130c457 |
| --- /dev/null |
| +++ b/content/browser/transition_request_manager.cc |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
|
nasko
2014/05/28 22:59:00
No "(c)" needed.
shatch
2014/05/29 21:41:22
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/browser/transition_request_manager.h" |
| + |
| +#include "base/memory/singleton.h" |
| + |
| +namespace content { |
| + |
| +bool TransitionRequestManager::HasPendingTransitionRequest( |
| + int renderer_id, int render_view_id) { |
| + base::AutoLock lock(lock_); |
| + |
| + std::pair<int, int> key(renderer_id, render_view_id); |
| + return pending_transition_views_.find(key) != |
| + pending_transition_views_.end(); |
| +} |
| + |
| +void TransitionRequestManager::SetHasPendingTransitionRequest( |
| + int renderer_id, int render_view_id, bool has_pending) { |
| + base::AutoLock lock(lock_); |
| + |
| + std::pair<int, int> key(renderer_id, render_view_id); |
| + if (has_pending) { |
| + pending_transition_views_.insert(key); |
| + } else { |
| + pending_transition_views_.erase(key); |
| + } |
| +} |
| + |
| +TransitionRequestManager::TransitionRequestManager() {} |
| + |
| +TransitionRequestManager::~TransitionRequestManager() {} |
| + |
| +// static |
| +TransitionRequestManager* TransitionRequestManager::GetInstance() { |
| + return Singleton<TransitionRequestManager>::get(); |
| +} |
| + |
| +} // namespace content |