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

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

Issue 8873004: Fix safe-browsing sub parsing for download whitelist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_PARSER_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_PARSER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_PARSER_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_PARSER_H_
7 #pragma once 7 #pragma once
8 8
9 // Parse the data returned from the chunk response. 9 // Parse the data returned from the chunk response.
10 // 10 //
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 int data_len, 108 int data_len,
109 int hash_len, 109 int hash_len,
110 std::deque<SBChunkHost>* hosts); 110 std::deque<SBChunkHost>* hosts);
111 bool ParseSubChunk(const std::string& list_name, 111 bool ParseSubChunk(const std::string& list_name,
112 const char* data, 112 const char* data,
113 int data_len, 113 int data_len,
114 int hash_len, 114 int hash_len,
115 std::deque<SBChunkHost>* hosts); 115 std::deque<SBChunkHost>* hosts);
116 116
117 // Helper functions used by ParseAddChunk and ParseSubChunk. 117 // Helper functions used by ParseAddChunk and ParseSubChunk.
118 static void ReadHostAndPrefixCount(const char** data, 118 static bool ReadHostAndPrefixCount(const char** data,
119 int* remaining, 119 int* remaining,
120 SBPrefix* host, 120 SBPrefix* host,
121 int* count); 121 int* count);
122 static int ReadChunkId(const char** data, int* remaining); 122 static bool ReadChunkId(const char** data, int* remaining, int* chunk_id);
123 static bool ReadPrefixes( 123 static bool ReadPrefixes(
124 const char** data, int* remaining, SBEntry* entry, int count); 124 const char** data, int* remaining, SBEntry* entry, int count);
125 125
126 // The name of the current list 126 // The name of the current list
127 std::string list_name_; 127 std::string list_name_;
128 128
129 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolParser); 129 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolParser);
130 }; 130 };
131 131
132 132
133 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_PARSER_H_ 133 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/protocol_parser.cc » ('j') | chrome/browser/safe_browsing/protocol_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698