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

Side by Side Diff: components/signin/core/browser/webdata/token_web_data.cc

Issue 2672833002: [Desktop] Add diagnostics about loading the refresh tokens. (Closed)
Patch Set: Nit Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/signin/core/browser/webdata/token_web_data.h" 5 #include "components/signin/core/browser/webdata/token_web_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/ref_counted_delete_on_sequence.h" 9 #include "base/memory/ref_counted_delete_on_sequence.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 29 matching lines...) Expand all
40 WebDatabase::State SetTokenForService( 40 WebDatabase::State SetTokenForService(
41 const std::string& service, const std::string& token, WebDatabase* db) { 41 const std::string& service, const std::string& token, WebDatabase* db) {
42 if (TokenServiceTable::FromWebDatabase(db)->SetTokenForService(service, 42 if (TokenServiceTable::FromWebDatabase(db)->SetTokenForService(service,
43 token)) { 43 token)) {
44 return WebDatabase::COMMIT_NEEDED; 44 return WebDatabase::COMMIT_NEEDED;
45 } 45 }
46 return WebDatabase::COMMIT_NOT_NEEDED; 46 return WebDatabase::COMMIT_NOT_NEEDED;
47 } 47 }
48 48
49 std::unique_ptr<WDTypedResult> GetAllTokens(WebDatabase* db) { 49 std::unique_ptr<WDTypedResult> GetAllTokens(WebDatabase* db) {
50 std::map<std::string, std::string> map; 50 TokenResult result;
51 TokenServiceTable::FromWebDatabase(db)->GetAllTokens(&map); 51 result.db_result =
52 return base::MakeUnique<WDResult<std::map<std::string, std::string>>>( 52 TokenServiceTable::FromWebDatabase(db)->GetAllTokens(&result.tokens);
53 TOKEN_RESULT, map); 53 return base::MakeUnique<WDResult<TokenResult>>(TOKEN_RESULT, result);
54 } 54 }
55 55
56 protected: 56 protected:
57 virtual ~TokenWebDataBackend() { 57 virtual ~TokenWebDataBackend() {
58 } 58 }
59 59
60 private: 60 private:
61 friend class base::RefCountedDeleteOnSequence<TokenWebDataBackend>; 61 friend class base::RefCountedDeleteOnSequence<TokenWebDataBackend>;
62 friend class base::DeleteHelper<TokenWebDataBackend>; 62 friend class base::DeleteHelper<TokenWebDataBackend>;
63 }; 63 };
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 TokenWebData::TokenWebData( 99 TokenWebData::TokenWebData(
100 scoped_refptr<base::SingleThreadTaskRunner> ui_thread, 100 scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
101 scoped_refptr<base::SingleThreadTaskRunner> db_thread) 101 scoped_refptr<base::SingleThreadTaskRunner> db_thread)
102 : WebDataServiceBase(NULL, ProfileErrorCallback(), ui_thread), 102 : WebDataServiceBase(NULL, ProfileErrorCallback(), ui_thread),
103 token_backend_(new TokenWebDataBackend(db_thread)) { 103 token_backend_(new TokenWebDataBackend(db_thread)) {
104 } 104 }
105 105
106 TokenWebData::~TokenWebData() { 106 TokenWebData::~TokenWebData() {
107 } 107 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698