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 // Common IPC messages used for child processes. | 5 // Common IPC messages used for child processes. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
9 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/public/common/process_type.h" |
| 13 #include "content/public/common/serialized_profiler_data.h" |
12 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
13 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
14 | 16 |
| 17 IPC_ENUM_TRAITS(content::ProcessType) |
15 IPC_ENUM_TRAITS(tracked_objects::ThreadData::Status) | 18 IPC_ENUM_TRAITS(tracked_objects::ThreadData::Status) |
16 | 19 |
| 20 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::SerializedLocation) |
| 21 IPC_STRUCT_TRAITS_MEMBER(file_name) |
| 22 IPC_STRUCT_TRAITS_MEMBER(function_name) |
| 23 IPC_STRUCT_TRAITS_MEMBER(line_number) |
| 24 IPC_STRUCT_TRAITS_END() |
| 25 |
| 26 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::SerializedBirthOnThread) |
| 27 IPC_STRUCT_TRAITS_MEMBER(location) |
| 28 IPC_STRUCT_TRAITS_MEMBER(thread_name) |
| 29 IPC_STRUCT_TRAITS_END() |
| 30 |
| 31 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::SerializedDeathData) |
| 32 IPC_STRUCT_TRAITS_MEMBER(count) |
| 33 IPC_STRUCT_TRAITS_MEMBER(run_duration_sum) |
| 34 IPC_STRUCT_TRAITS_MEMBER(run_duration_max) |
| 35 IPC_STRUCT_TRAITS_MEMBER(run_duration_sample) |
| 36 IPC_STRUCT_TRAITS_MEMBER(queue_duration_sum) |
| 37 IPC_STRUCT_TRAITS_MEMBER(queue_duration_max) |
| 38 IPC_STRUCT_TRAITS_MEMBER(queue_duration_sample) |
| 39 IPC_STRUCT_TRAITS_END() |
| 40 |
| 41 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::SerializedSnapshot) |
| 42 IPC_STRUCT_TRAITS_MEMBER(birth) |
| 43 IPC_STRUCT_TRAITS_MEMBER(death_data) |
| 44 IPC_STRUCT_TRAITS_MEMBER(death_thread_name) |
| 45 IPC_STRUCT_TRAITS_END() |
| 46 |
| 47 IPC_STRUCT_TRAITS_BEGIN(content::SerializedProfilerData) |
| 48 IPC_STRUCT_TRAITS_MEMBER(snapshots) |
| 49 IPC_STRUCT_TRAITS_MEMBER(process_id) |
| 50 IPC_STRUCT_TRAITS_MEMBER(process_type) |
| 51 IPC_STRUCT_TRAITS_END() |
| 52 |
17 #undef IPC_MESSAGE_EXPORT | 53 #undef IPC_MESSAGE_EXPORT |
18 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 54 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
19 | 55 |
20 #define IPC_MESSAGE_START ChildProcessMsgStart | 56 #define IPC_MESSAGE_START ChildProcessMsgStart |
21 | 57 |
22 // Messages sent from the browser to the child process. | 58 // Messages sent from the browser to the child process. |
23 | 59 |
24 // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child | 60 // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child |
25 // process that it's safe to shutdown. | 61 // process that it's safe to shutdown. |
26 IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) | 62 IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) |
(...skipping 15 matching lines...) Expand all Loading... |
42 // Sent to all child processes to get trace buffer fullness. | 78 // Sent to all child processes to get trace buffer fullness. |
43 IPC_MESSAGE_CONTROL0(ChildProcessMsg_GetTraceBufferPercentFull) | 79 IPC_MESSAGE_CONTROL0(ChildProcessMsg_GetTraceBufferPercentFull) |
44 | 80 |
45 // Tell the child process to enable or disable the profiler status. | 81 // Tell the child process to enable or disable the profiler status. |
46 IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetProfilerStatus, | 82 IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetProfilerStatus, |
47 tracked_objects::ThreadData::Status /* profiler status */) | 83 tracked_objects::ThreadData::Status /* profiler status */) |
48 | 84 |
49 // Send to all the child processes to send back profiler data (ThreadData in | 85 // Send to all the child processes to send back profiler data (ThreadData in |
50 // tracked_objects). | 86 // tracked_objects). |
51 IPC_MESSAGE_CONTROL2(ChildProcessMsg_GetChildProfilerData, | 87 IPC_MESSAGE_CONTROL2(ChildProcessMsg_GetChildProfilerData, |
52 int, /* sequence number. */ | 88 int, /* sequence number */ |
53 std::string /* pickled Value of process type. */) | 89 content::ProcessType /* child process type */) |
54 | 90 |
55 // Sent to child processes to dump their handle table. | 91 // Sent to child processes to dump their handle table. |
56 IPC_MESSAGE_CONTROL0(ChildProcessMsg_DumpHandles) | 92 IPC_MESSAGE_CONTROL0(ChildProcessMsg_DumpHandles) |
57 | 93 |
58 //////////////////////////////////////////////////////////////////////////////// | 94 //////////////////////////////////////////////////////////////////////////////// |
59 // Messages sent from the child process to the browser. | 95 // Messages sent from the child process to the browser. |
60 | 96 |
61 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) | 97 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) |
62 | 98 |
63 // Notify the browser that this child process supports tracing. | 99 // Notify the browser that this child process supports tracing. |
64 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ChildSupportsTracing) | 100 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ChildSupportsTracing) |
65 | 101 |
66 // Reply from child processes acking ChildProcessMsg_TraceChangeStatus(false). | 102 // Reply from child processes acking ChildProcessMsg_TraceChangeStatus(false). |
67 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_EndTracingAck, | 103 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_EndTracingAck, |
68 std::vector<std::string> /* known_categories */) | 104 std::vector<std::string> /* known_categories */) |
69 | 105 |
70 // Sent if the trace buffer becomes full. | 106 // Sent if the trace buffer becomes full. |
71 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_TraceBufferFull) | 107 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_TraceBufferFull) |
72 | 108 |
73 // Child processes send trace data back in JSON chunks. | 109 // Child processes send trace data back in JSON chunks. |
74 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_TraceDataCollected, | 110 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_TraceDataCollected, |
75 std::string /*json trace data*/) | 111 std::string /*json trace data*/) |
76 | 112 |
77 // Reply to ChildProcessMsg_GetTraceBufferPercentFull. | 113 // Reply to ChildProcessMsg_GetTraceBufferPercentFull. |
78 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_TraceBufferPercentFullReply, | 114 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_TraceBufferPercentFullReply, |
79 float /*trace buffer percent full*/) | 115 float /*trace buffer percent full*/) |
80 | 116 |
81 // Send back profiler data (ThreadData in tracked_objects). | 117 // Send back profiler data (ThreadData in tracked_objects). |
82 IPC_MESSAGE_CONTROL2(ChildProcessHostMsg_ChildProfilerData, | 118 IPC_MESSAGE_CONTROL2(ChildProcessHostMsg_ChildProfilerData, |
83 int, /* sequence number. */ | 119 int, /* sequence number */ |
84 DictionaryValue /* profiler data. */) | 120 content::SerializedProfilerData /* profiler data */) |
85 | 121 |
86 // Reply to ChildProcessMsg_DumpHandles when handle table dump is complete. | 122 // Reply to ChildProcessMsg_DumpHandles when handle table dump is complete. |
87 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_DumpHandlesDone) | 123 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_DumpHandlesDone) |
88 | 124 |
89 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
90 // Request that the given font be loaded by the host so it's cached by the | 126 // Request that the given font be loaded by the host so it's cached by the |
91 // OS. Please see ChildProcessHost::PreCacheFont for details. | 127 // OS. Please see ChildProcessHost::PreCacheFont for details. |
92 IPC_SYNC_MESSAGE_CONTROL1_0(ChildProcessHostMsg_PreCacheFont, | 128 IPC_SYNC_MESSAGE_CONTROL1_0(ChildProcessHostMsg_PreCacheFont, |
93 LOGFONT /* font data */) | 129 LOGFONT /* font data */) |
94 | 130 |
95 // Release the cached font | 131 // Release the cached font |
96 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ReleaseCachedFonts) | 132 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ReleaseCachedFonts) |
97 #endif // defined(OS_WIN) | 133 #endif // defined(OS_WIN) |
98 | 134 |
99 // Asks the browser to create a block of shared memory for the child process to | 135 // Asks the browser to create a block of shared memory for the child process to |
100 // fill in and pass back to the browser. | 136 // fill in and pass back to the browser. |
101 IPC_SYNC_MESSAGE_CONTROL1_1(ChildProcessHostMsg_SyncAllocateSharedMemory, | 137 IPC_SYNC_MESSAGE_CONTROL1_1(ChildProcessHostMsg_SyncAllocateSharedMemory, |
102 uint32 /* buffer size */, | 138 uint32 /* buffer size */, |
103 base::SharedMemoryHandle) | 139 base::SharedMemoryHandle) |
OLD | NEW |