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

Side by Side Diff: content/child/webfileutilities_impl.cc

Issue 2586483002: Use explicit WebString <-> string16 conversion methods in storage API files (Closed)
Patch Set: '' Created 4 years 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/child/web_database_observer_impl.cc ('k') | third_party/WebKit/Source/platform/exported/FilePathConversion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698