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

Side by Side Diff: chrome/browser/safe_browsing/protocol_parser.cc

Issue 3447008: base: Finish moving the SplitString functions from string_util.h to string_split.h (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: chromeos fixes Created 10 years, 3 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/safe_browsing/protocol_parser.h" 7 #include "chrome/browser/safe_browsing/protocol_parser.h"
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
11 #if defined(OS_WIN) 11 #if defined(OS_WIN)
12 #include <Winsock2.h> 12 #include <Winsock2.h>
13 #elif defined(OS_POSIX) 13 #elif defined(OS_POSIX)
14 #include <arpa/inet.h> 14 #include <arpa/inet.h>
15 #endif 15 #endif
16 16
17 #include "base/format_macros.h" 17 #include "base/format_macros.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/string_split.h"
19 #include "base/string_util.h" 20 #include "base/string_util.h"
20 21
21 namespace { 22 namespace {
22 // Helper function for quick scans of a line oriented protocol. Note that we use 23 // Helper function for quick scans of a line oriented protocol. Note that we use
23 // std::string::assign(const charT* s, size_type n) 24 // std::string::assign(const charT* s, size_type n)
24 // to copy data into 'line'. This form of 'assign' does not call strlen on 25 // to copy data into 'line'. This form of 'assign' does not call strlen on
25 // 'input', which is binary data and is not NULL terminated. 'input' may also 26 // 'input', which is binary data and is not NULL terminated. 'input' may also
26 // contain valid NULL bytes in the payload, which a strlen based copy would 27 // contain valid NULL bytes in the payload, which a strlen based copy would
27 // truncate. 28 // truncate.
28 bool GetLine(const char* input, int input_len, std::string* line) { 29 bool GetLine(const char* input, int input_len, std::string* line) {
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 484
484 data += line.size() + 1; 485 data += line.size() + 1;
485 remaining -= static_cast<int>(line.size()) + 1; 486 remaining -= static_cast<int>(line.size()) + 1;
486 } 487 }
487 488
488 if (client_key->empty() || wrapped_key->empty()) 489 if (client_key->empty() || wrapped_key->empty())
489 return false; 490 return false;
490 491
491 return true; 492 return true;
492 } 493 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/chunk_range.cc ('k') | chrome/browser/search_engines/template_url_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698