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/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/renderer/chrome_render_process_observer.h" | 14 #include "chrome/renderer/chrome_render_process_observer.h" |
15 #include "chrome/renderer/pepper/pnacl_translation_resource_host.h" | 15 #include "chrome/renderer/pepper/pnacl_translation_resource_host.h" |
16 #include "components/nacl/common/nacl_host_messages.h" | 16 #include "components/nacl/common/nacl_host_messages.h" |
17 #include "components/nacl/common/nacl_types.h" | 17 #include "components/nacl/common/nacl_types.h" |
18 #include "content/public/common/content_client.h" | 18 #include "content/public/common/content_client.h" |
19 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
20 #include "content/public/common/sandbox_init.h" | 20 #include "content/public/common/sandbox_init.h" |
| 21 #include "content/public/renderer/ppapi_plugin_instance.h" |
21 #include "content/public/renderer/renderer_ppapi_host.h" | 22 #include "content/public/renderer/renderer_ppapi_host.h" |
22 #include "content/public/renderer/render_thread.h" | 23 #include "content/public/renderer/render_thread.h" |
23 #include "content/public/renderer/render_view.h" | 24 #include "content/public/renderer/render_view.h" |
24 #include "ppapi/c/pp_bool.h" | 25 #include "ppapi/c/pp_bool.h" |
25 #include "ppapi/c/private/pp_file_handle.h" | 26 #include "ppapi/c/private/pp_file_handle.h" |
26 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" | 27 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" |
27 #include "ppapi/shared_impl/ppapi_permissions.h" | 28 #include "ppapi/shared_impl/ppapi_permissions.h" |
28 #include "ppapi/shared_impl/ppapi_preferences.h" | 29 #include "ppapi/shared_impl/ppapi_preferences.h" |
29 #include "ppapi/shared_impl/var.h" | 30 #include "ppapi/shared_impl/var.h" |
30 #include "ppapi/thunk/enter.h" | 31 #include "ppapi/thunk/enter.h" |
31 #include "third_party/WebKit/public/web/WebDocument.h" | 32 #include "third_party/WebKit/public/web/WebDocument.h" |
32 #include "third_party/WebKit/public/web/WebElement.h" | 33 #include "third_party/WebKit/public/web/WebElement.h" |
33 #include "third_party/WebKit/public/web/WebFrame.h" | 34 #include "third_party/WebKit/public/web/WebFrame.h" |
34 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 35 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
35 #include "third_party/WebKit/public/web/WebView.h" | 36 #include "third_party/WebKit/public/web/WebView.h" |
36 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 base::LazyInstance<scoped_refptr<PnaclTranslationResourceHost> > | 40 base::LazyInstance<scoped_refptr<PnaclTranslationResourceHost> > |
41 g_pnacl_resource_host = LAZY_INSTANCE_INITIALIZER; | 41 g_pnacl_resource_host = LAZY_INSTANCE_INITIALIZER; |
42 | 42 |
43 static bool InitializePnaclResourceHost() { | 43 static bool InitializePnaclResourceHost() { |
44 if (!g_pnacl_resource_host.Get()) { | 44 if (!g_pnacl_resource_host.Get()) { |
45 content::RenderThread* render_thread = content::RenderThread::Get(); | 45 content::RenderThread* render_thread = content::RenderThread::Get(); |
46 if (!render_thread) | 46 if (!render_thread) |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 &OpenNaClExecutable | 356 &OpenNaClExecutable |
357 }; | 357 }; |
358 | 358 |
359 } // namespace | 359 } // namespace |
360 | 360 |
361 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { | 361 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { |
362 return &nacl_interface; | 362 return &nacl_interface; |
363 } | 363 } |
364 | 364 |
365 #endif // DISABLE_NACL | 365 #endif // DISABLE_NACL |
OLD | NEW |