OLD | NEW |
---|---|
(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 #ifndef ServiceWorkerRegistrationProxy_h | |
6 #define ServiceWorkerRegistrationProxy_h | |
7 | |
8 #include "platform/heap/Handle.h" | |
9 #include "public/platform/WebServiceWorkerRegistrationProxy.h" | |
10 | |
11 namespace blink { | |
12 | |
13 class ServiceWorkerRegistration; | |
14 | |
15 class PLATFORM_EXPORT ServiceWorkerRegistrationProxy FINAL : public GarbageColle cted<ServiceWorkerRegistrationProxy> { | |
16 public: | |
17 static ServiceWorkerRegistrationProxy* create(ServiceWorkerRegistration* reg istration) | |
18 { | |
19 return new ServiceWorkerRegistrationProxy(registration); | |
20 } | |
21 | |
22 ServiceWorkerRegistration* registration() const { return m_registration; } | |
23 | |
24 void trace(Visitor* visitor) { } | |
25 | |
26 private: | |
27 explicit ServiceWorkerRegistrationProxy(ServiceWorkerRegistration* registrat ion) | |
28 : m_registration(registration) | |
29 { | |
30 } | |
31 | |
32 // Ideally we want to make this a Member<ServiceWorkerRegistration>, but we cannot do it | |
33 // because it requires to include modules/serviceworkers/ServiceWorkerRegist ration.h. | |
34 // This violates the include dependency rule. | |
35 // Using a raw pointer is safe, because the ServiceWorkerRegistrationProxy o bject is kept | |
36 // alive by the ServiceWorkerRegistration object. | |
37 GC_PLUGIN_IGNORE("") | |
38 ServiceWorkerRegistration* m_registration; | |
Mads Ager (chromium)
2014/09/03 08:17:34
If we are not tracing this pointer I don't underst
haraken
2014/09/03 08:26:53
The relationship is as follows:
WebSWRegistration
| |
39 }; | |
40 | |
41 } // namespace blink | |
42 | |
43 #endif // ServiceWorkerRegistrationProxy_h | |
OLD | NEW |