| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 public ScriptWrappable, | 57 public ScriptWrappable, |
| 58 public ContextLifecycleObserver, | 58 public ContextLifecycleObserver, |
| 59 public DOMWindowLifecycleObserver, | 59 public DOMWindowLifecycleObserver, |
| 60 public blink::WebServiceWorkerProviderClient { | 60 public blink::WebServiceWorkerProviderClient { |
| 61 public: | 61 public: |
| 62 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*); | 62 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*); |
| 63 ~ServiceWorkerContainer(); | 63 ~ServiceWorkerContainer(); |
| 64 | 64 |
| 65 void detachClient(); | 65 void detachClient(); |
| 66 | 66 |
| 67 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get
(); } |
| 68 ScriptPromise ready(ScriptState*); |
| 69 |
| 67 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con
st Dictionary&); | 70 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con
st Dictionary&); |
| 68 ScriptPromise unregisterServiceWorker(ScriptState*, const String& scope = St
ring()); | 71 ScriptPromise unregisterServiceWorker(ScriptState*, const String& scope = St
ring()); |
| 69 | 72 |
| 70 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get
(); } | |
| 71 | |
| 72 // WebServiceWorkerProviderClient overrides. | 73 // WebServiceWorkerProviderClient overrides. |
| 73 virtual void setController(blink::WebServiceWorker*) OVERRIDE; | 74 virtual void setController(blink::WebServiceWorker*) OVERRIDE; |
| 74 virtual void dispatchMessageEvent(const blink::WebString& message, const bli
nk::WebMessagePortChannelArray&) OVERRIDE; | 75 virtual void dispatchMessageEvent(const blink::WebString& message, const bli
nk::WebMessagePortChannelArray&) OVERRIDE; |
| 75 | 76 |
| 76 // FIXME: Delete this when the embedder switches to setController. | 77 // FIXME: Delete this when the embedder switches to setController. |
| 77 virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE; | 78 virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE; |
| 78 | 79 |
| 79 private: | 80 private: |
| 80 explicit ServiceWorkerContainer(ExecutionContext*); | 81 explicit ServiceWorkerContainer(ExecutionContext*); |
| 81 | 82 |
| 82 blink::WebServiceWorkerProvider* m_provider; | 83 blink::WebServiceWorkerProvider* m_provider; |
| 83 RefPtr<ServiceWorker> m_controller; | 84 RefPtr<ServiceWorker> m_controller; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace WebCore | 87 } // namespace WebCore |
| 87 | 88 |
| 88 #endif // ServiceWorkerContainer_h | 89 #endif // ServiceWorkerContainer_h |
| OLD | NEW |