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

Side by Side Diff: sync/tools/sync_client.cc

Issue 10830164: [Sync] Set transport_security_state for sync_{client,listen_notifications} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sync/tools/sync_listen_notifications.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/debug/stack_trace.h" 13 #include "base/debug/stack_trace.h"
14 #include "base/json/json_writer.h" 14 #include "base/json/json_writer.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/message_loop.h" 19 #include "base/message_loop.h"
20 #include "base/scoped_temp_dir.h" 20 #include "base/scoped_temp_dir.h"
21 #include "base/task_runner.h" 21 #include "base/task_runner.h"
22 #include "base/threading/thread.h" 22 #include "base/threading/thread.h"
23 #include "jingle/notifier/base/notification_method.h" 23 #include "jingle/notifier/base/notification_method.h"
24 #include "jingle/notifier/base/notifier_options.h" 24 #include "jingle/notifier/base/notifier_options.h"
25 #include "net/base/host_port_pair.h" 25 #include "net/base/host_port_pair.h"
26 #include "net/base/host_resolver.h" 26 #include "net/base/host_resolver.h"
27 #include "net/base/network_change_notifier.h" 27 #include "net/base/network_change_notifier.h"
28 #include "net/base/transport_security_state.h"
28 #include "net/url_request/url_request_test_util.h" 29 #include "net/url_request/url_request_test_util.h"
29 #include "sync/internal_api/public/base/model_type.h" 30 #include "sync/internal_api/public/base/model_type.h"
30 #include "sync/internal_api/public/base_node.h" 31 #include "sync/internal_api/public/base_node.h"
31 #include "sync/internal_api/public/engine/passive_model_worker.h" 32 #include "sync/internal_api/public/engine/passive_model_worker.h"
32 #include "sync/internal_api/public/http_bridge.h" 33 #include "sync/internal_api/public/http_bridge.h"
33 #include "sync/internal_api/public/internal_components_factory_impl.h" 34 #include "sync/internal_api/public/internal_components_factory_impl.h"
34 #include "sync/internal_api/public/read_node.h" 35 #include "sync/internal_api/public/read_node.h"
35 #include "sync/internal_api/public/sync_manager.h" 36 #include "sync/internal_api/public/sync_manager.h"
36 #include "sync/internal_api/public/sync_manager_factory.h" 37 #include "sync/internal_api/public/sync_manager_factory.h"
37 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" 38 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 96
96 // Needed to use a real host resolver. 97 // Needed to use a real host resolver.
97 class MyTestURLRequestContext : public TestURLRequestContext { 98 class MyTestURLRequestContext : public TestURLRequestContext {
98 public: 99 public:
99 MyTestURLRequestContext() : TestURLRequestContext(true) { 100 MyTestURLRequestContext() : TestURLRequestContext(true) {
100 context_storage_.set_host_resolver( 101 context_storage_.set_host_resolver(
101 net::CreateSystemHostResolver( 102 net::CreateSystemHostResolver(
102 net::HostResolver::kDefaultParallelism, 103 net::HostResolver::kDefaultParallelism,
103 net::HostResolver::kDefaultRetryAttempts, 104 net::HostResolver::kDefaultRetryAttempts,
104 NULL)); 105 NULL));
106 context_storage_.set_transport_security_state(
107 new net::TransportSecurityState());
105 Init(); 108 Init();
106 } 109 }
107 110
108 virtual ~MyTestURLRequestContext() {} 111 virtual ~MyTestURLRequestContext() {}
109 }; 112 };
110 113
111 class MyTestURLRequestContextGetter : public TestURLRequestContextGetter { 114 class MyTestURLRequestContextGetter : public TestURLRequestContextGetter {
112 public: 115 public:
113 explicit MyTestURLRequestContextGetter( 116 explicit MyTestURLRequestContextGetter(
114 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy) 117 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy)
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 io_thread.Stop(); 383 io_thread.Stop();
381 return 0; 384 return 0;
382 } 385 }
383 386
384 } // namespace 387 } // namespace
385 } // namespace syncer 388 } // namespace syncer
386 389
387 int main(int argc, char* argv[]) { 390 int main(int argc, char* argv[]) {
388 return syncer::SyncClientMain(argc, argv); 391 return syncer::SyncClientMain(argc, argv);
389 } 392 }
OLDNEW
« no previous file with comments | « no previous file | sync/tools/sync_listen_notifications.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698