diff options
16 files changed, 78 insertions, 72 deletions
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi index 1cff4ef..ce94a42 100644 --- a/chrome/chrome_renderer.gypi +++ b/chrome/chrome_renderer.gypi @@ -43,14 +43,6 @@ # Needed by chrome_content_renderer_client.cc. '<(SHARED_INTERMEDIATE_DIR)', ], - 'defines': [ - '<@(nacl_defines)', - ], - 'direct_dependent_settings': { - 'defines': [ - '<@(nacl_defines)', - ], - }, 'sources': [ 'renderer/benchmarking_extension.cc', 'renderer/benchmarking_extension.h', @@ -270,10 +262,6 @@ 'renderer/pepper/pepper_pdf_host.h', 'renderer/pepper/pepper_shared_memory_message_filter.cc', 'renderer/pepper/pepper_shared_memory_message_filter.h', - 'renderer/pepper/pnacl_translation_resource_host.cc', - 'renderer/pepper/pnacl_translation_resource_host.h', - 'renderer/pepper/ppb_nacl_private_impl.cc', - 'renderer/pepper/ppb_nacl_private_impl.h', 'renderer/pepper/ppb_pdf_impl.cc', 'renderer/pepper/ppb_pdf_impl.h', 'renderer/plugins/chrome_plugin_placeholder.cc', @@ -358,6 +346,7 @@ ['disable_nacl!=1', { 'dependencies': [ '../components/nacl.gyp:nacl', + '../components/nacl.gyp:nacl_renderer', ], }], ['enable_plugins==1', { diff --git a/chrome/renderer/DEPS b/chrome/renderer/DEPS index 5d98d35..5aa471a 100644 --- a/chrome/renderer/DEPS +++ b/chrome/renderer/DEPS @@ -1,6 +1,7 @@ include_rules = [ "+components/autofill/content/renderer", "+components/autofill/core/common", + "+components/nacl/renderer", "+components/plugins/renderer", "+components/translate/common", "+components/translate/language_detection", diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index ffb7765..dfbab66 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -45,7 +45,6 @@ #include "chrome/renderer/net_benchmarking_extension.h" #include "chrome/renderer/page_load_histograms.h" #include "chrome/renderer/pepper/pepper_helper.h" -#include "chrome/renderer/pepper/ppb_nacl_private_impl.h" #include "chrome/renderer/pepper/ppb_pdf_impl.h" #include "chrome/renderer/playback_extension.h" #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" @@ -67,6 +66,7 @@ #include "components/autofill/content/renderer/password_autofill_agent.h" #include "components/autofill/content/renderer/password_generation_agent.h" #include "components/autofill/core/common/password_generation_util.h" +#include "components/nacl/renderer/ppb_nacl_private_impl.h" #include "components/plugins/renderer/mobile_youtube_plugin.h" #include "components/visitedlink/renderer/visitedlink_slave.h" #include "content/public/common/content_constants.h" @@ -1276,7 +1276,7 @@ const void* ChromeContentRendererClient::CreatePPAPIInterface( #if defined(ENABLE_PLUGINS) #if !defined(DISABLE_NACL) if (interface_name == PPB_NACL_PRIVATE_INTERFACE) - return PPB_NaCl_Private_Impl::GetInterface(); + return nacl::GetNaClPrivateInterface(); #endif // DISABLE_NACL if (interface_name == PPB_PDF_INTERFACE) return PPB_PDF_Impl::GetInterface(); diff --git a/chrome/renderer/pepper/DEPS b/chrome/renderer/pepper/DEPS index 40e81e2..e19a4ee 100644 --- a/chrome/renderer/pepper/DEPS +++ b/chrome/renderer/pepper/DEPS @@ -1,7 +1,7 @@ include_rules = [ "+components/nacl/common", + "+components/nacl/renderer", "+ppapi/host", - "+ppapi/native_client/src/trusted/plugin/nacl_entry_points.h", # For NaCl registration. "+ppapi/proxy", # TODO(raymes): Once all of the resources are refactored to the new pepper diff --git a/chrome/renderer/pepper/ppb_nacl_private_impl.h b/chrome/renderer/pepper/ppb_nacl_private_impl.h deleted file mode 100644 index 510a6b9..0000000 --- a/chrome/renderer/pepper/ppb_nacl_private_impl.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_RENDERER_PEPPER_PPB_NACL_PRIVATE_IMPL_H_ -#define CHROME_RENDERER_PEPPER_PPB_NACL_PRIVATE_IMPL_H_ - -#include "build/build_config.h" - -#ifndef DISABLE_NACL -#include "ppapi/c/private/ppb_nacl_private.h" - -class PPB_NaCl_Private_Impl { - public: - static const PPB_NaCl_Private* GetInterface(); -}; - -#endif // DISABLE_NACL - -#endif // CHROME_RENDERER_PEPPER_PPB_NACL_PRIVATE_IMPL_H_ diff --git a/components/nacl.gyp b/components/nacl.gyp index 6550cb7..361ac06 100644 --- a/components/nacl.gyp +++ b/components/nacl.gyp @@ -137,6 +137,31 @@ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [4267, ], }, + { + 'target_name': 'nacl_renderer', + 'type': 'static_library', + 'sources': [ + 'nacl/renderer/pnacl_translation_resource_host.cc', + 'nacl/renderer/pnacl_translation_resource_host.h', + 'nacl/renderer/ppb_nacl_private_impl.cc', + 'nacl/renderer/ppb_nacl_private_impl.h', + ], + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../content/content.gyp:content_renderer', + '../webkit/common/webkit_common.gyp:webkit_common', + ], + 'defines': [ + '<@(nacl_defines)', + ], + 'direct_dependent_settings': { + 'defines': [ + '<@(nacl_defines)', + ], + }, + } ], 'conditions': [ ['OS=="linux"', { diff --git a/components/nacl/renderer/DEPS b/components/nacl/renderer/DEPS new file mode 100644 index 0000000..c72eb55 --- /dev/null +++ b/components/nacl/renderer/DEPS @@ -0,0 +1,14 @@ +include_rules = [ + "+content/public/renderer", + "+ppapi/c", + "+ppapi/native_client/src/trusted/plugin/nacl_entry_points.h", # For NaCl registration. + "+ppapi/proxy", + "+ppapi/shared_impl", + + # TODO(raymes): Once all of the resources are refactored to the new pepper + # resource model, these includes shouldn't be needed. + "+ppapi/thunk", + + "+v8/include", + "+third_party/WebKit/public/web", +] diff --git a/chrome/renderer/pepper/pnacl_translation_resource_host.cc b/components/nacl/renderer/pnacl_translation_resource_host.cc index 0546c75..0546c75 100644 --- a/chrome/renderer/pepper/pnacl_translation_resource_host.cc +++ b/components/nacl/renderer/pnacl_translation_resource_host.cc diff --git a/chrome/renderer/pepper/pnacl_translation_resource_host.h b/components/nacl/renderer/pnacl_translation_resource_host.h index 6570cd0..6570cd0 100644 --- a/chrome/renderer/pepper/pnacl_translation_resource_host.h +++ b/components/nacl/renderer/pnacl_translation_resource_host.h diff --git a/chrome/renderer/pepper/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc index 5b70ee3..332f516 100644 --- a/chrome/renderer/pepper/ppb_nacl_private_impl.cc +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/renderer/pepper/ppb_nacl_private_impl.h" +#include "components/nacl/renderer/ppb_nacl_private_impl.h" #ifndef DISABLE_NACL @@ -10,18 +10,16 @@ #include "base/lazy_instance.h" #include "base/logging.h" #include "base/rand_util.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/renderer/chrome_render_process_observer.h" -#include "chrome/renderer/pepper/pnacl_translation_resource_host.h" #include "components/nacl/common/nacl_host_messages.h" #include "components/nacl/common/nacl_types.h" +#include "components/nacl/renderer/pnacl_translation_resource_host.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" #include "content/public/common/sandbox_init.h" #include "content/public/renderer/pepper_plugin_instance.h" -#include "content/public/renderer/renderer_ppapi_host.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" +#include "content/public/renderer/renderer_ppapi_host.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/private/pp_file_handle.h" #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" @@ -291,10 +289,6 @@ void ReportTranslationFinished(PP_Instance instance, PP_Bool success) { g_pnacl_resource_host.Get()->ReportTranslationFinished(instance, success); } -PP_Bool IsOffTheRecord() { - return PP_FromBool(ChromeRenderProcessObserver::is_incognito_process()); -} - PP_ExternalPluginResult ReportNaClError(PP_Instance instance, PP_NaClError error_id) { IPC::Sender* sender = content::RenderThread::Get(); @@ -415,7 +409,7 @@ void SetReadOnlyProperty(PP_Instance instance, plugin_instance->SetEmbedProperty(key, value); } -const PPB_NaCl_Private nacl_interface = { +PPB_NaCl_Private nacl_interface = { &LaunchSelLdr, &StartPpapiProxy, &UrandomFD, @@ -425,7 +419,6 @@ const PPB_NaCl_Private nacl_interface = { &CreateTemporaryFile, &GetNexeFd, &ReportTranslationFinished, - &IsOffTheRecord, &ReportNaClError, &OpenNaClExecutable, &DispatchEvent, @@ -434,8 +427,12 @@ const PPB_NaCl_Private nacl_interface = { } // namespace -const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { +namespace nacl { + +PPB_NaCl_Private* GetNaClPrivateInterface() { return &nacl_interface; } +} // namespace nacl + #endif // DISABLE_NACL diff --git a/components/nacl/renderer/ppb_nacl_private_impl.h b/components/nacl/renderer/ppb_nacl_private_impl.h new file mode 100644 index 0000000..3f37698 --- /dev/null +++ b/components/nacl/renderer/ppb_nacl_private_impl.h @@ -0,0 +1,21 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_NACL_RENDERER_PPB_NACL_PRIVATE_IMPL_H_ +#define COMPONENTS_NACL_RENDERER_PPB_NACL_PRIVATE_IMPL_H_ + +#include "build/build_config.h" + +#ifndef DISABLE_NACL +#include "ppapi/c/private/ppb_nacl_private.h" + +namespace nacl { + +PPB_NaCl_Private* GetNaClPrivateInterface(); + +} // namespace nacl + +#endif // DISABLE_NACL + +#endif // COMPONENTS_NACL_RENDERER_PPB_NACL_PRIVATE_IMPL_H_ diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index 2d85044..4e215d7 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -146,10 +146,6 @@ interface PPB_NaCl_Private { void ReportTranslationFinished([in] PP_Instance instance, [in] PP_Bool success); - /* Return true if we are off the record. - */ - PP_Bool IsOffTheRecord(); - /* Display a UI message to the user. */ PP_ExternalPluginResult ReportNaClError([in] PP_Instance instance, [in] PP_NaClError message_id); diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h index 7ba7583..44bbb9f 100644 --- a/ppapi/c/private/ppb_nacl_private.h +++ b/ppapi/c/private/ppb_nacl_private.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/ppb_nacl_private.idl modified Thu Nov 14 08:29:25 2013. */ +/* From private/ppb_nacl_private.idl modified Fri Nov 29 09:11:40 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ @@ -160,9 +160,6 @@ struct PPB_NaCl_Private_1_0 { * the plugin.) */ void (*ReportTranslationFinished)(PP_Instance instance, PP_Bool success); - /* Return true if we are off the record. - */ - PP_Bool (*IsOffTheRecord)(void); /* Display a UI message to the user. */ PP_ExternalPluginResult (*ReportNaClError)(PP_Instance instance, PP_NaClError message_id); diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc index d67b991..f892059 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc @@ -226,12 +226,8 @@ PnaclCoordinator* PnaclCoordinator::BitcodeToNative( pnacl_options, translate_notify_callback); coordinator->pnacl_init_time_ = NaClGetTimeOfDayMicroseconds(); - coordinator->off_the_record_ = - plugin->nacl_interface()->IsOffTheRecord(); - PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (manifest=%p, " - "off_the_record=%d)\n", - reinterpret_cast<const void*>(coordinator->manifest_.get()), - coordinator->off_the_record_)); + PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (manifest=%p, ", + reinterpret_cast<const void*>(coordinator->manifest_.get()))); // First start a network request for the pexe, to tickle the component // updater's On-Demand resource throttler, and to get Last-Modified/ETag @@ -255,7 +251,6 @@ PnaclCoordinator::PnaclCoordinator( pnacl_options_(pnacl_options), is_cache_hit_(PP_FALSE), error_already_reported_(false), - off_the_record_(false), pnacl_init_time_(0), pexe_size_(0), pexe_bytes_compiled_(0), diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h index 00d6beb..e38cbc0 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h @@ -219,9 +219,6 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> { // was already run/consumed. bool error_already_reported_; - // True if compilation is off_the_record. - bool off_the_record_; - // State for timing and size information for UMA stats. int64_t pnacl_init_time_; int64_t pexe_size_; // Count as we stream -- will converge to pexe size. diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index 1c00a38..d22ec78 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -2998,11 +2998,6 @@ static void Pnacl_M25_PPB_NaCl_Private_ReportTranslationFinished(PP_Instance ins iface->ReportTranslationFinished(instance, success); } -static PP_Bool Pnacl_M25_PPB_NaCl_Private_IsOffTheRecord(void) { - const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; - return iface->IsOffTheRecord(); -} - static PP_ExternalPluginResult Pnacl_M25_PPB_NaCl_Private_ReportNaClError(PP_Instance instance, PP_NaClError message_id) { const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; return iface->ReportNaClError(instance, message_id); @@ -4896,7 +4891,6 @@ struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = { .CreateTemporaryFile = (PP_FileHandle (*)(PP_Instance instance))&Pnacl_M25_PPB_NaCl_Private_CreateTemporaryFile, .GetNexeFd = (int32_t (*)(PP_Instance instance, const char* pexe_url, uint32_t abi_version, uint32_t opt_level, const char* last_modified, const char* etag, PP_Bool has_no_store_header, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback callback))&Pnacl_M25_PPB_NaCl_Private_GetNexeFd, .ReportTranslationFinished = (void (*)(PP_Instance instance, PP_Bool success))&Pnacl_M25_PPB_NaCl_Private_ReportTranslationFinished, - .IsOffTheRecord = (PP_Bool (*)(void))&Pnacl_M25_PPB_NaCl_Private_IsOffTheRecord, .ReportNaClError = (PP_ExternalPluginResult (*)(PP_Instance instance, PP_NaClError message_id))&Pnacl_M25_PPB_NaCl_Private_ReportNaClError, .OpenNaClExecutable = (PP_FileHandle (*)(PP_Instance instance, const char* file_url, uint64_t* file_token_lo, uint64_t* file_token_hi))&Pnacl_M25_PPB_NaCl_Private_OpenNaClExecutable, .DispatchEvent = (void (*)(PP_Instance instance, PP_NaClEventType event_type, struct PP_Var resource_url, PP_Bool length_is_computable, uint64_t loaded_bytes, uint64_t total_bytes))&Pnacl_M25_PPB_NaCl_Private_DispatchEvent, |