summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/protocol_parser.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-17 17:45:02 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-17 17:45:02 +0000
commitd3ad8b706aff05ae06dd3dfc8bac850f0d364718 (patch)
treedb04a23ffba7b4c218d2a634292f5d3f2957256c /chrome/browser/safe_browsing/protocol_parser.cc
parentac8db27fb680fa0a11a99f7dd20176c5c4ce43c8 (diff)
downloadchromium_src-d3ad8b706aff05ae06dd3dfc8bac850f0d364718.zip
chromium_src-d3ad8b706aff05ae06dd3dfc8bac850f0d364718.tar.gz
chromium_src-d3ad8b706aff05ae06dd3dfc8bac850f0d364718.tar.bz2
Include chrome/browser/SConscript in Linux build.
In dns_host_info.cc there was probably a bug (hardcoded 1 instead of length. BUG=2333 R=mark,sgk Original patch by phajdan.jr@gmail.com at: http://codereview.chromium.org/2890 Review URL: http://codereview.chromium.org/3108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2317 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/protocol_parser.cc')
-rw-r--r--chrome/browser/safe_browsing/protocol_parser.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/safe_browsing/protocol_parser.cc b/chrome/browser/safe_browsing/protocol_parser.cc
index 3c6e17c..b3a460b 100644
--- a/chrome/browser/safe_browsing/protocol_parser.cc
+++ b/chrome/browser/safe_browsing/protocol_parser.cc
@@ -4,7 +4,13 @@
//
// Parse the data returned from the SafeBrowsing v2.1 protocol response.
-#include <Winsock2.h> // for htonl
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
+#include <Winsock2.h>
+#elif defined(OS_POSIX)
+#include <arpa/inet.h>
+#endif
#include "chrome/browser/safe_browsing/protocol_parser.h"
@@ -85,7 +91,7 @@ bool SafeBrowsingProtocolParser::ParseGetHash(
int full_hash_len = atoi(cmd_parts[2].c_str());
while (full_hash_len > 0) {
- DCHECK(full_hash_len >= sizeof(SBFullHash));
+ DCHECK(static_cast<size_t>(full_hash_len) >= sizeof(SBFullHash));
memcpy(&full_hash.hash, data, sizeof(SBFullHash));
full_hashes->push_back(full_hash);
data += sizeof(SBFullHash);
@@ -449,7 +455,7 @@ bool SafeBrowsingProtocolParser::ParseNewKey(const char* chunk_data,
if (cmd_parts.size() != 3)
return false;
- if (cmd_parts[2].size() != atoi(cmd_parts[1].c_str()))
+ if (static_cast<int>(cmd_parts[2].size()) != atoi(cmd_parts[1].c_str()))
return false;
if (cmd_parts[0] == "clientkey") {