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

Unified Diff: chrome/browser/after_startup_task_utils.cc

Issue 2911983003: Replace deprecated base::NonThreadSafe in chrome in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/after_startup_task_utils.cc
diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_startup_task_utils.cc
index 1ba1bd5529627ea2f916b764962b28ac9c214bb0..5c032d1da9a4af0a93d625c8e2f12262886c99c5 100644
--- a/chrome/browser/after_startup_task_utils.cc
+++ b/chrome/browser/after_startup_task_utils.cc
@@ -13,6 +13,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/process/process_info.h"
#include "base/rand_util.h"
+#include "base/sequence_checker.h"
#include "base/synchronization/atomic_flag.h"
#include "base/task_runner.h"
#include "base/tracked_objects.h"
@@ -122,16 +123,19 @@ void SetBrowserStartupIsComplete() {
// Observes the first visible page load and sets the startup complete
// flag accordingly.
-class StartupObserver : public WebContentsObserver, public base::NonThreadSafe {
+class StartupObserver : public WebContentsObserver {
public:
StartupObserver() : weak_factory_(this) {}
- ~StartupObserver() override { DCHECK(IsBrowserStartupComplete()); }
+ ~StartupObserver() override {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(IsBrowserStartupComplete());
+ }
void Start();
private:
void OnStartupComplete() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
SetBrowserStartupIsComplete();
delete this;
}
@@ -156,6 +160,8 @@ class StartupObserver : public WebContentsObserver, public base::NonThreadSafe {
void WebContentsDestroyed() override { OnStartupComplete(); }
+ SEQUENCE_CHECKER(sequence_checker_);
+
base::WeakPtrFactory<StartupObserver> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(StartupObserver);
« no previous file with comments | « no previous file | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698