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

Side by Side Diff: sync/internal_api/sync_manager_impl.cc

Issue 10826193: Remove SyncManager::Init() return value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CreateDirectory assertion 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 | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/test/fake_sync_manager.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 "sync/internal_api/sync_manager_impl.h" 5 #include "sync/internal_api/sync_manager_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 types_to_config, 355 types_to_config,
356 new_routing_info, 356 new_routing_info,
357 ready_task); 357 ready_task);
358 358
359 scheduler_->Start(SyncScheduler::CONFIGURATION_MODE); 359 scheduler_->Start(SyncScheduler::CONFIGURATION_MODE);
360 if (!scheduler_->ScheduleConfiguration(params)) 360 if (!scheduler_->ScheduleConfiguration(params))
361 retry_task.Run(); 361 retry_task.Run();
362 362
363 } 363 }
364 364
365 bool SyncManagerImpl::Init( 365 void SyncManagerImpl::Init(
366 const FilePath& database_location, 366 const FilePath& database_location,
367 const WeakHandle<JsEventHandler>& event_handler, 367 const WeakHandle<JsEventHandler>& event_handler,
368 const std::string& sync_server_and_path, 368 const std::string& sync_server_and_path,
369 int port, 369 int port,
370 bool use_ssl, 370 bool use_ssl,
371 const scoped_refptr<base::TaskRunner>& blocking_task_runner, 371 const scoped_refptr<base::TaskRunner>& blocking_task_runner,
372 scoped_ptr<HttpPostProviderFactory> post_factory, 372 scoped_ptr<HttpPostProviderFactory> post_factory,
373 const std::vector<ModelSafeWorker*>& workers, 373 const std::vector<ModelSafeWorker*>& workers,
374 ExtensionsActivityMonitor* extensions_activity_monitor, 374 ExtensionsActivityMonitor* extensions_activity_monitor,
375 SyncManager::ChangeDelegate* change_delegate, 375 SyncManager::ChangeDelegate* change_delegate,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 unrecoverable_error_handler_, 421 unrecoverable_error_handler_,
422 report_unrecoverable_error_function_, 422 report_unrecoverable_error_function_,
423 backing_store.release())); 423 backing_store.release()));
424 424
425 DVLOG(1) << "Username: " << username_for_share(); 425 DVLOG(1) << "Username: " << username_for_share();
426 if (!OpenDirectory()) { 426 if (!OpenDirectory()) {
427 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, 427 FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
428 OnInitializationComplete( 428 OnInitializationComplete(
429 MakeWeakHandle(weak_ptr_factory_.GetWeakPtr()), 429 MakeWeakHandle(weak_ptr_factory_.GetWeakPtr()),
430 false, syncer::ModelTypeSet())); 430 false, syncer::ModelTypeSet()));
431 return false; 431 LOG(ERROR) << "Sync manager initialization failed!";
432 return;
432 } 433 }
433 434
434 connection_manager_.reset(new SyncAPIServerConnectionManager( 435 connection_manager_.reset(new SyncAPIServerConnectionManager(
435 sync_server_and_path, port, use_ssl, post_factory.release())); 436 sync_server_and_path, port, use_ssl, post_factory.release()));
436 connection_manager_->set_client_id(directory()->cache_guid()); 437 connection_manager_->set_client_id(directory()->cache_guid());
437 connection_manager_->AddListener(this); 438 connection_manager_->AddListener(this);
438 439
439 // Retrieve and set the sync notifier state. 440 // Retrieve and set the sync notifier state.
440 std::string unique_id = directory()->cache_guid(); 441 std::string unique_id = directory()->cache_guid();
441 DVLOG(1) << "Read notification unique ID: " << unique_id; 442 DVLOG(1) << "Read notification unique ID: " << unique_id;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 ReadTransaction trans(FROM_HERE, GetUserShare()); 489 ReadTransaction trans(FROM_HERE, GetUserShare());
489 trans.GetCryptographer()->Bootstrap(restored_key_for_bootstrapping); 490 trans.GetCryptographer()->Bootstrap(restored_key_for_bootstrapping);
490 trans.GetCryptographer()->BootstrapKeystoreKey( 491 trans.GetCryptographer()->BootstrapKeystoreKey(
491 restored_keystore_key_for_bootstrapping); 492 restored_keystore_key_for_bootstrapping);
492 trans.GetCryptographer()->AddObserver(this); 493 trans.GetCryptographer()->AddObserver(this);
493 494
494 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, 495 FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
495 OnInitializationComplete( 496 OnInitializationComplete(
496 MakeWeakHandle(weak_ptr_factory_.GetWeakPtr()), 497 MakeWeakHandle(weak_ptr_factory_.GetWeakPtr()),
497 true, InitialSyncEndedTypes())); 498 true, InitialSyncEndedTypes()));
498 return true;
499 } 499 }
500 500
501 void SyncManagerImpl::RefreshNigori(const std::string& chrome_version, 501 void SyncManagerImpl::RefreshNigori(const std::string& chrome_version,
502 const base::Closure& done_callback) { 502 const base::Closure& done_callback) {
503 DCHECK(initialized_); 503 DCHECK(initialized_);
504 DCHECK(thread_checker_.CalledOnValidThread()); 504 DCHECK(thread_checker_.CalledOnValidThread());
505 GetSessionName( 505 GetSessionName(
506 blocking_task_runner_, 506 blocking_task_runner_,
507 base::Bind( 507 base::Bind(
508 &SyncManagerImpl::UpdateCryptographerAndNigoriCallback, 508 &SyncManagerImpl::UpdateCryptographerAndNigoriCallback,
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 int SyncManagerImpl::GetDefaultNudgeDelay() { 1897 int SyncManagerImpl::GetDefaultNudgeDelay() {
1898 return kDefaultNudgeDelayMilliseconds; 1898 return kDefaultNudgeDelayMilliseconds;
1899 } 1899 }
1900 1900
1901 // static. 1901 // static.
1902 int SyncManagerImpl::GetPreferencesNudgeDelay() { 1902 int SyncManagerImpl::GetPreferencesNudgeDelay() {
1903 return kPreferencesNudgeDelayMilliseconds; 1903 return kPreferencesNudgeDelayMilliseconds;
1904 } 1904 }
1905 1905
1906 } // namespace syncer 1906 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/test/fake_sync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698