Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1571)

Unified Diff: content/browser/transition_request_manager.cc

Issue 297973002: Navigation transitions: Block first response until after transitions have run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/transition_request_manager.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ab651fed5511c1bd461fd06db8be13115107433e
--- /dev/null
+++ b/content/browser/transition_request_manager.cc
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// 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"
+#include "content/public/browser/browser_thread.h"
+
+namespace content {
+
+bool TransitionRequestManager::HasPendingTransitionRequest(
+ int process_id,
+ int render_frame_id) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+ std::pair<int, int> key(process_id, render_frame_id);
+ return (pending_transition_frames_.find(key) !=
+ pending_transition_frames_.end());
+}
+
+void TransitionRequestManager::SetHasPendingTransitionRequest(
+ int process_id,
+ int render_frame_id,
+ bool has_pending) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+ std::pair<int, int> key(process_id, render_frame_id);
+ if (has_pending) {
+ pending_transition_frames_.insert(key);
+ } else {
+ pending_transition_frames_.erase(key);
+ }
+}
+
+TransitionRequestManager::TransitionRequestManager() {
+}
+
+TransitionRequestManager::~TransitionRequestManager() {
+}
+
+// static
+TransitionRequestManager* TransitionRequestManager::GetInstance() {
+ return Singleton<TransitionRequestManager>::get();
+}
+
+} // namespace content
« no previous file with comments | « content/browser/transition_request_manager.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698