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