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

Side by Side Diff: components/safe_browsing_db/v4_update_protocol_manager.cc

Issue 2241863004: Enable support for Rice encoding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_checksum_errors
Patch Set: Enable Chrome to request Rice encoding Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/safe_browsing_db/v4_update_protocol_manager.h" 5 #include "components/safe_browsing_db/v4_update_protocol_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base64url.h" 9 #include "base/base64url.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ListUpdateRequest* list_update_request = request.add_list_update_requests(); 205 ListUpdateRequest* list_update_request = request.add_list_update_requests();
206 list_update_request->set_platform_type(list_to_update.platform_type); 206 list_update_request->set_platform_type(list_to_update.platform_type);
207 list_update_request->set_threat_entry_type( 207 list_update_request->set_threat_entry_type(
208 list_to_update.threat_entry_type); 208 list_to_update.threat_entry_type);
209 list_update_request->set_threat_type(list_to_update.threat_type); 209 list_update_request->set_threat_type(list_to_update.threat_type);
210 210
211 if (!state.empty()) { 211 if (!state.empty()) {
212 list_update_request->set_state(state); 212 list_update_request->set_state(state);
213 } 213 }
214 214
215 // TODO(vakh): Accept other compression formats also. 215 // TODO(vakh): Accept other compression formats also.
Nathan Parker 2016/08/19 00:18:22 remove todo
vakh (use Gerrit instead) 2016/08/19 00:46:35 Done.
216 // See: https://bugs.chromium.org/p/chromium/issues/detail?id=624567 216 // See: https://bugs.chromium.org/p/chromium/issues/detail?id=624567
217 list_update_request->mutable_constraints()->add_supported_compressions(RAW); 217 list_update_request->mutable_constraints()->add_supported_compressions(RAW);
218 list_update_request->mutable_constraints()->add_supported_compressions(
Nathan Parker 2016/08/19 00:18:22 Are there any tests that is affects or should affe
vakh (use Gerrit instead) 2016/08/19 00:46:35 Good catch. Done.
219 RICE);
218 } 220 }
219 221
220 // Serialize and Base64 encode. 222 // Serialize and Base64 encode.
221 std::string req_data, req_base64; 223 std::string req_data, req_base64;
222 request.SerializeToString(&req_data); 224 request.SerializeToString(&req_data);
223 base::Base64UrlEncode(req_data, base::Base64UrlEncodePolicy::INCLUDE_PADDING, 225 base::Base64UrlEncode(req_data, base::Base64UrlEncodePolicy::INCLUDE_PADDING,
224 &req_base64); 226 &req_base64);
225 return req_base64; 227 return req_base64;
226 } 228 }
227 229
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 351
350 void V4UpdateProtocolManager::GetUpdateUrlAndHeaders( 352 void V4UpdateProtocolManager::GetUpdateUrlAndHeaders(
351 const std::string& req_base64, 353 const std::string& req_base64,
352 GURL* gurl, 354 GURL* gurl,
353 net::HttpRequestHeaders* headers) const { 355 net::HttpRequestHeaders* headers) const {
354 V4ProtocolManagerUtil::GetRequestUrlAndHeaders( 356 V4ProtocolManagerUtil::GetRequestUrlAndHeaders(
355 req_base64, "threatListUpdates:fetch", config_, gurl, headers); 357 req_base64, "threatListUpdates:fetch", config_, gurl, headers);
356 } 358 }
357 359
358 } // namespace safe_browsing 360 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698