OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browsing_data/content/conditional_cache_deletion_helper.h" | 5 #include "components/browsing_data/content/conditional_cache_deletion_helper.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 if (previous_entry_) { | 72 if (previous_entry_) { |
73 if (condition_.Run(previous_entry_)) | 73 if (condition_.Run(previous_entry_)) |
74 previous_entry_->Doom(); | 74 previous_entry_->Doom(); |
75 previous_entry_->Close(); | 75 previous_entry_->Close(); |
76 } | 76 } |
77 | 77 |
78 if (error == net::ERR_FAILED) { | 78 if (error == net::ERR_FAILED) { |
79 // The iteration finished successfuly or we can no longer iterate | 79 // The iteration finished successfuly or we can no longer iterate |
80 // (e.g. the cache was destroyed). We cannot distinguish between the two, | 80 // (e.g. the cache was destroyed). We cannot distinguish between the two, |
81 // but we know that there is nothing more that we can do, so we return OK. | 81 // but we know that there is nothing more that we can do, so we return OK. |
82 base::MessageLoop::current()->task_runner()->PostTask( | 82 base::ThreadTaskRunnerHandle::Get()->PostTask( |
83 FROM_HERE, base::Bind(completion_callback_, net::OK)); | 83 FROM_HERE, base::Bind(completion_callback_, net::OK)); |
84 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 84 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
85 return; | 85 return; |
86 } | 86 } |
87 | 87 |
88 previous_entry_ = current_entry_; | 88 previous_entry_ = current_entry_; |
89 error = iterator_->OpenNextEntry( | 89 error = iterator_->OpenNextEntry( |
90 ¤t_entry_, | 90 ¤t_entry_, |
91 base::Bind(&ConditionalCacheDeletionHelper::IterateOverEntries, | 91 base::Bind(&ConditionalCacheDeletionHelper::IterateOverEntries, |
92 base::Unretained(this))); | 92 base::Unretained(this))); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 } // namespace browsing_data | 96 } // namespace browsing_data |
OLD | NEW |