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

Side by Side Diff: chrome/browser/bookmarks/bookmark_storage.cc

Issue 1120006: detect preferences errors (Closed)
Patch Set: changes from review Created 10 years, 8 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/bookmarks/bookmark_storage.h" 5 #include "chrome/browser/bookmarks/bookmark_storage.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/histogram.h" 9 #include "base/histogram.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 BookmarkLoadDetails* details) 67 BookmarkLoadDetails* details)
68 : path_(path), 68 : path_(path),
69 storage_(storage), 69 storage_(storage),
70 details_(details) { 70 details_(details) {
71 } 71 }
72 72
73 virtual void Run() { 73 virtual void Run() {
74 bool bookmark_file_exists = file_util::PathExists(path_); 74 bool bookmark_file_exists = file_util::PathExists(path_);
75 if (bookmark_file_exists) { 75 if (bookmark_file_exists) {
76 JSONFileValueSerializer serializer(path_); 76 JSONFileValueSerializer serializer(path_);
77 scoped_ptr<Value> root(serializer.Deserialize(NULL)); 77 scoped_ptr<Value> root(serializer.Deserialize(NULL, NULL));
78 78
79 if (root.get()) { 79 if (root.get()) {
80 // Building the index can take a while, so we do it on the background 80 // Building the index can take a while, so we do it on the background
81 // thread. 81 // thread.
82 int64 max_node_id = 0; 82 int64 max_node_id = 0;
83 BookmarkCodec codec; 83 BookmarkCodec codec;
84 TimeTicks start_time = TimeTicks::Now(); 84 TimeTicks start_time = TimeTicks::Now();
85 codec.Decode(details_->bb_node(), details_->other_folder_node(), 85 codec.Decode(details_->bb_node(), details_->other_folder_node(),
86 &max_node_id, *root.get()); 86 &max_node_id, *root.get());
87 details_->set_max_id(std::max(max_node_id, details_->max_id())); 87 details_->set_max_id(std::max(max_node_id, details_->max_id()));
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 NOTREACHED(); 253 NOTREACHED();
254 return false; 254 return false;
255 } 255 }
256 256
257 std::string data; 257 std::string data;
258 if (!SerializeData(&data)) 258 if (!SerializeData(&data))
259 return false; 259 return false;
260 writer_.WriteNow(data); 260 writer_.WriteNow(data);
261 return true; 261 return true;
262 } 262 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/browser_theme_pack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698