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

Unified Diff: components/enhanced_bookmarks/persistent_image_store.cc

Issue 305963004: Add GetStoreSize() to ImageStore to know the actual db size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: size += bitmap.getSize(); Created 6 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
Index: components/enhanced_bookmarks/persistent_image_store.cc
diff --git a/components/enhanced_bookmarks/persistent_image_store.cc b/components/enhanced_bookmarks/persistent_image_store.cc
index 5e42f3528aa8e3358d36b25b099999397b8b4fc3..0108c85fc6549013e878284c10b4f4925af4e04c 100644
--- a/components/enhanced_bookmarks/persistent_image_store.cc
+++ b/components/enhanced_bookmarks/persistent_image_store.cc
@@ -4,6 +4,7 @@
#include "components/enhanced_bookmarks/persistent_image_store.h"
+#include "base/files/file.h"
#include "components/enhanced_bookmarks/image_store_util.h"
#include "sql/statement.h"
#include "sql/transaction.h"
@@ -197,6 +198,11 @@ void PersistentImageStore::ClearAll() {
statement.Run();
}
+int64 PersistentImageStore::GetStoreSizeInBytes() {
+ base::File file(path_, base::File::FLAG_OPEN | base::File::FLAG_READ);
+ return file.IsValid() ? file.GetLength() : -1;
+}
+
PersistentImageStore::~PersistentImageStore() {
DCHECK(sequence_checker_.CalledOnValidSequencedThread());
}
« no previous file with comments | « components/enhanced_bookmarks/persistent_image_store.h ('k') | components/enhanced_bookmarks/test_image_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698