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

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

Issue 10916276: sync: add Google API Key to all ClientToServerMessages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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/download_updates_command.h" 5 #include "sync/engine/download_updates_command.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "sync/engine/syncer.h" 10 #include "sync/engine/syncer.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // this to false, the server would send just the non-container items 102 // this to false, the server would send just the non-container items
103 // (e.g. Bookmark URLs but not their containing folders). 103 // (e.g. Bookmark URLs but not their containing folders).
104 get_updates->set_fetch_folders(true); 104 get_updates->set_fetch_folders(true);
105 105
106 // Set GetUpdatesMessage.GetUpdatesCallerInfo information. 106 // Set GetUpdatesMessage.GetUpdatesCallerInfo information.
107 get_updates->mutable_caller_info()->set_source( 107 get_updates->mutable_caller_info()->set_source(
108 session->source().updates_source); 108 session->source().updates_source);
109 get_updates->mutable_caller_info()->set_notifications_enabled( 109 get_updates->mutable_caller_info()->set_notifications_enabled(
110 session->context()->notifications_enabled()); 110 session->context()->notifications_enabled());
111 111
112 SyncerProtoUtil::SetProtocolVersion(&client_to_server_message);
113 SyncerProtoUtil::AddRequestBirthday(dir, &client_to_server_message);
114 SyncerProtoUtil::AddBagOfChips(dir, &client_to_server_message);
115
116 DebugInfo* debug_info = client_to_server_message.mutable_debug_info(); 112 DebugInfo* debug_info = client_to_server_message.mutable_debug_info();
117 113
118 AppendClientDebugInfoIfNeeded(session, debug_info); 114 AppendClientDebugInfoIfNeeded(session, debug_info);
119 115
120 SyncerError result = SyncerProtoUtil::PostClientToServerMessage( 116 SyncerError result = SyncerProtoUtil::PostClientToServerMessage(
121 client_to_server_message, 117 &client_to_server_message,
122 &update_response, 118 &update_response,
123 session); 119 session);
124 120
125 DVLOG(2) << SyncerProtoUtil::ClientToServerResponseDebugString( 121 DVLOG(2) << SyncerProtoUtil::ClientToServerResponseDebugString(
126 update_response); 122 update_response);
127 123
128 StatusController* status = session->mutable_status_controller(); 124 StatusController* status = session->mutable_status_controller();
129 status->set_updates_request_types(enabled_types); 125 status->set_updates_request_types(enabled_types);
130 if (result != SYNCER_OK) { 126 if (result != SYNCER_OK) {
131 status->mutable_updates_response()->Clear(); 127 status->mutable_updates_response()->Clear();
(...skipping 27 matching lines...) Expand all
159 // could be null in some unit tests. 155 // could be null in some unit tests.
160 if (session->context()->debug_info_getter()) { 156 if (session->context()->debug_info_getter()) {
161 session->context()->debug_info_getter()->GetAndClearDebugInfo( 157 session->context()->debug_info_getter()->GetAndClearDebugInfo(
162 debug_info); 158 debug_info);
163 } 159 }
164 session->mutable_status_controller()->set_debug_info_sent(); 160 session->mutable_status_controller()->set_debug_info_sent();
165 } 161 }
166 } 162 }
167 163
168 } // namespace syncer 164 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698