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

Unified Diff: components/safe_browsing_db/v4_rice.h

Issue 2228393003: PVer4: DecodeHashes needs to sort the output of the Rice decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_checksum
Patch Set: Use htonl. Return from GetBitsFromCurrentWord Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_rice.cc » ('j') | components/safe_browsing_db/v4_rice.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_rice.h
diff --git a/components/safe_browsing_db/v4_rice.h b/components/safe_browsing_db/v4_rice.h
index b9ab9f265f334e25fedc5bbd53e95508dc934cd7..9bff397d4c4342991574d6813a40c3e43b7cd831 100644
--- a/components/safe_browsing_db/v4_rice.h
+++ b/components/safe_browsing_db/v4_rice.h
@@ -10,6 +10,7 @@
#include <ostream>
#include <string>
+#include <vector>
#include "base/gtest_prod_util.h"
#if defined(USE_SYSTEM_PROTOBUF)
@@ -65,7 +66,7 @@ class V4RiceDecoder {
// |first_value| = 3, |num_entries| = 2 and decoding the |encoded_data| will
// produce the offsets: [4, 18].
static V4DecodeResult DecodeIntegers(
- const ::google::protobuf::int32 first_value,
+ const ::google::protobuf::int64 first_value,
const ::google::protobuf::int32 rice_parameter,
const ::google::protobuf::int32 num_entries,
const std::string& encoded_data,
@@ -75,11 +76,11 @@ class V4RiceDecoder {
// hash prefixes and stores them in |out|. The rest of the arguments are the
// same as for |DecodeIntegers|.
static V4DecodeResult DecodeBytes(
- const ::google::protobuf::int32 first_value,
+ const ::google::protobuf::int64 first_value,
const ::google::protobuf::int32 rice_parameter,
const ::google::protobuf::int32 num_entries,
const std::string& encoded_data,
- std::string* out);
+ std::vector<uint32_t>* out);
virtual ~V4RiceDecoder();
@@ -90,8 +91,7 @@ class V4RiceDecoder {
FRIEND_TEST_ALL_PREFIXES(V4RiceTest, TestDecoderGetNextBitsWithNoData);
FRIEND_TEST_ALL_PREFIXES(V4RiceTest, TestDecoderGetNextValueWithNoData);
FRIEND_TEST_ALL_PREFIXES(V4RiceTest, TestDecoderGetNextValueWithNoEntries);
- FRIEND_TEST_ALL_PREFIXES(V4RiceTest, TestDecoderGetNextValueWithSmallValues);
- FRIEND_TEST_ALL_PREFIXES(V4RiceTest, TestDecoderGetNextValueWithLargeValues);
+ friend class V4RiceTest;
// Validate some of the parameters passed to the decode methods.
static V4DecodeResult ValidateInput(
@@ -122,7 +122,7 @@ class V4RiceDecoder {
V4DecodeResult GetNextBits(unsigned int num_requested_bits, uint32_t* x);
// Reads |num_requested_bits| from |current_word_|.
- void GetBitsFromCurrentWord(unsigned int num_requested_bits, uint32_t* x);
+ uint32_t GetBitsFromCurrentWord(unsigned int num_requested_bits);
// The Rice parameter, which is the exponent of two for calculating 'M'. 'M'
// is used as the base to calculate the quotient and remainder in the
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_rice.cc » ('j') | components/safe_browsing_db/v4_rice.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698