Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / public / platform / WebServiceWorkerProxy.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WebServiceWorkerProxy_h
6 #define WebServiceWorkerProxy_h
7
8 namespace blink {
9
10 // A proxy interface, passed via WebServiceWorker.setProxy() from blink to
11 // the embedder, to talk to the ServiceWorker object from embedder.
12 class WebServiceWorkerProxy {
13 public:
14     // Returns true if the proxy is ready to be notified of service worker state
15     // changes. It may not be if it's waiting for the registration promise to
16     // resolve, while the browser side has registered and is proceeding to
17     // install and activate the worker.
18     virtual bool isReady() = 0;
19
20     // Notifies the proxy that the service worker state changed. The new state
21     // should be accessible via WebServiceWorker.state().
22     virtual void dispatchStateChangeEvent() = 0;
23
24 protected:
25     virtual ~WebServiceWorkerProxy() { }
26 };
27
28 } // namespace blink
29
30 #endif // WebServiceWorkerProxy_h