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

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

Issue 1191393008: Introduce a layering in the invalidation component as public and impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Explicitly forbid content to prevent future additions Created 5 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/callback_forward.h"
6 #include "base/memory/ref_counted.h"
7 #include "base/threading/non_thread_safe.h"
8 #include "components/invalidation/invalidation_service.h"
9 #include "components/invalidation/p2p_invalidator.h"
10 #include "components/keyed_service/core/keyed_service.h"
11
12 #ifndef COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_
13 #define COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_
14
15 namespace net {
16 class URLRequestContextGetter;
17 }
18
19 namespace syncer {
20 class P2PInvalidator;
21 }
22
23 namespace invalidation {
24
25 class InvalidationLogger;
26
27 // This service is a wrapper around P2PInvalidator. Unlike other
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.
30 class P2PInvalidationService : public base::NonThreadSafe,
31 public InvalidationService {
32 public:
33 P2PInvalidationService(
34 scoped_ptr<IdentityProvider> identity_provider,
35 const scoped_refptr<net::URLRequestContextGetter>& request_context,
36 syncer::P2PNotificationTarget notification_target);
37 ~P2PInvalidationService() override;
38
39 // InvalidationService implementation.
40 // It is an error to have registered handlers when the service is destroyed.
41 void RegisterInvalidationHandler(
42 syncer::InvalidationHandler* handler) override;
43 bool UpdateRegisteredInvalidationIds(syncer::InvalidationHandler* handler,
44 const syncer::ObjectIdSet& ids) override;
45 void UnregisterInvalidationHandler(
46 syncer::InvalidationHandler* handler) override;
47 syncer::InvalidatorState GetInvalidatorState() const override;
48 std::string GetInvalidatorClientId() const override;
49 InvalidationLogger* GetInvalidationLogger() override;
50 void RequestDetailedStatus(
51 base::Callback<void(const base::DictionaryValue&)> caller) const override;
52 IdentityProvider* GetIdentityProvider() override;
53
54 void UpdateCredentials(const std::string& username,
55 const std::string& password);
56
57 void SendInvalidation(const syncer::ObjectIdSet& ids);
58
59 private:
60 scoped_ptr<IdentityProvider> identity_provider_;
61 scoped_ptr<syncer::P2PInvalidator> invalidator_;
62 std::string invalidator_id_;
63
64 DISALLOW_COPY_AND_ASSIGN(P2PInvalidationService);
65 };
66
67 } // namespace invalidation
68
69 #endif // COMPONENTS_INVALIDATION_P2P_INVALIDATION_SERVICE_H_
OLDNEW
« no previous file with comments | « components/invalidation/object_id_invalidation_map_unittest.cc ('k') | components/invalidation/p2p_invalidation_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698