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

Unified Diff: chrome/browser/sync/glue/typed_url_change_processor.cc

Issue 10257026: Log UMA stats on Typed URL DB errors instead of stopping sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compilation err. Created 8 years, 8 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 | « no previous file | chrome/browser/sync/glue/typed_url_model_associator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/typed_url_change_processor.cc
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc
index 69933e0a381dc6d542b08b0e25e420a3d8f79565..2e6d6fb0fe6304c10f66ee02cd26cd22dff2929d 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/sync/glue/typed_url_change_processor.h"
#include "base/location.h"
+#include "base/metrics/histogram.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/history/history_backend.h"
@@ -79,6 +80,8 @@ void TypedUrlChangeProcessor::Observe(
HandleURLsVisited(
content::Details<history::URLVisitedDetails>(details).ptr());
}
+ UMA_HISTOGRAM_PERCENTAGE("Sync.TypedUrlChangeProcessorErrors",
+ model_associator_->GetErrorPercentage());
}
void TypedUrlChangeProcessor::HandleURLsModified(
@@ -100,7 +103,7 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode(
DCHECK_GT(url.typed_count(), 0);
// Get the visits for this node.
history::VisitVector visit_vector;
- if (!TypedUrlModelAssociator::FixupURLAndGetVisits(
+ if (!model_associator_->FixupURLAndGetVisits(
history_backend_, &url, &visit_vector)) {
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"Could not get the url's visits.");
@@ -249,14 +252,9 @@ void TypedUrlChangeProcessor::ApplyChangesFromSyncModel(
continue;
}
- SyncError error = model_associator_->UpdateFromSyncDB(
+ model_associator_->UpdateFromSyncDB(
filtered_url, &pending_new_visits_, &pending_deleted_visits_,
&pending_updated_urls_, &pending_new_urls_);
- if (error.IsSet()) {
- error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
- "Could not get existing url's visits.");
- return;
- }
}
}
@@ -271,23 +269,18 @@ void TypedUrlChangeProcessor::CommitChangesFromSyncModel() {
if (!pending_deleted_urls_.empty())
history_backend_->DeleteURLs(pending_deleted_urls_);
- SyncError error = model_associator_->WriteToHistoryBackend(
- &pending_new_urls_,
- &pending_updated_urls_,
- &pending_new_visits_,
- &pending_deleted_visits_);
-
- if (error.IsSet()) {
- error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
- "Could not write to the history backend.");
- return;
- }
+ model_associator_->WriteToHistoryBackend(&pending_new_urls_,
+ &pending_updated_urls_,
+ &pending_new_visits_,
+ &pending_deleted_visits_);
pending_new_urls_.clear();
pending_updated_urls_.clear();
pending_new_visits_.clear();
pending_deleted_visits_.clear();
pending_deleted_urls_.clear();
+ UMA_HISTOGRAM_PERCENTAGE("Sync.TypedUrlChangeProcessorErrors",
+ model_associator_->GetErrorPercentage());
}
void TypedUrlChangeProcessor::StartImpl(Profile* profile) {
« no previous file with comments | « no previous file | chrome/browser/sync/glue/typed_url_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698