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..73d920433c4b1f6cb4f1e5dcdba5bd1ffd3df67e 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,15 @@ void PersistentImageStore::ClearAll() { |
statement.Run(); |
} |
+int64 PersistentImageStore::GetStoreSize() { |
+ // Ensure that the db is actually valid. |
+ if (OpenDatabase() != sql::INIT_OK) |
sky
2014/05/29 21:51:05
Do you really need to open the db here?
Kibeom Kim (inactive)
2014/05/29 23:07:15
Done.
|
+ return -1; |
+ |
+ return base::File(path_, base::File::FLAG_OPEN | base::File::FLAG_READ). |
+ GetLength(); |
+} |
+ |
PersistentImageStore::~PersistentImageStore() { |
DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
} |