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

Side by Side Diff: sync/engine/syncer_proto_util.cc

Issue 14963002: sync: Report GetUpdate triggers to the server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix handling of NEW_CLIENT GU source Created 7 years, 7 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 unified diff | Download patch
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/engine/syncer_proto_util.h" 5 #include "sync/engine/syncer_proto_util.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "google_apis/google_api_keys.h" 9 #include "google_apis/google_api_keys.h"
10 #include "sync/engine/net/server_connection_manager.h" 10 #include "sync/engine/net/server_connection_manager.h"
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if (command.has_set_sync_poll_interval()) { 428 if (command.has_set_sync_poll_interval()) {
429 session->delegate()->OnReceivedShortPollIntervalUpdate( 429 session->delegate()->OnReceivedShortPollIntervalUpdate(
430 base::TimeDelta::FromSeconds(command.set_sync_poll_interval())); 430 base::TimeDelta::FromSeconds(command.set_sync_poll_interval()));
431 } 431 }
432 432
433 if (command.has_sessions_commit_delay_seconds()) { 433 if (command.has_sessions_commit_delay_seconds()) {
434 session->delegate()->OnReceivedSessionsCommitDelay( 434 session->delegate()->OnReceivedSessionsCommitDelay(
435 base::TimeDelta::FromSeconds( 435 base::TimeDelta::FromSeconds(
436 command.sessions_commit_delay_seconds())); 436 command.sessions_commit_delay_seconds()));
437 } 437 }
438
439 if (command.has_client_invalidation_hint_buffer_size()) {
440 session->delegate()->OnReceivedClientInvalidationHintBufferSize(
441 command.client_invalidation_hint_buffer_size());
442 }
438 } 443 }
439 444
440 // Now do any special handling for the error type and decide on the return 445 // Now do any special handling for the error type and decide on the return
441 // value. 446 // value.
442 switch (sync_protocol_error.error_type) { 447 switch (sync_protocol_error.error_type) {
443 case UNKNOWN_ERROR: 448 case UNKNOWN_ERROR:
444 LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " 449 LOG(WARNING) << "Sync protocol out-of-date. The server is using a more "
445 << "recent version."; 450 << "recent version.";
446 return SERVER_RETURN_UNKNOWN_ERROR; 451 return SERVER_RETURN_UNKNOWN_ERROR;
447 case SYNC_SUCCESS: 452 case SYNC_SUCCESS:
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 std::string SyncerProtoUtil::ClientToServerResponseDebugString( 619 std::string SyncerProtoUtil::ClientToServerResponseDebugString(
615 const ClientToServerResponse& response) { 620 const ClientToServerResponse& response) {
616 // Add more handlers as needed. 621 // Add more handlers as needed.
617 std::string output; 622 std::string output;
618 if (response.has_get_updates()) 623 if (response.has_get_updates())
619 output.append(GetUpdatesResponseString(response.get_updates())); 624 output.append(GetUpdatesResponseString(response.get_updates()));
620 return output; 625 return output;
621 } 626 }
622 627
623 } // namespace syncer 628 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698