Chromium Code Reviews| Index: Source/platform/serviceworkers/ServiceWorkerRegistrationProxy.h |
| diff --git a/Source/platform/serviceworkers/ServiceWorkerRegistrationProxy.h b/Source/platform/serviceworkers/ServiceWorkerRegistrationProxy.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..32e6436747ab3436d37606c805c07aeed920fa5d |
| --- /dev/null |
| +++ b/Source/platform/serviceworkers/ServiceWorkerRegistrationProxy.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ServiceWorkerRegistrationProxy_h |
| +#define ServiceWorkerRegistrationProxy_h |
| + |
| +#include "platform/heap/Handle.h" |
| +#include "public/platform/WebServiceWorkerRegistrationProxy.h" |
| + |
| +namespace blink { |
| + |
| +class ServiceWorkerRegistration; |
| + |
| +class PLATFORM_EXPORT ServiceWorkerRegistrationProxy FINAL : public GarbageCollected<ServiceWorkerRegistrationProxy> { |
| +public: |
| + static ServiceWorkerRegistrationProxy* create(ServiceWorkerRegistration* registration) |
| + { |
| + return new ServiceWorkerRegistrationProxy(registration); |
| + } |
| + |
| + ServiceWorkerRegistration* registration() const { return m_registration; } |
| + |
| + void trace(Visitor* visitor) { } |
| + |
| +private: |
| + explicit ServiceWorkerRegistrationProxy(ServiceWorkerRegistration* registration) |
| + : m_registration(registration) |
| + { |
| + } |
| + |
| + // Ideally we want to make this a Member<ServiceWorkerRegistration>, but we cannot do it |
| + // because it requires to include modules/serviceworkers/ServiceWorkerRegistration.h. |
| + // This violates the include dependency rule. |
| + // Using a raw pointer is safe, because the ServiceWorkerRegistrationProxy object is kept |
| + // alive by the ServiceWorkerRegistration object. |
| + GC_PLUGIN_IGNORE("") |
| + 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
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // ServiceWorkerRegistrationProxy_h |