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 COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 5 #ifndef COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/file_util_proxy.h" | 12 #include "base/files/file_util_proxy.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/shared_memory.h" | 14 #include "base/memory/shared_memory.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
18 #include "components/nacl/common/nacl_types.h" | 18 #include "components/nacl/common/nacl_types.h" |
19 #include "content/public/browser/browser_child_process_host_delegate.h" | 19 #include "content/public/browser/browser_child_process_host_delegate.h" |
20 #include "content/public/browser/browser_child_process_host_iterator.h" | 20 #include "content/public/browser/browser_child_process_host_iterator.h" |
21 #include "ipc/ipc_channel_handle.h" | 21 #include "ipc/ipc_channel_handle.h" |
22 #include "native_client/src/public/nacl_file_info.h" | |
23 #include "net/socket/socket_descriptor.h" | 22 #include "net/socket/socket_descriptor.h" |
24 #include "ppapi/shared_impl/ppapi_permissions.h" | 23 #include "ppapi/shared_impl/ppapi_permissions.h" |
25 #include "url/gurl.h" | 24 #include "url/gurl.h" |
26 | 25 |
27 namespace content { | 26 namespace content { |
28 class BrowserChildProcessHost; | 27 class BrowserChildProcessHost; |
29 class BrowserPpapiHost; | 28 class BrowserPpapiHost; |
30 } | 29 } |
31 | 30 |
32 namespace IPC { | 31 namespace IPC { |
33 class ChannelProxy; | 32 class ChannelProxy; |
34 } | 33 } |
35 | 34 |
36 namespace nacl { | 35 namespace nacl { |
37 | 36 |
| 37 // NaClFileToken is a single-use nonce that the NaCl loader process can use |
| 38 // to query the browser process for trusted information about a file. This |
| 39 // helps establish that the file is known by the browser to be immutable |
| 40 // and suitable for file-identity-based validation caching. lo == 0 && hi |
| 41 // == 0 indicates the token is invalid and no additional information is |
| 42 // available. |
| 43 struct NaClFileToken { |
| 44 uint64_t lo; |
| 45 uint64_t hi; |
| 46 }; |
| 47 |
38 class NaClHostMessageFilter; | 48 class NaClHostMessageFilter; |
39 void* AllocateAddressSpaceASLR(base::ProcessHandle process, size_t size); | 49 void* AllocateAddressSpaceASLR(base::ProcessHandle process, size_t size); |
40 | 50 |
41 // Represents the browser side of the browser <--> NaCl communication | 51 // Represents the browser side of the browser <--> NaCl communication |
42 // channel. There will be one NaClProcessHost per NaCl process | 52 // channel. There will be one NaClProcessHost per NaCl process |
43 // The browser is responsible for starting the NaCl process | 53 // The browser is responsible for starting the NaCl process |
44 // when requested by the renderer. | 54 // when requested by the renderer. |
45 // After that, most of the communication is directly between NaCl plugin | 55 // After that, most of the communication is directly between NaCl plugin |
46 // running in the renderer and NaCl processes. | 56 // running in the renderer and NaCl processes. |
47 class NaClProcessHost : public content::BrowserChildProcessHostDelegate { | 57 class NaClProcessHost : public content::BrowserChildProcessHostDelegate { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 base::File socket_for_sel_ldr_; | 246 base::File socket_for_sel_ldr_; |
237 | 247 |
238 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 248 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
239 | 249 |
240 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 250 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
241 }; | 251 }; |
242 | 252 |
243 } // namespace nacl | 253 } // namespace nacl |
244 | 254 |
245 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 255 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
OLD | NEW |