OLD | NEW |
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_system_natives.h" | 5 #include "chrome/renderer/extensions/file_system_natives.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" |
11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
12 #include "chrome/renderer/extensions/user_script_slave.h" | 12 #include "chrome/renderer/extensions/user_script_slave.h" |
13 #include "extensions/common/constants.h" | 13 #include "extensions/common/constants.h" |
14 #include "grit/renderer_resources.h" | 14 #include "grit/renderer_resources.h" |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystemType.h
" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystemType.h
" |
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
19 #include "webkit/common/fileapi/file_system_types.h" | 19 #include "webkit/common/fileapi/file_system_types.h" |
20 #include "webkit/common/fileapi/file_system_util.h" | 20 #include "webkit/common/fileapi/file_system_util.h" |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 FileSystemNatives::FileSystemNatives(v8::Handle<v8::Context> context) | 24 FileSystemNatives::FileSystemNatives(ChromeV8Context* context) |
25 : ObjectBackedNativeHandler(context) { | 25 : ObjectBackedNativeHandler(context) { |
26 RouteFunction("GetFileEntry", | 26 RouteFunction("GetFileEntry", |
27 base::Bind(&FileSystemNatives::GetFileEntry, base::Unretained(this))); | 27 base::Bind(&FileSystemNatives::GetFileEntry, base::Unretained(this))); |
28 RouteFunction("GetIsolatedFileSystem", | 28 RouteFunction("GetIsolatedFileSystem", |
29 base::Bind(&FileSystemNatives::GetIsolatedFileSystem, | 29 base::Bind(&FileSystemNatives::GetIsolatedFileSystem, |
30 base::Unretained(this))); | 30 base::Unretained(this))); |
31 RouteFunction("CrackIsolatedFileSystemName", | 31 RouteFunction("CrackIsolatedFileSystemName", |
32 base::Bind(&FileSystemNatives::CrackIsolatedFileSystemName, | 32 base::Bind(&FileSystemNatives::CrackIsolatedFileSystemName, |
33 base::Unretained(this))); | 33 base::Unretained(this))); |
34 } | 34 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 DCHECK(args[0]->IsString()); | 107 DCHECK(args[0]->IsString()); |
108 std::string filesystem_name = *v8::String::Utf8Value(args[0]->ToString()); | 108 std::string filesystem_name = *v8::String::Utf8Value(args[0]->ToString()); |
109 std::string filesystem_id; | 109 std::string filesystem_id; |
110 if (!fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) | 110 if (!fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) |
111 return v8::Undefined(); | 111 return v8::Undefined(); |
112 | 112 |
113 return v8::String::New(filesystem_id.c_str(), filesystem_id.size()); | 113 return v8::String::New(filesystem_id.c_str(), filesystem_id.size()); |
114 } | 114 } |
115 | 115 |
116 } // namespace extensions | 116 } // namespace extensions |
OLD | NEW |