diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-15 06:34:22 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-15 06:34:22 +0000 |
commit | 5485707a47aae11be217650d721913a096825852 (patch) | |
tree | 5c69203d3ea27c23b0f884ada6bb29c485b1925e | |
parent | c87dfdab742620a0a602e1204925728adf92063c (diff) | |
download | chromium_src-5485707a47aae11be217650d721913a096825852.zip chromium_src-5485707a47aae11be217650d721913a096825852.tar.gz chromium_src-5485707a47aae11be217650d721913a096825852.tar.bz2 |
Remove various DoNothing functions in favor of base::DoNothing
BUG=
TBR=yoz@chromium.org,rkc@chromium.org,sergeyu@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11361269
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167876 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed, 18 insertions, 35 deletions
diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc index 7e197da..05666ac 100644 --- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc +++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc @@ -5,6 +5,7 @@ #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/message_loop.h" #include "base/values.h" #include "chrome/browser/chromeos/settings/cros_settings.h" @@ -61,18 +62,13 @@ class KioskModeSettingsTest : public testing::Test { void ReInitialize() { KioskModeSettings::Get()->set_initialized(false); - KioskModeSettings::Get()->Initialize( - base::Bind(&KioskModeSettingsTest::DoNothing, - base::Unretained(this))); + KioskModeSettings::Get()->Initialize(base::Bind(&base::DoNothing)); } void DisableKioskModeSettings() { KioskModeSettings::Get()->set_initialized(false); } - void DoNothing() { - } - MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/extensions/test_extension_prefs.cc b/chrome/browser/extensions/test_extension_prefs.cc index f03df25..54fd40c 100644 --- a/chrome/browser/extensions/test_extension_prefs.cc +++ b/chrome/browser/extensions/test_extension_prefs.cc @@ -33,8 +33,6 @@ namespace extensions { namespace { -void DoNothing() {} - // Mock ExtensionPrefs class with artificial clock to guarantee that no two // extensions get the same installation time stamp and we can reliably // assert the installation order in the tests below. @@ -85,7 +83,7 @@ void TestExtensionPrefs::RecreateExtensionPrefs() { ASSERT_TRUE( task_runner_->PostTaskAndReply( FROM_HERE, - base::Bind(&DoNothing), + base::Bind(&base::DoNothing), run_loop.QuitClosure())); run_loop.Run(); } diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc index 1fabd18..9f1374e 100644 --- a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc +++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc @@ -7,6 +7,7 @@ #include <cstddef> #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/compiler_specific.h" #include "base/location.h" #include "base/memory/ref_counted.h" @@ -33,9 +34,6 @@ namespace { using ::testing::NiceMock; -// Needed by BlockForSyncThread(). -void DoNothing() {} - // Since all the interesting stuff happens on the sync thread, we have // to be careful to use GTest/GMock only on the main thread since they // are not thread-safe. @@ -150,7 +148,7 @@ class ChromeSyncNotificationBridgeTest : public testing::Test { base::RunLoop run_loop; ASSERT_TRUE(sync_thread_.message_loop_proxy()->PostTaskAndReply( FROM_HERE, - base::Bind(&DoNothing), + base::Bind(&base::DoNothing), run_loop.QuitClosure())); run_loop.Run(); } diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc index 6333e24..b983f81 100644 --- a/remoting/host/chromoting_host_unittest.cc +++ b/remoting/host/chromoting_host_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop_proxy.h" #include "remoting/base/auto_thread_task_runner.h" @@ -61,9 +62,6 @@ ACTION(RunDoneTask) { arg1.Run(); } -void DoNothing() { -} - } // namespace class MockIt2MeHostUserInterface : public It2MeHostUserInterface { @@ -520,7 +518,7 @@ TEST_F(ChromotingHostTest, Connect) { Expectation video_packet_sent = ExpectClientConnected( 0, InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); Expectation client_disconnected = ExpectClientDisconnected( - 0, true, video_packet_sent, InvokeWithoutArgs(DoNothing)); + 0, true, video_packet_sent, InvokeWithoutArgs(base::DoNothing)); EXPECT_CALL(host_status_observer_, OnShutdown()).After(client_disconnected); host_->Start(xmpp_login_); @@ -563,14 +561,14 @@ TEST_F(ChromotingHostTest, Reconnect) { InvokeWithoutArgs(this, &ChromotingHostTest::DisconnectClient1), InvokeWithoutArgs(this, &ChromotingHostTest::QuitMainMessageLoop))); ExpectClientDisconnectEffects( - 0, true, video_packet_sent1, InvokeWithoutArgs(DoNothing)); + 0, true, video_packet_sent1, InvokeWithoutArgs(base::DoNothing)); // When a video packet is received on the second connection, shut down the // host. Expectation video_packet_sent2 = ExpectClientConnected( 1, InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); Expectation client_disconnected2 = ExpectClientDisconnected( - 1, true, video_packet_sent2, InvokeWithoutArgs(DoNothing)); + 1, true, video_packet_sent2, InvokeWithoutArgs(base::DoNothing)); EXPECT_CALL(host_status_observer_, OnShutdown()).After(client_disconnected2); host_->Start(xmpp_login_); @@ -592,11 +590,11 @@ TEST_F(ChromotingHostTest, ConnectWhenAnotherClientIsConnected) { this, &ChromotingHostTest::SimulateClientConnection, 1, true, false))); ExpectClientDisconnected( - 0, true, video_packet_sent1, InvokeWithoutArgs(DoNothing)); + 0, true, video_packet_sent1, InvokeWithoutArgs(base::DoNothing)); Expectation video_packet_sent2 = ExpectClientConnected( 1, InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); Expectation client_disconnected2 = ExpectClientDisconnected( - 1, true, video_packet_sent2, InvokeWithoutArgs(DoNothing)); + 1, true, video_packet_sent2, InvokeWithoutArgs(base::DoNothing)); EXPECT_CALL(host_status_observer_, OnShutdown()).After(client_disconnected2); host_->Start(xmpp_login_); @@ -690,7 +688,8 @@ TEST_F(ChromotingHostTest, OnSessionRouteChange) { session_jid1_, channel_name, _)) .After(video_packet_sent) .WillOnce(InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); - ExpectClientDisconnected(0, true, route_change, InvokeWithoutArgs(DoNothing)); + ExpectClientDisconnected(0, true, route_change, + InvokeWithoutArgs(base::DoNothing)); EXPECT_CALL(host_status_observer_, OnShutdown()); host_->Start(xmpp_login_); diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc index f90bbd7..66b3ac6 100644 --- a/sync/internal_api/test/fake_sync_manager.cc +++ b/sync/internal_api/test/fake_sync_manager.cc @@ -7,6 +7,7 @@ #include <cstddef> #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/location.h" #include "base/logging.h" #include "base/run_loop.h" @@ -72,18 +73,12 @@ void FakeSyncManager::UpdateInvalidatorState(InvalidatorState state) { } } -namespace { - -void DoNothing() {} - -} // namespace - void FakeSyncManager::WaitForSyncThread() { // Post a task to |sync_task_runner_| and block until it runs. base::RunLoop run_loop; if (!sync_task_runner_->PostTaskAndReply( FROM_HERE, - base::Bind(&DoNothing), + base::Bind(&base::DoNothing), run_loop.QuitClosure())) { NOTREACHED(); } diff --git a/sync/notifier/non_blocking_invalidator_unittest.cc b/sync/notifier/non_blocking_invalidator_unittest.cc index 412c6b6..05d9f63 100644 --- a/sync/notifier/non_blocking_invalidator_unittest.cc +++ b/sync/notifier/non_blocking_invalidator_unittest.cc @@ -4,6 +4,7 @@ #include "sync/notifier/non_blocking_invalidator.h" +#include "base/bind_helpers.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" @@ -23,9 +24,6 @@ namespace syncer { namespace { -// Needed by WaitForInvalidator(). -void DoNothing() {} - class NonBlockingInvalidatorTestDelegate { public: NonBlockingInvalidatorTestDelegate() : io_thread_("IO thread") {} @@ -71,7 +69,7 @@ class NonBlockingInvalidatorTestDelegate { ASSERT_TRUE( io_thread_.message_loop_proxy()->PostTaskAndReply( FROM_HERE, - base::Bind(&DoNothing), + base::Bind(&base::DoNothing), run_loop.QuitClosure())); run_loop.Run(); } diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h index 375aacf..da92dfb 100644 --- a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h +++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h @@ -6,6 +6,7 @@ #define GOOGLE_CACHEINVALIDATION_DEPS_CALLBACK_H_ #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/callback.h" #define INVALIDATION_CALLBACK1_TYPE(Arg1) ::base::Callback<void(Arg1)> @@ -18,8 +19,6 @@ namespace invalidation { typedef ::base::Closure Closure; -static inline void DoNothing() {} - template <class T> bool IsCallbackRepeatable(const T* callback) { // The default cacheinvalidation Callbacks may be self-deleting. We don't |