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

Unified Diff: ppapi/nacl_irt/irt_ppapi.cc

Issue 1512233002: PPAPI/NaCl: Move plugin_main.cc's contents into irt_ppapi.cc (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « ppapi/nacl_irt/irt_ppapi.h ('k') | ppapi/nacl_irt/plugin_main.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/nacl_irt/irt_ppapi.cc
diff --git a/ppapi/nacl_irt/irt_ppapi.cc b/ppapi/nacl_irt/irt_ppapi.cc
index 7cdf58957c5fdfea09ed21f0ac9a83fa27007de1..2d2bb663ac3145443c984cf1f758a27d80f25ceb 100644
--- a/ppapi/nacl_irt/irt_ppapi.cc
+++ b/ppapi/nacl_irt/irt_ppapi.cc
@@ -3,16 +3,46 @@
// found in the LICENSE file.
#include "build/build_config.h"
+// Need to include this before most other files because it defines
+// IPC_MESSAGE_LOG_ENABLED. We need to use it to define
+// IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the
+// ViewMsgLog et al. functions.
+
+#include "base/threading/thread.h"
+#include "ipc/ipc_logging.h"
#include "ppapi/nacl_irt/irt_interfaces.h"
#include "ppapi/nacl_irt/irt_ppapi.h"
-#include "ppapi/nacl_irt/plugin_main.h"
+#include "ppapi/nacl_irt/plugin_startup.h"
+#include "ppapi/nacl_irt/ppapi_dispatcher.h"
#include "ppapi/nacl_irt/public/irt_ppapi.h"
+#include "ppapi/proxy/plugin_globals.h"
+#include "ppapi/shared_impl/ppb_audio_shared.h"
static struct PP_StartFunctions g_pp_functions;
+void PpapiPluginRegisterThreadCreator(
+ const struct PP_ThreadFunctions* thread_functions) {
+ // Initialize all classes that need to create threads that call back into
+ // user code.
+ ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions);
+}
+
int irt_ppapi_start(const struct PP_StartFunctions* funcs) {
g_pp_functions = *funcs;
- return PpapiPluginMain();
+
+ base::MessageLoop loop;
+ ppapi::proxy::PluginGlobals plugin_globals(
+ scoped_refptr<base::TaskRunner>(ppapi::GetIOThread()->task_runner()));
+
+ ppapi::PpapiDispatcher ppapi_dispatcher(
+ ppapi::GetIOThread()->task_runner(), ppapi::GetShutdownEvent(),
+ ppapi::GetBrowserIPCFileDescriptor(),
+ ppapi::GetRendererIPCFileDescriptor());
+ plugin_globals.SetPluginProxyDelegate(&ppapi_dispatcher);
+
+ loop.Run();
+
+ return 0;
}
int32_t PPP_InitializeModule(PP_Module module_id,
« no previous file with comments | « ppapi/nacl_irt/irt_ppapi.h ('k') | ppapi/nacl_irt/plugin_main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698