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

Unified Diff: sync/syncable/directory.cc

Issue 1275743002: [Sync] Remove backend unrecoverable error handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leak Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/syncable/directory.h ('k') | sync/syncable/directory_unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index 720a924e4a6b801a802e55ad825834e7e2509542..9d959e64193a95288541841a4f58dbdf68083223 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -103,11 +103,12 @@ Directory::Kernel::~Kernel() {
metahandles_map.end());
}
-Directory::Directory(DirectoryBackingStore* store,
- UnrecoverableErrorHandler* unrecoverable_error_handler,
- const base::Closure& report_unrecoverable_error_function,
- NigoriHandler* nigori_handler,
- Cryptographer* cryptographer)
+Directory::Directory(
+ DirectoryBackingStore* store,
+ const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler,
+ const base::Closure& report_unrecoverable_error_function,
+ NigoriHandler* nigori_handler,
+ Cryptographer* cryptographer)
: kernel_(NULL),
store_(store),
unrecoverable_error_handler_(unrecoverable_error_handler),
@@ -116,8 +117,7 @@ Directory::Directory(DirectoryBackingStore* store,
nigori_handler_(nigori_handler),
cryptographer_(cryptographer),
invariant_check_level_(VERIFY_CHANGES),
- weak_ptr_factory_(this) {
-}
+ weak_ptr_factory_(this) {}
Directory::~Directory() {
Close();
@@ -231,8 +231,9 @@ void Directory::OnUnrecoverableError(const BaseTransaction* trans,
const std::string & message) {
DCHECK(trans != NULL);
unrecoverable_error_set_ = true;
- unrecoverable_error_handler_->OnUnrecoverableError(location,
- message);
+ unrecoverable_error_handler_.Call(
+ FROM_HERE, &UnrecoverableErrorHandler::OnUnrecoverableError, location,
+ message);
}
EntryKernel* Directory::GetEntryById(const Id& id) {
« no previous file with comments | « sync/syncable/directory.h ('k') | sync/syncable/directory_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698