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 // An implementation of SyncNotifier that wraps InvalidationNotifier | 5 // An implementation of SyncNotifier that wraps InvalidationNotifier |
6 // on its own thread. | 6 // on its own thread. |
7 | 7 |
8 #ifndef SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ | 8 #ifndef SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
9 #define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ | 9 #define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
19 #include "jingle/notifier/base/notifier_options.h" | 19 #include "jingle/notifier/base/notifier_options.h" |
20 #include "sync/notifier/invalidation_version_tracker.h" | 20 #include "sync/notifier/invalidation_state_tracker.h" |
21 #include "sync/notifier/sync_notifier.h" | 21 #include "sync/notifier/sync_notifier.h" |
22 #include "sync/notifier/sync_notifier_observer.h" | 22 #include "sync/notifier/sync_notifier_observer.h" |
23 #include "sync/util/weak_handle.h" | 23 #include "sync/util/weak_handle.h" |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class MessageLoopProxy; | 26 class MessageLoopProxy; |
27 } | 27 } |
28 | 28 |
29 namespace sync_notifier { | 29 namespace sync_notifier { |
30 | 30 |
31 class NonBlockingInvalidationNotifier | 31 class NonBlockingInvalidationNotifier |
32 : public SyncNotifier, | 32 : public SyncNotifier, |
33 public SyncNotifierObserver { | 33 public SyncNotifierObserver { |
34 public: | 34 public: |
35 // |invalidation_version_tracker| must be initialized. | 35 // |invalidation_state_tracker| must be initialized. |
36 NonBlockingInvalidationNotifier( | 36 NonBlockingInvalidationNotifier( |
37 const notifier::NotifierOptions& notifier_options, | 37 const notifier::NotifierOptions& notifier_options, |
38 const InvalidationVersionMap& initial_max_invalidation_versions, | 38 const InvalidationVersionMap& initial_max_invalidation_versions, |
39 const browser_sync::WeakHandle<InvalidationVersionTracker>& | 39 const browser_sync::WeakHandle<InvalidationStateTracker>& |
40 invalidation_version_tracker, | 40 invalidation_state_tracker, |
41 const std::string& client_info); | 41 const std::string& client_info); |
42 | 42 |
43 virtual ~NonBlockingInvalidationNotifier(); | 43 virtual ~NonBlockingInvalidationNotifier(); |
44 | 44 |
45 // SyncNotifier implementation. | 45 // SyncNotifier implementation. |
46 virtual void AddObserver(SyncNotifierObserver* observer) OVERRIDE; | 46 virtual void AddObserver(SyncNotifierObserver* observer) OVERRIDE; |
47 virtual void RemoveObserver(SyncNotifierObserver* observer) OVERRIDE; | 47 virtual void RemoveObserver(SyncNotifierObserver* observer) OVERRIDE; |
48 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; | 48 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; |
49 virtual void SetState(const std::string& state) OVERRIDE; | 49 virtual void SetState(const std::string& state) OVERRIDE; |
50 virtual void UpdateCredentials( | 50 virtual void UpdateCredentials( |
(...skipping 23 matching lines...) Expand all Loading... |
74 scoped_refptr<Core> core_; | 74 scoped_refptr<Core> core_; |
75 scoped_refptr<base::MessageLoopProxy> parent_message_loop_proxy_; | 75 scoped_refptr<base::MessageLoopProxy> parent_message_loop_proxy_; |
76 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 76 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidationNotifier); | 78 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidationNotifier); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace sync_notifier | 81 } // namespace sync_notifier |
82 | 82 |
83 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ | 83 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
OLD | NEW |