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

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: Rebased to tip 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
« no previous file with comments | « content/public/browser/resource_dispatcher_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 <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 web_contents_->GetMainFrame()->ResumeBlockedRequestsForFrame();
90 web_contents_->GetMainFrame());
91 } 89 }
92 } 90 }
93 91
94 content::WebContents* AppWindowContentsImpl::GetWebContents() const { 92 content::WebContents* AppWindowContentsImpl::GetWebContents() const {
95 return web_contents_.get(); 93 return web_contents_.get();
96 } 94 }
97 95
98 WindowController* AppWindowContentsImpl::GetWindowController() const { 96 WindowController* AppWindowContentsImpl::GetWindowController() const {
99 return nullptr; 97 return nullptr;
100 } 98 }
(...skipping 19 matching lines...) Expand all
120 host_->UpdateDraggableRegions(regions); 118 host_->UpdateDraggableRegions(regions);
121 } 119 }
122 120
123 void AppWindowContentsImpl::SuspendRenderFrameHost( 121 void AppWindowContentsImpl::SuspendRenderFrameHost(
124 content::RenderFrameHost* rfh) { 122 content::RenderFrameHost* rfh) {
125 DCHECK(rfh); 123 DCHECK(rfh);
126 // Don't bother blocking requests if the renderer side is already good to go. 124 // Don't bother blocking requests if the renderer side is already good to go.
127 if (is_window_ready_) 125 if (is_window_ready_)
128 return; 126 return;
129 is_blocking_requests_ = true; 127 is_blocking_requests_ = true;
130 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); 128 rfh->BlockRequestsForFrame();
131 } 129 }
132 130
133 } // namespace extensions 131 } // namespace extensions
OLDNEW
« no previous file with comments | « content/public/browser/resource_dispatcher_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698