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

Side by Side Diff: components/dom_distiller/core/dom_distiller_service.cc

Issue 302163005: Change InMemoryContentStore to use MRUCache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated tests for expiry and fixed lint errors. Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "components/dom_distiller/core/dom_distiller_service.h" 5 #include "components/dom_distiller/core/dom_distiller_service.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "components/dom_distiller/core/distilled_content_store.h" 9 #include "components/dom_distiller/core/distilled_content_store.h"
10 #include "components/dom_distiller/core/dom_distiller_store.h" 10 #include "components/dom_distiller/core/dom_distiller_store.h"
(...skipping 23 matching lines...) Expand all
34 article_cb.Run(distillation_succeeded); 34 article_cb.Run(distillation_succeeded);
35 } 35 }
36 36
37 } // namespace 37 } // namespace
38 38
39 DomDistillerService::DomDistillerService( 39 DomDistillerService::DomDistillerService(
40 scoped_ptr<DomDistillerStoreInterface> store, 40 scoped_ptr<DomDistillerStoreInterface> store,
41 scoped_ptr<DistillerFactory> distiller_factory, 41 scoped_ptr<DistillerFactory> distiller_factory,
42 scoped_ptr<DistillerPageFactory> distiller_page_factory) 42 scoped_ptr<DistillerPageFactory> distiller_page_factory)
43 : store_(store.Pass()), 43 : store_(store.Pass()),
44 content_store_(new InMemoryContentStore()), 44 content_store_(new InMemoryContentStore(kDefaultMaxNumCachedEntries)),
45 distiller_factory_(distiller_factory.Pass()), 45 distiller_factory_(distiller_factory.Pass()),
46 distiller_page_factory_(distiller_page_factory.Pass()) { 46 distiller_page_factory_(distiller_page_factory.Pass()) {
47 } 47 }
48 48
49 DomDistillerService::~DomDistillerService() { 49 DomDistillerService::~DomDistillerService() {
50 } 50 }
51 51
52 syncer::SyncableService* DomDistillerService::GetSyncableService() const { 52 syncer::SyncableService* DomDistillerService::GetSyncableService() const {
53 return store_->GetSyncableService(); 53 return store_->GetSyncableService();
54 } 54 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 DCHECK(observer); 233 DCHECK(observer);
234 store_->AddObserver(observer); 234 store_->AddObserver(observer);
235 } 235 }
236 236
237 void DomDistillerService::RemoveObserver(DomDistillerObserver* observer) { 237 void DomDistillerService::RemoveObserver(DomDistillerObserver* observer) {
238 DCHECK(observer); 238 DCHECK(observer);
239 store_->RemoveObserver(observer); 239 store_->RemoveObserver(observer);
240 } 240 }
241 241
242 } // namespace dom_distiller 242 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698