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

Unified Diff: third_party/hunspell_new/google/bdict.cc

Issue 1135173004: Rename third_party/hunspell_new back to third_party/hunspell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « third_party/hunspell_new/google/bdict.h ('k') | third_party/hunspell_new/google/bdict_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/hunspell_new/google/bdict.cc
diff --git a/third_party/hunspell_new/google/bdict.cc b/third_party/hunspell_new/google/bdict.cc
deleted file mode 100644
index 638bf065dd614b50914169c4e13bc325ce9e1ba5..0000000000000000000000000000000000000000
--- a/third_party/hunspell_new/google/bdict.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "third_party/hunspell_new/google/bdict.h"
-
-// static
-bool hunspell::BDict::Verify(const char* bdict_data, size_t bdict_length) {
- if (bdict_length <= sizeof(hunspell::BDict::Header))
- return false;
-
- const BDict::Header* header =
- reinterpret_cast<const hunspell::BDict::Header*>(bdict_data);
- if (header->signature != hunspell::BDict::SIGNATURE ||
- header->major_version > hunspell::BDict::MAJOR_VERSION ||
- header->dic_offset > bdict_length)
- return false;
-
- // Get the affix header, make sure there is enough room for it.
- if (header->aff_offset + sizeof(hunspell::BDict::AffHeader) > bdict_length)
- return false;
-
- // Make sure there is enough room for the affix group count dword.
- const hunspell::BDict::AffHeader* aff_header =
- reinterpret_cast<const hunspell::BDict::AffHeader*>(
- &bdict_data[header->aff_offset]);
- if (aff_header->affix_group_offset + sizeof(uint32) > bdict_length)
- return false;
-
- // The new BDICT header has a MD5 digest of the dictionary data. Compare the
- // MD5 digest of the data with the one in the BDICT header.
- if (header->major_version >= 2) {
- base::MD5Digest digest;
- base::MD5Sum(aff_header, bdict_length - header->aff_offset, &digest);
- if (memcmp(&digest, &header->digest, sizeof(digest)))
- return false;
- }
-
- return true;
-}
« no previous file with comments | « third_party/hunspell_new/google/bdict.h ('k') | third_party/hunspell_new/google/bdict_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698