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

Side by Side Diff: extensions/browser/app_window/app_window_contents.cc

Issue 1340163002: PlzNavigate: fix timing issue in app window creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-throttle
Patch Set: Addressed nits Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/app_window/app_window_contents.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/app_window/app_window_contents.h" 5 #include "extensions/browser/app_window/app_window_contents.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 bool AppWindowContentsImpl::OnMessageReceived(const IPC::Message& message) { 111 bool AppWindowContentsImpl::OnMessageReceived(const IPC::Message& message) {
112 bool handled = true; 112 bool handled = true;
113 IPC_BEGIN_MESSAGE_MAP(AppWindowContentsImpl, message) 113 IPC_BEGIN_MESSAGE_MAP(AppWindowContentsImpl, message)
114 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions, 114 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions,
115 UpdateDraggableRegions) 115 UpdateDraggableRegions)
116 IPC_MESSAGE_UNHANDLED(handled = false) 116 IPC_MESSAGE_UNHANDLED(handled = false)
117 IPC_END_MESSAGE_MAP() 117 IPC_END_MESSAGE_MAP()
118 return handled; 118 return handled;
119 } 119 }
120 120
121 void AppWindowContentsImpl::ReadyToCommitNavigation(
122 content::NavigationHandle* handle) {
123 if (!is_window_ready_)
124 host_->OnReadyToCommitFirstNavigation();
125 }
126
121 void AppWindowContentsImpl::UpdateDraggableRegions( 127 void AppWindowContentsImpl::UpdateDraggableRegions(
122 const std::vector<DraggableRegion>& regions) { 128 const std::vector<DraggableRegion>& regions) {
123 host_->UpdateDraggableRegions(regions); 129 host_->UpdateDraggableRegions(regions);
124 } 130 }
125 131
126 void AppWindowContentsImpl::SuspendRenderFrameHost( 132 void AppWindowContentsImpl::SuspendRenderFrameHost(
127 content::RenderFrameHost* rfh) { 133 content::RenderFrameHost* rfh) {
128 DCHECK(rfh); 134 DCHECK(rfh);
129 // Don't bother blocking requests if the renderer side is already good to go. 135 // Don't bother blocking requests if the renderer side is already good to go.
130 if (is_window_ready_) 136 if (is_window_ready_)
131 return; 137 return;
132 is_blocking_requests_ = true; 138 is_blocking_requests_ = true;
133 // The ResourceDispatcherHost only accepts RenderViewHost child ids. 139 // The ResourceDispatcherHost only accepts RenderViewHost child ids.
134 // TODO(devlin): This will need to change for site isolation. 140 // TODO(devlin): This will need to change for site isolation.
135 content::BrowserThread::PostTask( 141 content::BrowserThread::PostTask(
136 content::BrowserThread::IO, FROM_HERE, 142 content::BrowserThread::IO, FROM_HERE,
137 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, 143 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute,
138 base::Unretained(content::ResourceDispatcherHost::Get()), 144 base::Unretained(content::ResourceDispatcherHost::Get()),
139 rfh->GetProcess()->GetID(), 145 rfh->GetProcess()->GetID(),
140 rfh->GetRenderViewHost()->GetRoutingID())); 146 rfh->GetRenderViewHost()->GetRoutingID()));
141 } 147 }
142 148
143 } // namespace extensions 149 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/app_window/app_window_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698