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