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

Unified Diff: chrome/browser/sync/glue/password_change_processor.h

Issue 6878038: [Sync] Ensure we don't hold a transaction when we access password store. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rearrange Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/glue/password_change_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/password_change_processor.h
diff --git a/chrome/browser/sync/glue/password_change_processor.h b/chrome/browser/sync/glue/password_change_processor.h
index ab6b89dfc5b8bcb8a99713d01b262aa6ba728f73..155a1b3e676ed16ed762859bee97ceb66f3b6fdf 100644
--- a/chrome/browser/sync/glue/password_change_processor.h
+++ b/chrome/browser/sync/glue/password_change_processor.h
@@ -9,6 +9,8 @@
#include "chrome/browser/sync/glue/change_processor.h"
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/browser/sync/glue/password_model_associator.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
@@ -20,7 +22,6 @@ class NotificationService;
namespace browser_sync {
-class PasswordModelAssociator;
class UnrecoverableErrorHandler;
// This class is responsible for taking changes from the password backend and
@@ -39,17 +40,23 @@ class PasswordChangeProcessor : public ChangeProcessor,
// Passwords -> sync_api model change application.
virtual void Observe(NotificationType type,
const NotificationSource& source,
- const NotificationDetails& details);
+ const NotificationDetails& details) OVERRIDE;
// sync_api model -> WebDataService change application.
virtual void ApplyChangesFromSyncModel(
const sync_api::BaseTransaction* trans,
const sync_api::SyncManager::ChangeRecord* changes,
- int change_count);
+ int change_count) OVERRIDE;
+
+ // Commit changes buffered during ApplyChanges. We must commit them to the
+ // password store only after the sync_api transaction is released, else there
+ // is risk of deadlock due to the password store posting tasks to the UI
+ // thread (http://crbug.com/70658).
+ virtual void CommitChangesFromSyncModel() OVERRIDE;
protected:
- virtual void StartImpl(Profile* profile);
- virtual void StopImpl();
+ virtual void StartImpl(Profile* profile) OVERRIDE;
+ virtual void StopImpl() OVERRIDE;
private:
void StartObserving();
@@ -63,6 +70,12 @@ class PasswordChangeProcessor : public ChangeProcessor,
// holding a reference.
PasswordStore* password_store_;
+ // Buffers used between ApplyChangesFromSyncModel and
+ // CommitChangesFromSyncModel.
+ PasswordModelAssociator::PasswordVector new_passwords_;
+ PasswordModelAssociator::PasswordVector updated_passwords_;
+ PasswordModelAssociator::PasswordVector deleted_passwords_;
+
NotificationRegistrar notification_registrar_;
bool observing_;
« no previous file with comments | « no previous file | chrome/browser/sync/glue/password_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698