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

Unified Diff: chrome/browser/ui/views/status_icons/status_tray_win.cc

Issue 2909213002: Replace deprecated base::NonThreadSafe in chrome/browser/ui/views in favor of SequenceChecker. (Closed)
Patch Set: SequenceChecker => ThreadChecker for StatusTrayStateChangerWin 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 | « chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/status_icons/status_tray_win.cc
diff --git a/chrome/browser/ui/views/status_icons/status_tray_win.cc b/chrome/browser/ui/views/status_icons/status_tray_win.cc
index 511a1ea369c67ffebc8eaa9133204bf0f440c59e..c9693a549252d9d26ac626e0bfee30f2924ef038 100644
--- a/chrome/browser/ui/views/status_icons/status_tray_win.cc
+++ b/chrome/browser/ui/views/status_icons/status_tray_win.cc
@@ -12,8 +12,8 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
-#include "base/threading/non_thread_safe.h"
#include "base/threading/thread.h"
#include "base/win/wrapped_window_proc.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -40,8 +40,7 @@ UINT ReservedIconId(StatusTray::StatusIconType type) {
// Exporer.exe via COM. It spawns a background thread with a fresh COM
// apartment and requests that the visibility be increased unless the user
// has explicitly set the icon to be hidden.
-class StatusTrayStateChangerProxyImpl : public StatusTrayStateChangerProxy,
- public base::NonThreadSafe {
+class StatusTrayStateChangerProxyImpl : public StatusTrayStateChangerProxy {
public:
StatusTrayStateChangerProxyImpl()
: pending_requests_(0),
@@ -50,8 +49,12 @@ class StatusTrayStateChangerProxyImpl : public StatusTrayStateChangerProxy,
worker_thread_.init_com_with_mta(false);
}
+ ~StatusTrayStateChangerProxyImpl() override {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ }
+
void EnqueueChange(UINT icon_id, HWND window) override {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (pending_requests_ == 0)
worker_thread_.Start();
@@ -80,7 +83,7 @@ class StatusTrayStateChangerProxyImpl : public StatusTrayStateChangerProxy,
// Called on UI thread.
void ChangeDone() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_GT(pending_requests_, 0);
if (--pending_requests_ == 0)
@@ -90,6 +93,9 @@ class StatusTrayStateChangerProxyImpl : public StatusTrayStateChangerProxy,
private:
int pending_requests_;
base::Thread worker_thread_;
+
+ SEQUENCE_CHECKER(sequence_checker_);
+
base::WeakPtrFactory<StatusTrayStateChangerProxyImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(StatusTrayStateChangerProxyImpl);
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698