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

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

Issue 2847056: Implement WebFileSystemImpl::directoryName. This is needed for directory upl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 | no next file » | 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) 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/webfilesystem_impl.h" 5 #include "webkit/glue/webfilesystem_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return false; 52 return false;
53 } 53 }
54 file_util::FileInfo info; 54 file_util::FileInfo info;
55 if (!file_util::GetFileInfo(WebStringToFilePath(path), &info)) 55 if (!file_util::GetFileInfo(WebStringToFilePath(path), &info))
56 return false; 56 return false;
57 result = info.last_modified.ToDoubleT(); 57 result = info.last_modified.ToDoubleT();
58 return true; 58 return true;
59 } 59 }
60 60
61 WebString WebFileSystemImpl::directoryName(const WebString& path) { 61 WebString WebFileSystemImpl::directoryName(const WebString& path) {
62 NOTREACHED(); 62 FilePath file_path(WebStringToFilePathString(path));
63 return WebString(); 63 return FilePathToWebString(file_path.DirName());
64 } 64 }
65 65
66 WebString WebFileSystemImpl::pathByAppendingComponent( 66 WebString WebFileSystemImpl::pathByAppendingComponent(
67 const WebString& webkit_path, 67 const WebString& webkit_path,
68 const WebString& webkit_component) { 68 const WebString& webkit_component) {
69 FilePath path(WebStringToFilePathString(webkit_path)); 69 FilePath path(WebStringToFilePathString(webkit_path));
70 FilePath component(WebStringToFilePathString(webkit_component)); 70 FilePath component(WebStringToFilePathString(webkit_component));
71 FilePath combined_path = path.Append(component); 71 FilePath combined_path = path.Append(component);
72 return FilePathStringToWebString(combined_path.value()); 72 return FilePathStringToWebString(combined_path.value());
73 } 73 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 int WebFileSystemImpl::writeToFile(base::PlatformFile handle, 145 int WebFileSystemImpl::writeToFile(base::PlatformFile handle,
146 const char* data, 146 const char* data,
147 int length) { 147 int length) {
148 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) 148 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0)
149 return -1; 149 return -1;
150 net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE); 150 net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE);
151 return file_stream.Write(data, length, NULL); 151 return file_stream.Write(data, length, NULL);
152 } 152 }
153 153
154 } // namespace webkit_glue 154 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698