diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 21:07:27 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 21:07:27 +0000 |
commit | d3216441b7726c31fb0ae9b9d90b64421e14ca39 (patch) | |
tree | 653882df34541ec7aa37e4024f8fce27fd9ba5b6 /chrome/browser/safe_browsing | |
parent | ba61ace67a08e56026d2e8034d7a938d2f8e5bd6 (diff) | |
download | chromium_src-d3216441b7726c31fb0ae9b9d90b64421e14ca39.zip chromium_src-d3216441b7726c31fb0ae9b9d90b64421e14ca39.tar.gz chromium_src-d3216441b7726c31fb0ae9b9d90b64421e14ca39.tar.bz2 |
NO CODE CHANGE.
Split the lines >80 cols. (Part 1)
Review URL: http://codereview.chromium.org/39206
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
9 files changed, 55 insertions, 26 deletions
diff --git a/chrome/browser/safe_browsing/chunk_range.cc b/chrome/browser/safe_browsing/chunk_range.cc index 0781e45..2d30fc3 100644 --- a/chrome/browser/safe_browsing/chunk_range.cc +++ b/chrome/browser/safe_browsing/chunk_range.cc @@ -73,7 +73,8 @@ bool StringToRanges(const std::string& input, std::vector<ChunkRange>* ranges) { DCHECK(ranges); - // Crack the string into chunk parts, then crack each part looking for a range. + // Crack the string into chunk parts, then crack each part looking for a + // range. std::vector<std::string> chunk_parts; SplitString(input, ',', &chunk_parts); diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index f800ce1..327297a 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -30,19 +30,23 @@ static const int kSbTimerStartIntervalSec = 5 * 60; // Update URL for querying about the latest set of chunk updates. static const char* const kSbUpdateUrl = - "http://safebrowsing.clients.google.com/safebrowsing/downloads?client=%s&appver=%s&pver=2.2"; + "http://safebrowsing.clients.google.com/safebrowsing/downloads?client=%s" + "&appver=%s&pver=2.2"; // GetHash request URL for retrieving full hashes. static const char* const kSbGetHashUrl = - "http://safebrowsing.clients.google.com/safebrowsing/gethash?client=%s&appver=%s&pver=2.2"; + "http://safebrowsing.clients.google.com/safebrowsing/gethash?client=%s" + "&appver=%s&pver=2.2"; // New MAC client key requests URL. static const char* const kSbNewKeyUrl = - "https://sb-ssl.google.com/safebrowsing/newkey?client=%s&appver=%s&pver=2.2"; + "https://sb-ssl.google.com/safebrowsing/newkey?client=%s&appver=%s" + "&pver=2.2"; // URL for reporting malware pages. static const char* const kSbMalwareReportUrl = - "http://safebrowsing.clients.google.com/safebrowsing/report?evts=malblhit&evtd=%s&evtr=%s&evhr=%s&client=%s&appver=%s"; + "http://safebrowsing.clients.google.com/safebrowsing/report?evts=malblhit" + "&evtd=%s&evtr=%s&evhr=%s&client=%s&appver=%s"; #if defined(GOOGLE_CHROME_BUILD) static const char* const kSbClientName = "googlechrome"; diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h index 3023a2c..9489b0f 100644 --- a/chrome/browser/safe_browsing/protocol_manager.h +++ b/chrome/browser/safe_browsing/protocol_manager.h @@ -45,7 +45,8 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate { // Testing friends: FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestBackOffTimes); FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestChunkStrings); - FRIEND_TEST(SafeBrowsingProtocolManagerTest, DISABLED_TestGetHashBackOffTimes); + FRIEND_TEST(SafeBrowsingProtocolManagerTest, + DISABLED_TestGetHashBackOffTimes); public: SafeBrowsingProtocolManager(SafeBrowsingService* sb_service, diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc index 25af2b3..57514ae 100644 --- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc +++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc @@ -76,7 +76,8 @@ TEST_F(SafeBrowsingProtocolManagerTest, TestChunkStrings) { phish.adds = ""; phish.subs = "16,32,64-96"; EXPECT_EQ(pm.FormatList(phish, false), "goog-phish-shavar;s:16,32,64-96\n"); - EXPECT_EQ(pm.FormatList(phish, true), "goog-phish-shavar;s:16,32,64-96:mac\n"); + EXPECT_EQ(pm.FormatList(phish, true), + "goog-phish-shavar;s:16,32,64-96:mac\n"); // No chunks of either type. phish.adds = ""; diff --git a/chrome/browser/safe_browsing/protocol_parser.cc b/chrome/browser/safe_browsing/protocol_parser.cc index 0359a1c..ce8474c 100644 --- a/chrome/browser/safe_browsing/protocol_parser.cc +++ b/chrome/browser/safe_browsing/protocol_parser.cc @@ -296,11 +296,13 @@ bool SafeBrowsingProtocolParser::ParseChunk(const char* data, if (cmd_parts[0] == "a") { chunks->back().is_add = true; - if (!ParseAddChunk(chunk_data, chunk_len, hash_len, &chunks->back().hosts)) + if (!ParseAddChunk(chunk_data, chunk_len, hash_len, + &chunks->back().hosts)) return false; // Parse error. } else if (cmd_parts[0] == "s") { chunks->back().is_add = false; - if (!ParseSubChunk(chunk_data, chunk_len, hash_len, &chunks->back().hosts)) + if (!ParseSubChunk(chunk_data, chunk_len, hash_len, + &chunks->back().hosts)) return false; // Parse error. } else { NOTREACHED(); @@ -354,7 +356,8 @@ bool SafeBrowsingProtocolParser::ParseAddChunk( hosts->push_back(chunk_host); } - if (!ReadPrefixes(&chunk_data, &remaining, entry, prefix_count, index_start)) + if (!ReadPrefixes(&chunk_data, &remaining, entry, prefix_count, + index_start)) return false; } diff --git a/chrome/browser/safe_browsing/protocol_parser_unittest.cc b/chrome/browser/safe_browsing/protocol_parser_unittest.cc index bc37118..47ea95d 100644 --- a/chrome/browser/safe_browsing/protocol_parser_unittest.cc +++ b/chrome/browser/safe_browsing/protocol_parser_unittest.cc @@ -699,19 +699,35 @@ TEST(SafeBrowsingProtocolParsingTest, TestVerifyUpdateMac) { "m:XIU0LiQhAPJq6dynXwHbygjS5tw=\n" "n:1895\n" "i:goog-phish-shavar\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6501-6505:6501-6505,pcY6iVeT9-CBQ3fdAF0rpnKjR1Y=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6506-6510:6506-6510,SDBrYC3rX3KEPe72LOypnP6QYac=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6511-6520:6511-6520,9UQo-e7OkcsXT2wFWTAhOuWOsUs=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6521-6560:6521-6560,qVNw6JIpR1q6PIXST7J4LJ9n3Zg=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6561-6720:6561-6720,7OiJvCbiwvpzPITW-hQohY5NHuc=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6721-6880:6721-6880,oBS3svhoi9deIa0sWZ_gnD0ujj8=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6881-7040:6881-7040,a0r8Xit4VvH39xgyQHZTPczKBIE=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_7041-7200:7041-7163,q538LChutGknBw55s6kcE2wTcvU=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8001-8160:8001-8024,8026-8045,8048-8049,8051-8134,8136-8152,8155-8160,j6XXAEWnjYk9tVVLBSdQvIEq2Wg=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8161-8320:8161-8215,8217-8222,8224-8320,YaNfiqdQOt-uLCLWVLj46AZpAjQ=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8321-8480:8321-8391,8393-8399,8402,8404-8419,8421-8425,8427,8431-8433,8435-8439,8441-8443,8445-8446,8448-8480,ALj31GQMwGiIeU3bM2ZYKITfU-U=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8481-8640:8481-8500,8502-8508,8510-8511,8513-8517,8519-8525,8527-8531,8533,8536-8539,8541-8576,8578-8638,8640,TlQYRmS_kZ5PBAUIUyNQDq0Jprs=\n" - "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8641-8800:8641-8689,8691-8731,8733-8786,x1Qf7hdNrO8b6yym03ZzNydDS1o=\n"; + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6501-6505:6501-6505," + "pcY6iVeT9-CBQ3fdAF0rpnKjR1Y=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6506-6510:6506-6510," + "SDBrYC3rX3KEPe72LOypnP6QYac=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6511-6520:6511-6520," + "9UQo-e7OkcsXT2wFWTAhOuWOsUs=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6521-6560:6521-6560," + "qVNw6JIpR1q6PIXST7J4LJ9n3Zg=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6561-6720:6561-6720," + "7OiJvCbiwvpzPITW-hQohY5NHuc=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6721-6880:6721-6880," + "oBS3svhoi9deIa0sWZ_gnD0ujj8=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_6881-7040:6881-7040," + "a0r8Xit4VvH39xgyQHZTPczKBIE=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_s_7041-7200:7041-7163," + "q538LChutGknBw55s6kcE2wTcvU=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8001-8160:8001-8024," + "8026-8045,8048-8049,8051-8134,8136-8152,8155-8160," + "j6XXAEWnjYk9tVVLBSdQvIEq2Wg=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8161-8320:8161-8215," + "8217-8222,8224-8320,YaNfiqdQOt-uLCLWVLj46AZpAjQ=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8321-8480:8321-8391," + "8393-8399,8402,8404-8419,8421-8425,8427,8431-8433,8435-8439,8441-8443," + "8445-8446,8448-8480,ALj31GQMwGiIeU3bM2ZYKITfU-U=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8481-8640:8481-8500," + "8502-8508,8510-8511,8513-8517,8519-8525,8527-8531,8533,8536-8539," + "8541-8576,8578-8638,8640,TlQYRmS_kZ5PBAUIUyNQDq0Jprs=\n" + "u:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_8641-8800:8641-8689," + "8691-8731,8733-8786,x1Qf7hdNrO8b6yym03ZzNydDS1o=\n"; bool re_key = false; bool reset = false; diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 2eafe9a1..c30a07f 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -38,7 +38,8 @@ static const char* const kSbReportPhishingUrl = "http://www.google.com/safebrowsing/report_error/"; static const wchar_t* const kSbDiagnosticHtml = - L"<a href=\"\" onClick=\"sendCommand('showDiagnostic'); return false;\" onMouseDown=\"return false;\">%ls</a>"; + L"<a href=\"\" onClick=\"sendCommand('showDiagnostic'); return false;\" " + L"onMouseDown=\"return false;\">%ls</a>"; // The commands returned by the page when the user performs an action. static const char* const kShowDiagnosticCommand = "showDiagnostic"; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc index a05933d..8e7566a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc @@ -538,7 +538,8 @@ void SafeBrowsingDatabaseBloom::InsertSub( } else { for (int i = 0; i < count; i++) { SBPrefix prefix = entry->PrefixAt(i); - encoded_add = EncodeChunkId(entry->ChunkIdAtPrefix(i), entry->list_id()); + encoded_add = EncodeChunkId(entry->ChunkIdAtPrefix(i), + entry->list_id()); InsertSubPrefix(prefix, encoded, encoded_add); } } diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc index 67edb12..ea19736 100644 --- a/chrome/browser/safe_browsing/safe_browsing_util.cc +++ b/chrome/browser/safe_browsing/safe_browsing_util.cc @@ -495,7 +495,8 @@ void SBHostInfo::RemoveSubEntry(int list_id, int chunk_id) { SBEntry* new_sub_entry = const_cast<SBEntry*>(entry); scoped_array<char> data; - if (entry->IsSub() && entry->list_id() == list_id && entry->prefix_count()) { + if (entry->IsSub() && entry->list_id() == list_id && + entry->prefix_count()) { // Make a copy of the entry so that we can modify it. data.reset(new char[entry->Size()]); new_sub_entry = reinterpret_cast<SBEntry*>(data.get()); |