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

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

Issue 3347005: Moving file_util::FileInfo to base::PlatformFileInfo, and adding the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "webkit/glue/webfileutilities_impl.h" 5 #include "webkit/glue/webfileutilities_impl.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return file_util::GetFileSize(WebStringToFilePath(path), 48 return file_util::GetFileSize(WebStringToFilePath(path),
49 reinterpret_cast<int64*>(&result)); 49 reinterpret_cast<int64*>(&result));
50 } 50 }
51 51
52 bool WebFileUtilitiesImpl::getFileModificationTime(const WebString& path, 52 bool WebFileUtilitiesImpl::getFileModificationTime(const WebString& path,
53 double& result) { 53 double& result) {
54 if (sandbox_enabled_) { 54 if (sandbox_enabled_) {
55 NOTREACHED(); 55 NOTREACHED();
56 return false; 56 return false;
57 } 57 }
58 file_util::FileInfo info; 58 base::PlatformFileInfo info;
59 if (!file_util::GetFileInfo(WebStringToFilePath(path), &info)) 59 if (!file_util::GetFileInfo(WebStringToFilePath(path), &info))
60 return false; 60 return false;
61 result = info.last_modified.ToDoubleT(); 61 result = info.last_modified.ToDoubleT();
62 return true; 62 return true;
63 } 63 }
64 64
65 WebString WebFileUtilitiesImpl::directoryName(const WebString& path) { 65 WebString WebFileUtilitiesImpl::directoryName(const WebString& path) {
66 FilePath file_path(WebStringToFilePathString(path)); 66 FilePath file_path(WebStringToFilePathString(path));
67 return FilePathToWebString(file_path.DirName()); 67 return FilePathToWebString(file_path.DirName());
68 } 68 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle, 149 int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle,
150 const char* data, 150 const char* data,
151 int length) { 151 int length) {
152 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) 152 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0)
153 return -1; 153 return -1;
154 net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE); 154 net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE);
155 return file_stream.Write(data, length, NULL); 155 return file_stream.Write(data, length, NULL);
156 } 156 }
157 157
158 } // namespace webkit_glue 158 } // namespace webkit_glue
OLDNEW
« base/platform_file.h ('K') | « webkit/glue/plugins/plugin_list_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698