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

Side by Side Diff: base/files/file_path.cc

Issue 1655333002: Add message sizing to basic IPC traits and struct macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@with-pickles
Patch Set: include ArrayHeader in size (oops!) and ensure the buffer doesn't relocate Created 4 years, 10 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
« no previous file with comments | « base/files/file_path.h ('k') | base/pickle.h » ('j') | 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 "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
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
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
OLDNEW
« no previous file with comments | « base/files/file_path.h ('k') | base/pickle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698