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

Side by Side Diff: trunk/src/chrome/browser/history/in_memory_url_index.cc

Issue 416543006: Revert 284958 "Make HistoryDBTask not refcounted, and ensure it'..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 "chrome/browser/history/in_memory_url_index.h" 5 #include "chrome/browser/history/in_memory_url_index.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 } 290 }
291 291
292 // Restoring from the History DB ----------------------------------------------- 292 // Restoring from the History DB -----------------------------------------------
293 293
294 void InMemoryURLIndex::ScheduleRebuildFromHistory() { 294 void InMemoryURLIndex::ScheduleRebuildFromHistory() {
295 HistoryService* service = 295 HistoryService* service =
296 HistoryServiceFactory::GetForProfile(profile_, 296 HistoryServiceFactory::GetForProfile(profile_,
297 Profile::EXPLICIT_ACCESS); 297 Profile::EXPLICIT_ACCESS);
298 service->ScheduleDBTask( 298 service->ScheduleDBTask(
299 scoped_ptr<history::HistoryDBTask>( 299 new InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask(
300 new InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask( 300 this, languages_, scheme_whitelist_),
301 this, languages_, scheme_whitelist_)),
302 &cache_reader_tracker_); 301 &cache_reader_tracker_);
303 } 302 }
304 303
305 void InMemoryURLIndex::DoneRebuidingPrivateDataFromHistoryDB( 304 void InMemoryURLIndex::DoneRebuidingPrivateDataFromHistoryDB(
306 bool succeeded, 305 bool succeeded,
307 scoped_refptr<URLIndexPrivateData> private_data) { 306 scoped_refptr<URLIndexPrivateData> private_data) {
308 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 307 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
309 if (succeeded) { 308 if (succeeded) {
310 private_data_tracker_.TryCancelAll(); 309 private_data_tracker_.TryCancelAll();
311 private_data_ = private_data; 310 private_data_ = private_data;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 base::Bind(DeleteCacheFile, path)); 351 base::Bind(DeleteCacheFile, path));
353 } 352 }
354 } 353 }
355 354
356 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) { 355 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) {
357 if (save_cache_observer_) 356 if (save_cache_observer_)
358 save_cache_observer_->OnCacheSaveFinished(succeeded); 357 save_cache_observer_->OnCacheSaveFinished(succeeded);
359 } 358 }
360 359
361 } // namespace history 360 } // namespace history
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/history/history_unittest.cc ('k') | trunk/src/chrome/browser/history/top_sites_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698