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

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

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « webkit/browser/fileapi/transient_file_util_unittest.cc ('k') | 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) 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 base::FilePath combined_path = path.Append(component); 67 base::FilePath combined_path = path.Append(component);
68 return combined_path.AsUTF16Unsafe(); 68 return combined_path.AsUTF16Unsafe();
69 } 69 }
70 70
71 bool WebFileUtilitiesImpl::makeAllDirectories(const WebString& path) { 71 bool WebFileUtilitiesImpl::makeAllDirectories(const WebString& path) {
72 DCHECK(!sandbox_enabled_); 72 DCHECK(!sandbox_enabled_);
73 return file_util::CreateDirectory(base::FilePath::FromUTF16Unsafe(path)); 73 return file_util::CreateDirectory(base::FilePath::FromUTF16Unsafe(path));
74 } 74 }
75 75
76 bool WebFileUtilitiesImpl::isDirectory(const WebString& path) { 76 bool WebFileUtilitiesImpl::isDirectory(const WebString& path) {
77 return file_util::DirectoryExists(base::FilePath::FromUTF16Unsafe(path)); 77 return base::DirectoryExists(base::FilePath::FromUTF16Unsafe(path));
78 } 78 }
79 79
80 WebKit::WebURL WebFileUtilitiesImpl::filePathToURL(const WebString& path) { 80 WebKit::WebURL WebFileUtilitiesImpl::filePathToURL(const WebString& path) {
81 return net::FilePathToFileURL(base::FilePath::FromUTF16Unsafe(path)); 81 return net::FilePathToFileURL(base::FilePath::FromUTF16Unsafe(path));
82 } 82 }
83 83
84 base::PlatformFile WebFileUtilitiesImpl::openFile(const WebString& path, 84 base::PlatformFile WebFileUtilitiesImpl::openFile(const WebString& path,
85 int mode) { 85 int mode) {
86 if (sandbox_enabled_) { 86 if (sandbox_enabled_) {
87 NOTREACHED(); 87 NOTREACHED();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle, 130 int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle,
131 const char* data, 131 const char* data,
132 int length) { 132 int length) {
133 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) 133 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0)
134 return -1; 134 return -1;
135 return base::WritePlatformFileCurPosNoBestEffort(handle, data, length); 135 return base::WritePlatformFileCurPosNoBestEffort(handle, data, length);
136 } 136 }
137 137
138 } // namespace webkit_glue 138 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/transient_file_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698