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

Unified Diff: components/sync/engine_impl/commit.cc

Issue 2380143002: [Sync] Enable Compression from Client to Server by experiment (Closed)
Patch Set: use experience to control compression Created 4 years, 2 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
Index: components/sync/engine_impl/commit.cc
diff --git a/components/sync/engine_impl/commit.cc b/components/sync/engine_impl/commit.cc
index abb8fc1b1c063969d0a9e732e098024b0bd4dc78..7c184326fa39e3ec005a34bbba0ea8e94c714120 100644
--- a/components/sync/engine_impl/commit.cc
+++ b/components/sync/engine_impl/commit.cc
@@ -7,10 +7,12 @@
#include <utility>
#include "base/metrics/sparse_histogram.h"
+#include "base/rand_util.h"
#include "base/trace_event/trace_event.h"
#include "components/sync/base/data_type_histogram.h"
#include "components/sync/engine/events/commit_request_event.h"
#include "components/sync/engine/events/commit_response_event.h"
+#include "components/sync/engine/net/http_bridge.h"
#include "components/sync/engine_impl/commit_processor.h"
#include "components/sync/engine_impl/commit_util.h"
#include "components/sync/engine_impl/cycle/sync_cycle.h"
@@ -56,6 +58,9 @@ Commit* Commit::Init(ModelTypeSet requested_types,
sync_pb::CommitMessage* commit_message = message.mutable_commit();
commit_message->set_cache_guid(cache_guid);
+ if (base::FeatureList::IsEnabled(syncer::kSyncClientToServerCompression)) {
+ commit_message->set_padding(base::RandBytesAsString(256));
Nicolas Zea 2016/10/18 20:23:08 prefer having the length defined at the top of fil
Gang Wu 2016/10/19 00:06:13 Done.
+ }
// Set extensions activity if bookmark commits are present.
ExtensionsActivity::Records extensions_activity_buffer;

Powered by Google App Engine
This is Rietveld 408576698