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

Side by Side Diff: components/invalidation/p2p_invalidation_service.h

Issue 327243003: Introduce ProfileInvalidationProvider wrapper for InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "base/callback_forward.h" 5 #include "base/callback_forward.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/threading/non_thread_safe.h" 7 #include "base/threading/non_thread_safe.h"
8 #include "components/invalidation/invalidation_service.h" 8 #include "components/invalidation/invalidation_service.h"
9 #include "components/invalidation/p2p_invalidator.h" 9 #include "components/invalidation/p2p_invalidator.h"
10 #include "components/keyed_service/core/keyed_service.h" 10 #include "components/keyed_service/core/keyed_service.h"
11 11
12 #ifndef COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_ 12 #ifndef COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_
13 #define COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_ 13 #define COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_
14 14
15 namespace net { 15 namespace net {
16 class URLRequestContextGetter; 16 class URLRequestContextGetter;
17 } 17 }
18 18
19 namespace syncer { 19 namespace syncer {
20 class P2PInvalidator; 20 class P2PInvalidator;
21 } 21 }
22 22
23 namespace invalidation { 23 namespace invalidation {
24 24
25 class InvalidationLogger; 25 class InvalidationLogger;
26 26
27 // This service is a wrapper around P2PInvalidator. Unlike other 27 // This service is a wrapper around P2PInvalidator. Unlike other
28 // InvalidationServices, it can both send and receive invalidations. It is used 28 // InvalidationServices, it can both send and receive invalidations. It is used
29 // only in tests, where we're unable to connect to a real invalidations server. 29 // only in tests, where we're unable to connect to a real invalidations server.
30 class P2PInvalidationService 30 class P2PInvalidationService : public base::NonThreadSafe,
31 : public base::NonThreadSafe, 31 public InvalidationService {
32 public InvalidationService {
33 public: 32 public:
34 P2PInvalidationService( 33 P2PInvalidationService(
35 scoped_ptr<IdentityProvider> identity_provider, 34 scoped_ptr<IdentityProvider> identity_provider,
36 const scoped_refptr<net::URLRequestContextGetter>& request_context, 35 const scoped_refptr<net::URLRequestContextGetter>& request_context,
37 syncer::P2PNotificationTarget notification_target); 36 syncer::P2PNotificationTarget notification_target);
38 virtual ~P2PInvalidationService(); 37 virtual ~P2PInvalidationService();
39 38
40 // Overrides KeyedService method.
41 virtual void Shutdown() OVERRIDE;
42
43 // InvalidationService implementation. 39 // InvalidationService implementation.
44 // It is an error to have registered handlers when Shutdown() is called. 40 // It is an error to have registered handlers when the service is destroyed.
45 virtual void RegisterInvalidationHandler( 41 virtual void RegisterInvalidationHandler(
46 syncer::InvalidationHandler* handler) OVERRIDE; 42 syncer::InvalidationHandler* handler) OVERRIDE;
47 virtual void UpdateRegisteredInvalidationIds( 43 virtual void UpdateRegisteredInvalidationIds(
48 syncer::InvalidationHandler* handler, 44 syncer::InvalidationHandler* handler,
49 const syncer::ObjectIdSet& ids) OVERRIDE; 45 const syncer::ObjectIdSet& ids) OVERRIDE;
50 virtual void UnregisterInvalidationHandler( 46 virtual void UnregisterInvalidationHandler(
51 syncer::InvalidationHandler* handler) OVERRIDE; 47 syncer::InvalidationHandler* handler) OVERRIDE;
52 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; 48 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE;
53 virtual std::string GetInvalidatorClientId() const OVERRIDE; 49 virtual std::string GetInvalidatorClientId() const OVERRIDE;
54 virtual InvalidationLogger* GetInvalidationLogger() OVERRIDE; 50 virtual InvalidationLogger* GetInvalidationLogger() OVERRIDE;
(...skipping 10 matching lines...) Expand all
65 scoped_ptr<IdentityProvider> identity_provider_; 61 scoped_ptr<IdentityProvider> identity_provider_;
66 scoped_ptr<syncer::P2PInvalidator> invalidator_; 62 scoped_ptr<syncer::P2PInvalidator> invalidator_;
67 std::string invalidator_id_; 63 std::string invalidator_id_;
68 64
69 DISALLOW_COPY_AND_ASSIGN(P2PInvalidationService); 65 DISALLOW_COPY_AND_ASSIGN(P2PInvalidationService);
70 }; 66 };
71 67
72 } // namespace invalidation 68 } // namespace invalidation
73 69
74 #endif // COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_ 70 #endif // COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_
OLDNEW
« no previous file with comments | « components/invalidation/invalidation_service.h ('k') | components/invalidation/p2p_invalidation_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698