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

Unified Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 270863006: Pepper: Miscellaneous trusted plugin cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/ppb_nacl_private_impl.cc
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index e9efc6b5ba027b6b132b23d65b92f1f91ab04409..9b29b38c872d5dcfc9d99021ec42f239d8e66c61 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -60,6 +60,9 @@
namespace nacl {
namespace {
+// The pseudo-architecture used to indicate portable native client.
+const char* const kPortableArch = "portable";
+
base::LazyInstance<scoped_refptr<PnaclTranslationResourceHost> >
g_pnacl_resource_host = LAZY_INSTANCE_INITIALIZER;
@@ -901,13 +904,6 @@ PP_Var GetManifestURLArgument(PP_Instance instance) {
return PP_MakeUndefined();
}
-PP_Bool IsPNaCl(PP_Instance instance) {
- nacl::NexeLoadManager* load_manager = GetNexeLoadManager(instance);
- if (load_manager)
- return PP_FromBool(load_manager->IsPNaCl());
- return PP_FALSE;
-}
-
PP_Bool DevInterfacesEnabled(PP_Instance instance) {
nacl::NexeLoadManager* load_manager = GetNexeLoadManager(instance);
if (load_manager)
@@ -1025,11 +1021,19 @@ int32_t CreatePNaClManifest(PP_Instance /* instance */) {
int32_t CreateJsonManifest(PP_Instance instance,
const char* manifest_url,
- const char* isa_type,
const char* manifest_data) {
+ nacl::NexeLoadManager* load_manager = GetNexeLoadManager(instance);
+ if (!load_manager)
+ return -1;
int32_t manifest_id = g_next_manifest_id.Get();
g_next_manifest_id.Get()++;
+ const char* isa_type;
+ if (load_manager->IsPNaCl())
+ isa_type = kPortableArch;
+ else
+ isa_type = GetSandboxArch();
+
scoped_ptr<nacl::JsonManifest> j(
new nacl::JsonManifest(
manifest_url,
@@ -1041,9 +1045,7 @@ int32_t CreateJsonManifest(PP_Instance instance,
g_manifest_map.Get().add(manifest_id, j.Pass());
return manifest_id;
}
- nacl::NexeLoadManager* load_manager = GetNexeLoadManager(instance);
- if (load_manager)
- load_manager->ReportLoadError(error_info.error, error_info.string);
+ load_manager->ReportLoadError(error_info.error, error_info.string);
return -1;
}
@@ -1295,7 +1297,6 @@ const PPB_NaCl_Private nacl_interface = {
&ParseDataURL,
&ProcessNaClManifest,
&GetManifestURLArgument,
- &IsPNaCl,
&DevInterfacesEnabled,
&DownloadManifestToBuffer,
&CreatePNaClManifest,
« no previous file with comments | « no previous file | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698