OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 #ifndef ServiceWorkerGlobalScope_h | 30 #ifndef ServiceWorkerGlobalScope_h |
31 #define ServiceWorkerGlobalScope_h | 31 #define ServiceWorkerGlobalScope_h |
32 | 32 |
33 #include "core/workers/WorkerGlobalScope.h" | 33 #include "core/workers/WorkerGlobalScope.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "wtf/Assertions.h" | 35 #include "wtf/Assertions.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
| 39 class FetchManager; |
| 40 class Request; |
| 41 class ScriptPromise; |
| 42 class ScriptState; |
39 class ServiceWorkerThread; | 43 class ServiceWorkerThread; |
40 class ServiceWorkerClients; | 44 class ServiceWorkerClients; |
41 class WorkerThreadStartupData; | 45 class WorkerThreadStartupData; |
42 | 46 |
43 class ServiceWorkerGlobalScope FINAL : public WorkerGlobalScope { | 47 class ServiceWorkerGlobalScope FINAL : public WorkerGlobalScope { |
44 public: | 48 public: |
45 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker
Thread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>); | 49 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker
Thread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>); |
46 | 50 |
47 virtual ~ServiceWorkerGlobalScope(); | 51 virtual ~ServiceWorkerGlobalScope(); |
48 virtual bool isServiceWorkerGlobalScope() const OVERRIDE { return true; } | 52 virtual bool isServiceWorkerGlobalScope() const OVERRIDE { return true; } |
| 53 virtual void stopFetch() OVERRIDE; |
49 | 54 |
50 // ServiceWorkerGlobalScope.idl | 55 // ServiceWorkerGlobalScope.idl |
51 PassRefPtr<ServiceWorkerClients> clients(); | 56 PassRefPtr<ServiceWorkerClients> clients(); |
52 String scope(ExecutionContext*); | 57 String scope(ExecutionContext*); |
| 58 ScriptPromise fetch(ScriptState*, Request*); |
| 59 ScriptPromise fetch(ScriptState*, const String&); |
53 | 60 |
54 // EventTarget | 61 // EventTarget |
55 virtual const AtomicString& interfaceName() const OVERRIDE; | 62 virtual const AtomicString& interfaceName() const OVERRIDE; |
56 | 63 |
57 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); | 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); |
58 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); | 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); |
59 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); | 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); |
60 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
61 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); | 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); |
62 | 69 |
63 virtual void trace(Visitor*) OVERRIDE; | 70 virtual void trace(Visitor*) OVERRIDE; |
64 | 71 |
65 private: | 72 private: |
66 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker
Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); | 73 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker
Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); |
67 | 74 |
68 RefPtr<ServiceWorkerClients> m_clients; | 75 RefPtr<ServiceWorkerClients> m_clients; |
| 76 OwnPtr<FetchManager> m_fetchManager; |
69 }; | 77 }; |
70 | 78 |
71 } // namespace WebCore | 79 } // namespace WebCore |
72 | 80 |
73 #endif // ServiceWorkerGlobalScope_h | 81 #endif // ServiceWorkerGlobalScope_h |
OLD | NEW |