OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_H_ | 5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_H_ |
6 #define COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_H_ | 6 #define COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/threading/thread_checker.h" | 11 #include "base/sequence_checker.h" |
12 #include "ui/gfx/image/image.h" | 12 #include "ui/gfx/image/image.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
16 // The ImageStore keeps an image for each URL. This class is not thread safe, | 16 // The ImageStore keeps an image for each URL. This class is not thread safe, |
17 // and will check the thread using base::ThreadChecker, except the constructor. | 17 // and will check the thread using base::ThreadChecker, except the constructor. |
18 class ImageStore { | 18 class ImageStore { |
19 public: | 19 public: |
20 ImageStore(); | 20 ImageStore(); |
21 virtual ~ImageStore(); | 21 virtual ~ImageStore(); |
(...skipping 24 matching lines...) Expand all Loading... |
46 // Populates |urls| with all the urls that have an image in the store. | 46 // Populates |urls| with all the urls that have an image in the store. |
47 virtual void GetAllPageUrls(std::set<GURL>* urls) = 0; | 47 virtual void GetAllPageUrls(std::set<GURL>* urls) = 0; |
48 | 48 |
49 // Removes all images. | 49 // Removes all images. |
50 virtual void ClearAll() = 0; | 50 virtual void ClearAll() = 0; |
51 | 51 |
52 // Moves an image from one url to another. | 52 // Moves an image from one url to another. |
53 void ChangeImageURL(const GURL& from, const GURL& to); | 53 void ChangeImageURL(const GURL& from, const GURL& to); |
54 | 54 |
55 protected: | 55 protected: |
56 base::ThreadChecker thread_checker_; | 56 base::SequenceChecker sequence_checker_; |
57 | 57 |
58 private: | 58 private: |
59 DISALLOW_COPY_AND_ASSIGN(ImageStore); | 59 DISALLOW_COPY_AND_ASSIGN(ImageStore); |
60 }; | 60 }; |
61 | 61 |
62 #endif // COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_H_ | 62 #endif // COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_H_ |
OLD | NEW |