summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 00:06:15 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 00:06:15 +0000
commit43ee82166efe4fea87bb186c629a35b3a8995fe2 (patch)
tree4aaefc82b73c3e0b4af7b8fc536476afed5a6ec5
parent2238037ce16a1f6e736001813b6a05c87fe0f7a9 (diff)
downloadchromium_src-43ee82166efe4fea87bb186c629a35b3a8995fe2.zip
chromium_src-43ee82166efe4fea87bb186c629a35b3a8995fe2.tar.gz
chromium_src-43ee82166efe4fea87bb186c629a35b3a8995fe2.tar.bz2
Add non-blocking sync code to ProfileSyncService
Adds support for non-blocking sync to the ProfileSyncService and related classes. This continues the work of r258390 and r259921. Like those patches, it is not expected to have any impact on behavior. Introduces ProfileSyncService::RegisterNonBlockingType(). This function will act as an alternative to RegisterDataTypeController(). Adds some support for these non-blocking types. Adds a special case to the code that generates the 'type status' table on the about:sync page. Instantiates and copies a SyncCoreProxy object to the ProfileSyncService as backend initialization completes. This will be an important part of non-blocking data type initialization, once that functionality is supported. BUG=351005 Review URL: https://codereview.chromium.org/217183003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261590 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.h5
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_core.cc12
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_core.h4
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_impl.cc12
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_impl.h7
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_mock.cc4
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_mock.h2
-rw-r--r--chrome/browser/sync/profile_sync_service.cc52
-rw-r--r--chrome/browser/sync/profile_sync_service.h21
-rw-r--r--sync/internal_api/public/sync_manager.h2
-rw-r--r--sync/internal_api/public/test/fake_sync_manager.h2
-rw-r--r--sync/internal_api/sync_manager_impl.cc4
-rw-r--r--sync/internal_api/sync_manager_impl.h2
-rw-r--r--sync/internal_api/test/fake_sync_manager.cc4
-rw-r--r--sync/sessions/model_type_registry.cc2
15 files changed, 120 insertions, 15 deletions
diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
index caea2d0..5b8afdc 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -16,6 +16,7 @@
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/configure_reason.h"
#include "sync/internal_api/public/sessions/sync_session_snapshot.h"
+#include "sync/internal_api/public/sync_core_proxy.h"
#include "sync/internal_api/public/sync_manager.h"
#include "sync/internal_api/public/sync_manager_factory.h"
#include "sync/internal_api/public/util/report_unrecoverable_error_function.h"
@@ -158,6 +159,10 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// initialization is complete with OnBackendInitialized().
virtual syncer::UserShare* GetUserShare() const = 0;
+ // Called on |frontend_loop_| to obtain a handle to the SyncCore needed by
+ // the non-blocking sync types to communicate with the server.
+ virtual syncer::SyncCoreProxy GetSyncCoreProxy() = 0;
+
// Called from any thread to obtain current status information in detailed or
// summarized form.
virtual Status GetDetailedStatus() = 0;
diff --git a/chrome/browser/sync/glue/sync_backend_host_core.cc b/chrome/browser/sync/glue/sync_backend_host_core.cc
index c49171a5..9d54617 100644
--- a/chrome/browser/sync/glue/sync_backend_host_core.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_core.cc
@@ -474,16 +474,26 @@ void SyncBackendHostCore::DoInitialProcessControlTypes() {
}
void SyncBackendHostCore::DoFinishInitialProcessControlTypes() {
+ DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
+
registrar_->ActivateDataType(syncer::DEVICE_INFO,
syncer::GROUP_PASSIVE,
synced_device_tracker_.get(),
sync_manager_->GetUserShare());
+ base::WeakPtr<syncer::SyncCore> sync_core = sync_manager_->GetSyncCore();
+
+ // De-reference the WeakPtr while we're here to signal to the debugging
+ // mechanisms that it belongs to the sync thread. This helps us DCHECK
+ // earlier if the pointer is misused.
+ sync_core.get();
+
host_.Call(
FROM_HERE,
&SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop,
js_backend_,
- debug_info_listener_);
+ debug_info_listener_,
+ syncer::SyncCoreProxy(base::MessageLoopProxy::current(), sync_core));
js_backend_.Reset();
debug_info_listener_.Reset();
diff --git a/chrome/browser/sync/glue/sync_backend_host_core.h b/chrome/browser/sync/glue/sync_backend_host_core.h
index 0c52100..408c3ab 100644
--- a/chrome/browser/sync/glue/sync_backend_host_core.h
+++ b/chrome/browser/sync/glue/sync_backend_host_core.h
@@ -212,6 +212,10 @@ class SyncBackendHostCore
void SendBufferedProtocolEventsAndEnableForwarding();
void DisableProtocolEventForwarding();
+ // Returns handle to sync functionality used by non-blocking sync types.
+ // Should only be called when the backend is initialized.
+ syncer::SyncCoreProxy GetSyncCoreProxy();
+
// Delete the sync data folder to cleanup backend data. Happens the first
// time sync is enabled for a user (to prevent accidentally reusing old
// sync databases), as well as shutdown when you're no longer syncing.
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc
index 4c202f0..09cfd1e 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc
@@ -234,6 +234,9 @@ void SyncBackendHostImpl::StopSyncingForShutdown() {
// Stop listening for and forwarding locally-triggered sync refresh requests.
notification_registrar_.RemoveAll();
+ // Stop non-blocking sync types from sending any more requests to the syncer.
+ sync_core_proxy_.reset();
+
DCHECK(registrar_->sync_thread()->IsRunning());
registrar_->RequestWorkerStopOnUIThread();
@@ -427,6 +430,10 @@ syncer::UserShare* SyncBackendHostImpl::GetUserShare() const {
return core_->sync_manager()->GetUserShare();
}
+syncer::SyncCoreProxy SyncBackendHostImpl::GetSyncCoreProxy() {
+ return *sync_core_proxy_.get();
+}
+
SyncBackendHostImpl::Status SyncBackendHostImpl::GetDetailedStatus() {
DCHECK(initialized());
return core_->sync_manager()->GetDetailedStatus();
@@ -573,13 +580,16 @@ void SyncBackendHostImpl::HandleControlTypesDownloadRetry() {
void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop(
const syncer::WeakHandle<syncer::JsBackend> js_backend,
const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>
- debug_info_listener) {
+ debug_info_listener,
+ syncer::SyncCoreProxy sync_core_proxy) {
DCHECK_EQ(base::MessageLoop::current(), frontend_loop_);
if (!frontend_)
return;
initialized_ = true;
+ sync_core_proxy_.reset(new syncer::SyncCoreProxy(sync_core_proxy));
+
invalidator_->RegisterInvalidationHandler(this);
invalidation_handler_registered_ = true;
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.h b/chrome/browser/sync/glue/sync_backend_host_impl.h
index d4568a2..3a35a16 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl.h
+++ b/chrome/browser/sync/glue/sync_backend_host_impl.h
@@ -112,6 +112,7 @@ class SyncBackendHostImpl
ChangeProcessor* change_processor) OVERRIDE;
virtual void DeactivateDataType(syncer::ModelType type) OVERRIDE;
virtual syncer::UserShare* GetUserShare() const OVERRIDE;
+ virtual syncer::SyncCoreProxy GetSyncCoreProxy() OVERRIDE;
virtual Status GetDetailedStatus() OVERRIDE;
virtual syncer::sessions::SyncSessionSnapshot
GetLastSessionSnapshot() const OVERRIDE;
@@ -162,7 +163,8 @@ class SyncBackendHostImpl
virtual void HandleInitializationSuccessOnFrontendLoop(
const syncer::WeakHandle<syncer::JsBackend> js_backend,
const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>
- debug_info_listener);
+ debug_info_listener,
+ syncer::SyncCoreProxy sync_core_proxy);
// Downloading of control types failed and will be retried. Invokes the
// frontend's sync configure retry method.
@@ -287,6 +289,9 @@ class SyncBackendHostImpl
// sync loop.
scoped_refptr<SyncBackendHostCore> core_;
+ // A handle referencing the main interface for non-blocking sync types.
+ scoped_ptr<syncer::SyncCoreProxy> sync_core_proxy_;
+
bool initialized_;
const base::WeakPtr<sync_driver::SyncPrefs> sync_prefs_;
diff --git a/chrome/browser/sync/glue/sync_backend_host_mock.cc b/chrome/browser/sync/glue/sync_backend_host_mock.cc
index 176652a..2f9d5aa 100644
--- a/chrome/browser/sync/glue/sync_backend_host_mock.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_mock.cc
@@ -69,6 +69,10 @@ syncer::UserShare* SyncBackendHostMock::GetUserShare() const {
return NULL;
}
+syncer::SyncCoreProxy SyncBackendHostMock::GetSyncCoreProxy() {
+ return syncer::SyncCoreProxy::GetInvalidSyncCoreProxyForTest();
+}
+
SyncBackendHost::Status SyncBackendHostMock::GetDetailedStatus() {
return SyncBackendHost::Status();
}
diff --git a/chrome/browser/sync/glue/sync_backend_host_mock.h b/chrome/browser/sync/glue/sync_backend_host_mock.h
index 76e3ea7..ee477b0 100644
--- a/chrome/browser/sync/glue/sync_backend_host_mock.h
+++ b/chrome/browser/sync/glue/sync_backend_host_mock.h
@@ -72,6 +72,8 @@ class SyncBackendHostMock : public SyncBackendHost {
virtual syncer::UserShare* GetUserShare() const OVERRIDE;
+ virtual syncer::SyncCoreProxy GetSyncCoreProxy() OVERRIDE;
+
virtual Status GetDetailedStatus() OVERRIDE;
virtual syncer::sessions::SyncSessionSnapshot
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 2e704e3..2a6ccef 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -79,6 +79,7 @@
#include "sync/internal_api/public/configure_reason.h"
#include "sync/internal_api/public/http_bridge_network_resources.h"
#include "sync/internal_api/public/network_resources.h"
+#include "sync/internal_api/public/sync_core_proxy.h"
#include "sync/internal_api/public/sync_encryption_handler.h"
#include "sync/internal_api/public/util/experiments.h"
#include "sync/internal_api/public/util/sync_string_conversions.h"
@@ -345,10 +346,18 @@ void ProfileSyncService::UnregisterAuthNotifications() {
void ProfileSyncService::RegisterDataTypeController(
DataTypeController* data_type_controller) {
DCHECK_EQ(data_type_controllers_.count(data_type_controller->type()), 0U);
+ DCHECK(!GetRegisteredNonBlockingDataTypes().Has(
+ data_type_controller->type()));
data_type_controllers_[data_type_controller->type()] =
data_type_controller;
}
+void ProfileSyncService::RegisterNonBlockingType(syncer::ModelType type) {
+ DCHECK_EQ(data_type_controllers_.count(type), 0U);
+ DCHECK(!GetRegisteredNonBlockingDataTypes().Has(type));
+ non_blocking_types_.Put(type);
+}
+
browser_sync::SessionModelAssociator*
ProfileSyncService::GetSessionModelAssociatorDeprecated() {
if (!IsSessionsDataTypeControllerRunning())
@@ -939,6 +948,8 @@ void ProfileSyncService::OnBackendInitialized(
backend_->RequestBufferedProtocolEventsAndEnableForwarding();
}
+ syncer::SyncCoreProxy sync_core_proxy_ = backend_->GetSyncCoreProxy();
+
// If we have a cached passphrase use it to decrypt/encrypt data now that the
// backend is initialized. We want to call this before notifying observers in
// case this operation affects the "passphrase required" status.
@@ -1213,7 +1224,7 @@ void ProfileSyncService::OnPassphraseRequired(
<< syncer::PassphraseRequiredReasonToString(reason);
passphrase_required_reason_ = reason;
- const syncer::ModelTypeSet types = GetPreferredDataTypes();
+ const syncer::ModelTypeSet types = GetPreferredDirectoryDataTypes();
if (data_type_manager_) {
// Reconfigure without the encrypted types (excluded implicitly via the
// failed datatypes handler).
@@ -1221,6 +1232,8 @@ void ProfileSyncService::OnPassphraseRequired(
syncer::CONFIGURE_REASON_CRYPTO);
}
+ // TODO(rlarocque): Support non-blocking types. http://crbug.com/351005.
+
// Notify observers that the passphrase status may have changed.
NotifyObservers();
}
@@ -1241,13 +1254,15 @@ void ProfileSyncService::OnPassphraseAccepted() {
// Make sure the data types that depend on the passphrase are started at
// this time.
- const syncer::ModelTypeSet types = GetPreferredDataTypes();
+ const syncer::ModelTypeSet types = GetPreferredDirectoryDataTypes();
if (data_type_manager_) {
// Re-enable any encrypted types if necessary.
data_type_manager_->Configure(types,
syncer::CONFIGURE_REASON_CRYPTO);
}
+ // TODO(rlarocque): Support non-blocking types. http://crbug.com/351005.
+
NotifyObservers();
}
@@ -1674,7 +1689,27 @@ syncer::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const {
return preferred_types;
}
+syncer::ModelTypeSet
+ProfileSyncService::GetPreferredDirectoryDataTypes() const {
+ const syncer::ModelTypeSet registered_directory_types =
+ GetRegisteredDirectoryDataTypes();
+ const syncer::ModelTypeSet preferred_types =
+ sync_prefs_.GetPreferredDataTypes(registered_directory_types);
+ return preferred_types;
+}
+
+syncer::ModelTypeSet
+ProfileSyncService::GetPreferredNonBlockingDataTypes() const {
+ return sync_prefs_.GetPreferredDataTypes(GetRegisteredNonBlockingDataTypes());
+}
+
syncer::ModelTypeSet ProfileSyncService::GetRegisteredDataTypes() const {
+ return Union(GetRegisteredDirectoryDataTypes(),
+ GetRegisteredNonBlockingDataTypes());
+}
+
+syncer::ModelTypeSet
+ProfileSyncService::GetRegisteredDirectoryDataTypes() const {
syncer::ModelTypeSet registered_types;
// The data_type_controllers_ are determined by command-line flags; that's
// effectively what controls the values returned here.
@@ -1686,6 +1721,11 @@ syncer::ModelTypeSet ProfileSyncService::GetRegisteredDataTypes() const {
return registered_types;
}
+syncer::ModelTypeSet
+ProfileSyncService::GetRegisteredNonBlockingDataTypes() const {
+ return non_blocking_types_;
+}
+
bool ProfileSyncService::IsUsingSecondaryPassphrase() const {
syncer::PassphraseType passphrase_type = GetPassphraseType();
return passphrase_type == syncer::FROZEN_IMPLICIT_PASSPHRASE ||
@@ -1707,7 +1747,8 @@ bool ProfileSyncService::IsCryptographerReady(
void ProfileSyncService::ConfigurePriorityDataTypes() {
const syncer::ModelTypeSet priority_types =
- Intersection(GetPreferredDataTypes(), syncer::PriorityUserTypes());
+ Intersection(GetPreferredDirectoryDataTypes(),
+ syncer::PriorityUserTypes());
if (!priority_types.Empty()) {
const syncer::ConfigureReason reason = HasSyncSetupCompleted() ?
syncer::CONFIGURE_REASON_RECONFIGURATION :
@@ -1745,7 +1786,7 @@ void ProfileSyncService::ConfigureDataTypeManager() {
base::Unretained(this))));
}
- const syncer::ModelTypeSet types = GetPreferredDataTypes();
+ const syncer::ModelTypeSet types = GetPreferredDirectoryDataTypes();
syncer::ConfigureReason reason = syncer::CONFIGURE_REASON_UNKNOWN;
if (!HasSyncSetupCompleted()) {
reason = syncer::CONFIGURE_REASON_NEW_CLIENT;
@@ -1862,6 +1903,9 @@ base::Value* ProfileSyncService::GetTypeStatusMap() const {
} else if (throttled_types.Has(type)) {
type_status->SetString("status", "warning");
type_status->SetString("value", "Throttled");
+ } else if (GetRegisteredNonBlockingDataTypes().Has(type)) {
+ type_status->SetString("status", "ok");
+ type_status->SetString("value", "Non-Blocking");
} else if (active_types.Has(type)) {
type_status->SetString("status", "ok");
type_status->SetString("value", "Active: " +
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 79b2a52..228dfbb 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -300,6 +300,12 @@ class ProfileSyncService : public ProfileSyncServiceBase,
void RegisterDataTypeController(
browser_sync::DataTypeController* data_type_controller);
+ // Registers a type whose sync storage will not be managed by the
+ // ProfileSyncService. It declares that this sync type may be activated at
+ // some point in the future. This function call does not enable or activate
+ // the syncing of this type
+ void RegisterNonBlockingType(syncer::ModelType type);
+
// Returns the session model associator associated with this type, but only if
// the associator is running. If it is doing anything else, it will return
// null.
@@ -578,12 +584,24 @@ class ProfileSyncService : public ProfileSyncServiceBase,
// superset of the active types (see GetActiveDataTypes()).
virtual syncer::ModelTypeSet GetPreferredDataTypes() const;
+ // Returns the set of directory types which are preferred for enabling.
+ virtual syncer::ModelTypeSet GetPreferredDirectoryDataTypes() const;
+
+ // Returns the set of off-thread types which are preferred for enabling.
+ virtual syncer::ModelTypeSet GetPreferredNonBlockingDataTypes() const;
+
// Gets the set of all data types that could be allowed (the set that
// should be advertised to the user). These will typically only change
// via a command-line option. See class comment for more on what it means
// for a datatype to be Registered.
virtual syncer::ModelTypeSet GetRegisteredDataTypes() const;
+ // Gets the set of directory types which could be allowed.
+ virtual syncer::ModelTypeSet GetRegisteredDirectoryDataTypes() const;
+
+ // Gets the set of off-thread types which could be allowed.
+ virtual syncer::ModelTypeSet GetRegisteredNonBlockingDataTypes() const;
+
// Checks whether the Cryptographer is ready to encrypt and decrypt updates
// for sensitive data types. Caller must be holding a
// syncapi::BaseTransaction to ensure thread safety.
@@ -892,6 +910,9 @@ class ProfileSyncService : public ProfileSyncServiceBase,
// List of available data type controllers.
browser_sync::DataTypeController::TypeMap data_type_controllers_;
+ // List of registered types that use the non-blocking API.
+ syncer::ModelTypeSet non_blocking_types_;
+
// Whether the SyncBackendHost has been initialized.
bool backend_initialized_;
diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h
index db1e188..0cdb599 100644
--- a/sync/internal_api/public/sync_manager.h
+++ b/sync/internal_api/public/sync_manager.h
@@ -334,7 +334,7 @@ class SYNC_EXPORT SyncManager : public syncer::InvalidationHandler {
virtual UserShare* GetUserShare() = 0;
// Returns an instance of the main interface for non-blocking sync types.
- virtual syncer::SyncCore* GetSyncCore() = 0;
+ virtual base::WeakPtr<syncer::SyncCore> GetSyncCore() = 0;
// Returns the cache_guid of the currently open database.
// Requires that the SyncManager be initialized.
diff --git a/sync/internal_api/public/test/fake_sync_manager.h b/sync/internal_api/public/test/fake_sync_manager.h
index 655caef..33d619a 100644
--- a/sync/internal_api/public/test/fake_sync_manager.h
+++ b/sync/internal_api/public/test/fake_sync_manager.h
@@ -119,7 +119,7 @@ class FakeSyncManager : public SyncManager {
virtual void SaveChanges() OVERRIDE;
virtual void ShutdownOnSyncThread() OVERRIDE;
virtual UserShare* GetUserShare() OVERRIDE;
- virtual syncer::SyncCore* GetSyncCore() OVERRIDE;
+ virtual base::WeakPtr<syncer::SyncCore> GetSyncCore() OVERRIDE;
virtual const std::string cache_guid() OVERRIDE;
virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE;
virtual bool HasUnsyncedItems() OVERRIDE;
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 0f30e65..0255522 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -1052,9 +1052,9 @@ UserShare* SyncManagerImpl::GetUserShare() {
return &share_;
}
-syncer::SyncCore* SyncManagerImpl::GetSyncCore() {
+base::WeakPtr<syncer::SyncCore> SyncManagerImpl::GetSyncCore() {
DCHECK(initialized_);
- return sync_core_.get();
+ return sync_core_->AsWeakPtr();
}
const std::string SyncManagerImpl::cache_guid() {
diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h
index c8f9aed..7386e01 100644
--- a/sync/internal_api/sync_manager_impl.h
+++ b/sync/internal_api/sync_manager_impl.h
@@ -110,7 +110,7 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl :
virtual void SaveChanges() OVERRIDE;
virtual void ShutdownOnSyncThread() OVERRIDE;
virtual UserShare* GetUserShare() OVERRIDE;
- virtual syncer::SyncCore* GetSyncCore() OVERRIDE;
+ virtual base::WeakPtr<syncer::SyncCore> GetSyncCore() OVERRIDE;
virtual const std::string cache_guid() OVERRIDE;
virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE;
virtual bool HasUnsyncedItems() OVERRIDE;
diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc
index 3fdbefa..c7dd249 100644
--- a/sync/internal_api/test/fake_sync_manager.cc
+++ b/sync/internal_api/test/fake_sync_manager.cc
@@ -218,8 +218,8 @@ UserShare* FakeSyncManager::GetUserShare() {
return test_user_share_.user_share();
}
-syncer::SyncCore* FakeSyncManager::GetSyncCore() {
- return NULL;
+base::WeakPtr<syncer::SyncCore> FakeSyncManager::GetSyncCore() {
+ return base::WeakPtr<syncer::SyncCore>();
}
const std::string FakeSyncManager::cache_guid() {
diff --git a/sync/sessions/model_type_registry.cc b/sync/sessions/model_type_registry.cc
index f93cba3e..b9d4114 100644
--- a/sync/sessions/model_type_registry.cc
+++ b/sync/sessions/model_type_registry.cc
@@ -90,7 +90,7 @@ void ModelTypeRegistry::InitializeNonBlockingType(
type_task_runner->PostTask(
FROM_HERE,
base::Bind(&NonBlockingTypeProcessor::OnConnect,
- processor->AsWeakPtr(),
+ processor,
core->AsWeakPtr(),
scoped_refptr<base::SequencedTaskRunner>(
base::MessageLoopProxy::current())));