| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Defines messages between the browser and worker process, as well as between | 5 // Defines messages between the browser and worker process, as well as between |
| 6 // the renderer and worker process. | 6 // the renderer and worker process. |
| 7 | 7 |
| 8 // Multiply-included message file, hence no include guard. | 8 // Multiply-included message file, hence no include guard. |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/common/content_param_traits.h" | 16 #include "content/common/content_param_traits.h" |
| 17 #include "content/common/message_port.h" | 17 #include "content/common/message_port.h" |
| 18 #include "ipc/ipc_message_macros.h" | 18 #include "ipc/ipc_message_macros.h" |
| 19 #include "ipc/ipc_message_utils.h" | 19 #include "ipc/ipc_message_utils.h" |
| 20 #include "third_party/WebKit/public/web/WebDataSaverFlag.h" |
| 20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 21 | 22 |
| 22 #undef IPC_MESSAGE_EXPORT | 23 #undef IPC_MESSAGE_EXPORT |
| 23 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 24 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 24 #define IPC_MESSAGE_START WorkerMsgStart | 25 #define IPC_MESSAGE_START WorkerMsgStart |
| 25 | 26 |
| 26 // Parameters structure for WorkerHostMsg_PostConsoleMessageToWorkerObject, | 27 // Parameters structure for WorkerHostMsg_PostConsoleMessageToWorkerObject, |
| 27 // which has too many data parameters to be reasonably put in a predefined | 28 // which has too many data parameters to be reasonably put in a predefined |
| 28 // IPC message. The data members directly correspond to parameters of | 29 // IPC message. The data members directly correspond to parameters of |
| 29 // WebWorkerClient::postConsoleMessageToWorkerObject() | 30 // WebWorkerClient::postConsoleMessageToWorkerObject() |
| 30 IPC_STRUCT_BEGIN(WorkerHostMsg_PostConsoleMessageToWorkerObject_Params) | 31 IPC_STRUCT_BEGIN(WorkerHostMsg_PostConsoleMessageToWorkerObject_Params) |
| 31 IPC_STRUCT_MEMBER(int, source_identifier) | 32 IPC_STRUCT_MEMBER(int, source_identifier) |
| 32 IPC_STRUCT_MEMBER(int, message_type) | 33 IPC_STRUCT_MEMBER(int, message_type) |
| 33 IPC_STRUCT_MEMBER(int, message_level) | 34 IPC_STRUCT_MEMBER(int, message_level) |
| 34 IPC_STRUCT_MEMBER(base::string16, message) | 35 IPC_STRUCT_MEMBER(base::string16, message) |
| 35 IPC_STRUCT_MEMBER(int, line_number) | 36 IPC_STRUCT_MEMBER(int, line_number) |
| 36 IPC_STRUCT_MEMBER(base::string16, source_url) | 37 IPC_STRUCT_MEMBER(base::string16, source_url) |
| 37 IPC_STRUCT_END() | 38 IPC_STRUCT_END() |
| 38 | 39 |
| 39 // Parameter structure for WorkerProcessMsg_CreateWorker. | 40 // Parameter structure for WorkerProcessMsg_CreateWorker. |
| 40 IPC_STRUCT_BEGIN(WorkerProcessMsg_CreateWorker_Params) | 41 IPC_STRUCT_BEGIN(WorkerProcessMsg_CreateWorker_Params) |
| 41 IPC_STRUCT_MEMBER(GURL, url) | 42 IPC_STRUCT_MEMBER(GURL, url) |
| 42 IPC_STRUCT_MEMBER(base::string16, name) | 43 IPC_STRUCT_MEMBER(base::string16, name) |
| 43 IPC_STRUCT_MEMBER(base::string16, content_security_policy) | 44 IPC_STRUCT_MEMBER(base::string16, content_security_policy) |
| 44 IPC_STRUCT_MEMBER(blink::WebContentSecurityPolicyType, security_policy_type) | 45 IPC_STRUCT_MEMBER(blink::WebContentSecurityPolicyType, security_policy_type) |
| 45 IPC_STRUCT_MEMBER(blink::WebAddressSpace, creation_address_space) | 46 IPC_STRUCT_MEMBER(blink::WebAddressSpace, creation_address_space) |
| 46 IPC_STRUCT_MEMBER(bool, pause_on_start) | 47 IPC_STRUCT_MEMBER(bool, pause_on_start) |
| 47 IPC_STRUCT_MEMBER(int, route_id) | 48 IPC_STRUCT_MEMBER(int, route_id) |
| 49 IPC_STRUCT_MEMBER(blink::WebDataSaverFlag, data_saver_flag) |
| 48 IPC_STRUCT_END() | 50 IPC_STRUCT_END() |
| 49 | 51 |
| 50 //----------------------------------------------------------------------------- | 52 //----------------------------------------------------------------------------- |
| 51 // WorkerProcess messages | 53 // WorkerProcess messages |
| 52 // These are messages sent from the browser to the worker process. | 54 // These are messages sent from the browser to the worker process. |
| 53 IPC_MESSAGE_CONTROL1(WorkerProcessMsg_CreateWorker, | 55 IPC_MESSAGE_CONTROL1(WorkerProcessMsg_CreateWorker, |
| 54 WorkerProcessMsg_CreateWorker_Params) | 56 WorkerProcessMsg_CreateWorker_Params) |
| 55 | 57 |
| 56 //----------------------------------------------------------------------------- | 58 //----------------------------------------------------------------------------- |
| 57 // WorkerProcessHost messages | 59 // WorkerProcessHost messages |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 113 |
| 112 IPC_MESSAGE_CONTROL1(WorkerHostMsg_WorkerScriptLoaded, | 114 IPC_MESSAGE_CONTROL1(WorkerHostMsg_WorkerScriptLoaded, |
| 113 int /* worker_route_id */) | 115 int /* worker_route_id */) |
| 114 | 116 |
| 115 IPC_MESSAGE_CONTROL1(WorkerHostMsg_WorkerScriptLoadFailed, | 117 IPC_MESSAGE_CONTROL1(WorkerHostMsg_WorkerScriptLoadFailed, |
| 116 int /* worker_route_id */) | 118 int /* worker_route_id */) |
| 117 | 119 |
| 118 IPC_MESSAGE_CONTROL2(WorkerHostMsg_WorkerConnected, | 120 IPC_MESSAGE_CONTROL2(WorkerHostMsg_WorkerConnected, |
| 119 int /* connection_request_id */, | 121 int /* connection_request_id */, |
| 120 int /* worker_route_id */) | 122 int /* worker_route_id */) |
| OLD | NEW |