Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: ppapi/native_client/src/trusted/plugin/module_ppapi.cc

Issue 876483002: NaCl: Move src/trusted/plugin/ to components/nacl/renderer/plugin/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update #include guards Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/native_client/src/trusted/plugin/module_ppapi.cc
diff --git a/ppapi/native_client/src/trusted/plugin/module_ppapi.cc b/ppapi/native_client/src/trusted/plugin/module_ppapi.cc
deleted file mode 100644
index bcdaf7d47e014d50523d86a933c7285db5e35b7c..0000000000000000000000000000000000000000
--- a/ppapi/native_client/src/trusted/plugin/module_ppapi.cc
+++ /dev/null
@@ -1,87 +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.
- */
-
-#include "native_client/src/shared/imc/nacl_imc_c.h"
-#include "native_client/src/shared/platform/nacl_secure_random.h"
-#include "native_client/src/shared/platform/nacl_time.h"
-#include "native_client/src/trusted/desc/nrd_all_modules.h"
-
-#include "ppapi/native_client/src/trusted/plugin/module_ppapi.h"
-#include "ppapi/native_client/src/trusted/plugin/plugin.h"
-#include "ppapi/native_client/src/trusted/plugin/utility.h"
-
-namespace plugin {
-
-ModulePpapi::ModulePpapi() : pp::Module(),
- init_was_successful_(false),
- private_interface_(NULL) {
- MODULE_PRINTF(("ModulePpapi::ModulePpapi (this=%p)\n",
- static_cast<void*>(this)));
-}
-
-ModulePpapi::~ModulePpapi() {
- if (init_was_successful_) {
- NaClSrpcModuleFini();
- NaClNrdAllModulesFini();
- }
- MODULE_PRINTF(("ModulePpapi::~ModulePpapi (this=%p)\n",
- static_cast<void*>(this)));
-}
-
-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_) {
- MODULE_PRINTF(("ModulePpapi::Init failed: "
- "GetBrowserInterface returned NULL\n"));
- return false;
- }
- SetNaClInterface(private_interface_);
-
-#if NACL_LINUX || NACL_OSX
- // Note that currently we do not need random numbers inside the
- // NaCl trusted plugin on Unix, but NaClSecureRngModuleInit() is
- // strict and will raise a fatal error unless we provide it with a
- // /dev/urandom FD beforehand.
- NaClSecureRngModuleSetUrandomFd(dup(private_interface_->UrandomFD()));
-#endif
-
- // In the plugin, we don't need high resolution time of day.
- NaClAllowLowResolutionTimeOfDay();
- NaClNrdAllModulesInit();
- NaClSrpcModuleInit();
-
-#if NACL_WINDOWS
- NaClSetBrokerDuplicateHandleFunc(private_interface_->BrokerDuplicateHandle);
-#endif
-
- init_was_successful_ = true;
- return true;
-}
-
-pp::Instance* ModulePpapi::CreateInstance(PP_Instance pp_instance) {
- MODULE_PRINTF(("ModulePpapi::CreateInstance (pp_instance=%" NACL_PRId32
- ")\n",
- pp_instance));
- Plugin* plugin = new Plugin(pp_instance);
- MODULE_PRINTF(("ModulePpapi::CreateInstance (return %p)\n",
- static_cast<void* >(plugin)));
- return plugin;
-}
-
-} // namespace plugin
-
-
-namespace pp {
-
-Module* CreateModule() {
- MODULE_PRINTF(("CreateModule ()\n"));
- return new plugin::ModulePpapi();
-}
-
-} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698