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

Side by Side Diff: components/history/core/browser/history_service.h

Issue 1368293012: HistoryQuickProviderTest.DeleteMatch thread safety fix. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 (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 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 scoped_ptr<base::CallbackList<void(const std::set<GURL>&, 496 scoped_ptr<base::CallbackList<void(const std::set<GURL>&,
497 const GURL&)>::Subscription> 497 const GURL&)>::Subscription>
498 AddFaviconsChangedCallback(const OnFaviconsChangedCallback& callback) 498 AddFaviconsChangedCallback(const OnFaviconsChangedCallback& callback)
499 WARN_UNUSED_RESULT; 499 WARN_UNUSED_RESULT;
500 500
501 // Testing ------------------------------------------------------------------- 501 // Testing -------------------------------------------------------------------
502 502
503 // Runs |flushed| after bouncing off the history thread. 503 // Runs |flushed| after bouncing off the history thread.
504 void FlushForTest(const base::Closure& flushed); 504 void FlushForTest(const base::Closure& flushed);
505 505
506 // Runs |task| on the history thread, and then |reply| on the sending thread.
507 bool PostTaskAndReplyForTest(const base::Closure& task,
sky 2015/09/30 23:52:10 THis is effectively duplicating what HistoryDBTask
Scott Hess - ex-Googler 2015/10/01 18:08:39 Didn't know about that one. Converted.
508 const base::Closure& reply);
509
506 // Designed for unit tests, this passes the given task on to the history 510 // Designed for unit tests, this passes the given task on to the history
507 // backend to be called once the history backend has terminated. This allows 511 // backend to be called once the history backend has terminated. This allows
508 // callers to know when the history thread is complete and the database files 512 // callers to know when the history thread is complete and the database files
509 // can be deleted and the next test run. Otherwise, the history thread may 513 // can be deleted and the next test run. Otherwise, the history thread may
510 // still be running, causing problems in subsequent tests. 514 // still be running, causing problems in subsequent tests.
511 // 515 //
512 // There can be only one closing task, so this will override any previously 516 // There can be only one closing task, so this will override any previously
513 // set task. We will take ownership of the pointer and delete it when done. 517 // set task. We will take ownership of the pointer and delete it when done.
514 // The task will be run on the calling thread (this function is threadsafe). 518 // The task will be run on the calling thread (this function is threadsafe).
515 void SetOnBackendDestroyTask(const base::Closure& task); 519 void SetOnBackendDestroyTask(const base::Closure& task);
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 863
860 // All vended weak pointers are invalidated in Cleanup(). 864 // All vended weak pointers are invalidated in Cleanup().
861 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; 865 base::WeakPtrFactory<HistoryService> weak_ptr_factory_;
862 866
863 DISALLOW_COPY_AND_ASSIGN(HistoryService); 867 DISALLOW_COPY_AND_ASSIGN(HistoryService);
864 }; 868 };
865 869
866 } // namespace history 870 } // namespace history
867 871
868 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ 872 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider_unittest.cc ('k') | components/history/core/browser/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698