OLD | NEW |
1 // Copyright (c) 2011 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/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> |
11 | 11 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // to be one of these commits still pending and holding a reference. | 117 // to be one of these commits still pending and holding a reference. |
118 // | 118 // |
119 // The backend can call Cancel to have this task release the reference. The | 119 // The backend can call Cancel to have this task release the reference. The |
120 // task will still run (if we ever get to processing the event before | 120 // task will still run (if we ever get to processing the event before |
121 // shutdown), but it will not do anything. | 121 // shutdown), but it will not do anything. |
122 // | 122 // |
123 // Note that this is a refcounted object and is not a task in itself. It should | 123 // Note that this is a refcounted object and is not a task in itself. It should |
124 // be assigned to a RunnableMethod. | 124 // be assigned to a RunnableMethod. |
125 // | 125 // |
126 // TODO(brettw): bug 1165182: This should be replaced with a | 126 // TODO(brettw): bug 1165182: This should be replaced with a |
127 // ScopedRunnableMethodFactory which will handle everything automatically (like | 127 // base::WeakPtrFactory which will handle everything automatically (like we do |
128 // we do in ExpireHistoryBackend). | 128 // in ExpireHistoryBackend). |
129 class CommitLaterTask : public base::RefCounted<CommitLaterTask> { | 129 class CommitLaterTask : public base::RefCounted<CommitLaterTask> { |
130 public: | 130 public: |
131 explicit CommitLaterTask(HistoryBackend* history_backend) | 131 explicit CommitLaterTask(HistoryBackend* history_backend) |
132 : history_backend_(history_backend) { | 132 : history_backend_(history_backend) { |
133 } | 133 } |
134 | 134 |
135 // The backend will call this function if it is being destroyed so that we | 135 // The backend will call this function if it is being destroyed so that we |
136 // release our reference. | 136 // release our reference. |
137 void Cancel() { | 137 void Cancel() { |
138 history_backend_ = NULL; | 138 history_backend_ = NULL; |
(...skipping 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 break; | 2312 break; |
2313 } | 2313 } |
2314 } | 2314 } |
2315 } | 2315 } |
2316 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name | 2316 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name |
2317 TimeTicks::Now() - beginning_time); | 2317 TimeTicks::Now() - beginning_time); |
2318 return success; | 2318 return success; |
2319 } | 2319 } |
2320 | 2320 |
2321 } // namespace history | 2321 } // namespace history |
OLD | NEW |