| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void OnMessageReceived(const IPC::Message& message); | 42 void OnMessageReceived(const IPC::Message& message); |
| 43 | 43 |
| 44 void DidHandleActivateEvent(int request_id, | 44 void DidHandleActivateEvent(int request_id, |
| 45 blink::WebServiceWorkerEventResult); | 45 blink::WebServiceWorkerEventResult); |
| 46 void DidHandleInstallEvent(int request_id, | 46 void DidHandleInstallEvent(int request_id, |
| 47 blink::WebServiceWorkerEventResult result); | 47 blink::WebServiceWorkerEventResult result); |
| 48 void DidHandleFetchEvent(int request_id, | 48 void DidHandleFetchEvent(int request_id, |
| 49 ServiceWorkerFetchEventResult result, | 49 ServiceWorkerFetchEventResult result, |
| 50 const ServiceWorkerResponse& response); | 50 const ServiceWorkerResponse& response); |
| 51 void DidHandleSyncEvent(int request_id); | 51 void DidHandleSyncEvent(int request_id); |
| 52 void DidHandlePushEvent(int request_id); |
| 52 void GetClientDocuments( | 53 void GetClientDocuments( |
| 53 blink::WebServiceWorkerClientsCallbacks* callbacks); | 54 blink::WebServiceWorkerClientsCallbacks* callbacks); |
| 54 void PostMessageToDocument( | 55 void PostMessageToDocument( |
| 55 int client_id, | 56 int client_id, |
| 56 const base::string16& message, | 57 const base::string16& message, |
| 57 scoped_ptr<blink::WebMessagePortChannelArray> channels); | 58 scoped_ptr<blink::WebMessagePortChannelArray> channels); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> | 61 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> |
| 61 ClientsCallbacksMap; | 62 ClientsCallbacksMap; |
| 62 | 63 |
| 63 // Send a message to the browser. | 64 // Send a message to the browser. |
| 64 void Send(IPC::Message* message); | 65 void Send(IPC::Message* message); |
| 65 | 66 |
| 66 void OnActivateEvent(int request_id); | 67 void OnActivateEvent(int request_id); |
| 67 void OnInstallEvent(int request_id, int active_version_id); | 68 void OnInstallEvent(int request_id, int active_version_id); |
| 68 void OnFetchEvent(int request_id, const ServiceWorkerFetchRequest& request); | 69 void OnFetchEvent(int request_id, const ServiceWorkerFetchRequest& request); |
| 69 void OnSyncEvent(int request_id); | 70 void OnSyncEvent(int request_id); |
| 71 void OnPushEvent(int request_id); |
| 70 void OnPostMessage(const base::string16& message, | 72 void OnPostMessage(const base::string16& message, |
| 71 const std::vector<int>& sent_message_port_ids, | 73 const std::vector<int>& sent_message_port_ids, |
| 72 const std::vector<int>& new_routing_ids); | 74 const std::vector<int>& new_routing_ids); |
| 73 void OnDidGetClientDocuments( | 75 void OnDidGetClientDocuments( |
| 74 int request_id, const std::vector<int>& client_ids); | 76 int request_id, const std::vector<int>& client_ids); |
| 75 | 77 |
| 76 // Get routing_id for sending message to the ServiceWorkerVersion | 78 // Get routing_id for sending message to the ServiceWorkerVersion |
| 77 // in the browser process. | 79 // in the browser process. |
| 78 int GetRoutingID() const; | 80 int GetRoutingID() const; |
| 79 | 81 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 90 | 92 |
| 91 // Pending callbacks for GetClientDocuments(). | 93 // Pending callbacks for GetClientDocuments(). |
| 92 ClientsCallbacksMap pending_clients_callbacks_; | 94 ClientsCallbacksMap pending_clients_callbacks_; |
| 93 | 95 |
| 94 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 96 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 } // namespace content | 99 } // namespace content |
| 98 | 100 |
| 99 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 101 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| OLD | NEW |