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

Unified Diff: chrome/renderer/extensions/file_system_natives.cc

Issue 11833002: Cleanup: Add fileapi::GetIsolatedFileSystemRootURIString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 7 years, 11 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 | chrome/renderer/extensions/media_galleries_custom_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/file_system_natives.cc
diff --git a/chrome/renderer/extensions/file_system_natives.cc b/chrome/renderer/extensions/file_system_natives.cc
index 3239c47a33c4a5dcaf84fcd234324744a1ef5664..af20825fb478b5753d2442b422790f8ca59c6d86 100644
--- a/chrome/renderer/extensions/file_system_natives.cc
+++ b/chrome/renderer/extensions/file_system_natives.cc
@@ -35,21 +35,19 @@ static v8::Handle<v8::Value> GetIsolatedFileSystem(
std::string name(fileapi::GetIsolatedFileSystemName(context_url.GetOrigin(),
file_system_id));
- std::string root(fileapi::GetFileSystemRootURI(
- context_url.GetOrigin(),
- fileapi::kFileSystemTypeIsolated).spec());
- root.append(file_system_id);
- root.append("/");
-
// The optional second argument is the subfolder within the isolated file
// system at which to root the DOMFileSystem we're returning to the caller.
+ std::string optional_root_name;
if (args.Length() == 2) {
DCHECK(args[1]->IsString());
- name = *v8::String::Utf8Value(args[1]);
- root.append(name);
- root.append("/");
+ optional_root_name = *v8::String::Utf8Value(args[1]);
}
+ std::string root(fileapi::GetIsolatedFileSystemRootURIString(
+ context_url.GetOrigin(),
+ file_system_id,
+ optional_root_name));
+
return webframe->createFileSystem(
WebKit::WebFileSystem::TypeIsolated,
WebKit::WebString::fromUTF8(name),
« no previous file with comments | « no previous file | chrome/renderer/extensions/media_galleries_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698