| Index: third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h
|
| diff --git a/third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h b/third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dac9bce472f54fe6797237912dead89ecc8b95d9
|
| --- /dev/null
|
| +++ b/third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h
|
| @@ -0,0 +1,50 @@
|
| +
|
| +#ifndef WebIsolatedWorkerContextClient_h
|
| +#define WebIsolatedWorkerContextClient_h
|
| +
|
| +#include "mojo/public/cpp/bindings/interface_request.h"
|
| +#include "mojo/public/cpp/bindings/struct_ptr.h"
|
| +#include "mojo/public/cpp/system/message_pipe.h"
|
| +#include "public/platform/WebCommon.h"
|
| +#include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
|
| +
|
| +namespace blink {
|
| +
|
| +namespace mojom {
|
| + class WorkerScriptList;
|
| +}
|
| +
|
| +class WebIsolatedWorkerContextClient {
|
| +public:
|
| + using DataVector = std::vector<std::unique_ptr<std::vector<char>>>;
|
| + struct WebScriptData {
|
| + WebScriptData(const std::string& url, std::unique_ptr<DataVector> data, std::unique_ptr<DataVector> meta_data)
|
| + : url(url)
|
| + , data(std::move(data))
|
| + , meta_data(std::move(meta_data))
|
| + {
|
| + }
|
| + std::string url;
|
| + std::unique_ptr<DataVector> data;
|
| + std::unique_ptr<DataVector> meta_data;
|
| + };
|
| +
|
| + virtual ~WebIsolatedWorkerContextClient() {}
|
| + virtual void initializeOnWorkerThread() {}
|
| + virtual void workerDestroyed() {}
|
| +
|
| + virtual void connectToRemoteService(const char* name, mojo::ScopedMessagePipeHandle) = 0;
|
| +
|
| + template <typename Interface>
|
| + void connectToRemoteService(mojo::InterfaceRequest<Interface> ptr)
|
| + {
|
| + connectToRemoteService(Interface::Name_, ptr.PassMessagePipe());
|
| + }
|
| +
|
| + virtual std::unique_ptr<std::vector<std::unique_ptr<WebScriptData>>> takeWorkerScriptList() = 0;
|
| + virtual std::unique_ptr<WebServiceWorkerRegistration::Handle> takeAssociatedRegistration() = 0;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // WebIsolatedWorkerContextClient_h
|
|
|