OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_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" |
11 #include "net/base/net_util.h" | 11 #include "net/base/net_util.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
14 #include "webkit/glue/webkit_glue.h" | 14 #include "webkit/glue/webkit_glue.h" |
15 | 15 |
16 using WebKit::WebString; | 16 using WebKit::WebString; |
17 | 17 |
18 namespace webkit_glue { | 18 namespace webkit_glue { |
19 | 19 |
20 WebFileUtilitiesImpl::WebFileUtilitiesImpl() | 20 WebFileUtilitiesImpl::WebFileUtilitiesImpl() |
21 : sandbox_enabled_(true) { | 21 : sandbox_enabled_(true) { |
22 } | 22 } |
23 | 23 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle, | 153 int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle, |
154 const char* data, | 154 const char* data, |
155 int length) { | 155 int length) { |
156 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) | 156 if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) |
157 return -1; | 157 return -1; |
158 net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE); | 158 net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE); |
159 return file_stream.Write(data, length, net::CompletionCallback()); | 159 return file_stream.Write(data, length, net::CompletionCallback()); |
160 } | 160 } |
161 | 161 |
162 } // namespace webkit_glue | 162 } // namespace webkit_glue |
OLD | NEW |