| OLD | NEW |
| (Empty) | |
| 1 |
| 2 #ifndef WebIsolatedWorkerContextClient_h |
| 3 #define WebIsolatedWorkerContextClient_h |
| 4 |
| 5 #include "mojo/public/cpp/bindings/interface_request.h" |
| 6 #include "mojo/public/cpp/bindings/struct_ptr.h" |
| 7 #include "mojo/public/cpp/system/message_pipe.h" |
| 8 #include "public/platform/WebCommon.h" |
| 9 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 namespace mojom { |
| 14 class WorkerScriptList; |
| 15 } |
| 16 |
| 17 class WebIsolatedWorkerContextClient { |
| 18 public: |
| 19 using DataVector = std::vector<std::unique_ptr<std::vector<char>>>; |
| 20 struct WebScriptData { |
| 21 WebScriptData(const std::string& url, std::unique_ptr<DataVector> data,
std::unique_ptr<DataVector> meta_data) |
| 22 : url(url) |
| 23 , data(std::move(data)) |
| 24 , meta_data(std::move(meta_data)) |
| 25 { |
| 26 } |
| 27 std::string url; |
| 28 std::unique_ptr<DataVector> data; |
| 29 std::unique_ptr<DataVector> meta_data; |
| 30 }; |
| 31 |
| 32 virtual ~WebIsolatedWorkerContextClient() {} |
| 33 virtual void initializeOnWorkerThread() {} |
| 34 virtual void workerDestroyed() {} |
| 35 |
| 36 virtual void connectToRemoteService(const char* name, mojo::ScopedMessagePip
eHandle) = 0; |
| 37 |
| 38 template <typename Interface> |
| 39 void connectToRemoteService(mojo::InterfaceRequest<Interface> ptr) |
| 40 { |
| 41 connectToRemoteService(Interface::Name_, ptr.PassMessagePipe()); |
| 42 } |
| 43 |
| 44 virtual std::unique_ptr<std::vector<std::unique_ptr<WebScriptData>>> takeWor
kerScriptList() = 0; |
| 45 virtual std::unique_ptr<WebServiceWorkerRegistration::Handle> takeAssociated
Registration() = 0; |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // WebIsolatedWorkerContextClient_h |
| OLD | NEW |