| 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; |
| 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; } |
| 49 | 52 |
| 50 // ServiceWorkerGlobalScope.idl | 53 // ServiceWorkerGlobalScope.idl |
| 51 PassRefPtr<ServiceWorkerClients> clients(); | 54 PassRefPtr<ServiceWorkerClients> clients(); |
| 52 String scope(ExecutionContext*); | 55 String scope(ExecutionContext*); |
| 56 ScriptPromise fetch(ScriptState*, Request*); |
| 57 ScriptPromise fetch(ScriptState*, const String&); |
| 53 | 58 |
| 54 // EventTarget | 59 // EventTarget |
| 55 virtual const AtomicString& interfaceName() const OVERRIDE; | 60 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 56 | 61 |
| 57 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); | 62 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); |
| 58 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); | 63 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); |
| 59 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); | 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); |
| 60 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 61 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); | 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); |
| 62 | 67 |
| 63 virtual void trace(Visitor*) OVERRIDE; | 68 virtual void trace(Visitor*) OVERRIDE; |
| 64 | 69 |
| 65 private: | 70 private: |
| 66 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker
Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); | 71 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker
Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); |
| 67 | 72 |
| 68 RefPtr<ServiceWorkerClients> m_clients; | 73 RefPtr<ServiceWorkerClients> m_clients; |
| 74 OwnPtr<FetchManager> m_fetchManager; |
| 69 }; | 75 }; |
| 70 | 76 |
| 71 } // namespace WebCore | 77 } // namespace WebCore |
| 72 | 78 |
| 73 #endif // ServiceWorkerGlobalScope_h | 79 #endif // ServiceWorkerGlobalScope_h |
| OLD | NEW |