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

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

Issue 1542743002: [RDHI] Refactored blocked_loaders_map_ to key by render frame route id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nasko nit Created 4 years, 10 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 | « content/public/test/mock_render_process_host.cc ('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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 content::RenderFrameHost* rfh = web_contents_->GetMainFrame(); 82 content::RenderFrameHost* rfh = web_contents_->GetMainFrame();
83 rfh->Send(new ExtensionMsg_MessageInvoke( 83 rfh->Send(new ExtensionMsg_MessageInvoke(
84 rfh->GetRoutingID(), host_->extension_id(), "app.window", 84 rfh->GetRoutingID(), host_->extension_id(), "app.window",
85 "appWindowShownForTests", args, false)); 85 "appWindowShownForTests", args, false));
86 } 86 }
87 87
88 void AppWindowContentsImpl::OnWindowReady() { 88 void AppWindowContentsImpl::OnWindowReady() {
89 is_window_ready_ = true; 89 is_window_ready_ = true;
90 if (is_blocking_requests_) { 90 if (is_blocking_requests_) {
91 is_blocking_requests_ = false; 91 is_blocking_requests_ = false;
92 content::RenderFrameHost* frame = web_contents_->GetMainFrame(); 92 content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI(
Devlin 2016/02/03 21:02:55 Yay type checking! I had a bug awhile back that t
93 content::BrowserThread::PostTask( 93 web_contents_->GetMainFrame());
94 content::BrowserThread::IO, FROM_HERE,
95 base::Bind(
96 &content::ResourceDispatcherHost::ResumeBlockedRequestsForRoute,
97 base::Unretained(content::ResourceDispatcherHost::Get()),
98 frame->GetProcess()->GetID(),
99 frame->GetRenderViewHost()->GetRoutingID()));
100 } 94 }
101 } 95 }
102 96
103 content::WebContents* AppWindowContentsImpl::GetWebContents() const { 97 content::WebContents* AppWindowContentsImpl::GetWebContents() const {
104 return web_contents_.get(); 98 return web_contents_.get();
105 } 99 }
106 100
107 WindowController* AppWindowContentsImpl::GetWindowController() const { 101 WindowController* AppWindowContentsImpl::GetWindowController() const {
108 return nullptr; 102 return nullptr;
109 } 103 }
(...skipping 19 matching lines...) Expand all
129 host_->UpdateDraggableRegions(regions); 123 host_->UpdateDraggableRegions(regions);
130 } 124 }
131 125
132 void AppWindowContentsImpl::SuspendRenderFrameHost( 126 void AppWindowContentsImpl::SuspendRenderFrameHost(
133 content::RenderFrameHost* rfh) { 127 content::RenderFrameHost* rfh) {
134 DCHECK(rfh); 128 DCHECK(rfh);
135 // Don't bother blocking requests if the renderer side is already good to go. 129 // Don't bother blocking requests if the renderer side is already good to go.
136 if (is_window_ready_) 130 if (is_window_ready_)
137 return; 131 return;
138 is_blocking_requests_ = true; 132 is_blocking_requests_ = true;
139 // The ResourceDispatcherHost only accepts RenderViewHost child ids. 133 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh);
140 // TODO(devlin): This will need to change for site isolation.
141 content::BrowserThread::PostTask(
142 content::BrowserThread::IO, FROM_HERE,
143 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute,
144 base::Unretained(content::ResourceDispatcherHost::Get()),
145 rfh->GetProcess()->GetID(),
146 rfh->GetRenderViewHost()->GetRoutingID()));
147 } 134 }
148 135
149 } // namespace extensions 136 } // namespace extensions
OLDNEW
« no previous file with comments | « content/public/test/mock_render_process_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698