diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-08 01:14:36 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-08 01:14:36 +0000 |
commit | db69676b2d172c0f1975b79650592e8d2ec53615 (patch) | |
tree | ff52d85697bfeeda8b836c16595aa6276bcad6dc /content | |
parent | 821e3bbf92d862892c404e9fa6e06f69e769160d (diff) | |
download | chromium_src-db69676b2d172c0f1975b79650592e8d2ec53615.zip chromium_src-db69676b2d172c0f1975b79650592e8d2ec53615.tar.gz chromium_src-db69676b2d172c0f1975b79650592e8d2ec53615.tar.bz2 |
indexed_db_leveldb_coding: Remove three unused functions.
jsbell says: "It's safe to remove them. The generic version of Compare<T>(a,
b) does a full decode then calls a_decoded.Compare(b_decoded). In these three
cases (ExistsEntryKey, ObjectStoreDataKey, IndexDataKey) there is no
T::Compare(T&) - the compare function has extra arguments which capture the
additional behavior. If someone reintroduces the call the template won't match
and it would fail to compile."
BUG=315884
R=jsbell@chromium.org
Review URL: https://codereview.chromium.org/66033002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233742 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/indexed_db/indexed_db_leveldb_coding.cc | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.cc b/content/browser/indexed_db/indexed_db_leveldb_coding.cc index b9ce26c..4c3997f 100644 --- a/content/browser/indexed_db/indexed_db_leveldb_coding.cc +++ b/content/browser/indexed_db/indexed_db_leveldb_coding.cc @@ -795,34 +795,6 @@ int CompareSuffix<ExistsEntryKey>(StringPiece* slice_a, } template <> -int Compare<ExistsEntryKey>(const StringPiece& a, - const StringPiece& b, - bool only_compare_index_keys, - bool* ok) { - KeyPrefix prefix_a; - KeyPrefix prefix_b; - StringPiece slice_a(a); - StringPiece slice_b(b); - bool ok_a = KeyPrefix::Decode(&slice_a, &prefix_a); - bool ok_b = KeyPrefix::Decode(&slice_b, &prefix_b); - DCHECK(ok_a); - DCHECK(ok_b); - DCHECK(prefix_a.database_id_); - DCHECK(prefix_a.object_store_id_); - DCHECK_EQ(prefix_a.index_id_, ExistsEntryKey::kSpecialIndexNumber); - DCHECK(prefix_b.database_id_); - DCHECK(prefix_b.object_store_id_); - DCHECK_EQ(prefix_b.index_id_, ExistsEntryKey::kSpecialIndexNumber); - DCHECK(!slice_a.empty()); - DCHECK(!slice_b.empty()); - // Prefixes are not compared - it is assumed this was already done. - DCHECK(!prefix_a.Compare(prefix_b)); - - return CompareSuffix<ExistsEntryKey>( - &slice_a, &slice_b, only_compare_index_keys, ok); -} - -template <> int CompareSuffix<ObjectStoreDataKey>(StringPiece* slice_a, StringPiece* slice_b, bool only_compare_index_keys, @@ -831,34 +803,6 @@ int CompareSuffix<ObjectStoreDataKey>(StringPiece* slice_a, } template <> -int Compare<ObjectStoreDataKey>(const StringPiece& a, - const StringPiece& b, - bool only_compare_index_keys, - bool* ok) { - KeyPrefix prefix_a; - KeyPrefix prefix_b; - StringPiece slice_a(a); - StringPiece slice_b(b); - bool ok_a = KeyPrefix::Decode(&slice_a, &prefix_a); - bool ok_b = KeyPrefix::Decode(&slice_b, &prefix_b); - DCHECK(ok_a); - DCHECK(ok_b); - DCHECK(prefix_a.database_id_); - DCHECK(prefix_a.object_store_id_); - DCHECK_EQ(prefix_a.index_id_, ObjectStoreDataKey::kSpecialIndexNumber); - DCHECK(prefix_b.database_id_); - DCHECK(prefix_b.object_store_id_); - DCHECK_EQ(prefix_b.index_id_, ObjectStoreDataKey::kSpecialIndexNumber); - DCHECK(!slice_a.empty()); - DCHECK(!slice_b.empty()); - // Prefixes are not compared - it is assumed this was already done. - DCHECK(!prefix_a.Compare(prefix_b)); - - return CompareSuffix<ObjectStoreDataKey>( - &slice_a, &slice_b, only_compare_index_keys, ok); -} - -template <> int CompareSuffix<IndexDataKey>(StringPiece* slice_a, StringPiece* slice_b, bool only_compare_index_keys, @@ -889,34 +833,6 @@ int CompareSuffix<IndexDataKey>(StringPiece* slice_a, return CompareInts(sequence_number_a, sequence_number_b); } -template <> -int Compare<IndexDataKey>(const StringPiece& a, - const StringPiece& b, - bool only_compare_index_keys, - bool* ok) { - KeyPrefix prefix_a; - KeyPrefix prefix_b; - StringPiece slice_a(a); - StringPiece slice_b(b); - bool ok_a = KeyPrefix::Decode(&slice_a, &prefix_a); - bool ok_b = KeyPrefix::Decode(&slice_b, &prefix_b); - DCHECK(ok_a); - DCHECK(ok_b); - DCHECK(prefix_a.database_id_); - DCHECK(prefix_a.object_store_id_); - DCHECK_GE(prefix_a.index_id_, kMinimumIndexId); - DCHECK(prefix_b.database_id_); - DCHECK(prefix_b.object_store_id_); - DCHECK_GE(prefix_b.index_id_, kMinimumIndexId); - DCHECK(!slice_a.empty()); - DCHECK(!slice_b.empty()); - // Prefixes are not compared - it is assumed this was already done. - DCHECK(!prefix_a.Compare(prefix_b)); - - return CompareSuffix<IndexDataKey>( - &slice_a, &slice_b, only_compare_index_keys, ok); -} - int Compare(const StringPiece& a, const StringPiece& b, bool only_compare_index_keys, |