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

Side by Side Diff: chrome/browser/profiles/profile.cc

Issue 653633004: Shutdown Service Workers before the profile is destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years, 2 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 | « chrome/browser/chrome_service_worker_browsertest.cc ('k') | content/browser/browser_context.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 // No ProfileSyncService created yet - we don't want to create one, so just 246 // No ProfileSyncService created yet - we don't want to create one, so just
247 // infer the accessible state by looking at prefs/command line flags. 247 // infer the accessible state by looking at prefs/command line flags.
248 sync_driver::SyncPrefs prefs(GetPrefs()); 248 sync_driver::SyncPrefs prefs(GetPrefs());
249 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); 249 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged();
250 } 250 }
251 251
252 void Profile::MaybeSendDestroyedNotification() { 252 void Profile::MaybeSendDestroyedNotification() {
253 if (!sent_destroyed_notification_) { 253 if (!sent_destroyed_notification_) {
254 sent_destroyed_notification_ = true; 254 sent_destroyed_notification_ = true;
255
256 NotifyWillBeDestroyed(this);
jam 2014/10/23 22:45:22 we shouldn't have content depend on every embedder
falken 2014/10/24 00:53:34 It's actually chrome stuff that's breaking because
255 content::NotificationService::current()->Notify( 257 content::NotificationService::current()->Notify(
256 chrome::NOTIFICATION_PROFILE_DESTROYED, 258 chrome::NOTIFICATION_PROFILE_DESTROYED,
257 content::Source<Profile>(this), 259 content::Source<Profile>(this),
258 content::NotificationService::NoDetails()); 260 content::NotificationService::NoDetails());
259 } 261 }
260 } 262 }
261 263
262 bool ProfileCompare::operator()(Profile* a, Profile* b) const { 264 bool ProfileCompare::operator()(Profile* a, Profile* b) const {
263 DCHECK(a && b); 265 DCHECK(a && b);
264 if (a->IsSameProfile(b)) 266 if (a->IsSameProfile(b))
265 return false; 267 return false;
266 return a->GetOriginalProfile() < b->GetOriginalProfile(); 268 return a->GetOriginalProfile() < b->GetOriginalProfile();
267 } 269 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_service_worker_browsertest.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698