OLD | NEW |
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 DCHECK(!msg->get_updates().has_from_timestamp()); // Deprecated. | 356 DCHECK(!msg->get_updates().has_from_timestamp()); // Deprecated. |
357 DCHECK(!msg->get_updates().has_requested_types()); // Deprecated. | 357 DCHECK(!msg->get_updates().has_requested_types()); // Deprecated. |
358 | 358 |
359 // Add must-have fields. | 359 // Add must-have fields. |
360 SetProtocolVersion(msg); | 360 SetProtocolVersion(msg); |
361 AddRequestBirthday(session->context()->directory(), msg); | 361 AddRequestBirthday(session->context()->directory(), msg); |
362 DCHECK(msg->has_store_birthday() || IsVeryFirstGetUpdates(*msg)); | 362 DCHECK(msg->has_store_birthday() || IsVeryFirstGetUpdates(*msg)); |
363 AddBagOfChips(session->context()->directory(), msg); | 363 AddBagOfChips(session->context()->directory(), msg); |
364 msg->set_api_key(google_apis::GetAPIKey()); | 364 msg->set_api_key(google_apis::GetAPIKey()); |
365 msg->mutable_client_status()->CopyFrom(session->context()->client_status()); | 365 msg->mutable_client_status()->CopyFrom(session->context()->client_status()); |
| 366 msg->set_invalidator_client_id(session->context()->invalidator_client_id()); |
366 | 367 |
367 syncable::Directory* dir = session->context()->directory(); | 368 syncable::Directory* dir = session->context()->directory(); |
368 | 369 |
369 LogClientToServerMessage(*msg); | 370 LogClientToServerMessage(*msg); |
370 session->context()->traffic_recorder()->RecordClientToServerMessage(*msg); | 371 session->context()->traffic_recorder()->RecordClientToServerMessage(*msg); |
371 if (!PostAndProcessHeaders(session->context()->connection_manager(), session, | 372 if (!PostAndProcessHeaders(session->context()->connection_manager(), session, |
372 *msg, response)) { | 373 *msg, response)) { |
373 // There was an error establishing communication with the server. | 374 // There was an error establishing communication with the server. |
374 // We can not proceed beyond this point. | 375 // We can not proceed beyond this point. |
375 const HttpResponse::ServerConnectionCode server_status = | 376 const HttpResponse::ServerConnectionCode server_status = |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 std::string SyncerProtoUtil::ClientToServerResponseDebugString( | 604 std::string SyncerProtoUtil::ClientToServerResponseDebugString( |
604 const ClientToServerResponse& response) { | 605 const ClientToServerResponse& response) { |
605 // Add more handlers as needed. | 606 // Add more handlers as needed. |
606 std::string output; | 607 std::string output; |
607 if (response.has_get_updates()) | 608 if (response.has_get_updates()) |
608 output.append(GetUpdatesResponseString(response.get_updates())); | 609 output.append(GetUpdatesResponseString(response.get_updates())); |
609 return output; | 610 return output; |
610 } | 611 } |
611 | 612 |
612 } // namespace syncer | 613 } // namespace syncer |
OLD | NEW |