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

Side by Side Diff: chrome/browser/history/expire_history_backend.cc

Issue 8384024: HQP Refactoring (in Preparation for SQLite Cache) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 "chrome/browser/history/expire_history_backend.h" 5 #include "chrome/browser/history/expire_history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 void ExpireHistoryBackend::BroadcastDeleteNotifications( 335 void ExpireHistoryBackend::BroadcastDeleteNotifications(
336 DeleteDependencies* dependencies) { 336 DeleteDependencies* dependencies) {
337 if (!dependencies->deleted_urls.empty()) { 337 if (!dependencies->deleted_urls.empty()) {
338 // Broadcast the URL deleted notification. Note that we also broadcast when 338 // Broadcast the URL deleted notification. Note that we also broadcast when
339 // we were requested to delete everything even if that was a NOP, since 339 // we were requested to delete everything even if that was a NOP, since
340 // some components care to know when history is deleted (it's up to them to 340 // some components care to know when history is deleted (it's up to them to
341 // determine if they care whether anything was deleted). 341 // determine if they care whether anything was deleted).
342 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; 342 URLsDeletedDetails* deleted_details = new URLsDeletedDetails;
343 deleted_details->all_history = false; 343 deleted_details->all_history = false;
344 for (size_t i = 0; i < dependencies->deleted_urls.size(); i++) 344 for (size_t i = 0; i < dependencies->deleted_urls.size(); i++) {
345 deleted_details->rows.push_back(dependencies->deleted_urls[i]);
345 deleted_details->urls.insert(dependencies->deleted_urls[i].url()); 346 deleted_details->urls.insert(dependencies->deleted_urls[i].url());
347 }
346 delegate_->BroadcastNotifications( 348 delegate_->BroadcastNotifications(
347 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); 349 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details);
348 } 350 }
349 } 351 }
350 352
351 void ExpireHistoryBackend::DeleteVisitRelatedInfo( 353 void ExpireHistoryBackend::DeleteVisitRelatedInfo(
352 const VisitVector& visits, 354 const VisitVector& visits,
353 DeleteDependencies* dependencies) { 355 DeleteDependencies* dependencies) {
354 for (size_t i = 0; i < visits.size(); i++) { 356 for (size_t i = 0; i < visits.size(); i++) {
355 // Delete the visit itself. 357 // Delete the visit itself.
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 // We use the bookmark service to determine if a URL is bookmarked. The 699 // We use the bookmark service to determine if a URL is bookmarked. The
698 // bookmark service is loaded on a separate thread and may not be done by the 700 // bookmark service is loaded on a separate thread and may not be done by the
699 // time we get here. We therefor block until the bookmarks have finished 701 // time we get here. We therefor block until the bookmarks have finished
700 // loading. 702 // loading.
701 if (bookmark_service_) 703 if (bookmark_service_)
702 bookmark_service_->BlockTillLoaded(); 704 bookmark_service_->BlockTillLoaded();
703 return bookmark_service_; 705 return bookmark_service_;
704 } 706 }
705 707
706 } // namespace history 708 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider_unittest.cc ('k') | chrome/browser/history/history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698