diff options
author | kevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 15:07:37 +0000 |
---|---|---|
committer | kevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 15:07:37 +0000 |
commit | 75d488fd44ddebabbd292cdd013f2b5a012a8b47 (patch) | |
tree | ed1bdf8111071d9c4b05d9df547592e519c244ec /base | |
parent | a3a7d5222bcb1fdc7a886206701f273a85769895 (diff) | |
download | chromium_src-75d488fd44ddebabbd292cdd013f2b5a012a8b47.zip chromium_src-75d488fd44ddebabbd292cdd013f2b5a012a8b47.tar.gz chromium_src-75d488fd44ddebabbd292cdd013f2b5a012a8b47.tar.bz2 |
Revert 134269 - Revert 134234 - Turn thread restrictions on for release builds as well so that they're triggered in (default) try/commit jobs. I let them be compiled out only in official builds.
Revert breaks ChromeOS Builder (dbg)
Also update bug for net::FileStream usage.
Review URL: https://chromiumcodereview.appspot.com/10238009
TBR=jam@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10256003
TBR=kevers@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10255004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/threading/thread_restrictions.cc | 6 | ||||
-rw-r--r-- | base/threading/thread_restrictions.h | 22 |
2 files changed, 19 insertions, 9 deletions
diff --git a/base/threading/thread_restrictions.cc b/base/threading/thread_restrictions.cc index 2300a78..ba77444 100644 --- a/base/threading/thread_restrictions.cc +++ b/base/threading/thread_restrictions.cc @@ -4,8 +4,8 @@ #include "base/threading/thread_restrictions.h" -// This entire file is compiled out in Release mode. -#ifndef NDEBUG +// This entire file is compiled out in official builds. +#if !defined(OFFICIAL_BUILD) #include "base/lazy_instance.h" #include "base/logging.h" @@ -83,4 +83,4 @@ bool ThreadRestrictions::SetWaitAllowed(bool allowed) { } // namespace base -#endif // NDEBUG +#endif // !defined(OFFICIAL_BUILD) diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h index 980f1f8..9b79587 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h @@ -13,6 +13,12 @@ class MetricsService; class RenderWidgetHelper; class TestingAutomationProvider; class TextInputClientMac; +class NativeBackendKWallet; + +namespace browser_sync { +class NonFrontendDataTypeController; +class UIModelWorker; +} namespace chromeos { class AudioMixerAlsa; } @@ -62,7 +68,9 @@ class ThreadTestHelper; // current thread is allowed: // base::ThreadRestrictions::AssertIOAllowed(); // -// ThreadRestrictions does nothing in release builds; it is debug-only. +// ThreadRestrictions does nothing in official builds; we enable it in release +// builds as well as debug because the trybots are release by default and we +// we want to catch this at code review time before commit. // // Style tip: where should you put AssertIOAllowed checks? It's best // if you put them as close to the disk access as possible, at the @@ -100,7 +108,7 @@ class BASE_EXPORT ThreadRestrictions { DISALLOW_COPY_AND_ASSIGN(ScopedAllowSingleton); }; -#ifndef NDEBUG +#if !defined(OFFICIAL_BUILD) // Set whether the current thread to make IO calls. // Threads start out in the *allowed* state. // Returns the previous value. @@ -126,7 +134,7 @@ class BASE_EXPORT ThreadRestrictions { // Check whether the current thread is allowed to wait, and DCHECK if not. static void AssertWaitAllowed(); #else - // In Release builds, inline the empty definitions of these functions so + // In official builds, inline the empty definitions of these functions so // that they can be compiled out. static bool SetIOAllowed(bool allowed) { return true; } static void AssertIOAllowed() {} @@ -148,14 +156,16 @@ class BASE_EXPORT ThreadRestrictions { // END ALLOWED USAGE. // BEGIN USAGE THAT NEEDS TO BE FIXED. friend class ::chromeos::AudioMixerAlsa; // http://crbug.com/125206 + friend class browser_sync::NonFrontendDataTypeController; // http://crbug.com/19757 + friend class browser_sync::UIModelWorker; // http://crbug.com/19757 friend class chrome_browser_net::Predictor; // http://crbug.com/78451 friend class dbus::Bus; // http://crbug.com/125222 friend class disk_cache::BackendImpl; // http://crbug.com/74623 friend class disk_cache::InFlightIO; // http://crbug.com/74623 friend class gdata::GDataFileSystem; // http://crbug.com/125220 friend class media::AudioOutputController; // http://crbug.com/120973 - friend class net::FileStreamPosix; // http://crbug.com/74623 - friend class net::FileStreamWin; // http://crbug.com/74623 + friend class net::FileStreamPosix; // http://crbug.com/115067 + friend class net::FileStreamWin; // http://crbug.com/115067 friend class net::NetworkManagerApi; // http://crbug.com/125097 friend class ::BrowserProcessImpl; // http://crbug.com/125207 friend class ::MetricsService; // http://crbug.com/124954 @@ -163,7 +173,7 @@ class BASE_EXPORT ThreadRestrictions { friend class ::NativeBackendKWallet; // http://crbug.com/125331 // END USAGE THAT NEEDS TO BE FIXED. -#ifndef NDEBUG +#if !defined(OFFICIAL_BUILD) static bool SetWaitAllowed(bool allowed); #else static bool SetWaitAllowed(bool allowed) { return true; } |