OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <memory> | 6 #include <memory> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 counter.Restart(); | 109 counter.Restart(); |
110 run_loop.Run(); | 110 run_loop.Run(); |
111 return size; | 111 return size; |
112 } | 112 } |
113 | 113 |
114 void RemoveAndWait(int remove_mask) { | 114 void RemoveAndWait(int remove_mask) { |
115 BrowsingDataRemover* remover = | 115 BrowsingDataRemover* remover = |
116 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); | 116 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); |
117 BrowsingDataRemoverCompletionObserver completion_observer(remover); | 117 BrowsingDataRemoverCompletionObserver completion_observer(remover); |
118 remover->RemoveAndReply( | 118 remover->RemoveAndReply( |
119 BrowsingDataRemover::Period(browsing_data::LAST_HOUR), remove_mask, | 119 base::Time(), base::Time::Max(), remove_mask, |
120 BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer); | 120 BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer); |
121 completion_observer.BlockUntilCompletion(); | 121 completion_observer.BlockUntilCompletion(); |
122 } | 122 } |
123 | 123 |
124 void RemoveWithFilterAndWait( | 124 void RemoveWithFilterAndWait( |
125 int remove_mask, | 125 int remove_mask, |
126 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder) { | 126 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder) { |
127 BrowsingDataRemover* remover = | 127 BrowsingDataRemover* remover = |
128 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); | 128 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); |
129 BrowsingDataRemoverCompletionObserver completion_observer(remover); | 129 BrowsingDataRemoverCompletionObserver completion_observer(remover); |
130 remover->RemoveWithFilterAndReply( | 130 remover->RemoveWithFilterAndReply( |
131 BrowsingDataRemover::Period(browsing_data::LAST_HOUR), remove_mask, | 131 base::Time(), base::Time::Max(), remove_mask, |
132 BrowsingDataHelper::UNPROTECTED_WEB, std::move(filter_builder), | 132 BrowsingDataHelper::UNPROTECTED_WEB, std::move(filter_builder), |
133 &completion_observer); | 133 &completion_observer); |
134 completion_observer.BlockUntilCompletion(); | 134 completion_observer.BlockUntilCompletion(); |
135 } | 135 } |
136 | 136 |
137 private: | 137 private: |
138 void OnCacheSizeResult( | 138 void OnCacheSizeResult( |
139 base::RunLoop* run_loop, | 139 base::RunLoop* run_loop, |
140 browsing_data::BrowsingDataCounter::ResultInt* out_size, | 140 browsing_data::BrowsingDataCounter::ResultInt* out_size, |
141 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { | 141 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 base::RunLoop run_loop; | 295 base::RunLoop run_loop; |
296 BrowserThread::PostTaskAndReply( | 296 BrowserThread::PostTaskAndReply( |
297 BrowserThread::IO, FROM_HERE, | 297 BrowserThread::IO, FROM_HERE, |
298 base::Bind(&BrowsingDataRemoverTransportSecurityStateBrowserTest:: | 298 base::Bind(&BrowsingDataRemoverTransportSecurityStateBrowserTest:: |
299 CheckTransportSecurityState, | 299 CheckTransportSecurityState, |
300 base::Unretained(this), | 300 base::Unretained(this), |
301 base::RetainedRef(browser()->profile()->GetRequestContext()), | 301 base::RetainedRef(browser()->profile()->GetRequestContext()), |
302 false /* should not be cleared */), | 302 false /* should not be cleared */), |
303 run_loop.QuitClosure()); | 303 run_loop.QuitClosure()); |
304 } | 304 } |
OLD | NEW |