summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-05 05:04:55 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-05 05:04:55 +0000
commit219b9b974fe4adf8069db2cb2d611c07f14798cc (patch)
tree2e7d3e8e92ecb7dea2ac0485a43c9feb2e13335c /webkit/plugins/ppapi
parent758eb9cda8f50d5d561aaf4a319d4f4f217b465a (diff)
downloadchromium_src-219b9b974fe4adf8069db2cb2d611c07f14798cc.zip
chromium_src-219b9b974fe4adf8069db2cb2d611c07f14798cc.tar.gz
chromium_src-219b9b974fe4adf8069db2cb2d611c07f14798cc.tar.bz2
Reduce one of the implicit dependencies of src\content on chrome\renderer by moving the custom nacl
ppapi interface PPB_NACL_PRIVATE_INTERFACE to chrome\renderer. This interface is returned via a factory which is registered in the renderer process, when the render thread is created. This CL is intended to eventually help build src\content as an independent dll. I also changed the ChromeContentRendererClient and ChromeContentPluginClient instances to be lazy instances to fix some asserts i was seeing while running browser_tests. BUG=82454 Review URL: http://codereview.chromium.org/7066069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi')
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc4
-rw-r--r--webkit/plugins/ppapi/ppapi_interface_factory.cc8
-rw-r--r--webkit/plugins/ppapi/ppapi_interface_factory.h4
-rw-r--r--webkit/plugins/ppapi/ppapi_unittest.cc2
-rw-r--r--webkit/plugins/ppapi/ppb_nacl_private_impl.cc48
-rw-r--r--webkit/plugins/ppapi/ppb_nacl_private_impl.h21
6 files changed, 7 insertions, 80 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 0f16cc1..23b127b 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -63,7 +63,6 @@
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_proxy_private.h"
-#include "ppapi/c/private/ppb_nacl_private.h"
#include "ppapi/c/private/ppb_uma_private.h"
#include "ppapi/c/trusted/ppb_audio_trusted.h"
#include "ppapi/c/trusted/ppb_broker_trusted.h"
@@ -90,7 +89,6 @@
#include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h"
#include "webkit/plugins/ppapi/ppb_image_data_impl.h"
#include "webkit/plugins/ppapi/ppb_layer_compositor_impl.h"
-#include "webkit/plugins/ppapi/ppb_nacl_private_impl.h"
#include "webkit/plugins/ppapi/ppb_pdf_impl.h"
#include "webkit/plugins/ppapi/ppb_proxy_impl.h"
#include "webkit/plugins/ppapi/ppb_scrollbar_impl.h"
@@ -275,8 +273,6 @@ const void* GetInterface(const char* name) {
return ::ppapi::thunk::GetPPB_FileChooser_Thunk();
if (strcmp(name, PPB_FILEIO_DEV_INTERFACE) == 0)
return ::ppapi::thunk::GetPPB_FileIO_Thunk();
- if (strcmp(name, PPB_NACL_PRIVATE_INTERFACE) == 0)
- return PPB_NaCl_Private_Impl::GetInterface();
if (strcmp(name, PPB_FILEIOTRUSTED_DEV_INTERFACE) == 0)
return ::ppapi::thunk::GetPPB_FileIOTrusted_Thunk();
if (strcmp(name, PPB_FILEREF_DEV_INTERFACE) == 0)
diff --git a/webkit/plugins/ppapi/ppapi_interface_factory.cc b/webkit/plugins/ppapi/ppapi_interface_factory.cc
index 587469a..629dca9 100644
--- a/webkit/plugins/ppapi/ppapi_interface_factory.cc
+++ b/webkit/plugins/ppapi/ppapi_interface_factory.cc
@@ -32,15 +32,15 @@ void PpapiInterfaceFactoryManager::UnregisterFactory(
FactoryList::iterator index =
std::find(interface_factory_list_.begin(), interface_factory_list_.end(),
factory);
- DCHECK(index != interface_factory_list_.end());
- interface_factory_list_.erase(index);
+ if (index != interface_factory_list_.end())
+ interface_factory_list_.erase(index);
}
-void* PpapiInterfaceFactoryManager::GetInterface(
+const void* PpapiInterfaceFactoryManager::GetInterface(
const std::string& interface_name) {
FactoryList::iterator index;
- void* ppapi_interface = NULL;
+ const void* ppapi_interface = NULL;
for (index = interface_factory_list_.begin();
index != interface_factory_list_.end();
diff --git a/webkit/plugins/ppapi/ppapi_interface_factory.h b/webkit/plugins/ppapi/ppapi_interface_factory.h
index 2950d92..d625f1e 100644
--- a/webkit/plugins/ppapi/ppapi_interface_factory.h
+++ b/webkit/plugins/ppapi/ppapi_interface_factory.h
@@ -18,7 +18,7 @@ namespace ppapi {
// factories.
class PpapiInterfaceFactoryManager {
public:
- typedef void* (InterfaceFactory)(const std::string& interface_name);
+ typedef const void* (InterfaceFactory)(const std::string& interface_name);
// Registers a custom PPAPI interface factory.
void RegisterFactory(InterfaceFactory* factory);
@@ -28,7 +28,7 @@ class PpapiInterfaceFactoryManager {
// Returns a pointer to the interface identified by the name passed in.
// Returns NULL if no factory handles this interface.
- void* GetInterface(const std::string& interface_name);
+ const void* GetInterface(const std::string& interface_name);
// Returns a pointer to the global instance of the
// PpapiInterfaceFactoryManager class.
diff --git a/webkit/plugins/ppapi/ppapi_unittest.cc b/webkit/plugins/ppapi/ppapi_unittest.cc
index 025cb56..3a276cc 100644
--- a/webkit/plugins/ppapi/ppapi_unittest.cc
+++ b/webkit/plugins/ppapi/ppapi_unittest.cc
@@ -134,7 +134,7 @@ class PpapiCustomInterfaceFactoryTest
result_ = false;
}
- static void* InterfaceFactory(const std::string& interface_name) {
+ static const void* InterfaceFactory(const std::string& interface_name) {
result_ = true;
return NULL;
}
diff --git a/webkit/plugins/ppapi/ppb_nacl_private_impl.cc b/webkit/plugins/ppapi/ppb_nacl_private_impl.cc
deleted file mode 100644
index d14737e..0000000
--- a/webkit/plugins/ppapi/ppb_nacl_private_impl.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2010 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 "webkit/plugins/ppapi/ppb_nacl_private_impl.h"
-
-#include "base/rand_util_c.h"
-#include "ppapi/c/private/ppb_nacl_private.h"
-#include "webkit/glue/webkit_glue.h"
-
-namespace webkit {
-namespace ppapi {
-
-namespace {
-
-bool LaunchSelLdr(const char* alleged_url, int socket_count,
- void* imc_handles, void* nacl_process_handle,
- int* nacl_process_id) {
-#if !defined(DISABLE_NACL)
- return webkit_glue::LaunchSelLdr(alleged_url, socket_count, imc_handles,
- nacl_process_handle, nacl_process_id);
-#else
- return false;
-#endif
-}
-
-int UrandomFD(void) {
-#if defined(OS_POSIX)
- return GetUrandomFD();
-#else
- return 0;
-#endif
-}
-
-} // namespace
-
-const PPB_NaCl_Private ppb_nacl = {
- &LaunchSelLdr,
- &UrandomFD,
-};
-
-// static
-const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() {
- return &ppb_nacl;
-}
-
-} // namespace ppapi
-} // namespace webkit
diff --git a/webkit/plugins/ppapi/ppb_nacl_private_impl.h b/webkit/plugins/ppapi/ppb_nacl_private_impl.h
deleted file mode 100644
index 1c01e98..0000000
--- a/webkit/plugins/ppapi/ppb_nacl_private_impl.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2010 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 WEBKIT_PLUGINS_PPAPI_PPB_NACL_PRIVATE_IMPL_H_
-#define WEBKIT_PLUGINS_PPAPI_PPB_NACL_PRIVATE_IMPL_H_
-
-struct PPB_NaCl_Private;
-
-namespace webkit {
-namespace ppapi {
-
-class PPB_NaCl_Private_Impl {
- public:
- static const PPB_NaCl_Private* GetInterface();
-};
-
-} // namespace ppapi
-} // namespace webkit
-
-#endif // WEBKIT_PLUGINS_PPAPI_PPB_NACL_PRIVATE_IMPL_H_