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

Side by Side Diff: apps/app_load_service.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
« no previous file with comments | « apps/app_load_service.h ('k') | chrome/browser/engagement/site_engagement_service.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 "apps/app_load_service.h" 5 #include "apps/app_load_service.h"
6 6
7 #include "apps/app_load_service_factory.h" 7 #include "apps/app_load_service_factory.h"
8 #include "apps/app_restore_service.h" 8 #include "apps/app_restore_service.h"
9 #include "apps/launcher.h" 9 #include "apps/launcher.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 AppLoadService::AppLoadService(Profile* profile) 35 AppLoadService::AppLoadService(Profile* profile)
36 : profile_(profile) { 36 : profile_(profile) {
37 registrar_.Add(this, 37 registrar_.Add(this,
38 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD, 38 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD,
39 content::NotificationService::AllSources()); 39 content::NotificationService::AllSources());
40 extensions::ExtensionRegistry::Get(profile_)->AddObserver(this); 40 extensions::ExtensionRegistry::Get(profile_)->AddObserver(this);
41 } 41 }
42 42
43 AppLoadService::~AppLoadService() { 43 AppLoadService::~AppLoadService() = default;
44
45 void AppLoadService::Shutdown() {
44 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); 46 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this);
45 } 47 }
46 48
47 void AppLoadService::RestartApplication(const std::string& extension_id) { 49 void AppLoadService::RestartApplication(const std::string& extension_id) {
48 post_reload_actions_[extension_id].action_type = RESTART; 50 post_reload_actions_[extension_id].action_type = RESTART;
49 ExtensionService* service = extensions::ExtensionSystem::Get(profile_)-> 51 ExtensionService* service = extensions::ExtensionSystem::Get(profile_)->
50 extension_service(); 52 extension_service();
51 DCHECK(service); 53 DCHECK(service);
52 service->ReloadExtension(extension_id); 54 service->ReloadExtension(extension_id);
53 } 55 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Extension::DISABLE_RELOAD) != 0; 155 Extension::DISABLE_RELOAD) != 0;
154 } 156 }
155 return false; 157 return false;
156 } 158 }
157 159
158 bool AppLoadService::HasPostReloadAction(const std::string& extension_id) { 160 bool AppLoadService::HasPostReloadAction(const std::string& extension_id) {
159 return post_reload_actions_.find(extension_id) != post_reload_actions_.end(); 161 return post_reload_actions_.find(extension_id) != post_reload_actions_.end();
160 } 162 }
161 163
162 } // namespace apps 164 } // namespace apps
OLDNEW
« no previous file with comments | « apps/app_load_service.h ('k') | chrome/browser/engagement/site_engagement_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698