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

Side by Side Diff: chrome/renderer/extensions/media_galleries_custom_bindings.cc

Issue 1854983002: [Extensions] Add more bindings access checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 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
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 "extensions/renderer/script_context.h" 9 #include "extensions/renderer/script_context.h"
10 #include "storage/common/fileapi/file_system_util.h" 10 #include "storage/common/fileapi/file_system_util.h"
11 #include "third_party/WebKit/public/platform/URLConversion.h" 11 #include "third_party/WebKit/public/platform/URLConversion.h"
12 #include "third_party/WebKit/public/web/WebDOMFileSystem.h" 12 #include "third_party/WebKit/public/web/WebDOMFileSystem.h"
13 #include "third_party/WebKit/public/web/WebDocument.h" 13 #include "third_party/WebKit/public/web/WebDocument.h"
14 #include "third_party/WebKit/public/web/WebLocalFrame.h" 14 #include "third_party/WebKit/public/web/WebLocalFrame.h"
15 #include "v8/include/v8.h" 15 #include "v8/include/v8.h"
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 MediaGalleriesCustomBindings::MediaGalleriesCustomBindings( 19 MediaGalleriesCustomBindings::MediaGalleriesCustomBindings(
20 ScriptContext* context) 20 ScriptContext* context)
21 : ObjectBackedNativeHandler(context) { 21 : ObjectBackedNativeHandler(context) {
22 RouteFunction( 22 RouteFunction(
23 "GetMediaFileSystemObject", 23 "GetMediaFileSystemObject", "mediaGalleries",
24 base::Bind(&MediaGalleriesCustomBindings::GetMediaFileSystemObject, 24 base::Bind(&MediaGalleriesCustomBindings::GetMediaFileSystemObject,
25 base::Unretained(this))); 25 base::Unretained(this)));
26 } 26 }
27 27
28 // FileSystemObject GetMediaFileSystem(string file_system_url): construct 28 // FileSystemObject GetMediaFileSystem(string file_system_url): construct
29 // a file system object from a file system url. 29 // a file system object from a file system url.
30 void MediaGalleriesCustomBindings::GetMediaFileSystemObject( 30 void MediaGalleriesCustomBindings::GetMediaFileSystemObject(
31 const v8::FunctionCallbackInfo<v8::Value>& args) { 31 const v8::FunctionCallbackInfo<v8::Value>& args) {
32 CHECK_EQ(1, args.Length()); 32 CHECK_EQ(1, args.Length());
33 CHECK(args[0]->IsString()); 33 CHECK(args[0]->IsString());
(...skipping 13 matching lines...) Expand all
47 storage::GetExternalFileSystemRootURIString(origin, fs_mount)); 47 storage::GetExternalFileSystemRootURIString(origin, fs_mount));
48 args.GetReturnValue().Set( 48 args.GetReturnValue().Set(
49 blink::WebDOMFileSystem::create(webframe, 49 blink::WebDOMFileSystem::create(webframe,
50 blink::WebFileSystemTypeExternal, 50 blink::WebFileSystemTypeExternal,
51 blink::WebString::fromUTF8(fs_name), 51 blink::WebString::fromUTF8(fs_name),
52 root_url) 52 root_url)
53 .toV8Value(context()->v8_context()->Global(), args.GetIsolate())); 53 .toV8Value(context()->v8_context()->Global(), args.GetIsolate()));
54 } 54 }
55 55
56 } // namespace extensions 56 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698