| 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 // Parse the data returned from the SafeBrowsing v2.1 protocol response. | 5 // Parse the data returned from the SafeBrowsing v2.1 protocol response. |
| 6 | 6 |
| 7 // TODOv3(shess): Review these changes carefully. | 7 // TODOv3(shess): Review these changes carefully. |
| 8 | 8 |
| 9 #include "chrome/browser/safe_browsing/protocol_parser.h" | 9 #include "chrome/browser/safe_browsing/protocol_parser.h" |
| 10 | 10 |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 #include <stdlib.h> | 12 #include <stdlib.h> |
| 13 #include <utility> | 13 #include <utility> |
| 14 | 14 |
| 15 #include "base/format_macros.h" | 15 #include "base/format_macros.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 19 #include "base/strings/string_split.h" | 19 #include "base/strings/string_split.h" |
| 20 #include "base/strings/stringprintf.h" | |
| 21 #include "base/sys_byteorder.h" | 20 #include "base/sys_byteorder.h" |
| 22 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 23 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 24 #include "components/safe_browsing_db/metadata.pb.h" | 23 #include "components/safe_browsing_db/metadata.pb.h" |
| 25 | 24 |
| 26 namespace safe_browsing { | 25 namespace safe_browsing { |
| 27 | 26 |
| 28 namespace { | 27 namespace { |
| 29 | 28 |
| 30 // Helper class for scanning a buffer. | 29 // Helper class for scanning a buffer. |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 if (!list.adds.empty() && !list.subs.empty()) | 459 if (!list.adds.empty() && !list.subs.empty()) |
| 461 formatted_results.append(":"); | 460 formatted_results.append(":"); |
| 462 if (!list.subs.empty()) | 461 if (!list.subs.empty()) |
| 463 formatted_results.append("s:").append(list.subs); | 462 formatted_results.append("s:").append(list.subs); |
| 464 formatted_results.append("\n"); | 463 formatted_results.append("\n"); |
| 465 | 464 |
| 466 return formatted_results; | 465 return formatted_results; |
| 467 } | 466 } |
| 468 | 467 |
| 469 } // namespace safe_browsing | 468 } // namespace safe_browsing |
| OLD | NEW |