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

Unified Diff: chrome/browser/devtools/devtools_file_system_indexer.cc

Issue 2508443002: [DevTools] Remove dead code from devtools_file_system_indexer.cc (Closed)
Patch Set: Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_file_system_indexer.cc
diff --git a/chrome/browser/devtools/devtools_file_system_indexer.cc b/chrome/browser/devtools/devtools_file_system_indexer.cc
index 2930a019b03e26e419d3ea28fdb91326844bf7db..5a5c7fd0c130e9f869f0d307d4d240ad71583917 100644
--- a/chrome/browser/devtools/devtools_file_system_indexer.cc
+++ b/chrome/browser/devtools/devtools_file_system_indexer.cc
@@ -54,17 +54,18 @@ const Trigram kUndefinedTrigram = -1;
class Index {
public:
Index();
+ // Index is only instantiated as a leak LazyInstance, so the destructor is
+ // never called.
+ ~Index() = delete;
+
Time LastModifiedTimeForFile(const FilePath& file_path);
void SetTrigramsForFile(const FilePath& file_path,
const vector<Trigram>& index,
const Time& time);
vector<FilePath> Search(string query);
- void PrintStats();
void NormalizeVectors();
private:
- ~Index();
-
FileId GetFileId(const FilePath& file_path);
typedef map<FilePath, FileId> FileIdsMap;
@@ -138,8 +139,6 @@ Index::Index() : last_file_id_(0) {
std::fill(is_normalized_.begin(), is_normalized_.end(), true);
}
-Index::~Index() {}
-
Time Index::LastModifiedTimeForFile(const FilePath& file_path) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
Time last_modified_time;
@@ -227,26 +226,6 @@ void Index::NormalizeVectors() {
}
}
-void Index::PrintStats() {
- DCHECK_CURRENTLY_ON(BrowserThread::FILE);
- LOG(ERROR) << "Index stats:";
- size_t size = 0;
- size_t maxSize = 0;
- size_t capacity = 0;
- for (size_t i = 0; i < kTrigramCount; ++i) {
- if (index_[i].size() > maxSize)
- maxSize = index_[i].size();
- size += index_[i].size();
- capacity += index_[i].capacity();
- }
- LOG(ERROR) << " - total trigram count: " << size;
- LOG(ERROR) << " - max file count per trigram: " << maxSize;
- LOG(ERROR) << " - total vectors capacity " << capacity;
- size_t total_index_size =
- capacity * sizeof(FileId) + sizeof(vector<FileId>) * kTrigramCount;
- LOG(ERROR) << " - estimated total index size " << total_index_size;
-}
-
typedef Callback<void(bool, const vector<bool>&)> IndexerCallback;
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698