OLD | NEW |
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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 FilePath FilePath::FromUTF8Unsafe(const std::string& utf8) { | 650 FilePath FilePath::FromUTF8Unsafe(const std::string& utf8) { |
651 return FilePath(UTF8ToWide(utf8)); | 651 return FilePath(UTF8ToWide(utf8)); |
652 } | 652 } |
653 | 653 |
654 // static | 654 // static |
655 FilePath FilePath::FromUTF16Unsafe(const string16& utf16) { | 655 FilePath FilePath::FromUTF16Unsafe(const string16& utf16) { |
656 return FilePath(utf16); | 656 return FilePath(utf16); |
657 } | 657 } |
658 #endif | 658 #endif |
659 | 659 |
| 660 void FilePath::GetSizeForPickle(PickleSizer* sizer) const { |
| 661 #if defined(OS_WIN) |
| 662 sizer->AddString16(path_); |
| 663 #else |
| 664 sizer->AddString(path_); |
| 665 #endif |
| 666 } |
| 667 |
660 void FilePath::WriteToPickle(Pickle* pickle) const { | 668 void FilePath::WriteToPickle(Pickle* pickle) const { |
661 #if defined(OS_WIN) | 669 #if defined(OS_WIN) |
662 pickle->WriteString16(path_); | 670 pickle->WriteString16(path_); |
663 #else | 671 #else |
664 pickle->WriteString(path_); | 672 pickle->WriteString(path_); |
665 #endif | 673 #endif |
666 } | 674 } |
667 | 675 |
668 bool FilePath::ReadFromPickle(PickleIterator* iter) { | 676 bool FilePath::ReadFromPickle(PickleIterator* iter) { |
669 #if defined(OS_WIN) | 677 #if defined(OS_WIN) |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 #endif | 1321 #endif |
1314 } | 1322 } |
1315 | 1323 |
1316 #if defined(OS_ANDROID) | 1324 #if defined(OS_ANDROID) |
1317 bool FilePath::IsContentUri() const { | 1325 bool FilePath::IsContentUri() const { |
1318 return StartsWith(path_, "content://", base::CompareCase::INSENSITIVE_ASCII); | 1326 return StartsWith(path_, "content://", base::CompareCase::INSENSITIVE_ASCII); |
1319 } | 1327 } |
1320 #endif | 1328 #endif |
1321 | 1329 |
1322 } // namespace base | 1330 } // namespace base |
OLD | NEW |