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; | |
tyoshino (SeeGerritForStatus)
2014/06/12 07:38:20
add ScriptState
horo
2014/06/12 08:32:55
Done.
| |
39 class ServiceWorkerThread; | 42 class ServiceWorkerThread; |
40 class ServiceWorkerClients; | 43 class ServiceWorkerClients; |
41 class WorkerThreadStartupData; | 44 class WorkerThreadStartupData; |
42 | 45 |
43 class ServiceWorkerGlobalScope FINAL : public WorkerGlobalScope { | 46 class ServiceWorkerGlobalScope FINAL : public WorkerGlobalScope { |
44 public: | 47 public: |
45 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker Thread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>); | 48 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker Thread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>); |
46 | 49 |
47 virtual ~ServiceWorkerGlobalScope(); | 50 virtual ~ServiceWorkerGlobalScope(); |
48 virtual bool isServiceWorkerGlobalScope() const OVERRIDE { return true; } | 51 virtual bool isServiceWorkerGlobalScope() const OVERRIDE { return true; } |
52 virtual void stopFetch() OVERRIDE; | |
49 | 53 |
50 // ServiceWorkerGlobalScope.idl | 54 // ServiceWorkerGlobalScope.idl |
51 PassRefPtr<ServiceWorkerClients> clients(); | 55 PassRefPtr<ServiceWorkerClients> clients(); |
52 String scope(ExecutionContext*); | 56 String scope(ExecutionContext*); |
57 ScriptPromise fetch(ScriptState*, Request*); | |
58 ScriptPromise fetch(ScriptState*, const String&); | |
53 | 59 |
54 // EventTarget | 60 // EventTarget |
55 virtual const AtomicString& interfaceName() const OVERRIDE; | 61 virtual const AtomicString& interfaceName() const OVERRIDE; |
56 | 62 |
57 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); | 63 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); |
58 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); | 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); |
59 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); | 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); |
60 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
61 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); | 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); |
62 | 68 |
63 virtual void trace(Visitor*) OVERRIDE; | 69 virtual void trace(Visitor*) OVERRIDE; |
64 | 70 |
65 private: | 71 private: |
66 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); | 72 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); |
67 | 73 |
68 RefPtr<ServiceWorkerClients> m_clients; | 74 RefPtr<ServiceWorkerClients> m_clients; |
75 OwnPtr<FetchManager> m_fetchManager; | |
69 }; | 76 }; |
70 | 77 |
71 } // namespace WebCore | 78 } // namespace WebCore |
72 | 79 |
73 #endif // ServiceWorkerGlobalScope_h | 80 #endif // ServiceWorkerGlobalScope_h |
OLD | NEW |