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

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 6270006: Revert 72685 - [SYNC] Refactor SyncSourceInfo and add support in chrome inval... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/download_updates_command.cc ('k') | chrome/browser/sync/engine/syncer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
===================================================================
--- chrome/browser/sync/engine/syncapi.cc (revision 72686)
+++ chrome/browser/sync/engine/syncapi.cc (working copy)
@@ -41,7 +41,6 @@
#include "chrome/browser/sync/protocol/sync.pb.h"
#include "chrome/browser/sync/protocol/theme_specifics.pb.h"
#include "chrome/browser/sync/protocol/typed_url_specifics.pb.h"
-#include "chrome/browser/sync/sessions/sync_session.h"
#include "chrome/browser/sync/sessions/sync_session_context.h"
#include "chrome/browser/sync/syncable/autofill_migration.h"
#include "chrome/browser/sync/syncable/directory_manager.h"
@@ -84,7 +83,6 @@
static const int kThreadExitTimeoutMsec = 60000;
static const int kSSLPort = 443;
-static const int kSyncerThreadDelayMsec = 250;
#if defined(OS_CHROMEOS)
static const int kChromeOSNetworkChangeReactionDelayHackMsec = 5000;
@@ -2195,29 +2193,22 @@
void SyncManager::SyncInternal::OnIncomingNotification(
const IncomingNotificationData& notification_data) {
- browser_sync::sessions::TypePayloadMap model_types_with_payloads;
+ syncable::ModelTypeBitSet model_types;
// Check if the service url is a sync URL. An empty service URL is
// treated as a legacy sync notification. If we're listening to
// server-issued notifications, no need to check the service_url.
if (notifier_options_.notification_method ==
notifier::NOTIFICATION_SERVER) {
- VLOG(1) << "Sync received server notification from " <<
- notification_data.service_url << ": " <<
+ VLOG(1) << "Sync received server notification: " <<
notification_data.service_specific_data;
- syncable::ModelTypeBitSet model_types;
- const std::string& model_type_list = notification_data.service_url;
- const std::string& notification_payload =
- notification_data.service_specific_data;
- if (!syncable::ModelTypeBitSetFromString(model_type_list, &model_types)) {
+ if (!syncable::ModelTypeBitSetFromString(
+ notification_data.service_specific_data,
+ &model_types)) {
LOG(DFATAL) << "Could not extract model types from server data.";
model_types.set();
}
-
- model_types_with_payloads =
- browser_sync::sessions::ModelTypeBitSetToTypePayloadMap(
- model_types, notification_payload);
} else if (notification_data.service_url.empty() ||
(notification_data.service_url ==
browser_sync::kSyncLegacyServiceUrl) ||
@@ -2225,24 +2216,20 @@
browser_sync::kSyncServiceUrl)) {
VLOG(1) << "Sync received P2P notification.";
- // Catch for sync integration tests (uses p2p). Just set all enabled
- // datatypes.
- ModelSafeRoutingInfo routes;
- registrar_->GetModelSafeRoutingInfo(&routes);
- model_types_with_payloads =
- browser_sync::sessions::RoutingInfoToTypePayloadMap(routes,
- std::string());
+ // Catch for sync integration tests (uses p2p). Just set all datatypes.
+ model_types.set();
} else {
LOG(WARNING) << "Notification fron unexpected source: "
<< notification_data.service_url;
}
- if (!model_types_with_payloads.empty()) {
+ if (model_types.any()) {
if (syncer_thread()) {
- syncer_thread()->NudgeSyncerWithPayloads(
- kSyncerThreadDelayMsec,
- SyncerThread::kNotification,
- model_types_with_payloads);
+ // Introduce a delay to help coalesce initial notifications.
+ syncer_thread()->NudgeSyncerWithDataTypes(
+ 250,
+ SyncerThread::kNotification,
+ model_types);
}
allstatus_.IncrementNotificationsReceived();
} else {
« no previous file with comments | « chrome/browser/sync/engine/download_updates_command.cc ('k') | chrome/browser/sync/engine/syncer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698