| 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 NavigationPreloadManager_h | 5 #ifndef NavigationPreloadManager_h |
| 6 #define NavigationPreloadManager_h | 6 #define NavigationPreloadManager_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class ServiceWorkerRegistration; |
| 15 |
| 14 class NavigationPreloadManager final | 16 class NavigationPreloadManager final |
| 15 : public GarbageCollected<NavigationPreloadManager>, | 17 : public GarbageCollected<NavigationPreloadManager>, |
| 16 public ScriptWrappable { | 18 public ScriptWrappable { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
| 18 | 20 |
| 19 public: | 21 public: |
| 20 static NavigationPreloadManager* create() { | 22 static NavigationPreloadManager* create( |
| 21 return new NavigationPreloadManager(); | 23 ServiceWorkerRegistration* registration) { |
| 24 return new NavigationPreloadManager(registration); |
| 22 } | 25 } |
| 23 | 26 |
| 24 ScriptPromise enable(ScriptState*); | 27 ScriptPromise enable(ScriptState*); |
| 25 ScriptPromise disable(ScriptState*); | 28 ScriptPromise disable(ScriptState*); |
| 26 ScriptPromise setHeaderValue(ScriptState*, const String& value); | 29 ScriptPromise setHeaderValue(ScriptState*, const String& value); |
| 27 ScriptPromise getState(ScriptState*); | 30 ScriptPromise getState(ScriptState*); |
| 28 | 31 |
| 29 DEFINE_INLINE_TRACE() {} | 32 DECLARE_TRACE(); |
| 30 | 33 |
| 31 private: | 34 private: |
| 32 NavigationPreloadManager(); | 35 explicit NavigationPreloadManager(ServiceWorkerRegistration*); |
| 36 |
| 37 Member<ServiceWorkerRegistration> m_registration; |
| 33 }; | 38 }; |
| 34 | 39 |
| 35 } // namespace blink | 40 } // namespace blink |
| 36 | 41 |
| 37 #endif // NavigationPreloadManager_h | 42 #endif // NavigationPreloadManager_h |
| OLD | NEW |