diff options
53 files changed, 128 insertions, 109 deletions
diff --git a/base/base.gyp b/base/base.gyp index b1e61e2..97cb3e0 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -106,7 +106,6 @@ 'metrics/field_trial_unittest.cc', 'metrics/histogram_unittest.cc', 'metrics/stats_table_unittest.cc', - 'non_thread_safe_unittest.cc', 'object_watcher_unittest.cc', 'observer_list_unittest.cc', 'path_service_unittest.cc', @@ -139,6 +138,7 @@ 'sys_string_conversions_unittest.cc', 'task_queue_unittest.cc', 'task_unittest.cc', + 'threading/non_thread_safe_unittest.cc', 'threading/platform_thread_unittest.cc', 'threading/simple_thread_unittest.cc', 'threading/thread_checker_unittest.cc', diff --git a/base/base.gypi b/base/base.gypi index 451803a..e7ebe0d 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -151,9 +151,6 @@ 'native_library_linux.cc', 'native_library_mac.mm', 'native_library_win.cc', - 'non_thread_safe.cc', - 'non_thread_safe.h', - 'nullable_string16.h', 'object_watcher.cc', 'object_watcher.h', 'observer_list.h', @@ -239,6 +236,8 @@ 'task_queue.cc', 'task_queue.h', 'template_util.h', + 'threading/non_thread_safe.cc', + 'threading/non_thread_safe.h', 'threading/platform_thread.h', 'threading/platform_thread_mac.mm', 'threading/platform_thread_posix.cc', diff --git a/base/task.h b/base/task.h index 85c0878..fc986b2 100644 --- a/base/task.h +++ b/base/task.h @@ -6,7 +6,6 @@ #define BASE_TASK_H_ #pragma once -#include "base/non_thread_safe.h" #include "base/raw_scoped_refptr_mismatch_checker.h" #include "base/tracked.h" #include "base/tuple.h" diff --git a/base/non_thread_safe.cc b/base/threading/non_thread_safe.cc index b01ed55..8b41bc0 100644 --- a/base/non_thread_safe.cc +++ b/base/threading/non_thread_safe.cc @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" // These checks are only done in debug builds. #ifndef NDEBUG #include "base/logging.h" +namespace base { + NonThreadSafe::~NonThreadSafe() { DCHECK(CalledOnValidThread()); } @@ -21,4 +23,6 @@ void NonThreadSafe::DetachFromThread() { thread_checker_.DetachFromThread(); } +} // namespace base + #endif // NDEBUG diff --git a/base/non_thread_safe.h b/base/threading/non_thread_safe.h index 24a9012..868a031 100644 --- a/base/non_thread_safe.h +++ b/base/threading/non_thread_safe.h @@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_NON_THREAD_SAFE_H_ -#define BASE_NON_THREAD_SAFE_H_ +#ifndef BASE_THREADING_NON_THREAD_SAFE_H_ +#define BASE_THREADING_NON_THREAD_SAFE_H_ #pragma once #include "base/threading/thread_checker.h" +namespace base { + // A helper class used to help verify that methods of a class are // called from the same thread. One can inherit from this class and use // CalledOnValidThread() to verify. @@ -16,7 +18,7 @@ // aren't. For example, a service or a singleton like the preferences system. // // Example: -// class MyClass : public NonThreadSafe { +// class MyClass : public base::NonThreadSafe { // public: // void Foo() { // DCHECK(CalledOnValidThread()); @@ -42,7 +44,7 @@ class NonThreadSafe { void DetachFromThread(); private: - base::ThreadChecker thread_checker_; + ThreadChecker thread_checker_; }; #else // Do nothing in release mode. @@ -57,4 +59,6 @@ class NonThreadSafe { }; #endif // NDEBUG +} // namespace base + #endif // BASE_NON_THREAD_SAFE_H_ diff --git a/base/non_thread_safe_unittest.cc b/base/threading/non_thread_safe_unittest.cc index 98af0e1..7d158cf 100644 --- a/base/non_thread_safe_unittest.cc +++ b/base/threading/non_thread_safe_unittest.cc @@ -4,13 +4,15 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "base/threading/simple_thread.h" #include "testing/gtest/include/gtest/gtest.h" #ifndef NDEBUG +namespace base { + // Simple class to exersice the basics of NonThreadSafe. // Both the destructor and DoStuff should verify that they were // called on the same thread as the constructor. @@ -32,7 +34,7 @@ class NonThreadSafeClass : public NonThreadSafe { }; // Calls NonThreadSafeClass::DoStuff on another thread. -class CallDoStuffOnThread : public base::SimpleThread { +class CallDoStuffOnThread : public SimpleThread { public: CallDoStuffOnThread(NonThreadSafeClass* non_thread_safe_class) : SimpleThread("call_do_stuff_on_thread"), @@ -50,7 +52,7 @@ class CallDoStuffOnThread : public base::SimpleThread { }; // Deletes NonThreadSafeClass on a different thread. -class DeleteNonThreadSafeClassOnThread : public base::SimpleThread { +class DeleteNonThreadSafeClassOnThread : public SimpleThread { public: DeleteNonThreadSafeClassOnThread(NonThreadSafeClass* non_thread_safe_class) : SimpleThread("delete_non_thread_safe_class_on_thread"), @@ -123,4 +125,6 @@ TEST(NonThreadSafeDeathTest, DestructorNotAllowedOnDifferentThread) { #endif // GTEST_HAS_DEATH_TEST +} // namespace base + #endif // NDEBUG diff --git a/base/weak_ptr.h b/base/weak_ptr.h index ed9ef66..6168367 100644 --- a/base/weak_ptr.h +++ b/base/weak_ptr.h @@ -53,8 +53,8 @@ #pragma once #include "base/logging.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" namespace base { @@ -64,7 +64,7 @@ namespace internal { class WeakReference { public: - class Flag : public RefCounted<Flag>, public NonThreadSafe { + class Flag : public RefCounted<Flag>, public base::NonThreadSafe { public: Flag(Flag** handle); ~Flag(); @@ -74,7 +74,7 @@ class WeakReference { void Invalidate() { handle_ = NULL; } bool is_valid() const { return handle_ != NULL; } - void DetachFromThread() { NonThreadSafe::DetachFromThread(); } + void DetachFromThread() { base::NonThreadSafe::DetachFromThread(); } private: Flag** handle_; diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index c763d31..d5d3b51 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -15,7 +15,7 @@ #include "base/basictypes.h" #include "base/message_loop.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "base/timer.h" #include "base/scoped_ptr.h" #include "chrome/browser/browser_process.h" @@ -36,7 +36,7 @@ class TabCloseableStateWatcher; // Real implementation of BrowserProcess that creates and returns the services. class BrowserProcessImpl : public BrowserProcess, - public NonThreadSafe, + public base::NonThreadSafe, public NotificationObserver { public: explicit BrowserProcessImpl(const CommandLine& command_line); diff --git a/chrome/browser/chromeos/cros_settings.h b/chrome/browser/chromeos/cros_settings.h index 79428d2..c8446c5 100644 --- a/chrome/browser/chromeos/cros_settings.h +++ b/chrome/browser/chromeos/cros_settings.h @@ -10,9 +10,9 @@ #include <vector> #include "base/hash_tables.h" -#include "base/non_thread_safe.h" #include "base/observer_list.h" #include "base/singleton.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/chromeos/cros_settings_names.h" #include "chrome/common/notification_observer.h" @@ -27,7 +27,7 @@ namespace chromeos { class CrosSettingsProvider; // A class manages per-device/global settings. -class CrosSettings : public NonThreadSafe { +class CrosSettings : public base::NonThreadSafe { public: // Class factory. static CrosSettings* Get(); diff --git a/chrome/browser/geolocation/device_data_provider.h b/chrome/browser/geolocation/device_data_provider.h index b6a3882..f795d10 100644 --- a/chrome/browser/geolocation/device_data_provider.h +++ b/chrome/browser/geolocation/device_data_provider.h @@ -29,11 +29,11 @@ #include "base/basictypes.h" #include "base/message_loop.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/string16.h" #include "base/string_util.h" #include "base/task.h" +#include "base/threading/non_thread_safe.h" // The following data structures are used to store cell radio data and wifi // data. See the Geolocation API design document at @@ -264,7 +264,7 @@ typedef DeviceDataProviderImplBase<WifiData> WifiDataProviderImplBase; // location providers. These location providers access the instance through the // Register and Unregister methods. template<typename DataType> -class DeviceDataProvider : public NonThreadSafe { +class DeviceDataProvider : public base::NonThreadSafe { public: // Interface to be implemented by listeners to a device data provider. class ListenerInterface { diff --git a/chrome/browser/geolocation/location_provider.h b/chrome/browser/geolocation/location_provider.h index 6c4d8da..fe19b36 100644 --- a/chrome/browser/geolocation/location_provider.h +++ b/chrome/browser/geolocation/location_provider.h @@ -15,8 +15,8 @@ #pragma once #include <map> -#include "base/non_thread_safe.h" #include "base/string16.h" +#include "base/threading/non_thread_safe.h" class AccessTokenStore; struct Geoposition; @@ -24,7 +24,7 @@ class GURL; class URLRequestContextGetter; // The base class used by all location providers. -class LocationProviderBase : public NonThreadSafe { +class LocationProviderBase : public base::NonThreadSafe { public: // Clients of the location provider must implement this interface. All call- // backs to this interface will happen in the context of the thread on which diff --git a/chrome/browser/gpu_process_host.h b/chrome/browser/gpu_process_host.h index 14edf88..e3bc66a 100644 --- a/chrome/browser/gpu_process_host.h +++ b/chrome/browser/gpu_process_host.h @@ -9,8 +9,8 @@ #include <queue> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/browser_child_process_host.h" #include "gfx/native_widget_types.h" @@ -29,7 +29,8 @@ struct ChannelHandle; class Message; } -class GpuProcessHost : public BrowserChildProcessHost, public NonThreadSafe { +class GpuProcessHost : public BrowserChildProcessHost, + public base::NonThreadSafe { public: // Getter for the singleton. This will return NULL on failure. static GpuProcessHost* Get(); diff --git a/chrome/browser/gpu_process_host_ui_shim.h b/chrome/browser/gpu_process_host_ui_shim.h index f261093d..17bf970 100644 --- a/chrome/browser/gpu_process_host_ui_shim.h +++ b/chrome/browser/gpu_process_host_ui_shim.h @@ -12,9 +12,9 @@ // shuttling messages between the browser and GPU processes. #include "base/callback.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" #include "base/singleton.h" +#include "base/threading/non_thread_safe.h" #include "chrome/common/gpu_info.h" #include "chrome/common/message_router.h" #include "ipc/ipc_channel.h" @@ -22,7 +22,7 @@ class GpuProcessHostUIShim : public IPC::Channel::Sender, public IPC::Channel::Listener, - public NonThreadSafe { + public base::NonThreadSafe { public: // Getter for the singleton. This will return NULL on failure. static GpuProcessHostUIShim* GetInstance(); diff --git a/chrome/browser/policy/asynchronous_policy_provider.h b/chrome/browser/policy/asynchronous_policy_provider.h index 561fc37..a6079dc 100644 --- a/chrome/browser/policy/asynchronous_policy_provider.h +++ b/chrome/browser/policy/asynchronous_policy_provider.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_PROVIDER_H_ #pragma once -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "base/weak_ptr.h" #include "chrome/browser/policy/configuration_policy_provider.h" @@ -21,7 +21,7 @@ class AsynchronousPolicyLoader; // policy is handled by a delegate passed at construction time. class AsynchronousPolicyProvider : public ConfigurationPolicyProvider, - public NonThreadSafe { + public base::NonThreadSafe { public: // Must be implemented by subclasses of the asynchronous policy provider to // provide the implementation details of how policy is loaded. diff --git a/chrome/browser/policy/device_management_backend.h b/chrome/browser/policy/device_management_backend.h index 24e7315..114c7b7 100644 --- a/chrome/browser/policy/device_management_backend.h +++ b/chrome/browser/policy/device_management_backend.h @@ -9,7 +9,7 @@ #include <string> #include "base/basictypes.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/policy/proto/device_management_backend.pb.h" namespace policy { @@ -20,7 +20,7 @@ namespace em = enterprise_management; // server, which provides services to register Chrome installations and CrOS // devices for the purpose of fetching centrally-administered policy from the // cloud. -class DeviceManagementBackend : NonThreadSafe { +class DeviceManagementBackend : base::NonThreadSafe { public: enum ErrorCode { // Request payload invalid. diff --git a/chrome/browser/prefs/pref_notifier_impl.h b/chrome/browser/prefs/pref_notifier_impl.h index 1d61830..085e547 100644 --- a/chrome/browser/prefs/pref_notifier_impl.h +++ b/chrome/browser/prefs/pref_notifier_impl.h @@ -9,8 +9,8 @@ #include <string> #include "base/hash_tables.h" -#include "base/non_thread_safe.h" #include "base/observer_list.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/prefs/pref_notifier.h" class PrefService; @@ -18,7 +18,7 @@ class NotificationObserver; // The PrefNotifier implementation used by the PrefService. class PrefNotifierImpl : public PrefNotifier, - public NonThreadSafe { + public base::NonThreadSafe { public: explicit PrefNotifierImpl(PrefService* pref_service); virtual ~PrefNotifierImpl(); diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h index 5485292..f17bbbd 100644 --- a/chrome/browser/prefs/pref_service.h +++ b/chrome/browser/prefs/pref_service.h @@ -11,9 +11,9 @@ #include <set> #include <string> -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "base/values.h" class DefaultPrefStore; @@ -31,7 +31,7 @@ namespace subtle { class PrefMemberBase; }; -class PrefService : public NonThreadSafe { +class PrefService : public base::NonThreadSafe { public: // A helper class to store all the information associated with a preference. class Preference { diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h index 045581c..2c49e68 100644 --- a/chrome/browser/prerender/prerender_manager.h +++ b/chrome/browser/prerender/prerender_manager.h @@ -8,8 +8,8 @@ #include <list> -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "base/time.h" #include "googleurl/src/gurl.h" @@ -19,7 +19,7 @@ class TabContents; // PrerenderManager is responsible for initiating and keeping prerendered // views of webpages. -class PrerenderManager : NonThreadSafe { +class PrerenderManager : base::NonThreadSafe { public: // Owned by a Profile object for the lifetime of the profile. explicit PrerenderManager(Profile* profile); diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h index 250d96bd..9418c60 100644 --- a/chrome/browser/process_singleton.h +++ b/chrome/browser/process_singleton.h @@ -14,8 +14,8 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "gfx/native_widget_types.h" #if defined(OS_POSIX) @@ -40,7 +40,7 @@ class FilePath; // - the Windows implementation uses an invisible global message window; // - the Linux implementation uses a Unix domain socket in the user data dir. -class ProcessSingleton : public NonThreadSafe { +class ProcessSingleton : public base::NonThreadSafe { public: enum NotifyResult { PROCESS_NONE, diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h index d46c900..1d6483d 100644 --- a/chrome/browser/profiles/profile_manager.h +++ b/chrome/browser/profiles/profile_manager.h @@ -13,14 +13,14 @@ #include "app/system_monitor.h" #include "base/basictypes.h" #include "base/message_loop.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" class FilePath; -class ProfileManager : public NonThreadSafe, +class ProfileManager : public base::NonThreadSafe, public SystemMonitor::PowerObserver, public NotificationObserver { public: diff --git a/chrome/browser/ssl/ssl_host_state.h b/chrome/browser/ssl/ssl_host_state.h index 43880f3..a23a239 100644 --- a/chrome/browser/ssl/ssl_host_state.h +++ b/chrome/browser/ssl/ssl_host_state.h @@ -11,7 +11,7 @@ #include <set> #include "base/basictypes.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "googleurl/src/gurl.h" #include "net/base/x509_certificate.h" @@ -23,7 +23,7 @@ // from the SSLManager because this state is shared across many navigation // controllers. -class SSLHostState : public NonThreadSafe { +class SSLHostState : public base::NonThreadSafe { public: SSLHostState(); ~SSLHostState(); diff --git a/chrome/browser/sync/glue/session_model_associator.h b/chrome/browser/sync/glue/session_model_associator.h index 502af18..f2909af 100644 --- a/chrome/browser/sync/glue/session_model_associator.h +++ b/chrome/browser/sync/glue/session_model_associator.h @@ -13,6 +13,7 @@ #include "base/gtest_prod_util.h" #include "base/observer_list.h" #include "base/scoped_vector.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/session_types.h" #include "chrome/browser/sync/engine/syncapi.h" @@ -44,8 +45,10 @@ static const char kSessionsTag[] = "google_chrome_sessions"; // that gets overwritten everytime there is an update. From it, we build a new // foreign session windows list each time |GetSessionData| is called by the // ForeignSessionHandler. -class SessionModelAssociator : public PerDataTypeAssociatorInterface< - sync_pb::SessionSpecifics, std::string>, public NonThreadSafe { +class SessionModelAssociator + : public PerDataTypeAssociatorInterface<sync_pb::SessionSpecifics, + std::string>, + public base::NonThreadSafe { public: // Does not take ownership of sync_service. @@ -60,7 +63,7 @@ class SessionModelAssociator : public PerDataTypeAssociatorInterface< // Dummy method, we do everything all-at-once in UpdateFromSyncModel. virtual void Associate(const sync_pb::SessionSpecifics* specifics, - int64 sync_id) { + int64 sync_id) { } // Updates the sync model with the local client data. (calls diff --git a/chrome/browser/sync/notifier/cache_invalidation_packet_handler.h b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.h index ac2d0c4..a879836 100644 --- a/chrome/browser/sync/notifier/cache_invalidation_packet_handler.h +++ b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.h @@ -13,8 +13,8 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" -#include "base/non_thread_safe.h" #include "base/scoped_callback_factory.h" +#include "base/threading/non_thread_safe.h" #include "base/weak_ptr.h" namespace invalidation { @@ -52,7 +52,7 @@ class CacheInvalidationPacketHandler { void HandleInboundPacket(const std::string& packet); - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; base::ScopedCallbackFactory<CacheInvalidationPacketHandler> scoped_callback_factory_; diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client.h b/chrome/browser/sync/notifier/chrome_invalidation_client.h index e408085..99af02c 100644 --- a/chrome/browser/sync/notifier/chrome_invalidation_client.h +++ b/chrome/browser/sync/notifier/chrome_invalidation_client.h @@ -12,9 +12,9 @@ #include <string> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/scoped_callback_factory.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "base/weak_ptr.h" #include "chrome/browser/sync/notifier/chrome_system_resources.h" #include "chrome/browser/sync/notifier/state_writer.h" @@ -99,7 +99,7 @@ class ChromeInvalidationClient void HandleOutboundPacket( invalidation::NetworkEndpoint* const& network_endpoint); - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; ChromeSystemResources chrome_system_resources_; base::ScopedCallbackFactory<ChromeInvalidationClient> scoped_callback_factory_; diff --git a/chrome/browser/sync/notifier/chrome_system_resources.h b/chrome/browser/sync/notifier/chrome_system_resources.h index b6e6256..06b8001 100644 --- a/chrome/browser/sync/notifier/chrome_system_resources.h +++ b/chrome/browser/sync/notifier/chrome_system_resources.h @@ -14,9 +14,9 @@ #include <string> #include "base/message_loop.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" #include "base/task.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/sync/notifier/state_writer.h" #include "google/cacheinvalidation/invalidation-client.h" @@ -52,7 +52,7 @@ class ChromeSystemResources : public invalidation::SystemResources { invalidation::StorageCallback* callback); private: - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; scoped_ptr<ScopedRunnableMethodFactory<ChromeSystemResources> > scoped_runnable_method_factory_; // Holds all posted tasks that have not yet been run. diff --git a/chrome/browser/sync/notifier/registration_manager.h b/chrome/browser/sync/notifier/registration_manager.h index 1b1a534..2694373 100644 --- a/chrome/browser/sync/notifier/registration_manager.h +++ b/chrome/browser/sync/notifier/registration_manager.h @@ -12,7 +12,7 @@ #include <map> #include "base/basictypes.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "chrome/browser/sync/syncable/model_type.h" #include "google/cacheinvalidation/invalidation-client.h" @@ -54,7 +54,7 @@ class RegistrationManager { void OnRegister(const invalidation::RegistrationUpdateResult& result); - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; // Weak pointer. invalidation::InvalidationClient* invalidation_client_; RegistrationStatusMap registration_status_; diff --git a/chrome/browser/themes/browser_theme_provider.h b/chrome/browser/themes/browser_theme_provider.h index cddd153..e400a1f 100644 --- a/chrome/browser/themes/browser_theme_provider.h +++ b/chrome/browser/themes/browser_theme_provider.h @@ -11,8 +11,8 @@ #include <string> #include "app/theme_provider.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" namespace color_utils { struct HSL; @@ -32,7 +32,7 @@ class ResourceBundle; extern "C" NSString* const kBrowserThemeDidChangeNotification; #endif // __OBJC__ -class BrowserThemeProvider : public NonThreadSafe, +class BrowserThemeProvider : public base::NonThreadSafe, public ThemeProvider { public: // Public constants used in BrowserThemeProvider and its subclasses: diff --git a/chrome/common/chrome_plugin_util.h b/chrome/common/chrome_plugin_util.h index 5e78245..9769a76 100644 --- a/chrome/common/chrome_plugin_util.h +++ b/chrome/common/chrome_plugin_util.h @@ -9,8 +9,8 @@ #include <string> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "chrome/common/chrome_plugin_api.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" @@ -41,7 +41,7 @@ struct ScopableCPRequest : public CPRequest { // the plugin unloads. This object also verifies that it is created and // destroyed on the same thread. class PluginHelper : public NotificationObserver, - public NonThreadSafe { + public base::NonThreadSafe { public: static void DestroyAllHelpersForPlugin(ChromePluginLib* plugin); diff --git a/chrome/common/important_file_writer.h b/chrome/common/important_file_writer.h index 5fdabce..34c6067 100644 --- a/chrome/common/important_file_writer.h +++ b/chrome/common/important_file_writer.h @@ -10,8 +10,8 @@ #include "base/basictypes.h" #include "base/file_path.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "base/time.h" #include "base/timer.h" @@ -36,7 +36,7 @@ class Thread; // // If you want to know more about this approach and ext3/ext4 fsync issues, see // http://valhenson.livejournal.com/37921.html -class ImportantFileWriter : public NonThreadSafe { +class ImportantFileWriter : public base::NonThreadSafe { public: // Used by ScheduleSave to lazily provide the data to be saved. Allows us // to also batch data serializations. diff --git a/chrome/service/cloud_print/cloud_print_proxy.h b/chrome/service/cloud_print/cloud_print_proxy.h index a5832f2..d30957e 100644 --- a/chrome/service/cloud_print/cloud_print_proxy.h +++ b/chrome/service/cloud_print/cloud_print_proxy.h @@ -9,8 +9,8 @@ #include <string> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "chrome/service/cloud_print/cloud_print_proxy_backend.h" class ServiceProcessPrefs; @@ -18,7 +18,7 @@ class ServiceProcessPrefs; // CloudPrintProxy is the layer between the service process UI thread // and the cloud print proxy backend. class CloudPrintProxy : public CloudPrintProxyFrontend, - public NonThreadSafe { + public base::NonThreadSafe { public: class Client { public: diff --git a/chrome_frame/task_marshaller.h b/chrome_frame/task_marshaller.h index f0f6890..9fd3701 100644 --- a/chrome_frame/task_marshaller.h +++ b/chrome_frame/task_marshaller.h @@ -10,8 +10,9 @@ #include <deque> #include <queue> #include "base/lock.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "base/time.h" + class Task; namespace tracked_objects { class Location; @@ -21,7 +22,7 @@ namespace tracked_objects { // in cases where we do not control the thread lifetime and message retrieval // and dispatching. It uses a HWND to ::PostMessage to it as a signal that // the task queue is not empty. -class TaskMarshallerThroughMessageQueue : public NonThreadSafe { +class TaskMarshallerThroughMessageQueue : public base::NonThreadSafe { public: TaskMarshallerThroughMessageQueue(); ~TaskMarshallerThroughMessageQueue(); diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 823c2bb..ee58701 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -11,7 +11,7 @@ #include "base/auto_reset.h" #include "base/compiler_specific.h" #include "base/logging.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "base/utf_string_conversions.h" #include "ipc/ipc_logging.h" #include "ipc/ipc_message_utils.h" @@ -250,7 +250,7 @@ bool Channel::ChannelImpl::Connect() { DLOG_IF(WARNING, thread_check_.get()) << "Connect called more than once"; if (!thread_check_.get()) - thread_check_.reset(new NonThreadSafe()); + thread_check_.reset(new base::NonThreadSafe()); if (pipe_ == INVALID_HANDLE_VALUE) return false; diff --git a/ipc/ipc_channel_win.h b/ipc/ipc_channel_win.h index 82b70db..eb38777 100644 --- a/ipc/ipc_channel_win.h +++ b/ipc/ipc_channel_win.h @@ -14,7 +14,9 @@ #include "base/message_loop.h" #include "base/scoped_ptr.h" +namespace base { class NonThreadSafe; +} namespace IPC { @@ -78,7 +80,7 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler { ScopedRunnableMethodFactory<ChannelImpl> factory_; - scoped_ptr<NonThreadSafe> thread_check_; + scoped_ptr<base::NonThreadSafe> thread_check_; DISALLOW_COPY_AND_ASSIGN(ChannelImpl); }; diff --git a/jingle/notifier/base/task_pump.h b/jingle/notifier/base/task_pump.h index ff8411a..fb0a7eb 100644 --- a/jingle/notifier/base/task_pump.h +++ b/jingle/notifier/base/task_pump.h @@ -5,8 +5,8 @@ #ifndef JINGLE_NOTIFIER_BASE_TASK_PUMP_H_ #define JINGLE_NOTIFIER_BASE_TASK_PUMP_H_ -#include "base/non_thread_safe.h" #include "base/task.h" +#include "base/threading/non_thread_safe.h" #include "talk/base/taskrunner.h" namespace notifier { @@ -24,7 +24,7 @@ class TaskPump : public talk_base::TaskRunner { private: void CheckAndRunTasks(); - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; ScopedRunnableMethodFactory<TaskPump> scoped_runnable_method_factory_; bool posted_wake_; diff --git a/jingle/notifier/base/weak_xmpp_client.h b/jingle/notifier/base/weak_xmpp_client.h index adda962..411e5b9 100644 --- a/jingle/notifier/base/weak_xmpp_client.h +++ b/jingle/notifier/base/weak_xmpp_client.h @@ -11,7 +11,7 @@ #pragma once #include "base/basictypes.h" -#include "base/non_thread_safe.h" +#include "base/threading/non_thread_safe.h" #include "base/weak_ptr.h" #include "talk/xmpp/xmppclient.h" @@ -43,7 +43,7 @@ class WeakXmppClient : public buzz::XmppClient { virtual void Stop(); private: - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; // We use our own WeakPtrFactory instead of inheriting from // SupportsWeakPtr since we want to invalidate in other places // besides the destructor. diff --git a/jingle/notifier/base/xmpp_connection.h b/jingle/notifier/base/xmpp_connection.h index 6df2c9e..4be6197 100644 --- a/jingle/notifier/base/xmpp_connection.h +++ b/jingle/notifier/base/xmpp_connection.h @@ -9,8 +9,8 @@ #pragma once #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "base/weak_ptr.h" #include "talk/base/sigslot.h" #include "talk/xmpp/xmppengine.h" @@ -84,7 +84,7 @@ class XmppConnection : public sigslot::has_slots<> { void ClearClient(); - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; scoped_ptr<TaskPump> task_pump_; base::WeakPtr<WeakXmppClient> weak_xmpp_client_; bool on_connect_called_; diff --git a/jingle/notifier/listener/talk_mediator_impl.h b/jingle/notifier/listener/talk_mediator_impl.h index 48c284b..68b80cf 100644 --- a/jingle/notifier/listener/talk_mediator_impl.h +++ b/jingle/notifier/listener/talk_mediator_impl.h @@ -13,8 +13,8 @@ #include <vector> #include "base/gtest_prod_util.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "jingle/notifier/listener/mediator_thread.h" #include "jingle/notifier/listener/talk_mediator.h" #include "talk/xmpp/xmppclientsettings.h" @@ -70,7 +70,7 @@ class TalkMediatorImpl unsigned int subscribed : 1; // Subscribed to the xmpp receiving channel. }; - NonThreadSafe non_thread_safe_; + base::NonThreadSafe non_thread_safe_; // Delegate, which we don't own. May be NULL. TalkMediator::Delegate* delegate_; diff --git a/net/base/cert_verifier.h b/net/base/cert_verifier.h index 3d19abb..f0df67a 100644 --- a/net/base/cert_verifier.h +++ b/net/base/cert_verifier.h @@ -10,8 +10,8 @@ #include <string> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "base/time.h" #include "net/base/cert_verify_result.h" #include "net/base/completion_callback.h" @@ -46,7 +46,7 @@ struct CachedCertVerifyResult { // request at a time is to create a SingleRequestCertVerifier wrapper around // CertVerifier (which will automatically cancel the single request when it // goes out of scope). -class CertVerifier : public NonThreadSafe { +class CertVerifier : public base::NonThreadSafe { public: // Opaque type used to cancel a request. typedef void* RequestHandle; diff --git a/net/base/dnsrr_resolver.h b/net/base/dnsrr_resolver.h index 30de5fe..9cc5bb8 100644 --- a/net/base/dnsrr_resolver.h +++ b/net/base/dnsrr_resolver.h @@ -12,8 +12,8 @@ #include <vector> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "base/time.h" #include "build/build_config.h" #include "net/base/completion_callback.h" @@ -66,7 +66,7 @@ class RRResolverJob; // the name is a fully qualified DNS domain. // // A DnsRRResolver must be used from the MessageLoop which created it. -class DnsRRResolver : public NonThreadSafe, +class DnsRRResolver : public base::NonThreadSafe, public NetworkChangeNotifier::Observer { public: enum { diff --git a/net/base/host_cache.h b/net/base/host_cache.h index aedc499..11ab1f3 100644 --- a/net/base/host_cache.h +++ b/net/base/host_cache.h @@ -10,8 +10,8 @@ #include <string> #include "base/gtest_prod_util.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "base/time.h" #include "net/base/address_family.h" #include "net/base/address_list.h" @@ -19,7 +19,7 @@ namespace net { // Cache used by HostResolver to map hostnames to their resolved result. -class HostCache : public NonThreadSafe { +class HostCache : public base::NonThreadSafe { public: // Stores the latest address list that was looked up for a hostname. struct Entry : public base::RefCounted<Entry> { diff --git a/net/base/host_resolver_impl.h b/net/base/host_resolver_impl.h index 68c8c0b..d6d82d0 100644 --- a/net/base/host_resolver_impl.h +++ b/net/base/host_resolver_impl.h @@ -8,8 +8,8 @@ #include <vector> -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "net/base/capturing_net_log.h" #include "net/base/host_cache.h" #include "net/base/host_resolver.h" @@ -50,7 +50,7 @@ namespace net { // Requests are ordered in the queue based on their priority. class HostResolverImpl : public HostResolver, - public NonThreadSafe, + public base::NonThreadSafe, public NetworkChangeNotifier::Observer { public: // The index into |job_pools_| for the various job pools. Pools with a higher diff --git a/net/http/disk_cache_based_ssl_host_info.h b/net/http/disk_cache_based_ssl_host_info.h index fee0a5c..c094163 100644 --- a/net/http/disk_cache_based_ssl_host_info.h +++ b/net/http/disk_cache_based_ssl_host_info.h @@ -8,8 +8,8 @@ #include <string> #include "base/lock.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "base/weak_ptr.h" #include "net/base/completion_callback.h" #include "net/disk_cache/disk_cache.h" @@ -25,7 +25,7 @@ struct SSLConfig; // standard disk cache. Since the information is defined to be non-sensitive, // it's ok for us to keep it on disk. class DiskCacheBasedSSLHostInfo : public SSLHostInfo, - public NonThreadSafe { + public base::NonThreadSafe { public: DiskCacheBasedSSLHostInfo(const std::string& hostname, const SSLConfig& ssl_config, diff --git a/net/http/http_auth_controller.h b/net/http/http_auth_controller.h index 1d0a5cd..85d9fa1 100644 --- a/net/http/http_auth_controller.h +++ b/net/http/http_auth_controller.h @@ -10,10 +10,10 @@ #include <string> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/string16.h" +#include "base/threading/non_thread_safe.h" #include "googleurl/src/gurl.h" #include "net/base/completion_callback.h" #include "net/base/net_log.h" @@ -29,7 +29,7 @@ class HttpRequestHeaders; struct HttpRequestInfo; class HttpAuthController : public base::RefCounted<HttpAuthController>, - public NonThreadSafe { + public base::NonThreadSafe { public: // The arguments are self explanatory except possibly for |auth_url|, which // should be both the auth target and auth path in a single url argument. diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 5c812da..8ff6442 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -23,9 +23,9 @@ #include "base/file_path.h" #include "base/hash_tables.h" #include "base/message_loop_proxy.h" -#include "base/non_thread_safe.h" #include "base/scoped_ptr.h" #include "base/task.h" +#include "base/threading/non_thread_safe.h" #include "base/weak_ptr.h" #include "net/base/cache_type.h" #include "net/base/completion_callback.h" @@ -58,7 +58,7 @@ class ViewCacheHelper; class HttpCache : public HttpTransactionFactory, public base::SupportsWeakPtr<HttpCache>, - public NonThreadSafe { + public base::NonThreadSafe { public: ~HttpCache(); diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h index 91e1a86..730b5c7 100644 --- a/net/http/http_network_layer.h +++ b/net/http/http_network_layer.h @@ -8,9 +8,9 @@ #include <string> -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "net/http/http_transaction_factory.h" namespace net { @@ -29,7 +29,8 @@ class SpdySessionPool; class SSLConfigService; class SSLHostInfoFactory; -class HttpNetworkLayer : public HttpTransactionFactory, public NonThreadSafe { +class HttpNetworkLayer : public HttpTransactionFactory, + public base::NonThreadSafe { public: // |socket_factory|, |proxy_service|, |host_resolver|, etc. must remain // valid for the lifetime of HttpNetworkLayer. diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 2c923b6..5a3b96c 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -8,9 +8,9 @@ #include <map> #include <set> -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "net/base/host_port_pair.h" #include "net/base/host_resolver.h" #include "net/base/ssl_client_auth_cache.h" @@ -45,7 +45,7 @@ class TCPClientSocketPool; // This class holds session objects used by HttpNetworkTransaction objects. class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>, - public NonThreadSafe { + public base::NonThreadSafe { public: HttpNetworkSession( HostResolver* host_resolver, diff --git a/net/proxy/multi_threaded_proxy_resolver.h b/net/proxy/multi_threaded_proxy_resolver.h index 1ad28f7..4dbe878 100644 --- a/net/proxy/multi_threaded_proxy_resolver.h +++ b/net/proxy/multi_threaded_proxy_resolver.h @@ -10,9 +10,9 @@ #include <vector> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "net/proxy/proxy_resolver.h" namespace base { @@ -71,7 +71,8 @@ class ProxyResolverFactory { // a global counter and using that to make a decision. In the // multi-threaded model, each thread may have a different value for this // counter, so it won't globally be seen as monotonically increasing! -class MultiThreadedProxyResolver : public ProxyResolver, public NonThreadSafe { +class MultiThreadedProxyResolver : public ProxyResolver, + public base::NonThreadSafe { public: // Creates an asynchronous ProxyResolver that runs requests on up to // |max_num_threads|. diff --git a/net/socket/client_socket_pool_manager.h b/net/socket/client_socket_pool_manager.h index cfcb465..d6d09e91 100644 --- a/net/socket/client_socket_pool_manager.h +++ b/net/socket/client_socket_pool_manager.h @@ -12,11 +12,11 @@ #include <map> #include "base/basictypes.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" -#include "base/template_util.h" #include "base/stl_util-inl.h" +#include "base/template_util.h" +#include "base/threading/non_thread_safe.h" #include "net/socket/client_socket_pool_histograms.h" class Value; @@ -57,7 +57,7 @@ class OwnedPoolMap : public std::map<Key, Value> { } // namespace internal -class ClientSocketPoolManager : public NonThreadSafe { +class ClientSocketPoolManager : public base::NonThreadSafe { public: ClientSocketPoolManager(NetLog* net_log, ClientSocketFactory* socket_factory, diff --git a/net/socket/dns_cert_provenance_checker.cc b/net/socket/dns_cert_provenance_checker.cc index 51a9750..665a16a 100644 --- a/net/socket/dns_cert_provenance_checker.cc +++ b/net/socket/dns_cert_provenance_checker.cc @@ -21,9 +21,9 @@ #include "base/crypto/encryptor.h" #include "base/crypto/symmetric_key.h" #include "base/lazy_instance.h" -#include "base/non_thread_safe.h" #include "base/pickle.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "net/base/completion_callback.h" #include "net/base/dns_util.h" #include "net/base/dnsrr_resolver.h" @@ -85,7 +85,7 @@ static base::LazyInstance<DnsCertLimits> g_dns_cert_limits( // DnsCertProvenanceCheck performs the DNS lookup of the certificate. This // class is self-deleting. -class DnsCertProvenanceCheck : public NonThreadSafe { +class DnsCertProvenanceCheck : public base::NonThreadSafe { public: DnsCertProvenanceCheck( const std::string& hostname, diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h index e0e6e31..4f002aa 100644 --- a/net/socket/tcp_client_socket_libevent.h +++ b/net/socket/tcp_client_socket_libevent.h @@ -7,9 +7,9 @@ #pragma once #include "base/message_loop.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/threading/non_thread_safe.h" #include "net/base/address_list.h" #include "net/base/completion_callback.h" #include "net/base/net_log.h" @@ -22,7 +22,7 @@ namespace net { class BoundNetLog; // A client socket that uses TCP as the transport layer. -class TCPClientSocketLibevent : public ClientSocket, NonThreadSafe { +class TCPClientSocketLibevent : public ClientSocket, base::NonThreadSafe { public: // The IP address(es) and port number to connect to. The TCP socket will try // each IP address in the list until it succeeds in establishing a diff --git a/net/socket/tcp_client_socket_win.h b/net/socket/tcp_client_socket_win.h index fb111b4..041c123 100644 --- a/net/socket/tcp_client_socket_win.h +++ b/net/socket/tcp_client_socket_win.h @@ -8,8 +8,8 @@ #include <winsock2.h> -#include "base/non_thread_safe.h" #include "base/object_watcher.h" +#include "base/threading/non_thread_safe.h" #include "net/base/address_list.h" #include "net/base/completion_callback.h" #include "net/base/net_log.h" @@ -19,7 +19,7 @@ namespace net { class BoundNetLog; -class TCPClientSocketWin : public ClientSocket, NonThreadSafe { +class TCPClientSocketWin : public ClientSocket, base::NonThreadSafe { public: // The IP address(es) and port number to connect to. The TCP socket will try // each IP address in the list until it succeeds in establishing a diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index ffd4f88..9d4347d 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -13,9 +13,9 @@ #include "base/debug/leak_tracker.h" #include "base/linked_ptr.h" #include "base/logging.h" -#include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "base/string16.h" +#include "base/threading/non_thread_safe.h" #include "googleurl/src/gurl.h" #include "net/base/load_states.h" #include "net/base/net_log.h" @@ -57,7 +57,7 @@ namespace net { // // NOTE: All usage of all instances of this class should be on the same thread. // -class URLRequest : public NonThreadSafe { +class URLRequest : public base::NonThreadSafe { public: // Derive from this class and add your own data members to associate extra // information with a URLRequest. Use GetUserData(key) and SetUserData() diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h index 307da44..517148e 100644 --- a/net/url_request/url_request_context.h +++ b/net/url_request/url_request_context.h @@ -11,8 +11,8 @@ #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ #pragma once -#include "base/non_thread_safe.h" #include "base/ref_counted.h" +#include "base/threading/non_thread_safe.h" #include "net/base/net_log.h" #include "net/base/ssl_config_service.h" #include "net/base/transport_security_state.h" @@ -39,7 +39,7 @@ class URLRequest; // instances. class URLRequestContext : public base::RefCountedThreadSafe<URLRequestContext>, - public NonThreadSafe { + public base::NonThreadSafe { public: URLRequestContext(); |