| OLD | NEW |
| 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_protocol_manager_util.h" | 5 #include "components/safe_browsing_db/v4_protocol_manager_util.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 paths->push_back(std::string(path.begin(), i + 1)); | 489 paths->push_back(std::string(path.begin(), i + 1)); |
| 490 } | 490 } |
| 491 | 491 |
| 492 if (!paths->empty() && paths->back() != path) | 492 if (!paths->empty() && paths->back() != path) |
| 493 paths->push_back(path); | 493 paths->push_back(path); |
| 494 | 494 |
| 495 if (!query.empty()) | 495 if (!query.empty()) |
| 496 paths->push_back(path + "?" + query); | 496 paths->push_back(path + "?" + query); |
| 497 } | 497 } |
| 498 | 498 |
| 499 // static |
| 500 void V4ProtocolManagerUtil::SetClientInfoFromConfig( |
| 501 ClientInfo* client_info, |
| 502 const V4ProtocolConfig& config) { |
| 503 DCHECK(client_info); |
| 504 client_info->set_client_id(config.client_name); |
| 505 client_info->set_client_version(config.version); |
| 506 } |
| 507 |
| 499 } // namespace safe_browsing | 508 } // namespace safe_browsing |
| OLD | NEW |