| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // WebServiceWorkerProxy overrides. | 70 // WebServiceWorkerProxy overrides. |
| 71 virtual bool isReady() OVERRIDE; | 71 virtual bool isReady() OVERRIDE; |
| 72 virtual void dispatchStateChangeEvent() OVERRIDE; | 72 virtual void dispatchStateChangeEvent() OVERRIDE; |
| 73 | 73 |
| 74 // AbstractWorker overrides. | 74 // AbstractWorker overrides. |
| 75 virtual const AtomicString& interfaceName() const OVERRIDE; | 75 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 class ThenFunction; | 78 class ThenFunction; |
| 79 | 79 |
| 80 enum ProxyState { |
| 81 Initial, |
| 82 RegisterPromisePending, |
| 83 Ready, |
| 84 ContextStopped |
| 85 }; |
| 86 |
| 80 static PassRefPtr<ServiceWorker> create(ExecutionContext*, PassOwnPtr<blink:
:WebServiceWorker>); | 87 static PassRefPtr<ServiceWorker> create(ExecutionContext*, PassOwnPtr<blink:
:WebServiceWorker>); |
| 81 ServiceWorker(ExecutionContext*, PassOwnPtr<blink::WebServiceWorker>); | 88 ServiceWorker(ExecutionContext*, PassOwnPtr<blink::WebServiceWorker>); |
| 89 void setProxyState(ProxyState); |
| 82 void onPromiseResolved(); | 90 void onPromiseResolved(); |
| 83 void waitOnPromise(ScriptPromise); | 91 void waitOnPromise(ScriptPromise); |
| 84 | 92 |
| 93 // ActiveDOMObject overrides. |
| 94 virtual bool hasPendingActivity() const OVERRIDE; |
| 95 virtual void stop() OVERRIDE; |
| 96 |
| 85 OwnPtr<blink::WebServiceWorker> m_outerWorker; | 97 OwnPtr<blink::WebServiceWorker> m_outerWorker; |
| 86 bool m_isPromisePending; | 98 ProxyState m_proxyState; |
| 87 }; | 99 }; |
| 88 | 100 |
| 89 } // namespace WebCore | 101 } // namespace WebCore |
| 90 | 102 |
| 91 #endif // ServiceWorker_h | 103 #endif // ServiceWorker_h |
| OLD | NEW |