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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host.h

Issue 10808040: [Sync] Avoid ObserverListThreadSafe in ChromeSyncNotificationBridge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test errors Created 8 years, 5 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
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 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/threading/thread.h" 16 #include "base/threading/thread.h"
17 #include "chrome/browser/sync/glue/backend_data_type_configurer.h" 17 #include "chrome/browser/sync/glue/backend_data_type_configurer.h"
18 #include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h" 18 #include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h"
19 #include "chrome/browser/sync/glue/chrome_sync_notification_bridge.h"
20 #include "chrome/common/net/gaia/google_service_auth_error.h" 19 #include "chrome/common/net/gaia/google_service_auth_error.h"
21 #include "googleurl/src/gurl.h" 20 #include "googleurl/src/gurl.h"
22 #include "sync/internal_api/public/base/model_type.h" 21 #include "sync/internal_api/public/base/model_type.h"
23 #include "sync/internal_api/public/configure_reason.h" 22 #include "sync/internal_api/public/configure_reason.h"
24 #include "sync/internal_api/public/engine/model_safe_worker.h" 23 #include "sync/internal_api/public/engine/model_safe_worker.h"
25 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" 24 #include "sync/internal_api/public/sessions/sync_session_snapshot.h"
26 #include "sync/internal_api/public/sync_manager.h" 25 #include "sync/internal_api/public/sync_manager.h"
27 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" 26 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h"
28 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" 27 #include "sync/internal_api/public/util/unrecoverable_error_handler.h"
29 #include "sync/internal_api/public/util/weak_handle.h" 28 #include "sync/internal_api/public/util/weak_handle.h"
30 #include "sync/notifier/sync_notifier_factory.h" 29 #include "sync/notifier/sync_notifier_factory.h"
31 #include "sync/protocol/encryption.pb.h" 30 #include "sync/protocol/encryption.pb.h"
32 #include "sync/protocol/sync_protocol_error.h" 31 #include "sync/protocol/sync_protocol_error.h"
33 32
34 class MessageLoop; 33 class MessageLoop;
35 class Profile; 34 class Profile;
36 35
37 namespace syncer { 36 namespace syncer {
38 class SyncManagerFactory; 37 class SyncManagerFactory;
39 } 38 }
40 39
41 namespace browser_sync { 40 namespace browser_sync {
42 41
43 class ChangeProcessor; 42 class ChangeProcessor;
43 class ChromeSyncNotificationBridge;
44 struct Experiments; 44 struct Experiments;
45 class InvalidatorStorage; 45 class InvalidatorStorage;
46 class JsBackend; 46 class JsBackend;
47 class JsEventHandler; 47 class JsEventHandler;
48 class SyncBackendRegistrar; 48 class SyncBackendRegistrar;
49 class SyncPrefs; 49 class SyncPrefs;
50 50
51 // SyncFrontend is the interface used by SyncBackendHost to communicate with 51 // SyncFrontend is the interface used by SyncBackendHost to communicate with
52 // the entity that created it and, presumably, is interested in sync-related 52 // the entity that created it and, presumably, is interested in sync-related
53 // activity. 53 // activity.
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 // Name used for debugging (set from profile_->GetDebugName()). 470 // Name used for debugging (set from profile_->GetDebugName()).
471 const std::string name_; 471 const std::string name_;
472 472
473 // Our core, which communicates directly to the syncapi. 473 // Our core, which communicates directly to the syncapi.
474 scoped_refptr<Core> core_; 474 scoped_refptr<Core> core_;
475 475
476 InitializationState initialization_state_; 476 InitializationState initialization_state_;
477 477
478 const base::WeakPtr<SyncPrefs> sync_prefs_; 478 const base::WeakPtr<SyncPrefs> sync_prefs_;
479 479
480 // A thread-safe listener for handling notifications triggered by 480 // A bridge that converts Chrome notifications (on the UI thread)
481 // chrome events. 481 // into invalidations (on the sync thread).
482 ChromeSyncNotificationBridge chrome_sync_notification_bridge_; 482 scoped_ptr<ChromeSyncNotificationBridge> chrome_sync_notification_bridge_;
483 483
484 syncer::SyncNotifierFactory sync_notifier_factory_; 484 syncer::SyncNotifierFactory sync_notifier_factory_;
485 485
486 ChromeExtensionsActivityMonitor extensions_activity_monitor_; 486 ChromeExtensionsActivityMonitor extensions_activity_monitor_;
487 487
488 scoped_ptr<SyncBackendRegistrar> registrar_; 488 scoped_ptr<SyncBackendRegistrar> registrar_;
489 489
490 // The frontend which we serve (and are owned by). 490 // The frontend which we serve (and are owned by).
491 SyncFrontend* frontend_; 491 SyncFrontend* frontend_;
492 492
493 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired 493 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired
494 // is called. This way, before the UI calls SetDecryptionPassphrase on the 494 // is called. This way, before the UI calls SetDecryptionPassphrase on the
495 // syncer, it can avoid the overhead of an asynchronous decryption call and 495 // syncer, it can avoid the overhead of an asynchronous decryption call and
496 // give the user immediate feedback about the passphrase entered by first 496 // give the user immediate feedback about the passphrase entered by first
497 // trying to decrypt the cached pending keys on the UI thread. Note that 497 // trying to decrypt the cached pending keys on the UI thread. Note that
498 // SetDecryptionPassphrase can still fail after the cached pending keys are 498 // SetDecryptionPassphrase can still fail after the cached pending keys are
499 // successfully decrypted if the pending keys have changed since the time they 499 // successfully decrypted if the pending keys have changed since the time they
500 // were cached. 500 // were cached.
501 sync_pb::EncryptedData cached_pending_keys_; 501 sync_pb::EncryptedData cached_pending_keys_;
502 502
503 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. 503 // UI-thread cache of the last SyncSessionSnapshot received from syncapi.
504 syncer::sessions::SyncSessionSnapshot last_snapshot_; 504 syncer::sessions::SyncSessionSnapshot last_snapshot_;
505 505
506 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); 506 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost);
507 }; 507 };
508 508
509 } // namespace browser_sync 509 } // namespace browser_sync
510 510
511 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ 511 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698