Index: net/url_request/url_request_throttler_manager.h |
diff --git a/net/url_request/url_request_throttler_manager.h b/net/url_request/url_request_throttler_manager.h |
index d1ede1d02803f875bbbeeda2e3929c4ce0251ccb..9016faedc018b5235b41dfb2330854ff56f9371e 100644 |
--- a/net/url_request/url_request_throttler_manager.h |
+++ b/net/url_request/url_request_throttler_manager.h |
@@ -4,6 +4,7 @@ |
#ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ |
#define NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ |
+#pragma once |
#include <map> |
#include <string> |
@@ -11,7 +12,7 @@ |
#include "base/basictypes.h" |
#include "base/scoped_ptr.h" |
#include "base/singleton.h" |
-#include "base/threading/thread_checker_impl.h" |
+#include "base/threading/non_thread_safe.h" |
#include "googleurl/src/gurl.h" |
#include "net/url_request/url_request_throttler_entry.h" |
@@ -26,13 +27,7 @@ namespace net { |
// are registered, and does garbage collection from time to time in order to |
// clean out outdated entries. URL ID consists of lowercased scheme, host, port |
// and path. All URLs converted to the same ID will share the same entry. |
-// |
-// NOTE: All usage of the singleton object of this class should be on the same |
-// thread. |
-// |
-// TODO(joi): Switch back to NonThreadSafe (and remove checks in release builds) |
-// once crbug.com/71721 has been tracked down. |
-class URLRequestThrottlerManager { |
+class URLRequestThrottlerManager : public base::NonThreadSafe { |
public: |
static URLRequestThrottlerManager* GetInstance(); |
@@ -93,20 +88,10 @@ class URLRequestThrottlerManager { |
// Number of requests that will be made between garbage collection. |
static const unsigned int kRequestsBetweenCollecting; |
- // Constructor copies the string "MAGICZZ\0" into this buffer; using it |
- // to try to detect memory overwrites affecting url_entries_ in the wild. |
- // TODO(joi): Remove once crbug.com/71721 is figured out. |
- char magic_buffer_1_[8]; |
- |
// Map that contains a list of URL ID and their matching |
// URLRequestThrottlerEntry. |
UrlEntryMap url_entries_; |
- // Constructor copies the string "GOOGYZZ\0" into this buffer; using it |
- // to try to detect memory overwrites affecting url_entries_ in the wild. |
- // TODO(joi): Remove once crbug.com/71721 is figured out. |
- char magic_buffer_2_[8]; |
- |
// This keeps track of how many requests have been made. Used with |
// GarbageCollectEntries. |
unsigned int requests_since_last_gc_; |
@@ -126,8 +111,6 @@ class URLRequestThrottlerManager { |
// workaround. |
bool being_tested_; |
- base::ThreadCheckerImpl thread_checker_; |
- |
DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerManager); |
}; |