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

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: just comments / minor restructuring (trybots previous) Created 4 years, 11 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::RenderFrameHost* frame = web_contents_->GetMainFrame();
93 content::BrowserThread::PostTask( 93 content::BrowserThread::PostTask(
94 content::BrowserThread::IO, FROM_HERE, 94 content::BrowserThread::IO, FROM_HERE,
95 base::Bind( 95 base::Bind(
96 &content::ResourceDispatcherHost::ResumeBlockedRequestsForRoute, 96 &content::ResourceDispatcherHost::ResumeBlockedRequestsForFrame,
97 base::Unretained(content::ResourceDispatcherHost::Get()), 97 base::Unretained(content::ResourceDispatcherHost::Get()),
98 frame->GetProcess()->GetID(), 98 frame->GetProcess()->GetID(), frame->GetRoutingID()));
99 frame->GetRenderViewHost()->GetRoutingID()));
100 } 99 }
101 } 100 }
102 101
103 content::WebContents* AppWindowContentsImpl::GetWebContents() const { 102 content::WebContents* AppWindowContentsImpl::GetWebContents() const {
104 return web_contents_.get(); 103 return web_contents_.get();
105 } 104 }
106 105
107 WindowController* AppWindowContentsImpl::GetWindowController() const { 106 WindowController* AppWindowContentsImpl::GetWindowController() const {
108 return nullptr; 107 return nullptr;
109 } 108 }
(...skipping 19 matching lines...) Expand all
129 host_->UpdateDraggableRegions(regions); 128 host_->UpdateDraggableRegions(regions);
130 } 129 }
131 130
132 void AppWindowContentsImpl::SuspendRenderFrameHost( 131 void AppWindowContentsImpl::SuspendRenderFrameHost(
133 content::RenderFrameHost* rfh) { 132 content::RenderFrameHost* rfh) {
134 DCHECK(rfh); 133 DCHECK(rfh);
135 // Don't bother blocking requests if the renderer side is already good to go. 134 // Don't bother blocking requests if the renderer side is already good to go.
136 if (is_window_ready_) 135 if (is_window_ready_)
137 return; 136 return;
138 is_blocking_requests_ = true; 137 is_blocking_requests_ = true;
139 // The ResourceDispatcherHost only accepts RenderViewHost child ids.
140 // TODO(devlin): This will need to change for site isolation.
141 content::BrowserThread::PostTask( 138 content::BrowserThread::PostTask(
142 content::BrowserThread::IO, FROM_HERE, 139 content::BrowserThread::IO, FROM_HERE,
143 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, 140 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForFrame,
144 base::Unretained(content::ResourceDispatcherHost::Get()), 141 base::Unretained(content::ResourceDispatcherHost::Get()),
145 rfh->GetProcess()->GetID(), 142 rfh->GetProcess()->GetID(), rfh->GetRoutingID()));
146 rfh->GetRenderViewHost()->GetRoutingID()));
147 } 143 }
148 144
149 } // namespace extensions 145 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698