OLD | NEW |
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/common/net/gaia/google_service_auth_error.h" | 19 #include "chrome/common/net/gaia/google_service_auth_error.h" |
20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
21 #include "sync/internal_api/public/base/model_type.h" | 21 #include "sync/internal_api/public/base/model_type.h" |
22 #include "sync/internal_api/public/configure_reason.h" | 22 #include "sync/internal_api/public/configure_reason.h" |
23 #include "sync/internal_api/public/engine/model_safe_worker.h" | 23 #include "sync/internal_api/public/engine/model_safe_worker.h" |
24 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 24 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
| 25 #include "sync/internal_api/public/sync_encryption_handler.h" |
25 #include "sync/internal_api/public/sync_manager.h" | 26 #include "sync/internal_api/public/sync_manager.h" |
26 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" | 27 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" |
27 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 28 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
28 #include "sync/internal_api/public/util/weak_handle.h" | 29 #include "sync/internal_api/public/util/weak_handle.h" |
29 #include "sync/notifier/sync_notifier_factory.h" | 30 #include "sync/notifier/sync_notifier_factory.h" |
30 #include "sync/notifier/sync_notifier_observer.h" | 31 #include "sync/notifier/sync_notifier_observer.h" |
31 #include "sync/protocol/encryption.pb.h" | 32 #include "sync/protocol/encryption.pb.h" |
32 #include "sync/protocol/sync_protocol_error.h" | 33 #include "sync/protocol/sync_protocol_error.h" |
33 | 34 |
34 class MessageLoop; | 35 class MessageLoop; |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // syncer::SyncNotifierObserver-like functions. | 471 // syncer::SyncNotifierObserver-like functions. |
471 void HandleNotificationsEnabledOnFrontendLoop(); | 472 void HandleNotificationsEnabledOnFrontendLoop(); |
472 void HandleNotificationsDisabledOnFrontendLoop( | 473 void HandleNotificationsDisabledOnFrontendLoop( |
473 syncer::NotificationsDisabledReason reason); | 474 syncer::NotificationsDisabledReason reason); |
474 void HandleIncomingNotificationOnFrontendLoop( | 475 void HandleIncomingNotificationOnFrontendLoop( |
475 const syncer::ObjectIdPayloadMap& id_payloads, | 476 const syncer::ObjectIdPayloadMap& id_payloads, |
476 syncer::IncomingNotificationSource source); | 477 syncer::IncomingNotificationSource source); |
477 | 478 |
478 // Must be called on |frontend_loop_|. |done_callback| is called on | 479 // Must be called on |frontend_loop_|. |done_callback| is called on |
479 // |frontend_loop_|. | 480 // |frontend_loop_|. |
480 void RefreshNigori(const base::Closure& done_callback); | 481 void AssociateNigori(const base::Closure& done_callback); |
481 | 482 |
482 // Handles stopping the core's SyncManager, accounting for whether | 483 // Handles stopping the core's SyncManager, accounting for whether |
483 // initialization is done yet. | 484 // initialization is done yet. |
484 void StopSyncManagerForShutdown(const base::Closure& closure); | 485 void StopSyncManagerForShutdown(const base::Closure& closure); |
485 | 486 |
486 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; | 487 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; |
487 | 488 |
488 // A thread where all the sync operations happen. | 489 // A thread where all the sync operations happen. |
489 base::Thread sync_thread_; | 490 base::Thread sync_thread_; |
490 | 491 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 530 |
530 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 531 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
531 syncer::sessions::SyncSessionSnapshot last_snapshot_; | 532 syncer::sessions::SyncSessionSnapshot last_snapshot_; |
532 | 533 |
533 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 534 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
534 }; | 535 }; |
535 | 536 |
536 } // namespace browser_sync | 537 } // namespace browser_sync |
537 | 538 |
538 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 539 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |