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

Side by Side Diff: webkit/fileapi/file_system_directory_database.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jar feedback Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/fileapi/file_system_directory_database.h" 5 #include "webkit/fileapi/file_system_directory_database.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 28 matching lines...) Expand all
39 pickle->WriteInt64(time.ToInternalValue())) 39 pickle->WriteInt64(time.ToInternalValue()))
40 return true; 40 return true;
41 41
42 NOTREACHED(); 42 NOTREACHED();
43 return false; 43 return false;
44 } 44 }
45 45
46 bool FileInfoFromPickle( 46 bool FileInfoFromPickle(
47 const Pickle& pickle, 47 const Pickle& pickle,
48 fileapi::FileSystemDirectoryDatabase::FileInfo* info) { 48 fileapi::FileSystemDirectoryDatabase::FileInfo* info) {
49 void* iter = NULL; 49 PickleReader iter(pickle);
50 std::string data_path; 50 std::string data_path;
51 std::string name; 51 std::string name;
52 int64 internal_time; 52 int64 internal_time;
53 53
54 if (pickle.ReadInt64(&iter, &info->parent_id) && 54 if (pickle.ReadInt64(&iter, &info->parent_id) &&
55 pickle.ReadString(&iter, &data_path) && 55 pickle.ReadString(&iter, &data_path) &&
56 pickle.ReadString(&iter, &name) && 56 pickle.ReadString(&iter, &name) &&
57 pickle.ReadInt64(&iter, &internal_time)) { 57 pickle.ReadInt64(&iter, &internal_time)) {
58 #if defined(OS_POSIX) 58 #if defined(OS_POSIX)
59 info->data_path = FilePath(data_path); 59 info->data_path = FilePath(data_path);
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 538
539 void FileSystemDirectoryDatabase::HandleError( 539 void FileSystemDirectoryDatabase::HandleError(
540 const tracked_objects::Location& from_here, 540 const tracked_objects::Location& from_here,
541 leveldb::Status status) { 541 leveldb::Status status) {
542 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: " 542 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: "
543 << from_here.ToString() << " with error: " << status.ToString(); 543 << from_here.ToString() << " with error: " << status.ToString();
544 db_.reset(); 544 db_.reset();
545 } 545 }
546 546
547 } // namespace fileapi 547 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698