| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // For CallbackPromiseAdapter | 63 // For CallbackPromiseAdapter |
| 64 typedef blink::WebServiceWorker WebType; | 64 typedef blink::WebServiceWorker WebType; |
| 65 static PassRefPtr<ServiceWorker> from(ScriptPromiseResolverWithContext*, Web
Type* worker); | 65 static PassRefPtr<ServiceWorker> from(ScriptPromiseResolverWithContext*, Web
Type* worker); |
| 66 | 66 |
| 67 void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePor
tArray*, ExceptionState&); | 67 void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePor
tArray*, ExceptionState&); |
| 68 | 68 |
| 69 const AtomicString& state() const; | 69 const AtomicString& state() const; |
| 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
| 71 | 71 |
| 72 // WebServiceWorkerProxy overrides. | 72 // WebServiceWorkerProxy overrides. |
| 73 virtual void onStateChanged(blink::WebServiceWorkerState) OVERRIDE; | 73 virtual bool isReady() OVERRIDE; |
| 74 virtual void dispatchStateChangeEvent() OVERRIDE; | 74 virtual void dispatchStateChangeEvent() OVERRIDE; |
| 75 | 75 |
| 76 // AbstractWorker overrides. | 76 // AbstractWorker overrides. |
| 77 virtual const AtomicString& interfaceName() const OVERRIDE; | 77 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 class ThenFunction; | 80 class ThenFunction; |
| 81 | 81 |
| 82 ServiceWorker(ExecutionContext*, PassOwnPtr<blink::WebServiceWorker>); | 82 ServiceWorker(ExecutionContext*, PassOwnPtr<blink::WebServiceWorker>); |
| 83 void onPromiseResolved(); | 83 void onPromiseResolved(); |
| 84 void waitOnPromise(ScriptPromise); | 84 void waitOnPromise(ScriptPromise); |
| 85 void changeState(blink::WebServiceWorkerState); | |
| 86 | 85 |
| 87 OwnPtr<blink::WebServiceWorker> m_outerWorker; | 86 OwnPtr<blink::WebServiceWorker> m_outerWorker; |
| 88 bool m_isPromisePending; | 87 bool m_isPromisePending; |
| 89 Vector<blink::WebServiceWorkerState> m_queuedStates; | |
| 90 }; | 88 }; |
| 91 | 89 |
| 92 } // namespace WebCore | 90 } // namespace WebCore |
| 93 | 91 |
| 94 #endif // ServiceWorker_h | 92 #endif // ServiceWorker_h |
| OLD | NEW |