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

Unified Diff: chrome/browser/history/history_backend.cc

Issue 8892023: Eliminated the last few uses of MessageLoop::QuitTask in chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more... Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_querying_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 18cc3cb1e54e654f12fd1a8fe3aa8ccd67c270b7..1fa9406a2ce6e7e36a402db44ebbed5ffcf64e26 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -9,6 +9,7 @@
#include <set>
#include <vector>
+#include "base/callback.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/file_util.h"
@@ -209,7 +210,6 @@ HistoryBackend::HistoryBackend(const FilePath& history_dir,
ALLOW_THIS_IN_INITIALIZER_LIST(expirer_(this, bookmark_service)),
recent_redirects_(kMaxRedirectCount),
backend_destroy_message_loop_(NULL),
- backend_destroy_task_(NULL),
segment_queried_(false),
bookmark_service_(bookmark_service) {
}
@@ -237,7 +237,7 @@ HistoryBackend::~HistoryBackend() {
text_database_.reset();
}
- if (backend_destroy_task_) {
+ if (!backend_destroy_task_.is_null()) {
// Notify an interested party (typically a unit test) that we're done.
DCHECK(backend_destroy_message_loop_);
backend_destroy_message_loop_->PostTask(FROM_HERE, backend_destroy_task_);
@@ -251,11 +251,9 @@ void HistoryBackend::Init(const std::string& languages, bool force_fail) {
}
void HistoryBackend::SetOnBackendDestroyTask(MessageLoop* message_loop,
- Task* task) {
- if (backend_destroy_task_) {
+ const base::Closure& task) {
+ if (!backend_destroy_task_.is_null())
DLOG(WARNING) << "Setting more than one destroy task, overriding";
- delete backend_destroy_task_;
- }
backend_destroy_message_loop_ = message_loop;
backend_destroy_task_ = task;
}
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_querying_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698