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

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

Issue 2758993002: Move the functions which block, resume and cancel requests for a frame route id out of ResourceDisp… (Closed)
Patch Set: Remove DCHECK for RDHI on the same lines as the old code Created 3 years, 9 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 <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "content/public/browser/browser_context.h" 11 #include "content/public/browser/browser_context.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/browser/render_frame_host.h" 13 #include "content/public/browser/render_frame_host.h"
14 #include "content/public/browser/render_process_host.h" 14 #include "content/public/browser/render_process_host.h"
15 #include "content/public/browser/render_view_host.h" 15 #include "content/public/browser/render_view_host.h"
16 #include "content/public/browser/resource_dispatcher_host.h"
17 #include "content/public/browser/site_instance.h" 16 #include "content/public/browser/site_instance.h"
18 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
19 #include "content/public/common/renderer_preferences.h" 18 #include "content/public/common/renderer_preferences.h"
20 #include "extensions/browser/app_window/native_app_window.h" 19 #include "extensions/browser/app_window/native_app_window.h"
21 #include "extensions/common/extension_messages.h" 20 #include "extensions/common/extension_messages.h"
22 21
23 namespace extensions { 22 namespace extensions {
24 23
25 AppWindowContentsImpl::AppWindowContentsImpl(AppWindow* host) 24 AppWindowContentsImpl::AppWindowContentsImpl(AppWindow* host)
26 : host_(host), is_blocking_requests_(false), is_window_ready_(false) {} 25 : host_(host), is_blocking_requests_(false), is_window_ready_(false) {}
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 78
80 void AppWindowContentsImpl::NativeWindowClosed() { 79 void AppWindowContentsImpl::NativeWindowClosed() {
81 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); 80 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
82 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); 81 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID()));
83 } 82 }
84 83
85 void AppWindowContentsImpl::OnWindowReady() { 84 void AppWindowContentsImpl::OnWindowReady() {
86 is_window_ready_ = true; 85 is_window_ready_ = true;
87 if (is_blocking_requests_) { 86 if (is_blocking_requests_) {
88 is_blocking_requests_ = false; 87 is_blocking_requests_ = false;
89 content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI( 88 content::RenderFrameHost::ResumeBlockedRequestsForFrame(
90 web_contents_->GetMainFrame()); 89 web_contents_->GetMainFrame());
91 } 90 }
92 } 91 }
93 92
94 content::WebContents* AppWindowContentsImpl::GetWebContents() const { 93 content::WebContents* AppWindowContentsImpl::GetWebContents() const {
95 return web_contents_.get(); 94 return web_contents_.get();
96 } 95 }
97 96
98 WindowController* AppWindowContentsImpl::GetWindowController() const { 97 WindowController* AppWindowContentsImpl::GetWindowController() const {
99 return nullptr; 98 return nullptr;
(...skipping 20 matching lines...) Expand all
120 host_->UpdateDraggableRegions(regions); 119 host_->UpdateDraggableRegions(regions);
121 } 120 }
122 121
123 void AppWindowContentsImpl::SuspendRenderFrameHost( 122 void AppWindowContentsImpl::SuspendRenderFrameHost(
124 content::RenderFrameHost* rfh) { 123 content::RenderFrameHost* rfh) {
125 DCHECK(rfh); 124 DCHECK(rfh);
126 // Don't bother blocking requests if the renderer side is already good to go. 125 // Don't bother blocking requests if the renderer side is already good to go.
127 if (is_window_ready_) 126 if (is_window_ready_)
128 return; 127 return;
129 is_blocking_requests_ = true; 128 is_blocking_requests_ = true;
130 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); 129 content::RenderFrameHost::BlockRequestsForFrame(rfh);
131 } 130 }
132 131
133 } // namespace extensions 132 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698