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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const AtomicString& state() const; | 62 const AtomicString& state() const; |
63 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 63 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
64 | 64 |
65 // WebServiceWorkerProxy overrides. | 65 // WebServiceWorkerProxy overrides. |
66 virtual bool isReady() override; | 66 virtual bool isReady() override; |
67 virtual void dispatchStateChangeEvent() override; | 67 virtual void dispatchStateChangeEvent() override; |
68 | 68 |
69 // AbstractWorker overrides. | 69 // AbstractWorker overrides. |
70 virtual const AtomicString& interfaceName() const override; | 70 virtual const AtomicString& interfaceName() const override; |
71 | 71 |
| 72 void internalsTerminate(); |
72 private: | 73 private: |
73 class ThenFunction; | 74 class ThenFunction; |
74 | 75 |
75 enum ProxyState { | 76 enum ProxyState { |
76 Initial, | 77 Initial, |
77 RegisterPromisePending, | 78 RegisterPromisePending, |
78 Ready, | 79 Ready, |
79 ContextStopped | 80 ContextStopped |
80 }; | 81 }; |
81 | 82 |
82 static PassRefPtrWillBeRawPtr<ServiceWorker> getOrCreate(ExecutionContext*,
WebType*); | 83 static PassRefPtrWillBeRawPtr<ServiceWorker> getOrCreate(ExecutionContext*,
WebType*); |
83 ServiceWorker(ExecutionContext*, PassOwnPtr<WebServiceWorker>); | 84 ServiceWorker(ExecutionContext*, PassOwnPtr<WebServiceWorker>); |
84 void setProxyState(ProxyState); | 85 void setProxyState(ProxyState); |
85 void onPromiseResolved(); | 86 void onPromiseResolved(); |
86 void waitOnPromise(ScriptPromiseResolver*); | 87 void waitOnPromise(ScriptPromiseResolver*); |
87 | 88 |
88 // ActiveDOMObject overrides. | 89 // ActiveDOMObject overrides. |
89 virtual bool hasPendingActivity() const override; | 90 virtual bool hasPendingActivity() const override; |
90 virtual void stop() override; | 91 virtual void stop() override; |
91 | 92 |
92 OwnPtr<WebServiceWorker> m_outerWorker; | 93 OwnPtr<WebServiceWorker> m_outerWorker; |
93 ProxyState m_proxyState; | 94 ProxyState m_proxyState; |
94 }; | 95 }; |
95 | 96 |
96 } // namespace blink | 97 } // namespace blink |
97 | 98 |
98 #endif // ServiceWorker_h | 99 #endif // ServiceWorker_h |
OLD | NEW |