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

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 comments 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
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 return;
125 host_->OnReadyToCommitFirstNavigation();
Devlin 2015/09/16 22:37:14 nit: instead of early returning, just put the call
clamy 2015/09/16 23:08:25 Done.
126 }
127
121 void AppWindowContentsImpl::UpdateDraggableRegions( 128 void AppWindowContentsImpl::UpdateDraggableRegions(
122 const std::vector<DraggableRegion>& regions) { 129 const std::vector<DraggableRegion>& regions) {
123 host_->UpdateDraggableRegions(regions); 130 host_->UpdateDraggableRegions(regions);
124 } 131 }
125 132
126 void AppWindowContentsImpl::SuspendRenderFrameHost( 133 void AppWindowContentsImpl::SuspendRenderFrameHost(
127 content::RenderFrameHost* rfh) { 134 content::RenderFrameHost* rfh) {
128 DCHECK(rfh); 135 DCHECK(rfh);
129 // Don't bother blocking requests if the renderer side is already good to go. 136 // Don't bother blocking requests if the renderer side is already good to go.
130 if (is_window_ready_) 137 if (is_window_ready_)
131 return; 138 return;
132 is_blocking_requests_ = true; 139 is_blocking_requests_ = true;
133 // The ResourceDispatcherHost only accepts RenderViewHost child ids. 140 // The ResourceDispatcherHost only accepts RenderViewHost child ids.
134 // TODO(devlin): This will need to change for site isolation. 141 // TODO(devlin): This will need to change for site isolation.
135 content::BrowserThread::PostTask( 142 content::BrowserThread::PostTask(
136 content::BrowserThread::IO, FROM_HERE, 143 content::BrowserThread::IO, FROM_HERE,
137 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, 144 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute,
138 base::Unretained(content::ResourceDispatcherHost::Get()), 145 base::Unretained(content::ResourceDispatcherHost::Get()),
139 rfh->GetProcess()->GetID(), 146 rfh->GetProcess()->GetID(),
140 rfh->GetRenderViewHost()->GetRoutingID())); 147 rfh->GetRenderViewHost()->GetRoutingID()));
141 } 148 }
142 149
143 } // namespace extensions 150 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698