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

Side by Side Diff: webkit/glue/glue_serialize.cc

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/glue_serialize.h ('k') | webkit/glue/glue_serialize_unittest.cc » ('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 "webkit/glue/glue_serialize.h" 5 #include "webkit/glue/glue_serialize.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 SerializeObject obj; 503 SerializeObject obj;
504 WriteHistoryItem(item, &obj); 504 WriteHistoryItem(item, &obj);
505 return obj.GetAsString(); 505 return obj.GetAsString();
506 } 506 }
507 507
508 WebHistoryItem HistoryItemFromString(const std::string& serialized_item) { 508 WebHistoryItem HistoryItemFromString(const std::string& serialized_item) {
509 return HistoryItemFromString(serialized_item, ALWAYS_INCLUDE_FORM_DATA, true); 509 return HistoryItemFromString(serialized_item, ALWAYS_INCLUDE_FORM_DATA, true);
510 } 510 }
511 511
512 std::vector<FilePath> FilePathsFromHistoryState( 512 std::vector<base::FilePath> FilePathsFromHistoryState(
513 const std::string& content_state) { 513 const std::string& content_state) {
514 std::vector<FilePath> to_return; 514 std::vector<base::FilePath> to_return;
515 // TODO(darin): We should avoid using the WebKit API here, so that we do not 515 // TODO(darin): We should avoid using the WebKit API here, so that we do not
516 // need to have WebKit initialized before calling this method. 516 // need to have WebKit initialized before calling this method.
517 const WebHistoryItem& item = 517 const WebHistoryItem& item =
518 HistoryItemFromString(content_state, ALWAYS_INCLUDE_FORM_DATA, true); 518 HistoryItemFromString(content_state, ALWAYS_INCLUDE_FORM_DATA, true);
519 if (item.isNull()) { 519 if (item.isNull()) {
520 // Couldn't parse the string. 520 // Couldn't parse the string.
521 return to_return; 521 return to_return;
522 } 522 }
523 const WebVector<WebString> file_paths = item.getReferencedFilePaths(); 523 const WebVector<WebString> file_paths = item.getReferencedFilePaths();
524 for (size_t i = 0; i < file_paths.size(); ++i) 524 for (size_t i = 0; i < file_paths.size(); ++i)
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 // serialization of the given URL with a dummy version number of -1. This 597 // serialization of the given URL with a dummy version number of -1. This
598 // will be interpreted by ReadHistoryItem as a request to create a default 598 // will be interpreted by ReadHistoryItem as a request to create a default
599 // WebHistoryItem. 599 // WebHistoryItem.
600 SerializeObject obj; 600 SerializeObject obj;
601 WriteInteger(-1, &obj); 601 WriteInteger(-1, &obj);
602 WriteGURL(url, &obj); 602 WriteGURL(url, &obj);
603 return obj.GetAsString(); 603 return obj.GetAsString();
604 } 604 }
605 605
606 } // namespace webkit_glue 606 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/glue_serialize.h ('k') | webkit/glue/glue_serialize_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698