OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/safe_browsing/protocol_manager.h" | 5 #include "chrome/browser/safe_browsing/protocol_manager.h" |
6 | 6 |
7 #ifndef NDEBUG | 7 #ifndef NDEBUG |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #endif | 9 #endif |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 scoped_ptr<SBChunkList> chunks(new SBChunkList); | 425 scoped_ptr<SBChunkList> chunks(new SBChunkList); |
426 UMA_HISTOGRAM_COUNTS("SB2.ChunkSize", length); | 426 UMA_HISTOGRAM_COUNTS("SB2.ChunkSize", length); |
427 update_size_ += length; | 427 update_size_ += length; |
428 if (!parser.ParseChunk(chunk_url.list_name, data, length, | 428 if (!parser.ParseChunk(chunk_url.list_name, data, length, |
429 client_key_, chunk_url.mac, | 429 client_key_, chunk_url.mac, |
430 &re_key, chunks.get())) { | 430 &re_key, chunks.get())) { |
431 #ifndef NDEBUG | 431 #ifndef NDEBUG |
432 std::string data_str; | 432 std::string data_str; |
433 data_str.assign(data, length); | 433 data_str.assign(data, length); |
434 std::string encoded_chunk; | 434 std::string encoded_chunk; |
435 base::Base64Encode(data, &encoded_chunk); | 435 base::Base64Encode(data_str, &encoded_chunk); |
436 VLOG(1) << "ParseChunk error for chunk: " << chunk_url.url | 436 VLOG(1) << "ParseChunk error for chunk: " << chunk_url.url |
437 << ", client_key: " << client_key_ | 437 << ", client_key: " << client_key_ |
438 << ", wrapped_key: " << wrapped_key_ | 438 << ", wrapped_key: " << wrapped_key_ |
439 << ", mac: " << chunk_url.mac | 439 << ", mac: " << chunk_url.mac |
440 << ", Base64Encode(data): " << encoded_chunk | 440 << ", Base64Encode(data): " << encoded_chunk |
441 << ", length: " << length; | 441 << ", length: " << length; |
442 #endif | 442 #endif |
443 return false; | 443 return false; |
444 } | 444 } |
445 | 445 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 if (!additional_query_.empty()) { | 832 if (!additional_query_.empty()) { |
833 if (next_url.find("?") != std::string::npos) { | 833 if (next_url.find("?") != std::string::npos) { |
834 next_url.append("&"); | 834 next_url.append("&"); |
835 } else { | 835 } else { |
836 next_url.append("?"); | 836 next_url.append("?"); |
837 } | 837 } |
838 next_url.append(additional_query_); | 838 next_url.append(additional_query_); |
839 } | 839 } |
840 return GURL(next_url); | 840 return GURL(next_url); |
841 } | 841 } |
OLD | NEW |