diff options
author | ckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-22 20:56:30 +0000 |
---|---|---|
committer | ckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-22 20:56:30 +0000 |
commit | f70eac0ea8b5f05302b70211c6d1e6afb92f552f (patch) | |
tree | e0c57ffdd0125e6aa4137a81a74cdcfe02c9563b | |
parent | 57e6eb80bebfd196e2efeb44f396aa3b12a177f5 (diff) | |
download | chromium_src-f70eac0ea8b5f05302b70211c6d1e6afb92f552f.zip chromium_src-f70eac0ea8b5f05302b70211c6d1e6afb92f552f.tar.gz chromium_src-f70eac0ea8b5f05302b70211c6d1e6afb92f552f.tar.bz2 |
Revert of [Mac] Reland r276808 Use a native MessagePump instead of a MessagePumpDefault (https://coderevie… (https://codereview.chromium.org/331983002/)
Reason for revert:
Breaks XmppConnectionTest.MultipleConnect on Mac: http://build.chromium.org/p/chromium.mac/builders/Mac%2010.6%20Tests%20%28dbg%29%281%29/builds/50525
Original issue's description:
> Reland change to use a native MessagePump instead of a MessagePumpDefault.
> Original CL: https://codereview.chromium.org/331513002/
>
> The previous CL caused a bunch of LibJingle unit tests to fail because the tests
> were using a gtest death test which runs in the context of a fork()ed but not
> execu()ed process.
>
> A CF Message loop can't live in this environment. Explicitly construct a
> MessagePumpDefault for these tests.
>
> BUG=356804,385604
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279013
TBR=mark@chromium.org,ajwong@chromium.org,jeremy@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=356804,385604
Review URL: https://codereview.chromium.org/332333004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279019 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/message_loop/message_loop.cc | 10 | ||||
-rw-r--r-- | base/message_loop/message_pump_default.h | 3 | ||||
-rw-r--r-- | jingle/glue/chrome_async_socket_unittest.cc | 87 | ||||
-rw-r--r-- | tools/valgrind/memcheck/suppressions_mac.txt | 26 |
4 files changed, 41 insertions, 85 deletions
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc index ccece4d..dd1a393 100644 --- a/base/message_loop/message_loop.cc +++ b/base/message_loop/message_loop.cc @@ -229,14 +229,6 @@ scoped_ptr<MessagePump> MessageLoop::CreateMessagePumpForType(Type type) { #define MESSAGE_PUMP_UI scoped_ptr<MessagePump>(new MessagePumpForUI()) #endif -#if defined(OS_MACOSX) - // Use an OS native runloop on Mac to support timer coalescing. - #define MESSAGE_PUMP_DEFAULT \ - scoped_ptr<MessagePump>(new MessagePumpCFRunLoop()) -#else - #define MESSAGE_PUMP_DEFAULT scoped_ptr<MessagePump>(new MessagePumpDefault()) -#endif - if (type == MessageLoop::TYPE_UI) { if (message_pump_for_ui_factory_) return message_pump_for_ui_factory_(); @@ -251,7 +243,7 @@ scoped_ptr<MessagePump> MessageLoop::CreateMessagePumpForType(Type type) { #endif DCHECK_EQ(MessageLoop::TYPE_DEFAULT, type); - return MESSAGE_PUMP_DEFAULT; + return scoped_ptr<MessagePump>(new MessagePumpDefault()); } void MessageLoop::AddDestructionObserver( diff --git a/base/message_loop/message_pump_default.h b/base/message_loop/message_pump_default.h index 19e7200..a9b83e8 100644 --- a/base/message_loop/message_pump_default.h +++ b/base/message_loop/message_pump_default.h @@ -5,14 +5,13 @@ #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_ #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_ -#include "base/base_export.h" #include "base/message_loop/message_pump.h" #include "base/synchronization/waitable_event.h" #include "base/time/time.h" namespace base { -class BASE_EXPORT MessagePumpDefault : public MessagePump { +class MessagePumpDefault : public MessagePump { public: MessagePumpDefault(); virtual ~MessagePumpDefault(); diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc index b3c81b1..db3d2b0 100644 --- a/jingle/glue/chrome_async_socket_unittest.cc +++ b/jingle/glue/chrome_async_socket_unittest.cc @@ -11,7 +11,6 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_pump_default.h" #include "jingle/glue/resolving_client_socket_factory.h" #include "net/base/address_list.h" #include "net/base/net_errors.h" @@ -144,15 +143,7 @@ class ChromeAsyncSocketTest protected: ChromeAsyncSocketTest() : ssl_socket_data_provider_(net::ASYNC, net::OK), - addr_("localhost", 35) { - // GTest death tests execute in a fork()ed but not exec()ed process. - // On OS X a CoreFoundation-backed message loop will exit with a - // __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ - // when called. - // Explicitly create a MessagePumpDefault which can run in this enivronment. - scoped_ptr<base::MessagePump> pump(new base::MessagePumpDefault()); - message_loop_.reset(new base::MessageLoop(pump.Pass())); - } + addr_("localhost", 35) {} virtual ~ChromeAsyncSocketTest() {} @@ -191,7 +182,7 @@ class ChromeAsyncSocketTest virtual void TearDown() { // Run any tasks that we forgot to pump. - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectClosed(); ExpectNoSignal(); chrome_async_socket_.reset(); @@ -351,7 +342,7 @@ class ChromeAsyncSocketTest EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); ExpectNonErrorState(ChromeAsyncSocket::STATE_CONNECTING); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); // We may not necessarily be open; may have been other events // queued up. ExpectSignalSocketState( @@ -381,7 +372,7 @@ class ChromeAsyncSocketTest EXPECT_EQ(kDummyData, DrainRead(1)); EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com")); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSSLConnectSignal(); ExpectNoSignal(); ExpectNonErrorState(ChromeAsyncSocket::STATE_TLS_OPEN); @@ -424,7 +415,7 @@ class ChromeAsyncSocketTest } // ChromeAsyncSocket expects a message loop. - scoped_ptr<base::MessageLoop> message_loop_; + base::MessageLoop message_loop_; AsyncSocketDataProvider async_socket_data_provider_; net::SSLSocketDataProvider ssl_socket_data_provider_; @@ -519,7 +510,7 @@ TEST_F(ChromeAsyncSocketTest, ImmediateConnectCloseBeforeRead) { SignalSocketState::NoError( SIGNAL_CLOSE, ChromeAsyncSocket::STATE_CLOSED)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); } TEST_F(ChromeAsyncSocketTest, HangingConnect) { @@ -541,14 +532,14 @@ TEST_F(ChromeAsyncSocketTest, PendingConnect) { ExpectNonErrorState(ChromeAsyncSocket::STATE_CONNECTING); ExpectNoSignal(); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectNonErrorState(ChromeAsyncSocket::STATE_OPEN); ExpectSignalSocketState( SignalSocketState::NoError( SIGNAL_CONNECT, ChromeAsyncSocket::STATE_OPEN)); ExpectNoSignal(); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); DoCloseOpenedNoError(); } @@ -561,14 +552,14 @@ TEST_F(ChromeAsyncSocketTest, PendingConnectCloseBeforeRead) { net::MockConnect(net::ASYNC, net::OK)); EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSignalSocketState( SignalSocketState::NoError( SIGNAL_CONNECT, ChromeAsyncSocket::STATE_OPEN)); DoCloseOpenedNoError(); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); } TEST_F(ChromeAsyncSocketTest, PendingConnectError) { @@ -576,7 +567,7 @@ TEST_F(ChromeAsyncSocketTest, PendingConnectError) { net::MockConnect(net::ASYNC, net::ERR_TIMED_OUT)); EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSignalSocketState( SignalSocketState( @@ -638,7 +629,7 @@ TEST_F(ChromeAsyncSocketTest, Read) { EXPECT_EQ(kReadData, DrainRead(1)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); DoCloseOpenedNoError(); } @@ -652,7 +643,7 @@ TEST_F(ChromeAsyncSocketTest, ReadTwice) { EXPECT_EQ(kReadData, DrainRead(1)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); const char kReadData2[] = "mydatatoread2"; async_socket_data_provider_.AddRead(net::MockRead(kReadData2)); @@ -674,7 +665,7 @@ TEST_F(ChromeAsyncSocketTest, ReadError) { EXPECT_EQ(kReadData, DrainRead(1)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); async_socket_data_provider_.AddRead( net::MockRead(net::SYNCHRONOUS, net::ERR_TIMED_OUT)); @@ -708,7 +699,7 @@ TEST_F(ChromeAsyncSocketTest, PendingRead) { EXPECT_EQ(kReadData, DrainRead(1)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); DoCloseOpenedNoError(); } @@ -764,12 +755,12 @@ TEST_F(ChromeAsyncSocketTest, SyncWrite) { DoOpenClosed(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8, arraysize(kWriteData) - 8)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectNoSignal(); @@ -787,12 +778,12 @@ TEST_F(ChromeAsyncSocketTest, AsyncWrite) { net::MockWrite(net::ASYNC, kWriteData + 8, arraysize(kWriteData) - 8)); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8, arraysize(kWriteData) - 8)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectNoSignal(); @@ -810,12 +801,12 @@ TEST_F(ChromeAsyncSocketTest, AsyncWriteError) { net::MockWrite(net::ASYNC, net::ERR_TIMED_OUT)); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8, arraysize(kWriteData) - 8)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSignalSocketState( SignalSocketState( @@ -883,7 +874,7 @@ TEST_F(ChromeAsyncSocketTest, ImmediateSSLConnect) { ExpectReadSignal(); EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com")); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSSLConnectSignal(); ExpectNoSignal(); ExpectNonErrorState(ChromeAsyncSocket::STATE_TLS_OPEN); @@ -898,7 +889,7 @@ TEST_F(ChromeAsyncSocketTest, DoubleSSLConnect) { ExpectReadSignal(); EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com")); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSSLConnectSignal(); ExpectNoSignal(); ExpectNonErrorState(ChromeAsyncSocket::STATE_TLS_OPEN); @@ -922,7 +913,7 @@ TEST_F(ChromeAsyncSocketTest, FailedSSLConnect) { ExpectReadSignal(); EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com")); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSignalSocketState( SignalSocketState( SIGNAL_CLOSE, ChromeAsyncSocket::STATE_CLOSED, @@ -950,7 +941,7 @@ TEST_F(ChromeAsyncSocketTest, ReadDuringSSLConnecting) { EXPECT_TRUE(chrome_async_socket_->Read(buf, sizeof(buf), &len_read)); EXPECT_EQ(0U, len_read); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSSLConnectSignal(); ExpectSSLReadSignal(); ExpectNoSignal(); @@ -981,11 +972,11 @@ TEST_F(ChromeAsyncSocketTest, WriteDuringSSLConnecting) { // TODO(akalin): Figure out how to test that the write happens // *after* the SSL connect. - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSSLConnectSignal(); ExpectNoSignal(); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); DoSSLCloseOpenedNoError(); } @@ -1014,7 +1005,7 @@ TEST_F(ChromeAsyncSocketTest, SSLConnectDuringPostedWrite) { EXPECT_FALSE(chrome_async_socket_->StartTls("fakedomain.com")); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); DoCloseOpened( SignalSocketState(SIGNAL_CLOSE, @@ -1029,14 +1020,14 @@ TEST_F(ChromeAsyncSocketTest, SSLConnectDuringPostedWrite) { TEST_F(ChromeAsyncSocketTest, SSLRead) { DoSSLOpenClosed(); async_socket_data_provider_.AddRead(net::MockRead(kReadData)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectSSLReadSignal(); ExpectNoSignal(); EXPECT_EQ(kReadData, DrainRead(1)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); DoSSLCloseOpenedNoError(); } @@ -1052,12 +1043,12 @@ TEST_F(ChromeAsyncSocketTest, SSLSyncWrite) { DoSSLOpenClosed(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8, arraysize(kWriteData) - 8)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectNoSignal(); @@ -1075,12 +1066,12 @@ TEST_F(ChromeAsyncSocketTest, SSLAsyncWrite) { net::MockWrite(net::ASYNC, kWriteData + 8, arraysize(kWriteData) - 8)); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8, arraysize(kWriteData) - 8)); - message_loop_->RunUntilIdle(); + message_loop_.RunUntilIdle(); ExpectNoSignal(); diff --git a/tools/valgrind/memcheck/suppressions_mac.txt b/tools/valgrind/memcheck/suppressions_mac.txt index de9fcbf..9b6a978 100644 --- a/tools/valgrind/memcheck/suppressions_mac.txt +++ b/tools/valgrind/memcheck/suppressions_mac.txt @@ -99,19 +99,6 @@ fun:-[NSBitmapImageRep(NSBitmapImageFileTypeExtensions) representationUsingType:properties:] fun:_ZN3gfx8internal24Get1xPNGBytesFromNSImageEP7NSImage } -{ - # See http://crbug.com/385604 - bug_385604_a - Memcheck:Leak - fun:_Znw* - fun:_ZNK11AEEventImpl9duplicateEv - fun:AESendMessage - fun:_ZL35HIToolboxLSNotificationCallbackFunc18LSNotificationCodedPKvPK7__LSASNS1_11LSSessionIDS1_ - fun:_ZL48LSScheduleNotificationReceiveMessageCallbackFuncP12__CFMachPortPvlS1_ - fun:__CFMachPortPerform - fun:__CFRunLoopRun - ... -} # Intentional leaks in AppKit, for an OS-level cache. Only appear on the first # run of each reboot. See also issues 105525, 257276, 340847. { @@ -2478,16 +2465,3 @@ fun:_ZN5media28VideoCaptureDeviceFactoryMac6CreateERKNS_18VideoCaptureDevice4NameE fun:_ZN5media45VideoCaptureDeviceTest_OpenInvalidDevice_Test8TestBodyEv } -{ - bug_385604_b - Memcheck:Leak - fun:calloc - fun:_ZN18hb_object_header_t6createEj - fun:_ZL16hb_object_createI9hb_face_tEPT_v - fun:hb_face_create_for_tables - fun:_ZN3gfx12_GLOBAL__N_118CreateHarfBuzzFaceEP10SkTypeface - fun:_ZN3gfx12_GLOBAL__N_118CreateHarfBuzzFontEP10SkTypefacei - fun:_ZN3gfx18RenderTextHarfBuzz8ShapeRunEPNS_8internal15TextRunHarfBuzzE - fun:_ZN3gfx18RenderTextHarfBuzz12EnsureLayoutEv - fun:_ZN3gfx41RenderTextTest_HarfBuzz_RunDirection_Test8TestBodyEv -} |