OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_CONTEXT_H_ |
6 #define CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_CONTEXT_H_ | 6 #define CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_CONTEXT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "content/browser/service_worker/service_worker_context_observer.h" | 12 #include "content/browser/service_worker/service_worker_context_core_observer.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 class BrowserContext; | 18 class BrowserContext; |
19 class ServiceWorkerContextWrapper; | 19 class ServiceWorkerContextWrapper; |
20 | 20 |
21 // Observes the service worker context of the storage partition owning this | 21 // Observes the service worker context of the storage partition owning this |
22 // instance and informs the push service of relevant service worker events. | 22 // instance and informs the push service of relevant service worker events. |
23 class PushMessagingContext : public ServiceWorkerContextObserver, | 23 class PushMessagingContext : public ServiceWorkerContextCoreObserver, |
24 public base::RefCounted<PushMessagingContext> { | 24 public base::RefCounted<PushMessagingContext> { |
25 public: | 25 public: |
26 PushMessagingContext( | 26 PushMessagingContext( |
27 BrowserContext* browser_context, | 27 BrowserContext* browser_context, |
28 const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context); | 28 const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context); |
29 | 29 |
30 // ServiceWorkerContextObserver methods | 30 // ServiceWorkerContextCoreObserver methods |
31 void OnRegistrationDeleted(int64_t registration_id, | 31 void OnRegistrationDeleted(int64_t registration_id, |
32 const GURL& pattern) override; | 32 const GURL& pattern) override; |
33 | 33 |
34 private: | 34 private: |
35 friend class base::RefCounted<PushMessagingContext>; | 35 friend class base::RefCounted<PushMessagingContext>; |
36 ~PushMessagingContext() override; | 36 ~PushMessagingContext() override; |
37 BrowserContext* browser_context_; | 37 BrowserContext* browser_context_; |
38 | 38 |
39 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 39 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(PushMessagingContext); | 41 DISALLOW_COPY_AND_ASSIGN(PushMessagingContext); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace content | 44 } // namespace content |
45 | 45 |
46 #endif // CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_CONTEXT_H_ | 46 #endif // CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_CONTEXT_H_ |
OLD | NEW |