| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/webfileutilities_impl.h" | 5 #include "content/child/webfileutilities_impl.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/child/file_info_util.h" | 10 #include "content/child/file_info_util.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 if (!base::GetFileInfo(blink::WebStringToFilePath(path), | 36 if (!base::GetFileInfo(blink::WebStringToFilePath(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 FileInfoToWebFileInfo(file_info, &web_file_info); | 40 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 blink::WebStringToFilePath(path).DirName().AsUTF16Unsafe(); | 46 return blink::FilePathToWebString(blink::WebStringToFilePath(path).DirName()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 WebString WebFileUtilitiesImpl::baseName(const WebString& path) { | 49 WebString WebFileUtilitiesImpl::baseName(const WebString& path) { |
| 50 return blink::WebStringToFilePath(path).BaseName().AsUTF16Unsafe(); | 50 return blink::FilePathToWebString( |
| 51 blink::WebStringToFilePath(path).BaseName()); |
| 51 } | 52 } |
| 52 | 53 |
| 53 blink::WebURL WebFileUtilitiesImpl::filePathToURL(const WebString& path) { | 54 blink::WebURL WebFileUtilitiesImpl::filePathToURL(const WebString& path) { |
| 54 return net::FilePathToFileURL(blink::WebStringToFilePath(path)); | 55 return net::FilePathToFileURL(blink::WebStringToFilePath(path)); |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace content | 58 } // namespace content |
| OLD | NEW |