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

Unified Diff: src/shared/ppapi_proxy/plugin_globals.cc

Issue 7605029: Extend IRT with nacl_irt_resource_open interface (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 4 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
« no previous file with comments | « no previous file | src/shared/ppapi_proxy/ppruntime.h » ('j') | src/untrusted/irt/irt.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/ppapi_proxy/plugin_globals.cc
===================================================================
--- src/shared/ppapi_proxy/plugin_globals.cc (revision 6419)
+++ src/shared/ppapi_proxy/plugin_globals.cc (working copy)
@@ -155,29 +155,26 @@
thread_funcs = *new_funcs;
}
-int PpapiPluginMain() {
- if (getenv("NACL_LD_ACCEPTS_PLUGIN_CONNECTION") != NULL) {
- // Send a message to the page to ask it to reinitialise the
- // plugin's SRPC/PPAPI connection. This triggers a call to
- // __startSrpcServices() which in turn calls
- // StartProxiedExecution() which sets up the PPAPI proxy. This is
- // necessary because LoadNaClModule()'s earlier call to
- // StartSrpcServices() was matched by the dynamic linker before
- // libppruntime was available.
- // For background, see:
- // http://code.google.com/p/nativeclient/issues/detail?id=617
- // http://code.google.com/p/nativeclient/issues/detail?id=1501
- // TODO(mseaborn): This is a temporary measure. Find a less hacky
- // way to do this.
- struct NaClImcMsgIoVec iov = { const_cast<char*>("Init"), 4 };
- struct NaClImcMsgHdr message = { &iov, 1, NULL, 0, 0 };
- imc_sendmsg(NACL_SEND_FD, &message, 0);
- }
+// TODO(halyavin): this is needed for tests without IRT. They do not start
+// in irt_entry.c where PpapiPluginPreInit is called.
Roland McGrath 2011/08/16 17:32:50 This comment refers to a function that does not ex
halyavin 2011/08/16 18:06:25 Done.
+static int initialized = 0;
+int IrtInit() {
if (!NaClSrpcModuleInit()) {
return 1;
}
NaClLogModuleInit(); // Enable NaClLog'ing used by CHECK().
+ initialized = 1;
+ return 0;
+}
+
+int PpapiPluginMain() {
+ if (!initialized) {
Roland McGrath 2011/08/16 17:32:50 This is not thread-safe, which could be a problem
halyavin 2011/08/16 18:06:25 This will be changed, if we implement lazy initial
+ int status = IrtInit();
+ if (0 != status) {
+ return status;
+ }
+ }
PpapiPluginRegisterDefaultThreadCreator();
// Designate this as the main thread for PPB_Core::IsMainThread().
ppapi_proxy::PluginCore::MarkMainThread();
« no previous file with comments | « no previous file | src/shared/ppapi_proxy/ppruntime.h » ('j') | src/untrusted/irt/irt.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698