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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 class WebServiceWorkerRegistration; | 52 class WebServiceWorkerRegistration; |
53 class WorkerThreadStartupData; | 53 class WorkerThreadStartupData; |
54 | 54 |
55 typedef RequestOrUSVString RequestInfo; | 55 typedef RequestOrUSVString RequestInfo; |
56 | 56 |
57 class MODULES_EXPORT ServiceWorkerGlobalScope final : public WorkerGlobalScope { | 57 class MODULES_EXPORT ServiceWorkerGlobalScope final : public WorkerGlobalScope { |
58 DEFINE_WRAPPERTYPEINFO(); | 58 DEFINE_WRAPPERTYPEINFO(); |
59 public: | 59 public: |
60 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker
Thread*, PassOwnPtr<WorkerThreadStartupData>); | 60 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker
Thread*, PassOwnPtr<WorkerThreadStartupData>); |
61 | 61 |
62 virtual ~ServiceWorkerGlobalScope(); | 62 ~ServiceWorkerGlobalScope() override; |
63 virtual bool isServiceWorkerGlobalScope() const override { return true; } | 63 bool isServiceWorkerGlobalScope() const override { return true; } |
64 | 64 |
65 // WorkerGlobalScope | 65 // WorkerGlobalScope |
66 virtual void didEvaluateWorkerScript() override; | 66 void didEvaluateWorkerScript() override; |
67 | 67 |
68 // ServiceWorkerGlobalScope.idl | 68 // ServiceWorkerGlobalScope.idl |
69 ServiceWorkerClients* clients(); | 69 ServiceWorkerClients* clients(); |
70 ServiceWorkerRegistration* registration(); | 70 ServiceWorkerRegistration* registration(); |
71 StashedPortCollection* ports(); | 71 StashedPortCollection* ports(); |
72 | 72 |
73 ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, Exc
eptionState&); | 73 ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, Exc
eptionState&); |
74 | 74 |
75 void close(ExceptionState&); | 75 void close(ExceptionState&); |
76 | 76 |
77 ScriptPromise skipWaiting(ScriptState*); | 77 ScriptPromise skipWaiting(ScriptState*); |
78 | 78 |
79 void setRegistration(WebServiceWorkerRegistration*); | 79 void setRegistration(WebServiceWorkerRegistration*); |
80 | 80 |
81 // EventTarget | 81 // EventTarget |
82 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) override; | 82 bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListene
r>, bool useCapture = false) override; |
83 virtual const AtomicString& interfaceName() const override; | 83 const AtomicString& interfaceName() const override; |
84 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; | 84 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; |
85 | 85 |
86 void dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Event>, WaitUntilObserve
r*); | 86 void dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Event>, WaitUntilObserve
r*); |
87 | 87 |
88 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); | 88 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); |
89 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); | 89 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); |
90 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); | 90 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); |
91 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
92 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); | 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); |
93 | 93 |
94 DECLARE_VIRTUAL_TRACE(); | 94 DECLARE_VIRTUAL_TRACE(); |
(...skipping 16 matching lines...) Expand all Loading... |
111 size_t m_scriptCount; | 111 size_t m_scriptCount; |
112 size_t m_scriptTotalSize; | 112 size_t m_scriptTotalSize; |
113 size_t m_scriptCachedMetadataTotalSize; | 113 size_t m_scriptCachedMetadataTotalSize; |
114 }; | 114 }; |
115 | 115 |
116 DEFINE_TYPE_CASTS(ServiceWorkerGlobalScope, ExecutionContext, context, context->
isServiceWorkerGlobalScope(), context.isServiceWorkerGlobalScope()); | 116 DEFINE_TYPE_CASTS(ServiceWorkerGlobalScope, ExecutionContext, context, context->
isServiceWorkerGlobalScope(), context.isServiceWorkerGlobalScope()); |
117 | 117 |
118 } // namespace blink | 118 } // namespace blink |
119 | 119 |
120 #endif // ServiceWorkerGlobalScope_h | 120 #endif // ServiceWorkerGlobalScope_h |
OLD | NEW |