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

Unified Diff: native_client_sdk/src/libraries/ppapi_simple/ps.cc

Issue 412083002: [NaCl SDK] Allow ppapi_simple executables to run in both sel_ldr and in chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: native_client_sdk/src/libraries/ppapi_simple/ps.cc
diff --git a/native_client_sdk/src/libraries/ppapi_simple/ps.cc b/native_client_sdk/src/libraries/ppapi_simple/ps.cc
index 540488f11d9d5b7979960192d5255e6bc8ebcec8..2ba183ea799486174ebb0df8611a3ea911a3e6a4 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/ps.cc
+++ b/native_client_sdk/src/libraries/ppapi_simple/ps.cc
@@ -12,12 +12,17 @@
static pp::Instance* s_Instance = NULL;
-PP_Instance PSGetInstanceId() {
+PP_Instance PSGetInstanceId(void) {
+ if (s_Instance == NULL)
+ return 0;
return s_Instance->pp_instance();
}
const void* PSGetInterface(const char *name) {
- return pp::Module::Get()->GetBrowserInterface(name);
+ pp::Module* module = pp::Module::Get();
+ if (module == NULL)
+ return NULL;
+ return module->GetBrowserInterface(name);
}

Powered by Google App Engine
This is Rietveld 408576698