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

Unified Diff: base/file_path.cc

Issue 549224: Support reordering of Browser Actions within the container. Currently does no... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_path.h ('k') | chrome/browser/bookmarks/bookmark_drag_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_path.cc
===================================================================
--- base/file_path.cc (revision 37723)
+++ base/file_path.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,6 +9,7 @@
#endif
#include "base/logging.h"
+#include "base/pickle.h"
// These includes are just for the *Hack functions, and should be removed
// when those functions are removed.
@@ -1051,6 +1052,43 @@
return new_path;
}
+// static.
+void FilePath::WriteStringTypeToPickle(Pickle* pickle,
+ const FilePath::StringType& path) {
+#if defined(WCHAR_T_IS_UTF16)
+ pickle->WriteWString(path);
+#elif defined(WCHAR_T_IS_UTF32)
+ pickle->WriteString(path);
+#else
+ NOTIMPLEMENTED() << "Impossible encoding situation!";
+#endif
+}
+
+// static.
+bool FilePath::ReadStringTypeFromPickle(Pickle* pickle, void** iter,
+ FilePath::StringType* path) {
+#if defined(WCHAR_T_IS_UTF16)
+ if (!pickle->ReadWString(iter, path))
+ return false;
+#elif defined(WCHAR_T_IS_UTF32)
+ if (!pickle->ReadString(iter, path))
+ return false;
+#else
+ NOTIMPLEMENTED() << "Impossible encoding situation!";
+ return false;
+#endif
+
+ return true;
+}
+
+void FilePath::WriteToPickle(Pickle* pickle) {
+ WriteStringTypeToPickle(pickle, value());
+}
+
+bool FilePath::ReadFromPickle(Pickle* pickle, void** iter) {
+ return ReadStringTypeFromPickle(pickle, iter, &path_);
+}
+
void FilePath::StripTrailingSeparatorsInternal() {
// If there is no drive letter, start will be 1, which will prevent stripping
// the leading separator if there is only one separator. If there is a drive
« no previous file with comments | « base/file_path.h ('k') | chrome/browser/bookmarks/bookmark_drag_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698