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

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

Issue 338523007: Pepper: Whitelist dev channel APIs for some apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 6 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: 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 b91eb26c1e620b123175520614f7eac61f7c219d..1ee5f31521dcb9daafb5a481edf0f9f6c7753139 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -293,6 +293,23 @@ void LaunchSelLdr(PP_Instance instance,
}
}
+ // If the nexe uses ppapi APIs, we have to send the document URL to the
+ // browser side when launching the host. This is so that whitelisting can be
+ // performed for specific application IDs.
+ std::string document_url_string;
+ if (uses_ppapi) {
+ content::RendererPpapiHost *host =
+ content::RendererPpapiHost::GetForPPInstance(instance);
+ if (!host) {
+ ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
+ FROM_HERE,
+ base::Bind(callback.func, callback.user_data,
+ static_cast<int32_t>(PP_ERROR_FAILED)));
dmichael (off chromium) 2014/06/13 21:07:26 suggestion: Looks like you could use PostPPComplet
teravest 2014/06/13 21:13:00 Done.
+ return;
+ }
+ document_url_string = host->GetDocumentURL(instance).spec();
+ }
+
InstanceInfo instance_info;
instance_info.url = GURL(alleged_url);
@@ -308,7 +325,8 @@ void LaunchSelLdr(PP_Instance instance,
NaClLaunchResult launch_result;
if (!sender->Send(new NaClHostMsg_LaunchNaCl(
- NaClLaunchParams(instance_info.url.spec(),
+ NaClLaunchParams(document_url_string,
+ instance_info.url.spec(),
routing_id,
perm_bits,
PP_ToBool(uses_irt),

Powered by Google App Engine
This is Rietveld 408576698