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

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

Issue 126137: Part 1 of merging Extensions and DOMUI (Closed)
Patch Set: add test and rebase Created 11 years, 5 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
« no previous file with comments | « chrome/browser/blocked_popup_container.cc ('k') | chrome/browser/browser.h » ('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) 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/json_writer.h" 10 #include "base/json_writer.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // This happens in unit tests. 178 // This happens in unit tests.
179 if (model_) 179 if (model_)
180 model_->DoneLoading(details_.release()); 180 model_->DoneLoading(details_.release());
181 return; 181 return;
182 } 182 }
183 if (!history->backend_loaded()) { 183 if (!history->backend_loaded()) {
184 // The backend isn't finished loading. Wait for it. 184 // The backend isn't finished loading. Wait for it.
185 notification_registrar_.Add(this, NotificationType::HISTORY_LOADED, 185 notification_registrar_.Add(this, NotificationType::HISTORY_LOADED,
186 Source<Profile>(profile_)); 186 Source<Profile>(profile_));
187 } else { 187 } else {
188 DoLoadBookmarks(tmp_history_path_); 188 OnHistoryFinishedWriting();
189 } 189 }
190 } 190 }
191 191
192 void BookmarkStorage::OnHistoryFinishedWriting() { 192 void BookmarkStorage::OnHistoryFinishedWriting() {
193 notification_registrar_.Remove(this, NotificationType::HISTORY_LOADED, 193 notification_registrar_.Remove(this, NotificationType::HISTORY_LOADED,
194 Source<Profile>(profile_)); 194 Source<Profile>(profile_));
195 195
196 // This is used when migrating bookmarks data from database to file. 196 // This is used when migrating bookmarks data from database to file.
197 // History wrote the file for us, and now we want to load data from it. 197 // History wrote the file for us, and now we want to load data from it.
198 DoLoadBookmarks(tmp_history_path_); 198 DoLoadBookmarks(tmp_history_path_);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 276
277 void BookmarkStorage::RunTaskOnBackendThread(Task* task) const { 277 void BookmarkStorage::RunTaskOnBackendThread(Task* task) const {
278 if (backend_thread()) { 278 if (backend_thread()) {
279 backend_thread()->message_loop()->PostTask(FROM_HERE, task); 279 backend_thread()->message_loop()->PostTask(FROM_HERE, task);
280 } else { 280 } else {
281 task->Run(); 281 task->Run();
282 delete task; 282 delete task;
283 } 283 }
284 } 284 }
OLDNEW
« no previous file with comments | « chrome/browser/blocked_popup_container.cc ('k') | chrome/browser/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698