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

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

Issue 8341087: HistoryBackend: Fix a crash in BroadcastNotification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix. 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
« no previous file with comments | « no previous file | no next file » | 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) 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/history_backend.h" 5 #include "chrome/browser/history/history_backend.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 db_task_requests_.push_back(request.get()); 2065 db_task_requests_.push_back(request.get());
2066 if (!task_scheduled) { 2066 if (!task_scheduled) {
2067 // No other tasks are scheduled. Process request now. 2067 // No other tasks are scheduled. Process request now.
2068 ProcessDBTaskImpl(); 2068 ProcessDBTaskImpl();
2069 } 2069 }
2070 } 2070 }
2071 2071
2072 void HistoryBackend::BroadcastNotifications( 2072 void HistoryBackend::BroadcastNotifications(
2073 int type, 2073 int type,
2074 HistoryDetails* details_deleted) { 2074 HistoryDetails* details_deleted) {
2075 DCHECK(delegate_.get()); 2075 // |delegate_| may be NULL if |this| is in the process of closing (closed by
2076 delegate_->BroadcastNotifications(type, details_deleted); 2076 // HistoryService -> HistroyBackend::Closing().
2077 if (delegate_.get())
2078 delegate_->BroadcastNotifications(type, details_deleted);
2077 } 2079 }
2078 2080
2079 // Deleting -------------------------------------------------------------------- 2081 // Deleting --------------------------------------------------------------------
2080 2082
2081 void HistoryBackend::DeleteAllHistory() { 2083 void HistoryBackend::DeleteAllHistory() {
2082 // Our approach to deleting all history is: 2084 // Our approach to deleting all history is:
2083 // 1. Copy the bookmarks and their dependencies to new tables with temporary 2085 // 1. Copy the bookmarks and their dependencies to new tables with temporary
2084 // names. 2086 // names.
2085 // 2. Delete the original tables. Since tables can not share pages, we know 2087 // 2. Delete the original tables. Since tables can not share pages, we know
2086 // that any data we don't want to keep is now in an unused page. 2088 // that any data we don't want to keep is now in an unused page.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 break; 2301 break;
2300 } 2302 }
2301 } 2303 }
2302 } 2304 }
2303 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name 2305 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name
2304 TimeTicks::Now() - beginning_time); 2306 TimeTicks::Now() - beginning_time);
2305 return success; 2307 return success;
2306 } 2308 }
2307 2309
2308 } // namespace history 2310 } // namespace history
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698