| 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_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_STORE_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_STORE_H_ |
| 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_STORE_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_STORE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/containers/mru_cache.h" | 12 #include "base/containers/mru_cache.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "components/dom_distiller/core/article_entry.h" | 15 #include "components/dom_distiller/core/article_entry.h" |
| 15 #include "components/dom_distiller/core/proto/distilled_article.pb.h" | 16 #include "components/dom_distiller/core/proto/distilled_article.pb.h" |
| 16 | 17 |
| 17 namespace dom_distiller { | 18 namespace dom_distiller { |
| 18 | 19 |
| 19 // The maximum number of items to keep in the cache before deleting some. | 20 // The maximum number of items to keep in the cache before deleting some. |
| 20 const int kDefaultMaxNumCachedEntries = 32; | 21 const int kDefaultMaxNumCachedEntries = 32; |
| 21 | 22 |
| 22 // This is a simple interface for saving and loading of distilled content for an | 23 // This is a simple interface for saving and loading of distilled content for an |
| 23 // ArticleEntry. | 24 // ArticleEntry. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 ContentMap; | 82 ContentMap; |
| 82 typedef base::hash_map<std::string, std::string> UrlMap; | 83 typedef base::hash_map<std::string, std::string> UrlMap; |
| 83 | 84 |
| 84 ContentMap cache_; | 85 ContentMap cache_; |
| 85 UrlMap url_to_id_; | 86 UrlMap url_to_id_; |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // dom_distiller | 89 } // dom_distiller |
| 89 | 90 |
| 90 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_CACHE_H_ | 91 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_CACHE_H_ |
| OLD | NEW |