| 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 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |