0

Revert "Pepper: Remove trusted plugin loadable module."

The reverted change broke the ChromeOS builder, which depends on the loadable
module file existing. Argh.

This reverts commit b0b91c06bc.

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287090 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
teravest@chromium.org
2014-08-01 21:20:32 +00:00
parent 3c254b86ec
commit 753a1b1e21
37 changed files with 321 additions and 163 deletions

@ -141,6 +141,7 @@
'isolate_dependency_tracked': [
'<(PRODUCT_DIR)/keyboard_resources.pak',
'<(PRODUCT_DIR)/libexif.so',
'<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
'<(PRODUCT_DIR)/nacl_helper',
'<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
'browser/chromeos/login/test/https_forwarder.py',

@ -8,6 +8,7 @@
'isolate_dependency_tracked': [
'<(PRODUCT_DIR)/libffmpegsumo.so',
'<(PRODUCT_DIR)/libosmesa.so',
'<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
'<(PRODUCT_DIR)/nacl_helper<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/nacl_helper_bootstrap<(EXECUTABLE_SUFFIX)',
],
@ -63,6 +64,7 @@
'<(PRODUCT_DIR)/libexif.dll',
'<(PRODUCT_DIR)/nacl64<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/osmesa.dll',
'<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
],
},
}],

@ -418,7 +418,6 @@
['disable_nacl==0', {
'dependencies': [
'<(DEPTH)/components/nacl.gyp:nacl_common',
'<(DEPTH)/ppapi/native_client/src/trusted/plugin/plugin.gyp:nacl_trusted_plugin',
],
'sources': [
'common/extensions/manifest_handlers/nacl_modules_handler.cc',

@ -152,6 +152,9 @@
],
'conditions': [
['disable_nacl!=1', {
'files': [
'<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.plugin',
],
'conditions': [
['target_arch=="x64"', {
'files': [

@ -457,6 +457,7 @@
'<(PRODUCT_DIR)/chrome_sandbox',
'<(PRODUCT_DIR)/libffmpegsumo.so',
'<(PRODUCT_DIR)/libpdf.so',
'<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
'<(PRODUCT_DIR)/xdg-mime',
'<(PRODUCT_DIR)/xdg-settings',
'<(PRODUCT_DIR)/locales/en-US.pak',

@ -1690,7 +1690,7 @@
],
'dependencies': [
# Runtime dependency.
'../ppapi/native_client/src/trusted/plugin/plugin.gyp:nacl_trusted_plugin',
'../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
],
'conditions': [
['disable_nacl_untrusted==0', {

@ -20,7 +20,6 @@ include_rules = [
"+google_apis/gaia", # For gaia_switches.h
"+grit", # For generated headers
"+media",
"+ppapi/native_client/src/trusted/plugin/ppapi_entrypoints.h",
"+ppapi/shared_impl",
"+remoting/client/plugin",
"+webkit/common/user_agent",

@ -49,10 +49,6 @@
#include "components/nacl/common/nacl_sandbox_type_mac.h"
#endif
#if !defined(DISABLE_NACL)
#include "ppapi/native_client/src/trusted/plugin/ppapi_entrypoints.h"
#endif
#if defined(ENABLE_REMOTING)
#include "remoting/client/plugin/pepper_entrypoints.h"
#endif
@ -74,7 +70,6 @@ const char kPDFPluginOutOfProcessMimeType[] =
const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV;
#if !defined(DISABLE_NACL)
const char kNaClPluginMimeType[] = "application/x-nacl";
const char kNaClPluginExtension[] = "";
const char kNaClPluginDescription[] = "Native Client Executable";
@ -84,7 +79,6 @@ const uint32 kNaClPluginPermissions = ppapi::PERMISSION_PRIVATE |
const char kPnaclPluginMimeType[] = "application/x-pnacl";
const char kPnaclPluginExtension[] = "";
const char kPnaclPluginDescription[] = "Portable Native Client Executable";
#endif // !defined(DISABLE_NACL)
const char kO1DPluginName[] = "Google Talk Plugin Video Renderer";
const char kO1DPluginMimeType[] ="application/o1d";
@ -172,34 +166,30 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
}
}
#if !defined(DISABLE_NACL)
// Handle Native Client just like the PDF plugin. This means that it is
// enabled by default for the non-portable case. This allows apps installed
// from the Chrome Web Store to use NaCl even if the command line switch
// isn't set. For other uses of NaCl we check for the command line switch.
static bool skip_nacl_file_check = false;
if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) {
content::PepperPluginInfo nacl;
// The nacl plugin is now built into the Chromium binary.
nacl.is_internal = true;
nacl.path = path;
nacl.name = ChromeContentClient::kNaClPluginName;
content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType,
kNaClPluginExtension,
kNaClPluginDescription);
nacl.mime_types.push_back(nacl_mime_type);
content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType,
kPnaclPluginExtension,
kPnaclPluginDescription);
nacl.mime_types.push_back(pnacl_mime_type);
nacl.internal_entry_points.get_interface = nacl_plugin::PPP_GetInterface;
nacl.internal_entry_points.initialize_module =
nacl_plugin::PPP_InitializeModule;
nacl.internal_entry_points.shutdown_module =
nacl_plugin::PPP_ShutdownModule;
nacl.permissions = kNaClPluginPermissions;
plugins->push_back(nacl);
if (skip_nacl_file_check || base::PathExists(path)) {
content::PepperPluginInfo nacl;
nacl.path = path;
nacl.name = ChromeContentClient::kNaClPluginName;
content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType,
kNaClPluginExtension,
kNaClPluginDescription);
nacl.mime_types.push_back(nacl_mime_type);
content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType,
kPnaclPluginExtension,
kPnaclPluginDescription);
nacl.mime_types.push_back(pnacl_mime_type);
nacl.permissions = kNaClPluginPermissions;
plugins->push_back(nacl);
skip_nacl_file_check = true;
}
}
#endif // !defined(DISABLE_NACL)
static bool skip_o1d_file_check = false;
if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) {

@ -60,8 +60,16 @@ const base::FilePath::CharType kInternalPDFPluginFileName[] =
FILE_PATH_LITERAL("libpdf.so");
#endif
// File name of the internal NaCl plugin on different platforms.
const base::FilePath::CharType kInternalNaClPluginFileName[] =
FILE_PATH_LITERAL("internal-nacl-plugin");
#if defined(OS_WIN)
FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll");
#elif defined(OS_MACOSX)
// TODO(noelallen) Please verify this extention name is correct.
FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin");
#else // Linux and Chrome OS
FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so");
#endif
const base::FilePath::CharType kEffectsPluginFileName[] =
#if defined(OS_WIN)
@ -304,9 +312,6 @@ bool PathProvider(int key, base::FilePath* result) {
return false;
cur = cur.Append(kEffectsPluginFileName);
break;
// TODO(teravest): Remove this case once the internal NaCl plugin is gone.
// We currently need a path here to look up whether the plugin is disabled
// and what its permissions are.
case chrome::FILE_NACL_PLUGIN:
if (!GetInternalPluginsDirectory(&cur))
return false;

@ -177,6 +177,11 @@ stage_install_common() {
install -m 644 -s "${BUILDDIR}/lib/libpeerconnection.so" "${STAGEDIR}/${INSTALLDIR}/lib/"
fi
# nacl pepper plugin
if [ -f "${BUILDDIR}/libppGoogleNaClPluginChrome.so" ]; then
install -m 644 -s "${BUILDDIR}/libppGoogleNaClPluginChrome.so" "${STAGEDIR}/${INSTALLDIR}/"
fi
# nacl_helper and nacl_helper_bootstrap
# Don't use "-s" (strip) because this runs binutils "strip", which
# mangles the special ELF program headers of nacl_helper_bootstrap.

@ -198,6 +198,7 @@
['disable_nacl==1', {
'inputs!': [
'<(PRODUCT_DIR)/nacl64.exe',
'<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
'<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
'<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
],
@ -230,6 +231,7 @@
'<(PRODUCT_DIR)/chrome.exe',
'<(PRODUCT_DIR)/chrome.dll',
'<(PRODUCT_DIR)/nacl64.exe',
'<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
'<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
'<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
'<(PRODUCT_DIR)/locales/en-US.pak',

@ -185,6 +185,7 @@
'<(PRODUCT_DIR)/chrome.exe',
'<@(chrome_dll_path)',
'<(PRODUCT_DIR)/nacl64.exe',
'<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
'<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
'<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
'<(PRODUCT_DIR)/locales/en-US.pak',

@ -34,6 +34,7 @@ nacl64.exe: %(VersionDir)s\
nacl_irt_x86_32.nexe: %(VersionDir)s\
nacl_irt_x86_64.nexe: %(VersionDir)s\
pdf.dll: %(VersionDir)s\
ppGoogleNaClPluginChrome.dll: %(VersionDir)s\
resources.pak: %(VersionDir)s\
syzyasan_rtl.dll: %(VersionDir)s\
xinput1_3.dll: %(VersionDir)s\

@ -79,6 +79,7 @@
'<(PRODUCT_DIR)/ffmpegsumo.dll',
'<(PRODUCT_DIR)/libEGL.dll',
'<(PRODUCT_DIR)/libGLESv2.dll',
'<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
'<(PRODUCT_DIR)/osmesa.dll',
],
'isolate_dependency_untracked': [

@ -21,6 +21,7 @@ ln -f -s /opt/google/chrome/*.pak "$this_dir/"
ln -f -s /opt/google/chrome/nacl_helper "$this_dir/"
ln -f -s /opt/google/chrome/nacl_helper_bootstrap "$this_dir/"
ln -f -s /opt/google/chrome/nacl_irt_*.nexe "$this_dir/"
ln -f -s /opt/google/chrome/libppGoogleNaClPluginChrome.so "$this_dir/"
# Create links to resources from pyauto_dep.

@ -199,6 +199,11 @@ void NaClBrowserTestBase::SetUpCommandLine(base::CommandLine* command_line) {
}
void NaClBrowserTestBase::SetUpOnMainThread() {
// Sanity check.
base::FilePath plugin_lib;
ASSERT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib));
ASSERT_TRUE(base::PathExists(plugin_lib)) << plugin_lib.value();
ASSERT_TRUE(StartTestServer()) << "Cannot start test server.";
}

@ -342,6 +342,9 @@ void PPAPINaClTest::SetUpCommandLine(base::CommandLine* command_line) {
}
void PPAPINaClTest::SetUpOnMainThread() {
base::FilePath plugin_lib;
EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib));
EXPECT_TRUE(base::PathExists(plugin_lib));
}
void PPAPINaClTest::RunTest(const std::string& test_case) {
@ -461,4 +464,8 @@ std::string PPAPINaClTestDisallowedSockets::BuildQuery(
void PPAPIBrokerInfoBarTest::SetUpOnMainThread() {
// The default content setting for the PPAPI broker is ASK. We purposefully
// don't call PPAPITestBase::SetUpOnMainThread() to keep it that way.
base::FilePath plugin_lib;
EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib));
EXPECT_TRUE(base::PathExists(plugin_lib));
}

@ -119,6 +119,10 @@ FILES = [
'buildtype': ['dev', 'official'],
},
# Native Client plugin files:
{
'filename': 'libppGoogleNaClPluginChrome.so',
'buildtype': ['dev', 'official'],
},
{
'filename': 'nacl_irt_x86_32.nexe',
'arch': ['32bit'],

@ -128,6 +128,10 @@ FILES = [
'buildtype': ['dev', 'official'],
},
# Native Client plugin files:
{
'filename': 'libppGoogleNaClPluginChrome.so',
'buildtype': ['dev', 'official'],
},
{
'filename': 'nacl_irt_x86_32.nexe',
'arch': ['32bit'],

@ -83,6 +83,7 @@ SRC_NAMES=(
"crash_report_sender.app"
"exif.so"
"ffmpegsumo.so"
"ppGoogleNaClPluginChrome.plugin"
)
# PDF.plugin is optional. Only include it if present.

@ -380,6 +380,11 @@ FILES = [
'buildtype': ['dev', 'official'],
},
# Native Client plugin files:
{
'filename': 'ppGoogleNaClPluginChrome.dll',
'buildtype': ['dev', 'official'],
'filegroup': ['default', 'symsrc'],
},
{
'filename': 'nacl_irt_x86_32.nexe',
'arch': ['32bit'],
@ -697,6 +702,11 @@ FILES = [
'buildtype': ['dev', 'official'],
'archive': 'chrome-win32-syms.zip',
},
{
'filename': 'ppGoogleNaClPluginChrome.dll.pdb',
'buildtype': ['dev', 'official'],
'archive': 'chrome-win32-syms.zip',
},
{
'filename': 'setup.exe.pdb',
'buildtype': ['dev', 'official'],

@ -52,6 +52,9 @@
'<(PRODUCT_DIR)/locales/fr.pak',
'<(PRODUCT_DIR)/xdisplaycheck<(EXECUTABLE_SUFFIX)',
],
'isolate_dependency_touched': [
'<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
],
},
}],
['OS=="linux" or OS=="mac" or OS=="win"', {

@ -78,6 +78,7 @@
'../base/base.gyp:base',
'../base/base.gyp:base_static',
'../ipc/ipc.gyp:ipc',
'../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
'../ppapi/ppapi_internal.gyp:ppapi_shared',
'../ppapi/ppapi_internal.gyp:ppapi_ipc',
'../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
@ -182,7 +183,6 @@
],
'dependencies': [
'../content/content.gyp:content_renderer',
'../ppapi/native_client/src/trusted/plugin/plugin.gyp:nacl_trusted_plugin',
'../third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
'../third_party/WebKit/public/blink.gyp:blink',
],

@ -54,13 +54,6 @@ source_set("ppapi_cpp") {
]
}
source_set("ppapi_internal_module") {
sources = [
"cpp/private/internal_module.cc",
"cpp/private/internal_module.h",
]
}
source_set("ppapi_gles2") {
sources = [
"lib/gl/gles2/gl2ext_ppapi.c",

@ -1,21 +0,0 @@
// Copyright (c) 2014 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 "ppapi/cpp/module.h"
#include "ppapi/cpp/private/internal_module.h"
namespace pp {
namespace {
static Module* g_module_singleton = NULL;
} // namespace
Module* Module::Get() {
return g_module_singleton;
}
void InternalSetModuleSingleton(Module* module) {
g_module_singleton = module;
}
} // namespace pp

@ -1,16 +0,0 @@
// Copyright (c) 2014 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 PPAPI_CPP_PRIVATE_INTERNAL_MODULE_H_
#define PPAPI_CPP_PRIVATE_INTERNAL_MODULE_H_
namespace pp {
class Module;
// Forcibly sets the value returned by pp::Module::Get(). Do not call this
// function except to support the trusted plugin or the remoting plugin!
void InternalSetModuleSingleton(Module* module);
}
#endif // PPAPI_CPP_PRIVATE_INTERNAL_MODULE_H_

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>ppNaClPlugin</string>
<key>CFBundleIdentifier</key>
<string>com.google.ppNaClPlugin</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BRPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>nacl</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>CFPlugInDynamicRegisterFunction</key>
<string></string>
<key>CFPlugInDynamicRegistration</key>
<string>NO</string>
<key>CFPlugInUnloadFunction</key>
<string></string>
<key>WebPluginDescription</key>
<string>ppNaClPlugin</string>
<key>NSPrincipalClass</key>
<string>ppNaClPlugin</string>
<key>WebPluginMIMETypes</key>
<dict>
<key>application/x-nacl</key>
<dict>
<key>WebPluginTypeDescription</key>
<string>PPAPI Native Client SimpleRPC interaction</string>
<key>WebPluginExtensions</key>
<array>
<string>nexe,nacl</string>
</array>
</dict>
</dict>
<key>WebPluginName</key>
<string>Google Native Client Plugin</string>
</dict>
</plist>

@ -0,0 +1,15 @@
#include <CoreServices/CoreServices.r>
resource 'STR#' (126) { {
"PPAPI NativeClient",
"PPAPI NativeClient Plug-in"
} };
resource 'STR#' (127) { {
"PPAPI NativeClient Module - SRPC",
} };
resource 'STR#' (128) { {
"application/x-nacl",
"nexe",
} };

@ -7,13 +7,57 @@
'includes': [
'plugin.gypi',
],
'target_defaults': {
'variables': {
'target_base': 'none',
},
'target_conditions': [
['target_base=="ppNaClPlugin"', {
'sources': [
'<@(common_sources)',
],
'xcode_settings': {
'WARNING_CFLAGS!': [
# TODO(bradnelson): remove -pedantic when --std=c++98 in common.gypi
'-pedantic',
],
'WARNING_CFLAGS': [
'-Wno-deprecated',
'-Wno-deprecated-declarations',
],
},
'conditions': [
['OS=="win"', {
'sources': [
'win/nacl_plugin.rc',
],
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': '2', # /EHsc
},
'VCLinkerTool': {
'AdditionalLibraryDirectories': [
'$(OutDir)/lib',
],
},
},
}],
],
}],
],
},
'targets': [
{
'target_name': 'nacl_trusted_plugin',
'type': 'static_library',
'target_name': 'ppGoogleNaClPluginChrome',
'type': 'loadable_module',
'sources': [
'<@(common_sources)',
],
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-exported_symbols_list <(DEPTH)/ppapi/native_client/src/trusted/plugin/ppapi.def'
],
},
'dependencies': [
'<(DEPTH)/media/media.gyp:shared_memory_support',
'<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
@ -21,14 +65,26 @@
'<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
'<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
'<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
'<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:sel_ldr_launcher_base',
'<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:nonnacl_util',
'<(DEPTH)/native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib',
'<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc',
'<(DEPTH)/native_client/src/trusted/simple_service/simple_service.gyp:simple_service',
'<(DEPTH)/native_client/src/trusted/reverse_service/reverse_service.gyp:reverse_service',
'<(DEPTH)/native_client/src/trusted/weak_ref/weak_ref.gyp:weak_ref',
'<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp_objects',
'<(DEPTH)/ppapi/ppapi.gyp:ppapi_internal_module',
'<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
],
'conditions': [
['OS=="mac"', {
'mac_bundle': 1,
'product_name': 'ppGoogleNaClPluginChrome',
'product_extension': 'plugin',
}],
['OS=="mac" and mac_breakpad==1', {
'variables': {
# A real .dSYM is needed for dump_syms to operate on.
'mac_real_dsym': 1,
},
}],
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],

@ -12,7 +12,6 @@
'pnacl_coordinator.cc',
'pnacl_resources.cc',
'pnacl_translate_thread.cc',
'ppapi_entrypoints.cc',
'sel_ldr_launcher_chrome.cc',
'service_runtime.cc',
'srpc_client.cc',

@ -0,0 +1,3 @@
_PPP_GetInterface
_PPP_InitializeModule
_PPP_ShutdownModule

@ -1,39 +0,0 @@
// Copyright (c) 2014 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 "ppapi/native_client/src/trusted/plugin/ppapi_entrypoints.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/ppb.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/private/internal_module.h"
#include "ppapi/native_client/src/trusted/plugin/module_ppapi.h"
namespace nacl_plugin {
int32_t PPP_InitializeModule(PP_Module module_id,
PPB_GetInterface get_browser_interface) {
plugin::ModulePpapi* module = new plugin::ModulePpapi();
if (!module->InternalInit(module_id, get_browser_interface)) {
delete module;
return PP_ERROR_FAILED;
}
pp::InternalSetModuleSingleton(module);
return PP_OK;
}
void PPP_ShutdownModule() {
delete pp::Module::Get();
pp::InternalSetModuleSingleton(NULL);
}
const void* PPP_GetInterface(const char* interface_name) {
if (!pp::Module::Get())
return NULL;
return pp::Module::Get()->GetPluginInterface(interface_name);
}
} // namespace nacl_plugin

@ -1,21 +0,0 @@
// Copyright (c) 2014 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 PPAPI_NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PPAPI_ENTRYPOINTS_H_
#define PPAPI_NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PPAPI_ENTRYPOINTS_H_
#include "ppapi/c/pp_module.h"
#include "ppapi/c/ppb.h"
// Provides entry points for the trusted plugin.
namespace nacl_plugin {
int PPP_InitializeModule(PP_Module module,
PPB_GetInterface get_browser_interface);
const void* PPP_GetInterface(const char* interface_name);
void PPP_ShutdownModule();
} // namespace nacl_plugin
#endif // PPAPI_NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PPAPI_ENTRYPOINTS_H_

@ -0,0 +1,102 @@
// Microsoft Visual C++ generated resource script.
//
// #include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "FileDescription", "NativeClient Execution Environment"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "nacl_plugin"
VALUE "LegalCopyright", "Copyright (C) 2007, 2008"
VALUE "MIMEType", "application/x-nacl"
VALUE "OriginalFilename", "nacl_plugin.dll"
VALUE "ProductName", "NativeClient Execution Environment"
VALUE "ProductVersion", "1, 0, 0, 1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

@ -24,7 +24,7 @@
],
},
{
# GN version: //ppapi:ppapi_cpp_objects
# GN version: //ppapi:ppapi_cpp_pbjects
'target_name': 'ppapi_cpp_objects',
'type': 'static_library',
'dependencies': [
@ -83,17 +83,5 @@
}]
],
},
{
# GN version: //ppapi:ppapi_internal_module
'target_name': 'ppapi_internal_module',
'type': 'static_library',
'include_dirs+': [
'..',
],
'sources': [
'cpp/private/internal_module.cc',
'cpp/private/internal_module.h',
]
},
],
}

@ -11,9 +11,18 @@
#include "ppapi/c/ppb_instance.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/private/internal_module.h"
#include "remoting/client/plugin/chromoting_instance.h"
static pp::Module* g_module_singleton = NULL;
namespace pp {
Module* Module::Get() {
return g_module_singleton;
}
} // namespace pp
namespace remoting {
class ChromotingModule : public pp::Module {
@ -37,13 +46,13 @@ int32_t PPP_InitializeModule(PP_Module module_id,
ChromotingInstance::RegisterLogMessageHandler();
#endif
pp::InternalSetModuleSingleton(module);
g_module_singleton = module;
return PP_OK;
}
void PPP_ShutdownModule() {
delete pp::Module::Get();
pp::InternalSetModuleSingleton(NULL);
g_module_singleton = NULL;
}
const void* PPP_GetInterface(const char* interface_name) {

@ -14,7 +14,6 @@
'dependencies': [
'../net/net.gyp:net',
'../ppapi/ppapi.gyp:ppapi_cpp_objects',
'../ppapi/ppapi.gyp:ppapi_internal_module',
'../third_party/webrtc/modules/modules.gyp:desktop_capture',
'../ui/events/events.gyp:dom4_keycode_converter',
'remoting_base',