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 29 matching lines...) Expand all Loading... | |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class Dictionary; | 43 class Dictionary; |
44 class Request; | 44 class Request; |
45 class ScriptPromise; | 45 class ScriptPromise; |
46 class ScriptState; | 46 class ScriptState; |
47 class ServiceWorkerClients; | 47 class ServiceWorkerClients; |
48 class ServiceWorkerRegistration; | 48 class ServiceWorkerRegistration; |
49 class ServiceWorkerThread; | 49 class ServiceWorkerThread; |
50 class StashedPortCollection; | |
50 class WaitUntilObserver; | 51 class WaitUntilObserver; |
51 class WebServiceWorkerRegistration; | 52 class WebServiceWorkerRegistration; |
52 class WorkerThreadStartupData; | 53 class WorkerThreadStartupData; |
53 | 54 |
54 typedef RequestOrUSVString RequestInfo; | 55 typedef RequestOrUSVString RequestInfo; |
55 | 56 |
56 class MODULES_EXPORT ServiceWorkerGlobalScope final : public WorkerGlobalScope { | 57 class MODULES_EXPORT ServiceWorkerGlobalScope final : public WorkerGlobalScope { |
57 DEFINE_WRAPPERTYPEINFO(); | 58 DEFINE_WRAPPERTYPEINFO(); |
58 public: | 59 public: |
59 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker Thread*, PassOwnPtr<WorkerThreadStartupData>); | 60 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker Thread*, PassOwnPtr<WorkerThreadStartupData>); |
60 | 61 |
61 virtual ~ServiceWorkerGlobalScope(); | 62 virtual ~ServiceWorkerGlobalScope(); |
62 virtual bool isServiceWorkerGlobalScope() const override { return true; } | 63 virtual bool isServiceWorkerGlobalScope() const override { return true; } |
63 | 64 |
64 // WorkerGlobalScope | 65 // WorkerGlobalScope |
65 virtual void didEvaluateWorkerScript() override; | 66 virtual void didEvaluateWorkerScript() override; |
66 | 67 |
67 // ServiceWorkerGlobalScope.idl | 68 // ServiceWorkerGlobalScope.idl |
68 ServiceWorkerClients* clients(); | 69 ServiceWorkerClients* clients(); |
69 ServiceWorkerRegistration* registration(); | 70 ServiceWorkerRegistration* registration(); |
70 | 71 |
scheib
2015/05/06 21:44:30
Remove blank line and have ports() in same group a
Marijn Kruisselbrink
2015/05/12 06:56:40
Done, although all the methods upto the next comme
| |
72 PassRefPtrWillBeRawPtr<StashedPortCollection> ports(); | |
73 | |
71 ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, Exc eptionState&); | 74 ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, Exc eptionState&); |
72 | 75 |
73 void close(ExceptionState&); | 76 void close(ExceptionState&); |
74 | 77 |
75 ScriptPromise skipWaiting(ScriptState*); | 78 ScriptPromise skipWaiting(ScriptState*); |
76 | 79 |
77 void setRegistration(WebServiceWorkerRegistration*); | 80 void setRegistration(WebServiceWorkerRegistration*); |
78 | 81 |
79 // EventTarget | 82 // EventTarget |
80 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture = false) override; | 83 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture = false) override; |
(...skipping 14 matching lines...) Expand all Loading... | |
95 class SkipWaitingCallback; | 98 class SkipWaitingCallback; |
96 | 99 |
97 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker Thread*, double timeOrigin, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<Worker Clients>); | 100 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker Thread*, double timeOrigin, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<Worker Clients>); |
98 void importScripts(const Vector<String>& urls, ExceptionState&) override; | 101 void importScripts(const Vector<String>& urls, ExceptionState&) override; |
99 PassOwnPtr<CachedMetadataHandler> createWorkerScriptCachedMetadataHandler(co nst KURL& scriptURL, const Vector<char>* metaData) override; | 102 PassOwnPtr<CachedMetadataHandler> createWorkerScriptCachedMetadataHandler(co nst KURL& scriptURL, const Vector<char>* metaData) override; |
100 void logExceptionToConsole(const String& errorMessage, int scriptId, const S tring& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scrip tCallStack>) override; | 103 void logExceptionToConsole(const String& errorMessage, int scriptId, const S tring& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scrip tCallStack>) override; |
101 void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) override; | 104 void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) override; |
102 | 105 |
103 PersistentWillBeMember<ServiceWorkerClients> m_clients; | 106 PersistentWillBeMember<ServiceWorkerClients> m_clients; |
104 PersistentWillBeMember<ServiceWorkerRegistration> m_registration; | 107 PersistentWillBeMember<ServiceWorkerRegistration> m_registration; |
108 RefPtrWillBeMember<StashedPortCollection> m_ports; | |
105 bool m_didEvaluateScript; | 109 bool m_didEvaluateScript; |
106 bool m_hadErrorInTopLevelEventHandler; | 110 bool m_hadErrorInTopLevelEventHandler; |
107 unsigned m_eventNestingLevel; | 111 unsigned m_eventNestingLevel; |
108 size_t m_scriptCount; | 112 size_t m_scriptCount; |
109 size_t m_scriptTotalSize; | 113 size_t m_scriptTotalSize; |
110 size_t m_scriptCachedMetadataTotalSize; | 114 size_t m_scriptCachedMetadataTotalSize; |
111 }; | 115 }; |
112 | 116 |
117 DEFINE_TYPE_CASTS(ServiceWorkerGlobalScope, ExecutionContext, context, context-> isServiceWorkerGlobalScope(), context.isServiceWorkerGlobalScope()); | |
118 | |
113 } // namespace blink | 119 } // namespace blink |
114 | 120 |
115 #endif // ServiceWorkerGlobalScope_h | 121 #endif // ServiceWorkerGlobalScope_h |
OLD | NEW |