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

Side by Side Diff: chrome/browser/signin/token_service.cc

Issue 14121012: Make TokenService drop its ref to WebDataService in Shutdown() rather than dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pure merge 2 Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/signin/token_service.h ('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 (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/signin/token_service.h" 5 #include "chrome/browser/signin/token_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 token_loading_query_(0), 52 token_loading_query_(0),
53 tokens_loaded_(false) { 53 tokens_loaded_(false) {
54 // Allow constructor to be called outside the UI thread, so it can be mocked 54 // Allow constructor to be called outside the UI thread, so it can be mocked
55 // out for unit tests. 55 // out for unit tests.
56 56
57 COMPILE_ASSERT(arraysize(kServices) == arraysize(fetchers_), 57 COMPILE_ASSERT(arraysize(kServices) == arraysize(fetchers_),
58 kServices_and_fetchers_dont_have_same_size); 58 kServices_and_fetchers_dont_have_same_size);
59 } 59 }
60 60
61 TokenService::~TokenService() { 61 TokenService::~TokenService() {
62 }
63
64 void TokenService::Shutdown() {
62 if (!source_.empty()) { 65 if (!source_.empty()) {
63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
64 ResetCredentialsInMemory(); 67 ResetCredentialsInMemory();
65 } 68 }
69 web_data_service_ = NULL;
66 } 70 }
67 71
68 void TokenService::Initialize(const char* const source, 72 void TokenService::Initialize(const char* const source,
69 Profile* profile) { 73 Profile* profile) {
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
71 if (!source_.empty()) { 75 if (!source_.empty()) {
72 // Already initialized. 76 // Already initialized.
73 return; 77 return;
74 } 78 }
75 DCHECK(!profile_); 79 DCHECK(!profile_);
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 457
454 void TokenService::AddSigninDiagnosticsObserver( 458 void TokenService::AddSigninDiagnosticsObserver(
455 SigninDiagnosticsObserver* observer) { 459 SigninDiagnosticsObserver* observer) {
456 signin_diagnostics_observers_.AddObserver(observer); 460 signin_diagnostics_observers_.AddObserver(observer);
457 } 461 }
458 462
459 void TokenService::RemoveSigninDiagnosticsObserver( 463 void TokenService::RemoveSigninDiagnosticsObserver(
460 SigninDiagnosticsObserver* observer) { 464 SigninDiagnosticsObserver* observer) {
461 signin_diagnostics_observers_.RemoveObserver(observer); 465 signin_diagnostics_observers_.RemoveObserver(observer);
462 } 466 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/token_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698