| 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 #include "components/dom_distiller/core/distilled_content_store.h" | 5 #include "components/dom_distiller/core/distilled_content_store.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 | 8 |
| 9 namespace dom_distiller { | 9 namespace dom_distiller { |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 InMemoryContentStore::CacheDeletor::CacheDeletor(InMemoryContentStore* store) | 91 InMemoryContentStore::CacheDeletor::CacheDeletor(InMemoryContentStore* store) |
| 92 : store_(store) { | 92 : store_(store) { |
| 93 } | 93 } |
| 94 | 94 |
| 95 InMemoryContentStore::CacheDeletor::~CacheDeletor() { | 95 InMemoryContentStore::CacheDeletor::~CacheDeletor() { |
| 96 } | 96 } |
| 97 | 97 |
| 98 void InMemoryContentStore::CacheDeletor::operator()( | 98 void InMemoryContentStore::CacheDeletor::operator()( |
| 99 const DistilledArticleProto& proto) { | 99 DistilledArticleProto* proto) { |
| 100 // When InMemoryContentStore is deleted, the |store_| pointer becomes invalid, | 100 // When InMemoryContentStore is deleted, the |store_| pointer becomes invalid, |
| 101 // but since the ContentMap is cleared in the InMemoryContentStore destructor, | 101 // but since the ContentMap is cleared in the InMemoryContentStore destructor, |
| 102 // this should never be called after the destructor. | 102 // this should never be called after the destructor. |
| 103 store_->EraseUrlToIdMapping(proto); | 103 store_->EraseUrlToIdMapping(*proto); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace dom_distiller | 106 } // namespace dom_distiller |
| OLD | NEW |