diff options
author | lukasza <lukasza@chromium.org> | 2015-06-11 21:21:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-12 04:22:02 +0000 |
commit | 037c10b1b0e88341219a7943143487fd65080186 (patch) | |
tree | 174b3d6027a722f33d48f379f497a398994148bd /chrome/browser/chromeos/drive/file_write_watcher.h | |
parent | 28fcf1477d5a5928d9e43e8f87f762693f722739 (diff) | |
download | chromium_src-037c10b1b0e88341219a7943143487fd65080186.zip chromium_src-037c10b1b0e88341219a7943143487fd65080186.tar.gz chromium_src-037c10b1b0e88341219a7943143487fd65080186.tar.bz2 |
DCHECK..ON(BrowserThread::UI) -> DCHECK(thread_checker_.CalledOnValidThread())
This changelist removes one unnecessary dependency from
chrome/browser/chromeos/drive
to
content/public/browser/browser_thread.h
- Where possible
DCHECK_CURRENTLY_ON(BrowserThread::UI)
is replaced with
DCHECK(thread_checker_.CalledOnValidThread())
- The new DCHECK is in theory more relaxed than the original DCHECK, but
in practice is no different, assumming that objects (and therefore the
newly added base::ThreadChecker field) are created from the UI thread
(in practice this is enforced by DCHECK_CURRENTLY_ON(BrowserThread::UI)
in the constructor and methods of DriveIntegrationService).
- The old DCHECK is left untouched in places that do not have to be
reused outside of a browser (most notably - browser-specific
file_system_util.cc and most of drive_integration_service.cc).
- The old DCHECK is removed without adding the new DCHECK in a few
places where base::ThreadChecker could not be used in a straightforward
way (i.e. in standalone functions or callbacks).
BUG=498951
TEST=built (GYP_DEFINES="... chromeos=1") and run unit_tests gyp/ninja target from chrome/chrome_tests_unit.gypi
Review URL: https://codereview.chromium.org/1177823002
Cr-Commit-Position: refs/heads/master@{#334127}
Diffstat (limited to 'chrome/browser/chromeos/drive/file_write_watcher.h')
-rw-r--r-- | chrome/browser/chromeos/drive/file_write_watcher.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/drive/file_write_watcher.h b/chrome/browser/chromeos/drive/file_write_watcher.h index 63ee9f5..68004ca 100644 --- a/chrome/browser/chromeos/drive/file_write_watcher.h +++ b/chrome/browser/chromeos/drive/file_write_watcher.h @@ -7,6 +7,7 @@ #include "base/callback_forward.h" #include "base/memory/scoped_ptr.h" +#include "base/threading/thread_checker.h" #include "chrome/browser/chromeos/drive/file_system_util.h" namespace base { @@ -54,6 +55,8 @@ class FileWriteWatcher { class FileWriteWatcherImpl; scoped_ptr<FileWriteWatcherImpl, util::DestroyHelper> watcher_impl_; + base::ThreadChecker thread_checker_; + DISALLOW_COPY_AND_ASSIGN(FileWriteWatcher); }; |