diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 05:52:30 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 05:52:30 +0000 |
commit | 364d6eae3a61c300f36d5bfe1ea1bdeb45e63410 (patch) | |
tree | b81bba1048d5e56a0cf905885f111fdd336b9e63 /base | |
parent | a3988cc6dc963e8e8672448056246d649ca7fa45 (diff) | |
download | chromium_src-364d6eae3a61c300f36d5bfe1ea1bdeb45e63410.zip chromium_src-364d6eae3a61c300f36d5bfe1ea1bdeb45e63410.tar.gz chromium_src-364d6eae3a61c300f36d5bfe1ea1bdeb45e63410.tar.bz2 |
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.
Also update bug for net::FileStream usage.
Review URL: https://chromiumcodereview.appspot.com/10238009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134234 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 | 20 |
2 files changed, 17 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 8dc050d..95357b7 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h @@ -13,6 +13,10 @@ class MetricsService; class RenderWidgetHelper; class TestingAutomationProvider; class TextInputClientMac; +namespace browser_sync { +class NonFrontendDataTypeController; +class UIModelWorker; +} namespace chromeos { class AudioMixerAlsa; } @@ -62,7 +66,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 +106,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 +132,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,21 +154,23 @@ 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 friend class ::TextInputClientMac; // http://crbug.com/121917 // 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; } |