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

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

Issue 10713007: Make isolated file system works for a device root (e.g. X:\\) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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: content/browser/intents/intent_injector.cc
diff --git a/content/browser/intents/intent_injector.cc b/content/browser/intents/intent_injector.cc
index aaf55c014138fa06f6fa51b91d589aeb48227d23..06c1a8f5949c26ad8dc167d526b51fa2c449b8df 100644
--- a/content/browser/intents/intent_injector.cc
+++ b/content/browser/intents/intent_injector.cc
@@ -18,6 +18,7 @@
#include "content/common/intents_messages.h"
#include "content/public/common/content_switches.h"
#include "webkit/fileapi/file_system_util.h"
+#include "webkit/fileapi/isolated_context.h"
#include "webkit/glue/web_intent_data.h"
#include "webkit/glue/web_intent_reply_data.h"
@@ -91,10 +92,16 @@ void IntentInjector::RenderViewCreated(RenderViewHost* render_view_host) {
} else if (source_intent_->data_type ==
webkit_glue::WebIntentData::FILESYSTEM) {
const int child_id = render_view_host->GetProcess()->GetID();
+ std::vector<fileapi::IsolatedContext::FileInfo> files;
+ const bool valid =
+ fileapi::IsolatedContext::GetInstance()->GetRegisteredFileInfo(
+ source_intent_->filesystem_id, &files);
+ DCHECK(valid);
+ DCHECK_EQ(1U, files.size());
ChildProcessSecurityPolicy* policy =
ChildProcessSecurityPolicy::GetInstance();
- if (!policy->CanReadFile(child_id, source_intent_->root_path))
- policy->GrantReadFile(child_id, source_intent_->root_path);
+ if (!policy->CanReadFile(child_id, files[0].path))
+ policy->GrantReadFile(child_id, files[0].path);
policy->GrantReadFileSystem(child_id, source_intent_->filesystem_id);
}
« no previous file with comments | « chrome/browser/media_gallery/media_file_system_registry.cc ('k') | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698