OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |