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

Side by Side Diff: chrome/renderer/extensions/media_galleries_custom_bindings.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/extensions/file_system_natives.cc ('k') | webkit/fileapi/file_system_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/extensions/media_galleries_custom_bindings.h" 5 #include "chrome/renderer/extensions/media_galleries_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return v8::Undefined(); 49 return v8::Undefined();
50 } 50 }
51 std::string name(*v8::String::Utf8Value(args[1])); 51 std::string name(*v8::String::Utf8Value(args[1]));
52 if (name.empty()) { 52 if (name.empty()) {
53 NOTREACHED(); 53 NOTREACHED();
54 return v8::Undefined(); 54 return v8::Undefined();
55 } 55 }
56 56
57 WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext(); 57 WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext();
58 const GURL origin = GURL(webframe->document().securityOrigin().toString()); 58 const GURL origin = GURL(webframe->document().securityOrigin().toString());
59 const GURL root_url = 59 const std::string root_url =
60 fileapi::GetFileSystemRootURI(origin, fileapi::kFileSystemTypeIsolated); 60 fileapi::GetIsolatedFileSystemRootURIString(
61 const std::string url = 61 origin, fsid, extension_misc::kMediaFileSystemPathPart);
62 base::StringPrintf("%s%s/%s/", root_url.spec().c_str(), fsid.c_str(),
63 extension_misc::kMediaFileSystemPathPart);
64 return webframe->createFileSystem(WebKit::WebFileSystem::TypeIsolated, 62 return webframe->createFileSystem(WebKit::WebFileSystem::TypeIsolated,
65 WebKit::WebString::fromUTF8(name), 63 WebKit::WebString::fromUTF8(name),
66 WebKit::WebString::fromUTF8(url)); 64 WebKit::WebString::fromUTF8(root_url));
67 } 65 }
68 66
69 v8::Handle<v8::Value> MediaGalleriesCustomBindings::ExtractEmbeddedThumbnails( 67 v8::Handle<v8::Value> MediaGalleriesCustomBindings::ExtractEmbeddedThumbnails(
70 const v8::Arguments& args) { 68 const v8::Arguments& args) {
71 if (args.Length() != 1) { 69 if (args.Length() != 1) {
72 NOTREACHED() << "Bad arguments"; 70 NOTREACHED() << "Bad arguments";
73 return v8::Undefined(); 71 return v8::Undefined();
74 } 72 }
75 // TODO(vandebo) Check that the object is a FileEntry. 73 // TODO(vandebo) Check that the object is a FileEntry.
76 74
77 // TODO(vandebo) Create and return a Directory entry object. 75 // TODO(vandebo) Create and return a Directory entry object.
78 return v8::Null(); 76 return v8::Null();
79 } 77 }
80 78
81 } // namespace extensions 79 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/file_system_natives.cc ('k') | webkit/fileapi/file_system_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698