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

Side by Side Diff: webkit/glue/webfileutilities_impl.cc

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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 | « webkit/common/fileapi/file_system_util.cc ('k') | webkit/glue/webkit_glue.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 "webkit/glue/webfileutilities_impl.h" 5 #include "webkit/glue/webfileutilities_impl.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/base/file_stream.h" 10 #include "net/base/file_stream.h"
(...skipping 14 matching lines...) Expand all
25 WebFileUtilitiesImpl::~WebFileUtilitiesImpl() { 25 WebFileUtilitiesImpl::~WebFileUtilitiesImpl() {
26 } 26 }
27 27
28 bool WebFileUtilitiesImpl::getFileInfo(const WebString& path, 28 bool WebFileUtilitiesImpl::getFileInfo(const WebString& path,
29 blink::WebFileInfo& web_file_info) { 29 blink::WebFileInfo& web_file_info) {
30 if (sandbox_enabled_) { 30 if (sandbox_enabled_) {
31 NOTREACHED(); 31 NOTREACHED();
32 return false; 32 return false;
33 } 33 }
34 // TODO(rvargas): convert this code to use base::File::Info. 34 // TODO(rvargas): convert this code to use base::File::Info.
35 base::PlatformFileInfo file_info; 35 base::File::Info file_info;
36 if (!base::GetFileInfo(base::FilePath::FromUTF16Unsafe(path), 36 if (!base::GetFileInfo(base::FilePath::FromUTF16Unsafe(path),
37 reinterpret_cast<base::File::Info*>(&file_info))) 37 reinterpret_cast<base::File::Info*>(&file_info)))
38 return false; 38 return false;
39 39
40 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); 40 webkit_glue::FileInfoToWebFileInfo(file_info, &web_file_info);
41 web_file_info.platformPath = path; 41 web_file_info.platformPath = path;
42 return true; 42 return true;
43 } 43 }
44 44
45 WebString WebFileUtilitiesImpl::directoryName(const WebString& path) { 45 WebString WebFileUtilitiesImpl::directoryName(const WebString& path) {
46 return base::FilePath::FromUTF16Unsafe(path).DirName().AsUTF16Unsafe(); 46 return base::FilePath::FromUTF16Unsafe(path).DirName().AsUTF16Unsafe();
47 } 47 }
48 48
49 WebString WebFileUtilitiesImpl::baseName(const WebString& path) { 49 WebString WebFileUtilitiesImpl::baseName(const WebString& path) {
50 return base::FilePath::FromUTF16Unsafe(path).BaseName().AsUTF16Unsafe(); 50 return base::FilePath::FromUTF16Unsafe(path).BaseName().AsUTF16Unsafe();
(...skipping 27 matching lines...) Expand all
78 78
79 int WebFileUtilitiesImpl::readFromFile(base::PlatformFile handle, 79 int WebFileUtilitiesImpl::readFromFile(base::PlatformFile handle,
80 char* data, 80 char* data,
81 int length) { 81 int length) {
82 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) 82 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0)
83 return -1; 83 return -1;
84 return base::ReadPlatformFileCurPosNoBestEffort(handle, data, length); 84 return base::ReadPlatformFileCurPosNoBestEffort(handle, data, length);
85 } 85 }
86 86
87 } // namespace webkit_glue 87 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/common/fileapi/file_system_util.cc ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698