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