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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 new net::TransportSecurityState()); | 75 new net::TransportSecurityState()); |
76 Init(); | 76 Init(); |
77 } | 77 } |
78 | 78 |
79 virtual ~MyTestURLRequestContext() {} | 79 virtual ~MyTestURLRequestContext() {} |
80 }; | 80 }; |
81 | 81 |
82 class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { | 82 class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { |
83 public: | 83 public: |
84 explicit MyTestURLRequestContextGetter( | 84 explicit MyTestURLRequestContextGetter( |
85 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy) | 85 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) |
86 : TestURLRequestContextGetter(io_message_loop_proxy) {} | 86 : TestURLRequestContextGetter(io_task_runner) {} |
87 | 87 |
88 virtual net::TestURLRequestContext* GetURLRequestContext() OVERRIDE { | 88 virtual net::TestURLRequestContext* GetURLRequestContext() OVERRIDE { |
89 // Construct |context_| lazily so it gets constructed on the right | 89 // Construct |context_| lazily so it gets constructed on the right |
90 // thread (the IO thread). | 90 // thread (the IO thread). |
91 if (!context_) | 91 if (!context_) |
92 context_.reset(new MyTestURLRequestContext()); | 92 context_.reset(new MyTestURLRequestContext()); |
93 return context_.get(); | 93 return context_.get(); |
94 } | 94 } |
95 | 95 |
96 private: | 96 private: |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 io_thread.Stop(); | 464 io_thread.Stop(); |
465 return 0; | 465 return 0; |
466 } | 466 } |
467 | 467 |
468 } // namespace | 468 } // namespace |
469 } // namespace syncer | 469 } // namespace syncer |
470 | 470 |
471 int main(int argc, char* argv[]) { | 471 int main(int argc, char* argv[]) { |
472 return syncer::SyncClientMain(argc, argv); | 472 return syncer::SyncClientMain(argc, argv); |
473 } | 473 } |
OLD | NEW |