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 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" | 5 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" |
6 | 6 |
7 #ifndef DISABLE_NACL | 7 #ifndef DISABLE_NACL |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/render_messages.h" | 15 #include "chrome/common/render_messages.h" |
16 #include "chrome/renderer/chrome_render_process_observer.h" | |
17 #include "content/public/common/content_client.h" | 16 #include "content/public/common/content_client.h" |
18 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
19 #include "content/public/common/sandbox_init.h" | 18 #include "content/public/common/sandbox_init.h" |
20 #include "content/public/renderer/render_thread.h" | 19 #include "content/public/renderer/render_thread.h" |
21 #include "content/public/renderer/render_view.h" | 20 #include "content/public/renderer/render_view.h" |
22 #include "content/public/renderer/renderer_restrict_dispatch_group.h" | 21 #include "content/public/renderer/renderer_restrict_dispatch_group.h" |
23 #include "ipc/ipc_sync_message_filter.h" | 22 #include "ipc/ipc_sync_message_filter.h" |
24 #include "ppapi/c/pp_bool.h" | |
25 #include "ppapi/c/private/pp_file_handle.h" | 23 #include "ppapi/c/private/pp_file_handle.h" |
26 #include "ppapi/c/private/ppb_nacl_private.h" | 24 #include "ppapi/c/private/ppb_nacl_private.h" |
27 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" | 25 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" |
28 #include "ppapi/proxy/host_dispatcher.h" | 26 #include "ppapi/proxy/host_dispatcher.h" |
29 #include "ppapi/proxy/proxy_channel.h" | 27 #include "ppapi/proxy/proxy_channel.h" |
30 #include "ppapi/shared_impl/ppapi_preferences.h" | 28 #include "ppapi/shared_impl/ppapi_preferences.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 300 |
303 if (transit_fd == IPC::InvalidPlatformFileForTransit()) { | 301 if (transit_fd == IPC::InvalidPlatformFileForTransit()) { |
304 return base::kInvalidPlatformFileValue; | 302 return base::kInvalidPlatformFileValue; |
305 } | 303 } |
306 | 304 |
307 base::PlatformFile handle = IPC::PlatformFileForTransitToPlatformFile( | 305 base::PlatformFile handle = IPC::PlatformFileForTransitToPlatformFile( |
308 transit_fd); | 306 transit_fd); |
309 return handle; | 307 return handle; |
310 } | 308 } |
311 | 309 |
312 PP_Bool IsOffTheRecord() { | |
313 return PP_FromBool(ChromeRenderProcessObserver::is_incognito_process()); | |
314 } | |
315 | |
316 const PPB_NaCl_Private nacl_interface = { | 310 const PPB_NaCl_Private nacl_interface = { |
317 &LaunchSelLdr, | 311 &LaunchSelLdr, |
318 &StartPpapiProxy, | 312 &StartPpapiProxy, |
319 &UrandomFD, | 313 &UrandomFD, |
320 &Are3DInterfacesDisabled, | 314 &Are3DInterfacesDisabled, |
321 &EnableBackgroundSelLdrLaunch, | 315 &EnableBackgroundSelLdrLaunch, |
322 &BrokerDuplicateHandle, | 316 &BrokerDuplicateHandle, |
323 &GetReadonlyPnaclFD, | 317 &GetReadonlyPnaclFD, |
324 &CreateTemporaryFile, | 318 &CreateTemporaryFile |
325 &IsOffTheRecord | |
326 }; | 319 }; |
327 | 320 |
328 } // namespace | 321 } // namespace |
329 | 322 |
330 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { | 323 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { |
331 return &nacl_interface; | 324 return &nacl_interface; |
332 } | 325 } |
333 | 326 |
334 #endif // DISABLE_NACL | 327 #endif // DISABLE_NACL |
OLD | NEW |