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

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

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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_message_loop.h" 9 #include "base/memory/ref_counted_delete_on_message_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 if (TokenServiceTable::FromWebDatabase(db)->SetTokenForService(service, 43 if (TokenServiceTable::FromWebDatabase(db)->SetTokenForService(service,
44 token)) { 44 token)) {
45 return WebDatabase::COMMIT_NEEDED; 45 return WebDatabase::COMMIT_NEEDED;
46 } 46 }
47 return WebDatabase::COMMIT_NOT_NEEDED; 47 return WebDatabase::COMMIT_NOT_NEEDED;
48 } 48 }
49 49
50 std::unique_ptr<WDTypedResult> GetAllTokens(WebDatabase* db) { 50 std::unique_ptr<WDTypedResult> GetAllTokens(WebDatabase* db) {
51 std::map<std::string, std::string> map; 51 std::map<std::string, std::string> map;
52 TokenServiceTable::FromWebDatabase(db)->GetAllTokens(&map); 52 TokenServiceTable::FromWebDatabase(db)->GetAllTokens(&map);
53 return base::WrapUnique( 53 return base::MakeUnique<WDResult<std::map<std::string, std::string>>>(
54 new WDResult<std::map<std::string, std::string>>(TOKEN_RESULT, map)); 54 TOKEN_RESULT, map);
55 } 55 }
56 56
57 protected: 57 protected:
58 virtual ~TokenWebDataBackend() { 58 virtual ~TokenWebDataBackend() {
59 } 59 }
60 60
61 private: 61 private:
62 friend class base::RefCountedDeleteOnMessageLoop<TokenWebDataBackend>; 62 friend class base::RefCountedDeleteOnMessageLoop<TokenWebDataBackend>;
63 friend class base::DeleteHelper<TokenWebDataBackend>; 63 friend class base::DeleteHelper<TokenWebDataBackend>;
64 }; 64 };
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 TokenWebData::TokenWebData( 100 TokenWebData::TokenWebData(
101 scoped_refptr<base::SingleThreadTaskRunner> ui_thread, 101 scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
102 scoped_refptr<base::SingleThreadTaskRunner> db_thread) 102 scoped_refptr<base::SingleThreadTaskRunner> db_thread)
103 : WebDataServiceBase(NULL, ProfileErrorCallback(), ui_thread), 103 : WebDataServiceBase(NULL, ProfileErrorCallback(), ui_thread),
104 token_backend_(new TokenWebDataBackend(db_thread)) { 104 token_backend_(new TokenWebDataBackend(db_thread)) {
105 } 105 }
106 106
107 TokenWebData::~TokenWebData() { 107 TokenWebData::~TokenWebData() {
108 } 108 }
OLDNEW
« no previous file with comments | « components/signin/core/browser/test_signin_client.cc ('k') | components/ssl_errors/error_classification_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698