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

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

Issue 306063005: Use createV8Entry() and toV8Value() with context and isolate defined in WebDOMFileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | chrome/renderer/extensions/file_browser_private_custom_bindings.cc » ('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/file_browser_handler_custom_bindings.h" 5 #include "chrome/renderer/extensions/file_browser_handler_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 blink::WebDOMFileSystem::EntryType entry_type = 50 blink::WebDOMFileSystem::EntryType entry_type =
51 is_directory ? blink::WebDOMFileSystem::EntryTypeDirectory 51 is_directory ? blink::WebDOMFileSystem::EntryTypeDirectory
52 : blink::WebDOMFileSystem::EntryTypeFile; 52 : blink::WebDOMFileSystem::EntryTypeFile;
53 blink::WebLocalFrame* webframe = 53 blink::WebLocalFrame* webframe =
54 blink::WebLocalFrame::frameForContext(context()->v8_context()); 54 blink::WebLocalFrame::frameForContext(context()->v8_context());
55 args.GetReturnValue().Set( 55 args.GetReturnValue().Set(
56 blink::WebDOMFileSystem::create( 56 blink::WebDOMFileSystem::create(
57 webframe, 57 webframe,
58 blink::WebFileSystemTypeExternal, 58 blink::WebFileSystemTypeExternal,
59 blink::WebString::fromUTF8(file_system_name), 59 blink::WebString::fromUTF8(file_system_name),
60 file_system_root).createV8Entry( 60 file_system_root)
61 blink::WebString::fromUTF8(file_full_path), 61 .createV8Entry(blink::WebString::fromUTF8(file_full_path),
62 entry_type)); 62 entry_type,
63 args.Holder(),
64 args.GetIsolate()));
63 #endif 65 #endif
64 } 66 }
65 67
66 void FileBrowserHandlerCustomBindings::GetEntryURL( 68 void FileBrowserHandlerCustomBindings::GetEntryURL(
67 const v8::FunctionCallbackInfo<v8::Value>& args) { 69 const v8::FunctionCallbackInfo<v8::Value>& args) {
68 CHECK(args.Length() == 1); 70 CHECK(args.Length() == 1);
69 CHECK(args[0]->IsObject()); 71 CHECK(args[0]->IsObject());
70 const blink::WebURL& url = 72 const blink::WebURL& url =
71 blink::WebDOMFileSystem::createFileSystemURL(args[0]); 73 blink::WebDOMFileSystem::createFileSystemURL(args[0]);
72 args.GetReturnValue().Set( 74 args.GetReturnValue().Set(
73 blink::WebScriptBindings::toV8String(url.string(), args.GetIsolate())); 75 blink::WebScriptBindings::toV8String(url.string(), args.GetIsolate()));
74 } 76 }
75 77
76 } // namespace extensions 78 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/extensions/file_browser_private_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698