summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormseaborn <mseaborn@chromium.org>2016-02-05 11:39:13 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-05 19:40:26 +0000
commitb853715a3a505ff6a56f7bb1415f53ef3ee488d9 (patch)
tree7c3b70345f04f75de4fed1aba80a696f698272d5
parent18ce944e768ac30cfb172665d159b30d8e4c2294 (diff)
downloadchromium_src-b853715a3a505ff6a56f7bb1415f53ef3ee488d9.zip
chromium_src-b853715a3a505ff6a56f7bb1415f53ef3ee488d9.tar.gz
chromium_src-b853715a3a505ff6a56f7bb1415f53ef3ee488d9.tar.bz2
NaCl cleanup: Remove the need to register PPB_NACL_PRIVATE_INTERFACE
This PPAPI interface is left over from when the NaCl trusted plugin was built as a separate DSO/DLL (which is no longer the case). We can simplify the code by getting it directly from nacl::GetNaClPrivateInterface() rather than from GetBrowserInterface(). This means we can remove the CreatePPAPIInterface() method and utility.cc. BUG=none TEST=e.g. NaClBrowserTestPnacl.PPAPICore Review URL: https://codereview.chromium.org/1669563002 Cr-Commit-Position: refs/heads/master@{#373876}
-rw-r--r--chrome/renderer/chrome_content_renderer_client.cc11
-rw-r--r--chrome/renderer/chrome_content_renderer_client.h1
-rw-r--r--components/nacl/renderer/plugin/BUILD.gn1
-rw-r--r--components/nacl/renderer/plugin/module_ppapi.cc13
-rw-r--r--components/nacl/renderer/plugin/module_ppapi.h4
-rw-r--r--components/nacl/renderer/plugin/plugin.gyp1
-rw-r--r--components/nacl/renderer/plugin/utility.cc24
-rw-r--r--components/nacl/renderer/plugin/utility.h14
-rw-r--r--components/nacl/renderer/ppb_nacl_private.h2
-rw-r--r--content/public/renderer/content_renderer_client.cc5
-rw-r--r--content/public/renderer/content_renderer_client.h4
-rw-r--r--content/renderer/pepper/plugin_module.cc6
-rw-r--r--extensions/shell/renderer/shell_content_renderer_client.cc11
-rw-r--r--extensions/shell/renderer/shell_content_renderer_client.h1
14 files changed, 7 insertions, 91 deletions
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index acc347d..d426b37 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -67,8 +67,6 @@
#include "components/dom_distiller/content/renderer/distiller_js_render_frame_observer.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/error_page/common/localized_error.h"
-#include "components/nacl/renderer/ppb_nacl_private.h"
-#include "components/nacl/renderer/ppb_nacl_private_impl.h"
#include "components/network_hints/renderer/prescient_networking_dispatcher.h"
#include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
#include "components/password_manager/content/renderer/credential_manager_client.h"
@@ -1209,15 +1207,6 @@ void ChromeContentRendererClient::SetSpellcheck(SpellCheck* spellcheck) {
}
#endif
-const void* ChromeContentRendererClient::CreatePPAPIInterface(
- const std::string& interface_name) {
-#if defined(ENABLE_PLUGINS) && !defined(DISABLE_NACL)
- if (interface_name == PPB_NACL_PRIVATE_INTERFACE)
- return nacl::GetNaClPrivateInterface();
-#endif
- return NULL;
-}
-
bool ChromeContentRendererClient::IsExternalPepperPlugin(
const std::string& module_name) {
// TODO(bbudge) remove this when the trusted NaCl plugin has been removed.
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
index 128602c..b0bb7fb 100644
--- a/chrome/renderer/chrome_content_renderer_client.h
+++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -123,7 +123,6 @@ class ChromeContentRendererClient : public content::ContentRendererClient {
bool ShouldOverridePageVisibilityState(
const content::RenderFrame* render_frame,
blink::WebPageVisibilityState* override_state) override;
- const void* CreatePPAPIInterface(const std::string& interface_name) override;
bool IsExternalPepperPlugin(const std::string& module_name) override;
blink::WebSpeechSynthesizer* OverrideSpeechSynthesizer(
blink::WebSpeechSynthesizerClient* client) override;
diff --git a/components/nacl/renderer/plugin/BUILD.gn b/components/nacl/renderer/plugin/BUILD.gn
index 52145fc..8f8d620 100644
--- a/components/nacl/renderer/plugin/BUILD.gn
+++ b/components/nacl/renderer/plugin/BUILD.gn
@@ -12,7 +12,6 @@ source_set("nacl_trusted_plugin") {
"pnacl_translate_thread.cc",
"ppapi_entrypoints.cc",
"service_runtime.cc",
- "utility.cc",
]
deps = [
diff --git a/components/nacl/renderer/plugin/module_ppapi.cc b/components/nacl/renderer/plugin/module_ppapi.cc
index 6b090f0..e74d535 100644
--- a/components/nacl/renderer/plugin/module_ppapi.cc
+++ b/components/nacl/renderer/plugin/module_ppapi.cc
@@ -6,27 +6,16 @@
#include "components/nacl/renderer/plugin/module_ppapi.h"
#include "components/nacl/renderer/plugin/plugin.h"
-#include "components/nacl/renderer/plugin/utility.h"
namespace plugin {
-ModulePpapi::ModulePpapi() : pp::Module(),
- private_interface_(NULL) {
+ModulePpapi::ModulePpapi() : pp::Module() {
}
ModulePpapi::~ModulePpapi() {
}
bool ModulePpapi::Init() {
- // Ask the browser for an interface which provides missing functions
- private_interface_ = reinterpret_cast<const PPB_NaCl_Private*>(
- GetBrowserInterface(PPB_NACL_PRIVATE_INTERFACE));
-
- if (NULL == private_interface_) {
- return false;
- }
- SetNaClInterface(private_interface_);
-
return true;
}
diff --git a/components/nacl/renderer/plugin/module_ppapi.h b/components/nacl/renderer/plugin/module_ppapi.h
index 18fd825..e36ee96 100644
--- a/components/nacl/renderer/plugin/module_ppapi.h
+++ b/components/nacl/renderer/plugin/module_ppapi.h
@@ -7,7 +7,6 @@
#ifndef COMPONENTS_NACL_RENDERER_PLUGIN_MODULE_PPAPI_H_
#define COMPONENTS_NACL_RENDERER_PLUGIN_MODULE_PPAPI_H_
-#include "components/nacl/renderer/ppb_nacl_private.h"
#include "ppapi/cpp/module.h"
namespace plugin {
@@ -21,9 +20,6 @@ class ModulePpapi : public pp::Module {
bool Init() override;
pp::Instance* CreateInstance(PP_Instance pp_instance) override;
-
- private:
- const PPB_NaCl_Private* private_interface_;
};
} // namespace plugin
diff --git a/components/nacl/renderer/plugin/plugin.gyp b/components/nacl/renderer/plugin/plugin.gyp
index 9eefc25..6fb305d 100644
--- a/components/nacl/renderer/plugin/plugin.gyp
+++ b/components/nacl/renderer/plugin/plugin.gyp
@@ -20,7 +20,6 @@
'pnacl_translate_thread.cc',
'ppapi_entrypoints.cc',
'service_runtime.cc',
- 'utility.cc',
],
'dependencies': [
'<(DEPTH)/media/media.gyp:shared_memory_support',
diff --git a/components/nacl/renderer/plugin/utility.cc b/components/nacl/renderer/plugin/utility.cc
deleted file mode 100644
index 0cd9575..0000000
--- a/components/nacl/renderer/plugin/utility.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2011 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 "components/nacl/renderer/plugin/utility.h"
-#include "ppapi/cpp/module.h"
-
-namespace plugin {
-
-// We cache the NaCl interface pointer and ensure that its set early on, on the
-// main thread. This allows GetNaClInterface() to be used from non-main threads.
-static const PPB_NaCl_Private* g_nacl_interface = NULL;
-
-const PPB_NaCl_Private* GetNaClInterface() {
- return g_nacl_interface;
-}
-
-void SetNaClInterface(const PPB_NaCl_Private* nacl_interface) {
- g_nacl_interface = nacl_interface;
-}
-
-} // namespace plugin
diff --git a/components/nacl/renderer/plugin/utility.h b/components/nacl/renderer/plugin/utility.h
index 359662e..0495b4b 100644
--- a/components/nacl/renderer/plugin/utility.h
+++ b/components/nacl/renderer/plugin/utility.h
@@ -4,21 +4,19 @@
* found in the LICENSE file.
*/
-// A collection of debugging related interfaces.
-
#ifndef COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_
#define COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_
-#include <stdint.h>
-
#include "components/nacl/renderer/ppb_nacl_private.h"
-
-#define SRPC_PLUGIN_DEBUG 1
+#include "components/nacl/renderer/ppb_nacl_private_impl.h"
namespace plugin {
-const PPB_NaCl_Private* GetNaClInterface();
-void SetNaClInterface(const PPB_NaCl_Private* nacl_interface);
+// TODO(mseaborn): Remove this and replace its uses with direct calls to
+// the functions defined in ppb_nacl_private_impl.cc.
+inline const PPB_NaCl_Private* GetNaClInterface() {
+ return nacl::GetNaClPrivateInterface();
+}
} // namespace plugin
diff --git a/components/nacl/renderer/ppb_nacl_private.h b/components/nacl/renderer/ppb_nacl_private.h
index 4542c81..6d00d66 100644
--- a/components/nacl/renderer/ppb_nacl_private.h
+++ b/components/nacl/renderer/ppb_nacl_private.h
@@ -28,8 +28,6 @@
// functions below directly, rather than providing these functions via the
// PPB_NaCl_Private interface struct.
-#define PPB_NACL_PRIVATE_INTERFACE "PPB_NaCl_Private"
-
/**
* @addtogroup Enums
* @{
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
index 3d0316f..a9b28f8 100644
--- a/content/public/renderer/content_renderer_client.cc
+++ b/content/public/renderer/content_renderer_client.cc
@@ -150,11 +150,6 @@ bool ContentRendererClient::ShouldOverridePageVisibilityState(
return false;
}
-const void* ContentRendererClient::CreatePPAPIInterface(
- const std::string& interface_name) {
- return nullptr;
-}
-
bool ContentRendererClient::IsExternalPepperPlugin(
const std::string& module_name) {
return false;
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 45686b5..241d95b 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -239,10 +239,6 @@ class CONTENT_EXPORT ContentRendererClient {
const RenderFrame* render_frame,
blink::WebPageVisibilityState* override_state);
- // Allows an embedder to return custom PPAPI interfaces.
- virtual const void* CreatePPAPIInterface(
- const std::string& interface_name);
-
// Returns true if the given Pepper plugin is external (requiring special
// startup steps).
virtual bool IsExternalPepperPlugin(const std::string& module_name);
diff --git a/content/renderer/pepper/plugin_module.cc b/content/renderer/pepper/plugin_module.cc
index 8b2bfcb..c87977b 100644
--- a/content/renderer/pepper/plugin_module.cc
+++ b/content/renderer/pepper/plugin_module.cc
@@ -399,12 +399,6 @@ const PPB_Testing_Private testing_interface = {
// GetInterface ----------------------------------------------------------------
const void* InternalGetInterface(const char* name) {
- // Allow custom interface factories first stab at the GetInterface call.
- const void* custom_interface =
- GetContentClient()->renderer()->CreatePPAPIInterface(name);
- if (custom_interface)
- return custom_interface;
-
// TODO(brettw) put these in a hash map for better performance.
#define PROXIED_IFACE(iface_str, iface_struct) \
if (strcmp(name, iface_str) == 0) \
diff --git a/extensions/shell/renderer/shell_content_renderer_client.cc b/extensions/shell/renderer/shell_content_renderer_client.cc
index e3fda28..7dc2aaa 100644
--- a/extensions/shell/renderer/shell_content_renderer_client.cc
+++ b/extensions/shell/renderer/shell_content_renderer_client.cc
@@ -24,8 +24,6 @@
#if !defined(DISABLE_NACL)
#include "components/nacl/common/nacl_constants.h"
#include "components/nacl/renderer/nacl_helper.h"
-#include "components/nacl/renderer/ppb_nacl_private.h"
-#include "components/nacl/renderer/ppb_nacl_private_impl.h"
#endif
using blink::WebFrame;
@@ -106,15 +104,6 @@ bool ShellContentRendererClient::WillSendRequest(
return false;
}
-const void* ShellContentRendererClient::CreatePPAPIInterface(
- const std::string& interface_name) {
-#if !defined(DISABLE_NACL)
- if (interface_name == PPB_NACL_PRIVATE_INTERFACE)
- return nacl::GetNaClPrivateInterface();
-#endif
- return NULL;
-}
-
bool ShellContentRendererClient::IsExternalPepperPlugin(
const std::string& module_name) {
#if !defined(DISABLE_NACL)
diff --git a/extensions/shell/renderer/shell_content_renderer_client.h b/extensions/shell/renderer/shell_content_renderer_client.h
index 7a1c397..a928e10 100644
--- a/extensions/shell/renderer/shell_content_renderer_client.h
+++ b/extensions/shell/renderer/shell_content_renderer_client.h
@@ -41,7 +41,6 @@ class ShellContentRendererClient : public content::ContentRendererClient {
const GURL& url,
const GURL& first_party_for_cookies,
GURL* new_url) override;
- const void* CreatePPAPIInterface(const std::string& interface_name) override;
bool IsExternalPepperPlugin(const std::string& module_name) override;
bool ShouldGatherSiteIsolationStats() const override;
content::BrowserPluginDelegate* CreateBrowserPluginDelegate(