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

Side by Side Diff: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h

Issue 2781083002: Fix the multi-threaded access to WeakPtr<BrowsingDataRemoverImpl> (Closed)
Patch Set: Ordering Created 3 years, 8 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
OLDNEW
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 #ifndef CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_
6 #define CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 bool is_pending_; 167 bool is_pending_;
168 const base::Closure& forward_callback_; 168 const base::Closure& forward_callback_;
169 base::WeakPtrFactory<SubTask> weak_ptr_factory_; 169 base::WeakPtrFactory<SubTask> weak_ptr_factory_;
170 }; 170 };
171 171
172 ChromeBrowsingDataRemoverDelegate(content::BrowserContext* browser_context); 172 ChromeBrowsingDataRemoverDelegate(content::BrowserContext* browser_context);
173 ~ChromeBrowsingDataRemoverDelegate() override; 173 ~ChromeBrowsingDataRemoverDelegate() override;
174 174
175 // BrowsingDataRemoverDelegate: 175 // BrowsingDataRemoverDelegate:
176 bool DoesOriginMatchEmbedderMask( 176 BrowsingDataRemoverDelegate::EmbedderOriginTypeMatcher GetOriginTypeMatcher()
177 int origin_type_mask, 177 const override;
178 const GURL& origin,
179 storage::SpecialStoragePolicy* special_storage_policy) const override;
180 void RemoveEmbedderData( 178 void RemoveEmbedderData(
181 const base::Time& delete_begin, 179 const base::Time& delete_begin,
182 const base::Time& delete_end, 180 const base::Time& delete_end,
183 int remove_mask, 181 int remove_mask,
184 const content::BrowsingDataFilterBuilder& filter_builder, 182 const content::BrowsingDataFilterBuilder& filter_builder,
185 int origin_type_mask, 183 int origin_type_mask,
186 const base::Closure& callback) override; 184 const base::Closure& callback) override;
187 185
188 #if defined(OS_ANDROID) 186 #if defined(OS_ANDROID)
189 void OverrideWebappRegistryForTesting( 187 void OverrideWebappRegistryForTesting(
190 std::unique_ptr<WebappRegistry> webapp_registry); 188 std::unique_ptr<WebappRegistry> webapp_registry);
191 #endif 189 #endif
192 190
193 #if BUILDFLAG(ENABLE_PLUGINS) 191 #if BUILDFLAG(ENABLE_PLUGINS)
194 // Used for testing. 192 // Used for testing.
195 void OverrideFlashLSOHelperForTesting( 193 void OverrideFlashLSOHelperForTesting(
196 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper); 194 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper);
197 #endif 195 #endif
198 196
199 private: 197 private:
198 // Returned by GetOriginTypeMatcher().
199 static bool DoesOriginMatchEmbedderMask(
Bernhard Bauer 2017/04/06 15:02:12 Does this need to be part of the class, or could i
msramek 2017/04/06 16:27:30 Done. No, it doesn't.
200 int origin_type_mask,
201 const GURL& origin,
202 storage::SpecialStoragePolicy* special_storage_policy);
203
200 // If AllDone(), calls the callback provided in RemoveEmbedderData(). 204 // If AllDone(), calls the callback provided in RemoveEmbedderData().
201 void NotifyIfDone(); 205 void NotifyIfDone();
202 206
203 // Whether there are no running deletion tasks. 207 // Whether there are no running deletion tasks.
204 bool AllDone(); 208 bool AllDone();
205 209
206 // Callback for when TemplateURLService has finished loading. Clears the data, 210 // Callback for when TemplateURLService has finished loading. Clears the data,
207 // clears the respective waiting flag, and invokes NotifyIfDone. 211 // clears the respective waiting flag, and invokes NotifyIfDone.
208 void OnKeywordsLoaded(base::Callback<bool(const GURL&)> url_filter); 212 void OnKeywordsLoaded(base::Callback<bool(const GURL&)> url_filter);
209 213
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 // not initialised, so the registry must be mocked out. 308 // not initialised, so the registry must be mocked out.
305 std::unique_ptr<WebappRegistry> webapp_registry_; 309 std::unique_ptr<WebappRegistry> webapp_registry_;
306 #endif 310 #endif
307 311
308 base::WeakPtrFactory<ChromeBrowsingDataRemoverDelegate> weak_ptr_factory_; 312 base::WeakPtrFactory<ChromeBrowsingDataRemoverDelegate> weak_ptr_factory_;
309 313
310 DISALLOW_COPY_AND_ASSIGN(ChromeBrowsingDataRemoverDelegate); 314 DISALLOW_COPY_AND_ASSIGN(ChromeBrowsingDataRemoverDelegate);
311 }; 315 };
312 316
313 #endif // CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_ 317 #endif // CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698