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

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

Issue 9071001: base::Bind: Remove ScopedRunnableMethodFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 8 years, 11 months 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) 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/offline/offline_load_page.cc ('k') | chrome/browser/ui/panels/panel_browser_window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698