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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2249173003: Removes the references to shared workers from the all documents in being deleted frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated nhiroki's comment Created 4 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
« no previous file with comments | « no previous file | content/browser/shared_worker/shared_worker_host.h » ('j') | 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 "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 30 matching lines...) Expand all
41 #include "content/browser/presentation/presentation_service_impl.h" 41 #include "content/browser/presentation/presentation_service_impl.h"
42 #include "content/browser/renderer_host/input/input_router_impl.h" 42 #include "content/browser/renderer_host/input/input_router_impl.h"
43 #include "content/browser/renderer_host/input/timeout_monitor.h" 43 #include "content/browser/renderer_host/input/timeout_monitor.h"
44 #include "content/browser/renderer_host/render_process_host_impl.h" 44 #include "content/browser/renderer_host/render_process_host_impl.h"
45 #include "content/browser/renderer_host/render_view_host_delegate.h" 45 #include "content/browser/renderer_host/render_view_host_delegate.h"
46 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 46 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
47 #include "content/browser/renderer_host/render_view_host_impl.h" 47 #include "content/browser/renderer_host/render_view_host_impl.h"
48 #include "content/browser/renderer_host/render_widget_host_delegate.h" 48 #include "content/browser/renderer_host/render_widget_host_delegate.h"
49 #include "content/browser/renderer_host/render_widget_host_impl.h" 49 #include "content/browser/renderer_host/render_widget_host_impl.h"
50 #include "content/browser/renderer_host/render_widget_host_view_base.h" 50 #include "content/browser/renderer_host/render_widget_host_view_base.h"
51 #include "content/browser/shared_worker/shared_worker_service_impl.h"
51 #include "content/browser/wake_lock/wake_lock_service_context.h" 52 #include "content/browser/wake_lock/wake_lock_service_context.h"
52 #include "content/browser/websockets/websocket_manager.h" 53 #include "content/browser/websockets/websocket_manager.h"
53 #include "content/browser/webui/web_ui_controller_factory_registry.h" 54 #include "content/browser/webui/web_ui_controller_factory_registry.h"
54 #include "content/common/accessibility_messages.h" 55 #include "content/common/accessibility_messages.h"
55 #include "content/common/frame_messages.h" 56 #include "content/common/frame_messages.h"
56 #include "content/common/frame_owner_properties.h" 57 #include "content/common/frame_owner_properties.h"
57 #include "content/common/input_messages.h" 58 #include "content/common/input_messages.h"
58 #include "content/common/inter_process_time_ticks_converter.h" 59 #include "content/common/inter_process_time_ticks_converter.h"
59 #include "content/common/navigation_params.h" 60 #include "content/common/navigation_params.h"
60 #include "content/common/site_isolation_policy.h" 61 #include "content/common/site_isolation_policy.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 const std::vector<base::FilePath>& file_paths) { 174 const std::vector<base::FilePath>& file_paths) {
174 ChildProcessSecurityPolicyImpl* policy = 175 ChildProcessSecurityPolicyImpl* policy =
175 ChildProcessSecurityPolicyImpl::GetInstance(); 176 ChildProcessSecurityPolicyImpl::GetInstance();
176 177
177 for (const auto& file : file_paths) { 178 for (const auto& file : file_paths) {
178 if (!policy->CanReadFile(child_id, file)) 179 if (!policy->CanReadFile(child_id, file))
179 policy->GrantReadFile(child_id, file); 180 policy->GrantReadFile(child_id, file);
180 } 181 }
181 } 182 }
182 183
184 void NotifyRenderFrameDetachedOnIO(int render_process_id, int render_frame_id) {
185 DCHECK_CURRENTLY_ON(BrowserThread::IO);
186 SharedWorkerServiceImpl::GetInstance()->RenderFrameDetached(render_process_id,
187 render_frame_id);
188 }
189
183 } // namespace 190 } // namespace
184 191
185 // static 192 // static
186 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, 193 RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
187 int render_frame_id) { 194 int render_frame_id) {
188 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 195 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
189 } 196 }
190 197
191 #if defined(OS_ANDROID) 198 #if defined(OS_ANDROID)
192 // static 199 // static
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 310 }
304 311
305 RenderFrameHostImpl::~RenderFrameHostImpl() { 312 RenderFrameHostImpl::~RenderFrameHostImpl() {
306 // Release the WebUI instances before all else as the WebUI may accesses the 313 // Release the WebUI instances before all else as the WebUI may accesses the
307 // RenderFrameHost during cleanup. 314 // RenderFrameHost during cleanup.
308 ClearAllWebUI(); 315 ClearAllWebUI();
309 316
310 GetProcess()->RemoveRoute(routing_id_); 317 GetProcess()->RemoveRoute(routing_id_);
311 g_routing_id_frame_map.Get().erase( 318 g_routing_id_frame_map.Get().erase(
312 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); 319 RenderFrameHostID(GetProcess()->GetID(), routing_id_));
320 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
321 base::Bind(&NotifyRenderFrameDetachedOnIO,
322 GetProcess()->GetID(), routing_id_));
313 323
314 site_instance_->RemoveObserver(this); 324 site_instance_->RemoveObserver(this);
315 325
316 if (delegate_ && render_frame_created_) 326 if (delegate_ && render_frame_created_)
317 delegate_->RenderFrameDeleted(this); 327 delegate_->RenderFrameDeleted(this);
318 328
319 // If this was the last active frame in the SiteInstance, the 329 // If this was the last active frame in the SiteInstance, the
320 // DecrementActiveFrameCount call will trigger the deletion of the 330 // DecrementActiveFrameCount call will trigger the deletion of the
321 // SiteInstance's proxies. 331 // SiteInstance's proxies.
322 GetSiteInstance()->DecrementActiveFrameCount(); 332 GetSiteInstance()->DecrementActiveFrameCount();
(...skipping 2745 matching lines...) Expand 10 before | Expand all | Expand 10 after
3068 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 3078 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
3069 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 3079 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
3070 return web_bluetooth_service_.get(); 3080 return web_bluetooth_service_.get();
3071 } 3081 }
3072 3082
3073 void RenderFrameHostImpl::DeleteWebBluetoothService() { 3083 void RenderFrameHostImpl::DeleteWebBluetoothService() {
3074 web_bluetooth_service_.reset(); 3084 web_bluetooth_service_.reset();
3075 } 3085 }
3076 3086
3077 } // namespace content 3087 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/shared_worker/shared_worker_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698