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

Side by Side Diff: components/sync/tools/sync_listen_notifications.cc

Issue 2422253002: [Sync] Rewriting ".reset(new" pattern to use "= base::MakeUnique" instead. (Closed)
Patch Set: Fixing compile. Created 4 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
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 <cstddef> 5 #include <cstddef>
6 #include <cstdio> 6 #include <cstdio>
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { 94 class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter {
95 public: 95 public:
96 explicit MyTestURLRequestContextGetter( 96 explicit MyTestURLRequestContextGetter(
97 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) 97 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
98 : TestURLRequestContextGetter(io_task_runner) {} 98 : TestURLRequestContextGetter(io_task_runner) {}
99 99
100 net::TestURLRequestContext* GetURLRequestContext() override { 100 net::TestURLRequestContext* GetURLRequestContext() override {
101 // Construct |context_| lazily so it gets constructed on the right 101 // Construct |context_| lazily so it gets constructed on the right
102 // thread (the IO thread). 102 // thread (the IO thread).
103 if (!context_) 103 if (!context_)
104 context_.reset(new MyTestURLRequestContext()); 104 context_ = base::MakeUnique<MyTestURLRequestContext>();
105 return context_.get(); 105 return context_.get();
106 } 106 }
107 107
108 private: 108 private:
109 ~MyTestURLRequestContextGetter() override {} 109 ~MyTestURLRequestContextGetter() override {}
110 110
111 std::unique_ptr<MyTestURLRequestContext> context_; 111 std::unique_ptr<MyTestURLRequestContext> context_;
112 }; 112 };
113 113
114 notifier::NotifierOptions ParseNotifierOptions( 114 notifier::NotifierOptions ParseNotifierOptions(
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 io_thread.Stop(); 205 io_thread.Stop();
206 return 0; 206 return 0;
207 } 207 }
208 208
209 } // namespace 209 } // namespace
210 } // namespace syncer 210 } // namespace syncer
211 211
212 int main(int argc, char* argv[]) { 212 int main(int argc, char* argv[]) {
213 return syncer::SyncListenNotificationsMain(argc, argv); 213 return syncer::SyncListenNotificationsMain(argc, argv);
214 } 214 }
OLDNEW
« no previous file with comments | « components/sync/tools/sync_client.cc ('k') | components/sync_bookmarks/bookmark_data_type_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698