summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/glue
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/glue')
-rw-r--r--chrome/browser/sync/glue/autofill_change_processor.cc13
-rw-r--r--chrome/browser/sync/glue/autofill_change_processor.h14
-rw-r--r--chrome/browser/sync/glue/autofill_model_associator.cc30
-rw-r--r--chrome/browser/sync/glue/autofill_model_associator.h26
-rw-r--r--chrome/browser/sync/glue/extension_data.cc2
-rw-r--r--chrome/browser/sync/glue/extension_data.h2
-rw-r--r--chrome/browser/sync/glue/password_model_associator.cc2
-rw-r--r--chrome/browser/sync/glue/password_model_associator.h2
-rw-r--r--chrome/browser/sync/glue/password_model_worker.cc2
-rw-r--r--chrome/browser/sync/glue/password_model_worker.h1
-rw-r--r--chrome/browser/sync/glue/typed_url_model_associator.cc2
-rw-r--r--chrome/browser/sync/glue/typed_url_model_associator.h2
12 files changed, 64 insertions, 34 deletions
diff --git a/chrome/browser/sync/glue/autofill_change_processor.cc b/chrome/browser/sync/glue/autofill_change_processor.cc
index c025e84..a2a8db4 100644
--- a/chrome/browser/sync/glue/autofill_change_processor.cc
+++ b/chrome/browser/sync/glue/autofill_change_processor.cc
@@ -20,6 +20,17 @@
namespace browser_sync {
+struct AutofillChangeProcessor::AutofillChangeRecord {
+ sync_api::SyncManager::ChangeRecord::Action action_;
+ int64 id_;
+ sync_pb::AutofillSpecifics autofill_;
+ AutofillChangeRecord(sync_api::SyncManager::ChangeRecord::Action action,
+ int64 id, const sync_pb::AutofillSpecifics& autofill)
+ : action_(action),
+ id_(id),
+ autofill_(autofill) { }
+};
+
AutofillChangeProcessor::AutofillChangeProcessor(
AutofillModelAssociator* model_associator,
WebDatabase* web_database,
@@ -38,6 +49,8 @@ AutofillChangeProcessor::AutofillChangeProcessor(
StartObserving();
}
+AutofillChangeProcessor::~AutofillChangeProcessor() {}
+
void AutofillChangeProcessor::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
diff --git a/chrome/browser/sync/glue/autofill_change_processor.h b/chrome/browser/sync/glue/autofill_change_processor.h
index 0680d0c..7a84520 100644
--- a/chrome/browser/sync/glue/autofill_change_processor.h
+++ b/chrome/browser/sync/glue/autofill_change_processor.h
@@ -40,7 +40,7 @@ class AutofillChangeProcessor : public ChangeProcessor,
WebDatabase* web_database,
PersonalDataManager* personal_data,
UnrecoverableErrorHandler* error_handler);
- virtual ~AutofillChangeProcessor() {}
+ virtual ~AutofillChangeProcessor();
// NotificationObserver implementation.
// WebDataService -> sync_api model change application.
@@ -73,17 +73,6 @@ class AutofillChangeProcessor : public ChangeProcessor,
virtual void StopImpl();
private:
- struct AutofillChangeRecord {
- sync_api::SyncManager::ChangeRecord::Action action_;
- int64 id_;
- sync_pb::AutofillSpecifics autofill_;
- AutofillChangeRecord(sync_api::SyncManager::ChangeRecord::Action action,
- int64 id, const sync_pb::AutofillSpecifics& autofill)
- : action_(action),
- id_(id),
- autofill_(autofill) { }
- };
-
void StartObserving();
void StopObserving();
@@ -170,6 +159,7 @@ class AutofillChangeProcessor : public ChangeProcessor,
// Record of changes from ApplyChangesFromSyncModel. These are then processed
// in CommitChangesFromSyncModel.
+ struct AutofillChangeRecord;
std::vector<AutofillChangeRecord> autofill_changes_;
DISALLOW_COPY_AND_ASSIGN(AutofillChangeProcessor);
diff --git a/chrome/browser/sync/glue/autofill_model_associator.cc b/chrome/browser/sync/glue/autofill_model_associator.cc
index 43914c2..b550ab5 100644
--- a/chrome/browser/sync/glue/autofill_model_associator.cc
+++ b/chrome/browser/sync/glue/autofill_model_associator.cc
@@ -30,6 +30,25 @@ const char kAutofillProfileNamespaceTag[] = "autofill_profile|";
static const int kMaxNumAttemptsToFindUniqueLabel = 100;
+struct AutofillModelAssociator::DataBundle {
+ std::set<AutofillKey> current_entries;
+ std::vector<AutofillEntry> new_entries;
+ std::set<string16> current_profiles;
+ std::vector<AutoFillProfile*> updated_profiles;
+ std::vector<AutoFillProfile*> new_profiles; // We own these pointers.
+ ~DataBundle() { STLDeleteElements(&new_profiles); }
+};
+
+AutofillModelAssociator::DoOptimisticRefreshTask::DoOptimisticRefreshTask(
+ PersonalDataManager* pdm) : pdm_(pdm) {}
+
+AutofillModelAssociator::DoOptimisticRefreshTask::~DoOptimisticRefreshTask() {}
+
+void AutofillModelAssociator::DoOptimisticRefreshTask::Run() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ pdm_->Refresh();
+}
+
AutofillModelAssociator::AutofillModelAssociator(
ProfileSyncService* sync_service,
WebDatabase* web_database,
@@ -396,6 +415,17 @@ void AutofillModelAssociator::AbortAssociation() {
abort_association_pending_ = true;
}
+const std::string*
+AutofillModelAssociator::GetChromeNodeFromSyncId(int64 sync_id) {
+ return NULL;
+}
+
+bool AutofillModelAssociator::InitSyncNodeFromChromeId(
+ std::string node_id,
+ sync_api::BaseNode* sync_node) {
+ return false;
+}
+
int64 AutofillModelAssociator::GetSyncIdFromChromeId(
const std::string autofill) {
AutofillToSyncIdMap::const_iterator iter = id_map_.find(autofill);
diff --git a/chrome/browser/sync/glue/autofill_model_associator.h b/chrome/browser/sync/glue/autofill_model_associator.h
index f0dbe1a..d4e5363 100644
--- a/chrome/browser/sync/glue/autofill_model_associator.h
+++ b/chrome/browser/sync/glue/autofill_model_associator.h
@@ -15,7 +15,6 @@
#include "base/lock.h"
#include "base/ref_counted.h"
#include "chrome/browser/autofill/personal_data_manager.h"
-#include "chrome/browser/browser_thread.h"
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/glue/model_associator.h"
#include "chrome/browser/sync/protocol/autofill_specifics.pb.h"
@@ -56,11 +55,9 @@ class AutofillModelAssociator
// PersonalDataManager living on the UI thread that it needs to refresh.
class DoOptimisticRefreshTask : public Task {
public:
- explicit DoOptimisticRefreshTask(PersonalDataManager* pdm) : pdm_(pdm) {}
- virtual void Run() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- pdm_->Refresh();
- }
+ explicit DoOptimisticRefreshTask(PersonalDataManager* pdm);
+ virtual ~DoOptimisticRefreshTask();
+ virtual void Run();
private:
scoped_refptr<PersonalDataManager> pdm_;
};
@@ -81,15 +78,11 @@ class AutofillModelAssociator
virtual void AbortAssociation();
// Not implemented.
- virtual const std::string* GetChromeNodeFromSyncId(int64 sync_id) {
- return NULL;
- }
+ virtual const std::string* GetChromeNodeFromSyncId(int64 sync_id);
// Not implemented.
virtual bool InitSyncNodeFromChromeId(std::string node_id,
- sync_api::BaseNode* sync_node) {
- return false;
- }
+ sync_api::BaseNode* sync_node);
// Returns the sync id for the given autofill name, or sync_api::kInvalidId
// if the autofill name is not associated to any sync id.
@@ -137,14 +130,7 @@ class AutofillModelAssociator
// A convenience wrapper of a bunch of state we pass around while associating
// models, and send to the WebDatabase for persistence.
- struct DataBundle {
- std::set<AutofillKey> current_entries;
- std::vector<AutofillEntry> new_entries;
- std::set<string16> current_profiles;
- std::vector<AutoFillProfile*> updated_profiles;
- std::vector<AutoFillProfile*> new_profiles; // We own these pointers.
- ~DataBundle() { STLDeleteElements(&new_profiles); }
- };
+ struct DataBundle;
// Helper to query WebDatabase for the current autofill state.
bool LoadAutofillData(std::vector<AutofillEntry>* entries,
diff --git a/chrome/browser/sync/glue/extension_data.cc b/chrome/browser/sync/glue/extension_data.cc
index eb4fea6..c62c362 100644
--- a/chrome/browser/sync/glue/extension_data.cc
+++ b/chrome/browser/sync/glue/extension_data.cc
@@ -19,6 +19,8 @@ ExtensionData ExtensionData::FromData(
return extension_data;
}
+ExtensionData::~ExtensionData() {}
+
const sync_pb::ExtensionSpecifics& ExtensionData::merged_data() const {
DcheckIsExtensionSpecificsValid(merged_data_);
return merged_data_;
diff --git a/chrome/browser/sync/glue/extension_data.h b/chrome/browser/sync/glue/extension_data.h
index 67951b9..73316de 100644
--- a/chrome/browser/sync/glue/extension_data.h
+++ b/chrome/browser/sync/glue/extension_data.h
@@ -28,6 +28,8 @@ class ExtensionData {
static ExtensionData FromData(
Source source, const sync_pb::ExtensionSpecifics& data);
+ ~ExtensionData();
+
// Implicit copy constructor and assignment operator welcome.
// Returns the version of the data that all sources should
diff --git a/chrome/browser/sync/glue/password_model_associator.cc b/chrome/browser/sync/glue/password_model_associator.cc
index 7d33a0e..f9ab890 100644
--- a/chrome/browser/sync/glue/password_model_associator.cc
+++ b/chrome/browser/sync/glue/password_model_associator.cc
@@ -37,6 +37,8 @@ PasswordModelAssociator::PasswordModelAssociator(
#endif
}
+PasswordModelAssociator::~PasswordModelAssociator() {}
+
bool PasswordModelAssociator::AssociateModels() {
DCHECK(expected_loop_ == MessageLoop::current());
{
diff --git a/chrome/browser/sync/glue/password_model_associator.h b/chrome/browser/sync/glue/password_model_associator.h
index 096c3af..22c81ba 100644
--- a/chrome/browser/sync/glue/password_model_associator.h
+++ b/chrome/browser/sync/glue/password_model_associator.h
@@ -52,7 +52,7 @@ class PasswordModelAssociator
static syncable::ModelType model_type() { return syncable::PASSWORDS; }
PasswordModelAssociator(ProfileSyncService* sync_service,
PasswordStore* password_store);
- virtual ~PasswordModelAssociator() { }
+ virtual ~PasswordModelAssociator();
// PerDataTypeAssociatorInterface implementation.
//
diff --git a/chrome/browser/sync/glue/password_model_worker.cc b/chrome/browser/sync/glue/password_model_worker.cc
index 9c5b0d6..f832ac1 100644
--- a/chrome/browser/sync/glue/password_model_worker.cc
+++ b/chrome/browser/sync/glue/password_model_worker.cc
@@ -19,6 +19,8 @@ PasswordModelWorker::PasswordModelWorker(PasswordStore* password_store)
DCHECK(password_store);
}
+PasswordModelWorker::~PasswordModelWorker() {}
+
void PasswordModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) {
WaitableEvent done(false, false);
password_store_->ScheduleTask(
diff --git a/chrome/browser/sync/glue/password_model_worker.h b/chrome/browser/sync/glue/password_model_worker.h
index cd55c79..cd16874 100644
--- a/chrome/browser/sync/glue/password_model_worker.h
+++ b/chrome/browser/sync/glue/password_model_worker.h
@@ -26,6 +26,7 @@ namespace browser_sync {
class PasswordModelWorker : public browser_sync::ModelSafeWorker {
public:
explicit PasswordModelWorker(PasswordStore* password_store);
+ virtual ~PasswordModelWorker();
// ModelSafeWorker implementation. Called on syncapi SyncerThread.
void DoWorkAndWaitUntilDone(Callback0::Type* work);
diff --git a/chrome/browser/sync/glue/typed_url_model_associator.cc b/chrome/browser/sync/glue/typed_url_model_associator.cc
index dc9cc3a..ad15629 100644
--- a/chrome/browser/sync/glue/typed_url_model_associator.cc
+++ b/chrome/browser/sync/glue/typed_url_model_associator.cc
@@ -29,6 +29,8 @@ TypedUrlModelAssociator::TypedUrlModelAssociator(
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
}
+TypedUrlModelAssociator::~TypedUrlModelAssociator() {}
+
bool TypedUrlModelAssociator::AssociateModels() {
VLOG(1) << "Associating TypedUrl Models";
DCHECK(expected_loop_ == MessageLoop::current());
diff --git a/chrome/browser/sync/glue/typed_url_model_associator.h b/chrome/browser/sync/glue/typed_url_model_associator.h
index e894100..a07bae9 100644
--- a/chrome/browser/sync/glue/typed_url_model_associator.h
+++ b/chrome/browser/sync/glue/typed_url_model_associator.h
@@ -57,7 +57,7 @@ class TypedUrlModelAssociator
static syncable::ModelType model_type() { return syncable::TYPED_URLS; }
TypedUrlModelAssociator(ProfileSyncService* sync_service,
history::HistoryBackend* history_backend);
- virtual ~TypedUrlModelAssociator() { }
+ virtual ~TypedUrlModelAssociator();
// PerDataTypeAssociatorInterface implementation.
//