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 #ifndef CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/shared_memory.h" | 16 #include "base/memory/shared_memory.h" |
17 #include "base/memory/singleton.h" | 17 #include "base/memory/singleton.h" |
18 #include "base/process/process.h" | 18 #include "base/process/process.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "content/public/common/child_process_host.h" | 21 #include "content/public/common/child_process_host.h" |
22 #include "ipc/ipc_listener.h" | 22 #include "ipc/ipc_listener.h" |
23 #include "ui/gfx/gpu_memory_buffer.h" | 23 #include "ui/gfx/gpu_memory_buffer.h" |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class CommandLine; | |
26 class FilePath; | 27 class FilePath; |
27 } | 28 } |
28 | 29 |
29 namespace IPC { | 30 namespace IPC { |
30 class MessageFilter; | 31 class MessageFilter; |
31 } | 32 } |
32 | 33 |
33 namespace gpu { | 34 namespace gpu { |
34 struct SyncToken; | 35 struct SyncToken; |
35 } | 36 } |
(...skipping 18 matching lines...) Expand all Loading... | |
54 // function will be used to generate the id_, but it is also used to generate | 55 // function will be used to generate the id_, but it is also used to generate |
55 // IDs for the RenderProcessHost, which doesn't inherit from us, and whose IDs | 56 // IDs for the RenderProcessHost, which doesn't inherit from us, and whose IDs |
56 // must be unique for all child processes. | 57 // must be unique for all child processes. |
57 // | 58 // |
58 // This function is threadsafe since RenderProcessHost is on the UI thread, | 59 // This function is threadsafe since RenderProcessHost is on the UI thread, |
59 // but normally this will be used on the IO thread. | 60 // but normally this will be used on the IO thread. |
60 // | 61 // |
61 // This will never return ChildProcessHost::kInvalidUniqueID. | 62 // This will never return ChildProcessHost::kInvalidUniqueID. |
62 static int GenerateChildProcessUniqueId(); | 63 static int GenerateChildProcessUniqueId(); |
63 | 64 |
65 // Copies kEnableFeatures and kDisableFeatures to the command line. Generates | |
66 // them from the FeatureList override state, to take into account overrides | |
67 // from FieldTrials. | |
68 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line); | |
jam
2016/05/03 19:45:08
this code is only called from content/browser, so
erikchen
2016/05/03 19:55:05
I added a static method to BrowserChildProcessHost
| |
69 | |
64 // Derives a tracing process id from a child process id. Child process ids | 70 // Derives a tracing process id from a child process id. Child process ids |
65 // cannot be used directly in child process for tracing due to security | 71 // cannot be used directly in child process for tracing due to security |
66 // reasons (see: discussion in crrev.com/1173263004). This method is meant to | 72 // reasons (see: discussion in crrev.com/1173263004). This method is meant to |
67 // be used when tracing for identifying cross-process shared memory from a | 73 // be used when tracing for identifying cross-process shared memory from a |
68 // process which knows the child process id of its endpoints. The value | 74 // process which knows the child process id of its endpoints. The value |
69 // returned by this method is guaranteed to be equal to the value returned by | 75 // returned by this method is guaranteed to be equal to the value returned by |
70 // MemoryDumpManager::GetTracingProcessId() in the corresponding child | 76 // MemoryDumpManager::GetTracingProcessId() in the corresponding child |
71 // process. | 77 // process. |
72 // | 78 // |
73 // Never returns MemoryDumpManager::kInvalidTracingProcessId. | 79 // Never returns MemoryDumpManager::kInvalidTracingProcessId. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 // thread, we don't have a IPC::ChannelProxy and so we manage filters | 125 // thread, we don't have a IPC::ChannelProxy and so we manage filters |
120 // manually. | 126 // manually. |
121 std::vector<scoped_refptr<IPC::MessageFilter> > filters_; | 127 std::vector<scoped_refptr<IPC::MessageFilter> > filters_; |
122 | 128 |
123 DISALLOW_COPY_AND_ASSIGN(ChildProcessHostImpl); | 129 DISALLOW_COPY_AND_ASSIGN(ChildProcessHostImpl); |
124 }; | 130 }; |
125 | 131 |
126 } // namespace content | 132 } // namespace content |
127 | 133 |
128 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 134 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |