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

Unified Diff: content/browser/intents/intent_injector.cc

Issue 9651020: Pass content-type resources to web intents. Goes through download, then invokes the p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move static method location Created 8 years, 9 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: content/browser/intents/intent_injector.cc
diff --git a/content/browser/intents/intent_injector.cc b/content/browser/intents/intent_injector.cc
index 03198892525e1254a190c4e3ea44abd07b2d826e..0e1f96fd1773bb0a1b56cc71dc13816a6e767bc2 100644
--- a/content/browser/intents/intent_injector.cc
+++ b/content/browser/intents/intent_injector.cc
@@ -6,8 +6,10 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/file_path.h"
#include "base/logging.h"
#include "base/string16.h"
+#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/intents_messages.h"
@@ -63,6 +65,15 @@ void IntentInjector::RenderViewCreated(RenderViewHost* render_view_host) {
return;
}
+ if (source_intent_->data_type == webkit_glue::WebIntentData::BLOB) {
+ // Grant read permission on the blob file to the delivered context.
+ ChildProcessSecurityPolicyImpl* policy =
+ ChildProcessSecurityPolicyImpl::GetInstance();
+ int child_id = render_view_host->GetProcess()->GetID();
+ policy->GrantReadFile(child_id,
michaeln 2012/03/29 20:51:57 are read rights ever revoked, should they be at so
Greg Billock 2012/03/29 21:04:45 I should do that when the injector is destroyed? I
+ FilePath::FromUTF8Unsafe(source_intent_->blob_file));
+ }
+
render_view_host->Send(new IntentsMsg_SetWebIntentData(
render_view_host->GetRoutingID(), *(source_intent_.get())));
}

Powered by Google App Engine
This is Rietveld 408576698