OLD | NEW |
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 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // |delegate_| may be NULL if |this| is in the process of closing (closed by | 2075 // |delegate_| may be NULL if |this| is in the process of closing (closed by |
2076 // HistoryService -> HistroyBackend::Closing(). | 2076 // HistoryService -> HistroyBackend::Closing(). |
2077 if (delegate_.get()) | 2077 if (delegate_.get()) |
2078 delegate_->BroadcastNotifications(type, details_deleted); | 2078 delegate_->BroadcastNotifications(type, details_deleted); |
| 2079 else |
| 2080 delete details_deleted; |
2079 } | 2081 } |
2080 | 2082 |
2081 // Deleting -------------------------------------------------------------------- | 2083 // Deleting -------------------------------------------------------------------- |
2082 | 2084 |
2083 void HistoryBackend::DeleteAllHistory() { | 2085 void HistoryBackend::DeleteAllHistory() { |
2084 // Our approach to deleting all history is: | 2086 // Our approach to deleting all history is: |
2085 // 1. Copy the bookmarks and their dependencies to new tables with temporary | 2087 // 1. Copy the bookmarks and their dependencies to new tables with temporary |
2086 // names. | 2088 // names. |
2087 // 2. Delete the original tables. Since tables can not share pages, we know | 2089 // 2. Delete the original tables. Since tables can not share pages, we know |
2088 // that any data we don't want to keep is now in an unused page. | 2090 // 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 Loading... |
2301 break; | 2303 break; |
2302 } | 2304 } |
2303 } | 2305 } |
2304 } | 2306 } |
2305 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name | 2307 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name |
2306 TimeTicks::Now() - beginning_time); | 2308 TimeTicks::Now() - beginning_time); |
2307 return success; | 2309 return success; |
2308 } | 2310 } |
2309 | 2311 |
2310 } // namespace history | 2312 } // namespace history |
OLD | NEW |