Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_BOOKMARKS_ENHANCED_PERSISTENT_IMAGE_STORE_H_ | |
| 6 #define COMPONENTS_BOOKMARKS_ENHANCED_PERSISTENT_IMAGE_STORE_H_ | |
| 7 | |
| 8 #include "components/bookmarks_enhanced/image_store.h" | |
| 9 | |
| 10 #include "base/files/file_path.h" | |
| 11 #include "sql/connection.h" | |
| 12 #include "sql/init_status.h" | |
| 13 | |
| 14 // The PersistentImageStore is an implementation of ImageStore that persists its | |
| 15 // data on disk. | |
| 16 class PersistentImageStore : public ImageStore { | |
| 17 public: | |
| 18 // Creates a PersistentImageStore in the directory at the given path. | |
| 19 explicit PersistentImageStore(const base::FilePath& path); | |
| 20 virtual bool HasKey(const GURL& page_url) OVERRIDE; | |
| 21 virtual void Insert(const GURL& page_url, | |
| 22 const GURL& image_url, | |
| 23 const gfx::Image& image) OVERRIDE; | |
| 24 virtual void Erase(const GURL& page_url) OVERRIDE; | |
| 25 virtual gfx::Image Get(const GURL& page_url, GURL* image_url) OVERRIDE; | |
| 26 virtual gfx::Size GetSize(const GURL& page_url) OVERRIDE; | |
| 27 virtual void GetAllPageUrls(std::vector<GURL>* urls) OVERRIDE; | |
| 28 | |
| 29 protected: | |
| 30 virtual ~PersistentImageStore(); | |
| 31 | |
| 32 private: | |
| 33 sql::InitStatus OpenDatabase(); | |
| 34 bool InitTables(); | |
| 35 bool InitIndices(); | |
| 36 const base::FilePath path_; | |
|
sky
2014/05/06 16:14:20
nit: newline between 35/36.
Kibeom Kim (inactive)
2014/05/07 00:09:46
Done.
| |
| 37 sql::Connection db_; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(PersistentImageStore); | |
| 40 }; | |
| 41 | |
| 42 #endif // COMPONENTS_BOOKMARKS_ENHANCED_PERSISTENT_IMAGE_STORE_H_ | |
| OLD | NEW |