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

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

Issue 116533006: Control invalidations network channel from TiclInvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years 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 <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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 // Set up objects that monitor the network. 263 // Set up objects that monitor the network.
264 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier( 264 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier(
265 net::NetworkChangeNotifier::Create()); 265 net::NetworkChangeNotifier::Create());
266 266
267 // Set up sync notifier factory. 267 // Set up sync notifier factory.
268 const scoped_refptr<MyTestURLRequestContextGetter> context_getter = 268 const scoped_refptr<MyTestURLRequestContextGetter> context_getter =
269 new MyTestURLRequestContextGetter(io_thread.message_loop_proxy()); 269 new MyTestURLRequestContextGetter(io_thread.message_loop_proxy());
270 const notifier::NotifierOptions& notifier_options = 270 const notifier::NotifierOptions& notifier_options =
271 ParseNotifierOptions(command_line, context_getter); 271 ParseNotifierOptions(command_line, context_getter);
272 syncer::NetworkChannelCreator network_channel_creator =
273 syncer::NonBlockingInvalidator::MakePushClientChannelCreator(
274 notifier_options);
272 const char kClientInfo[] = "standalone_sync_client"; 275 const char kClientInfo[] = "standalone_sync_client";
273 std::string invalidator_id = base::RandBytesAsString(8); 276 std::string invalidator_id = base::RandBytesAsString(8);
274 NullInvalidationStateTracker null_invalidation_state_tracker; 277 NullInvalidationStateTracker null_invalidation_state_tracker;
275 scoped_ptr<Invalidator> invalidator(new NonBlockingInvalidator( 278 scoped_ptr<Invalidator> invalidator(new NonBlockingInvalidator(
276 notifier_options, 279 network_channel_creator,
277 invalidator_id, 280 invalidator_id,
278 null_invalidation_state_tracker.GetSavedInvalidations(), 281 null_invalidation_state_tracker.GetSavedInvalidations(),
279 null_invalidation_state_tracker.GetBootstrapData(), 282 null_invalidation_state_tracker.GetBootstrapData(),
280 WeakHandle<InvalidationStateTracker>( 283 WeakHandle<InvalidationStateTracker>(
281 null_invalidation_state_tracker.AsWeakPtr()), 284 null_invalidation_state_tracker.AsWeakPtr()),
282 kClientInfo)); 285 kClientInfo,
286 notifier_options.request_context_getter));
283 287
284 // Set up database directory for the syncer. 288 // Set up database directory for the syncer.
285 base::ScopedTempDir database_dir; 289 base::ScopedTempDir database_dir;
286 CHECK(database_dir.CreateUniqueTempDir()); 290 CHECK(database_dir.CreateUniqueTempDir());
287 291
288 // Developers often add types to ModelTypeSet::All() before the server 292 // Developers often add types to ModelTypeSet::All() before the server
289 // supports them. We need to be explicit about which types we want here. 293 // supports them. We need to be explicit about which types we want here.
290 ModelTypeSet model_types; 294 ModelTypeSet model_types;
291 model_types.Put(BOOKMARKS); 295 model_types.Put(BOOKMARKS);
292 model_types.Put(PREFERENCES); 296 model_types.Put(PREFERENCES);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 io_thread.Stop(); 391 io_thread.Stop();
388 return 0; 392 return 0;
389 } 393 }
390 394
391 } // namespace 395 } // namespace
392 } // namespace syncer 396 } // namespace syncer
393 397
394 int main(int argc, char* argv[]) { 398 int main(int argc, char* argv[]) {
395 return syncer::SyncClientMain(argc, argv); 399 return syncer::SyncClientMain(argc, argv);
396 } 400 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698