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

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: compile (racing with incoming CLs) 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) 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/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 29 matching lines...) Expand all
40 pickle->WriteInt64(time.ToInternalValue())) 40 pickle->WriteInt64(time.ToInternalValue()))
41 return true; 41 return true;
42 42
43 NOTREACHED(); 43 NOTREACHED();
44 return false; 44 return false;
45 } 45 }
46 46
47 bool FileInfoFromPickle( 47 bool FileInfoFromPickle(
48 const Pickle& pickle, 48 const Pickle& pickle,
49 fileapi::FileSystemDirectoryDatabase::FileInfo* info) { 49 fileapi::FileSystemDirectoryDatabase::FileInfo* info) {
50 void* iter = NULL; 50 PickleIterator iter(pickle);
51 std::string data_path; 51 std::string data_path;
52 std::string name; 52 std::string name;
53 int64 internal_time; 53 int64 internal_time;
54 54
55 if (pickle.ReadInt64(&iter, &info->parent_id) && 55 if (pickle.ReadInt64(&iter, &info->parent_id) &&
56 pickle.ReadString(&iter, &data_path) && 56 pickle.ReadString(&iter, &data_path) &&
57 pickle.ReadString(&iter, &name) && 57 pickle.ReadString(&iter, &name) &&
58 pickle.ReadInt64(&iter, &internal_time)) { 58 pickle.ReadInt64(&iter, &internal_time)) {
59 #if defined(OS_POSIX) 59 #if defined(OS_POSIX)
60 info->data_path = FilePath(data_path); 60 info->data_path = FilePath(data_path);
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 539
540 void FileSystemDirectoryDatabase::HandleError( 540 void FileSystemDirectoryDatabase::HandleError(
541 const tracked_objects::Location& from_here, 541 const tracked_objects::Location& from_here,
542 leveldb::Status status) { 542 leveldb::Status status) {
543 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: " 543 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: "
544 << from_here.ToString() << " with error: " << status.ToString(); 544 << from_here.ToString() << " with error: " << status.ToString();
545 db_.reset(); 545 db_.reset();
546 } 546 }
547 547
548 } // namespace fileapi 548 } // namespace fileapi
OLDNEW
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_win_unittest.cc ('k') | webkit/fileapi/file_system_usage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698