Chromium Code Reviews| 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/files/file_util.h" | |
| 8 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| 10 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 11 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 12 #include "crypto/sha2.h" | 13 #include "crypto/sha2.h" |
| 13 #include "net/base/escape.h" | 14 #include "net/base/escape.h" |
| 14 #include "net/http/http_request_headers.h" | 15 #include "net/http/http_request_headers.h" |
| 15 #include "url/url_util.h" | 16 #include "url/url_util.h" |
| 16 | 17 |
| 17 using base::Time; | 18 using base::Time; |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 | 503 |
| 503 // static | 504 // static |
| 504 void V4ProtocolManagerUtil::SetClientInfoFromConfig( | 505 void V4ProtocolManagerUtil::SetClientInfoFromConfig( |
| 505 ClientInfo* client_info, | 506 ClientInfo* client_info, |
| 506 const V4ProtocolConfig& config) { | 507 const V4ProtocolConfig& config) { |
| 507 DCHECK(client_info); | 508 DCHECK(client_info); |
| 508 client_info->set_client_id(config.client_name); | 509 client_info->set_client_id(config.client_name); |
| 509 client_info->set_client_version(config.version); | 510 client_info->set_client_version(config.version); |
| 510 } | 511 } |
| 511 | 512 |
| 513 // static | |
| 514 int64_t V4ProtocolManagerUtil::GetFileSizeOrZero( | |
| 515 const base::FilePath& file_path) { | |
| 516 int64_t size_64; | |
|
Scott Hess - ex-Googler
2016/10/21 23:36:45
Maybe strip the _64 while you're at it. I don't r
vakh (use Gerrit instead)
2016/10/24 19:39:32
Done.
| |
| 517 if (!base::GetFileSize(file_path, &size_64)) | |
| 518 return 0; | |
| 519 return size_64; | |
| 520 } | |
| 521 | |
| 512 } // namespace safe_browsing | 522 } // namespace safe_browsing |
| OLD | NEW |