| Index: public/platform/WebServiceWorkerFetchStores.h
|
| diff --git a/public/platform/WebServiceWorkerFetchStores.h b/public/platform/WebServiceWorkerFetchStores.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..050aef5522b57c41a688c17df6098032c730c6dd
|
| --- /dev/null
|
| +++ b/public/platform/WebServiceWorkerFetchStores.h
|
| @@ -0,0 +1,40 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WebServiceWorkerFetchStores_h
|
| +#define WebServiceWorkerFetchStores_h
|
| +
|
| +#include "WebCommon.h"
|
| +#include "public/platform/WebCallbacks.h"
|
| +#include "public/platform/WebServiceWorkerFetchStoresError.h"
|
| +#include "public/platform/WebString.h"
|
| +#include "public/platform/WebVector.h"
|
| +
|
| +namespace blink {
|
| +
|
| +// An interface to the FetchStores API, implemented by the embedder and passed in to blink. Blink's implementation
|
| +// of the ServiceWorker spec will call these methods to create/open caches, and expect callbacks from the embedder
|
| +// after operations complete.
|
| +class WebServiceWorkerFetchStores {
|
| +public:
|
| +
|
| + typedef WebCallbacks<void, WebServiceWorkerFetchStoresError> FetchStoresCallbacks;
|
| + typedef WebCallbacks<int /* fetchStoreID */, WebServiceWorkerFetchStoresError> FetchStoresWithFetchStoreCallbacks;
|
| + typedef WebCallbacks<WebVector<WebString>, WebServiceWorkerFetchStoresError> FetchStoresKeysCallbacks;
|
| +
|
| + WebServiceWorkerFetchStores() { }
|
| + virtual ~WebServiceWorkerFetchStores() { }
|
| +
|
| + // Ownership of the FetchStores*Callbacks methods passes to the WebServiceWorkerFetchStores
|
| + // instance, which will delete it after calling onSuccess or onFailure.
|
| + virtual void dispatchGet(FetchStoresWithFetchStoreCallbacks*, const WebString& fetchStoreName) = 0;
|
| + virtual void dispatchHas(FetchStoresCallbacks*, const WebString& fetchStoreName) = 0;
|
| + virtual void dispatchCreate(FetchStoresWithFetchStoreCallbacks*, const WebString& fetchStoreName) = 0;
|
| + virtual void dispatchDelete(FetchStoresCallbacks*, const WebString& fetchStoreName) = 0;
|
| + virtual void dispatchKeys(FetchStoresKeysCallbacks*) = 0;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // WebServiceWorkerFetchStores_h
|
|
|