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

Side by Side Diff: extensions/browser/process_manager.cc

Issue 2749823002: Restore KeyedServiceFactory diagnostics for context use-after-destroy. (Closed)
Patch Set: Refactor SiteEngagementService tests. 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/process_manager.h" 5 #include "extensions/browser/process_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, 260 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
261 content::Source<BrowserContext>(context)); 261 content::Source<BrowserContext>(context));
262 registrar_.Add(this, 262 registrar_.Add(this,
263 extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, 263 extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
264 content::Source<BrowserContext>(context)); 264 content::Source<BrowserContext>(context));
265 content::DevToolsAgentHost::AddObserver(this); 265 content::DevToolsAgentHost::AddObserver(this);
266 266
267 OnKeepaliveImpulseCheck(); 267 OnKeepaliveImpulseCheck();
268 } 268 }
269 269
270 ProcessManager::~ProcessManager() { 270 ProcessManager::~ProcessManager() = default;
271
272 void ProcessManager::Shutdown() {
271 extension_registry_->RemoveObserver(this); 273 extension_registry_->RemoveObserver(this);
272 CloseBackgroundHosts(); 274 CloseBackgroundHosts();
273 DCHECK(background_hosts_.empty()); 275 DCHECK(background_hosts_.empty());
274 content::DevToolsAgentHost::RemoveObserver(this); 276 content::DevToolsAgentHost::RemoveObserver(this);
277 site_instance_ = nullptr;
275 } 278 }
276 279
277 void ProcessManager::RegisterRenderFrameHost( 280 void ProcessManager::RegisterRenderFrameHost(
278 content::WebContents* web_contents, 281 content::WebContents* web_contents,
279 content::RenderFrameHost* render_frame_host, 282 content::RenderFrameHost* render_frame_host,
280 const Extension* extension) { 283 const Extension* extension) {
281 ExtensionRenderFrameData* data = &all_extension_frames_[render_frame_host]; 284 ExtensionRenderFrameData* data = &all_extension_frames_[render_frame_host];
282 data->view_type = GetViewType(web_contents); 285 data->view_type = GetViewType(web_contents);
283 286
284 // Keep the lazy background page alive as long as any non-background-page 287 // Keep the lazy background page alive as long as any non-background-page
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 if (extension && !IncognitoInfo::IsSplitMode(extension)) { 993 if (extension && !IncognitoInfo::IsSplitMode(extension)) {
991 BrowserContext* original_context = 994 BrowserContext* original_context =
992 ExtensionsBrowserClient::Get()->GetOriginalContext(browser_context()); 995 ExtensionsBrowserClient::Get()->GetOriginalContext(browser_context());
993 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); 996 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url);
994 } 997 }
995 998
996 return ProcessManager::GetSiteInstanceForURL(url); 999 return ProcessManager::GetSiteInstanceForURL(url);
997 } 1000 }
998 1001
999 } // namespace extensions 1002 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/process_manager.h ('k') | extensions/shell/browser/shell_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698