diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 23:38:51 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 23:38:51 +0000 |
commit | 4006448408b35ca6be5aef5db1be1e966d31eee4 (patch) | |
tree | d5b94f868aed7307b289fe0ab937d49a21a762ef /net/url_request/url_request_throttler_manager.h | |
parent | bdcf77a58ac680951fc6bf4f02b3b46f172ab01b (diff) | |
download | chromium_src-4006448408b35ca6be5aef5db1be1e966d31eee4.zip chromium_src-4006448408b35ca6be5aef5db1be1e966d31eee4.tar.gz chromium_src-4006448408b35ca6be5aef5db1be1e966d31eee4.tar.bz2 |
Modify ThreadChecker and NonThreadSafe so that their
functionality is available in release builds if explicitly
requested by using their Impl types. The default usage remains
that they do nothing in release mode.
Also, update unit tests to run in release mode, verifying that the release versions of NonThreadSafe and ThreadChecker do nothing in release builds.
BUG=none
TEST=base unit tests
Review URL: http://codereview.chromium.org/6599004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_throttler_manager.h')
-rw-r--r-- | net/url_request/url_request_throttler_manager.h | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/net/url_request/url_request_throttler_manager.h b/net/url_request/url_request_throttler_manager.h index f037fe7..d1ede1d 100644 --- a/net/url_request/url_request_throttler_manager.h +++ b/net/url_request/url_request_throttler_manager.h @@ -11,37 +11,12 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/singleton.h" -#include "base/synchronization/lock.h" // ThreadCheckerForRelease -#include "base/threading/platform_thread.h" // ThreadCheckerForRelease +#include "base/threading/thread_checker_impl.h" #include "googleurl/src/gurl.h" #include "net/url_request/url_request_throttler_entry.h" namespace net { -// TODO(joi): Delete this temporary copy of base::ThreadChecker (needed to -// enable it in release builds) and go back to simply inheriting from -// NonThreadSafe once crbug.com/71721 has been tracked down. -class ThreadCheckerForRelease { - public: - ThreadCheckerForRelease(); - ~ThreadCheckerForRelease(); - - bool CalledOnValidThread() const; - - // Changes the thread that is checked for in CalledOnValidThread. This may - // be useful when an object may be created on one thread and then used - // exclusively on another thread. - void DetachFromThread(); - - private: - void EnsureThreadIdAssigned() const; - - mutable base::Lock lock_; - // This is mutable so that CalledOnValidThread can set it. - // It's guarded by |lock_|. - mutable base::PlatformThreadId valid_thread_id_; -}; - // Class that registers URL request throttler entries for URLs being accessed // in order to supervise traffic. URL requests for HTTP contents should // register their URLs in this manager on each request. @@ -151,7 +126,7 @@ class URLRequestThrottlerManager { // workaround. bool being_tested_; - ThreadCheckerForRelease thread_checker_; + base::ThreadCheckerImpl thread_checker_; DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerManager); }; |