diff options
author | erikchen@chromium.org <erikchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-31 23:50:09 +0000 |
---|---|---|
committer | erikchen@chromium.org <erikchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-31 23:50:09 +0000 |
commit | d08baed84e8aed2343a697c6d1627d3b456e3e02 (patch) | |
tree | 7dd88c7c6b82475919881932340d314a9ef9ed72 /jingle/glue | |
parent | 504cc9199a69d10a4a2296697afb4736e1b53231 (diff) | |
download | chromium_src-d08baed84e8aed2343a697c6d1627d3b456e3e02.zip chromium_src-d08baed84e8aed2343a697c6d1627d3b456e3e02.tar.gz chromium_src-d08baed84e8aed2343a697c6d1627d3b456e3e02.tar.bz2 |
Revert "Update webrtc&libjingle 6774:6799."
This reverts commit bf45dff0ca703e5ad3bb6c6754ebdcb0c1b1296a.
(https://codereview.chromium.org/429253003)
Broke sizes on Linux
http://build.chromium.org/p/chromium/builders/Linux/builds/51786
https://code.google.com/p/webrtc/source/browse/trunk/webrtc/base/linux.cc
defines static std::string lsb_release_string; among other things
It's guarded in WEBRTC_CHROMIUM_BUILDs. Maybe it should be
WEBRTC_CHROMIUM_BUILD.
BUG=NONE
TBR=darin@chromium.org, hclam@chromium.org, jochen@chromium.org, palmer@chromium.org, sergeyu@chromium.org, wez@chromium.org, ronghuawu@chromium.org
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/435823002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/glue')
-rw-r--r-- | jingle/glue/DEPS | 1 | ||||
-rw-r--r-- | jingle/glue/channel_socket_adapter.cc | 10 | ||||
-rw-r--r-- | jingle/glue/channel_socket_adapter.h | 8 | ||||
-rw-r--r-- | jingle/glue/channel_socket_adapter_unittest.cc | 12 | ||||
-rw-r--r-- | jingle/glue/chrome_async_socket.cc | 4 | ||||
-rw-r--r-- | jingle/glue/chrome_async_socket.h | 2 | ||||
-rw-r--r-- | jingle/glue/chrome_async_socket_unittest.cc | 16 | ||||
-rw-r--r-- | jingle/glue/jingle_glue_mock_objects.h | 12 | ||||
-rw-r--r-- | jingle/glue/logging_unittest.cc | 82 | ||||
-rw-r--r-- | jingle/glue/mock_task.cc | 2 | ||||
-rw-r--r-- | jingle/glue/mock_task.h | 6 | ||||
-rw-r--r-- | jingle/glue/task_pump.h | 8 | ||||
-rw-r--r-- | jingle/glue/task_pump_unittest.cc | 4 | ||||
-rw-r--r-- | jingle/glue/thread_wrapper.cc | 64 | ||||
-rw-r--r-- | jingle/glue/thread_wrapper.h | 42 | ||||
-rw-r--r-- | jingle/glue/thread_wrapper_unittest.cc | 46 | ||||
-rw-r--r-- | jingle/glue/utils.cc | 12 | ||||
-rw-r--r-- | jingle/glue/utils.h | 8 |
18 files changed, 169 insertions, 170 deletions
diff --git a/jingle/glue/DEPS b/jingle/glue/DEPS index 790c9b7..708fdc5 100644 --- a/jingle/glue/DEPS +++ b/jingle/glue/DEPS @@ -1,5 +1,4 @@ # Needed by logging_unittest.cc since it tests the overrides. include_rules = [ "+third_party/libjingle/overrides", - "+third_party/webrtc", ]
\ No newline at end of file diff --git a/jingle/glue/channel_socket_adapter.cc b/jingle/glue/channel_socket_adapter.cc index 1645f96..bca4222 100644 --- a/jingle/glue/channel_socket_adapter.cc +++ b/jingle/glue/channel_socket_adapter.cc @@ -76,7 +76,7 @@ int TransportChannelSocketAdapter::Write( } int result; - rtc::PacketOptions options; + talk_base::PacketOptions options; if (channel_->writable()) { result = channel_->SendPacket(buffer->data(), buffer_size, options); if (result < 0) { @@ -101,13 +101,13 @@ int TransportChannelSocketAdapter::Write( int TransportChannelSocketAdapter::SetReceiveBufferSize(int32 size) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); - return (channel_->SetOption(rtc::Socket::OPT_RCVBUF, size) == 0) ? + return (channel_->SetOption(talk_base::Socket::OPT_RCVBUF, size) == 0) ? net::OK : net::ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR; } int TransportChannelSocketAdapter::SetSendBufferSize(int32 size) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); - return (channel_->SetOption(rtc::Socket::OPT_SNDBUF, size) == 0) ? + return (channel_->SetOption(talk_base::Socket::OPT_SNDBUF, size) == 0) ? net::OK : net::ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR; } @@ -142,7 +142,7 @@ void TransportChannelSocketAdapter::OnNewPacket( cricket::TransportChannel* channel, const char* data, size_t data_size, - const rtc::PacketTime& packet_time, + const talk_base::PacketTime& packet_time, int flags) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(channel, channel_); @@ -174,7 +174,7 @@ void TransportChannelSocketAdapter::OnWritableState( DCHECK_EQ(base::MessageLoop::current(), message_loop_); // Try to send the packet if there is a pending write. if (!write_callback_.is_null()) { - rtc::PacketOptions options; + talk_base::PacketOptions options; int result = channel_->SendPacket(write_buffer_->data(), write_buffer_size_, options); diff --git a/jingle/glue/channel_socket_adapter.h b/jingle/glue/channel_socket_adapter.h index 8bd330f..fc90df9 100644 --- a/jingle/glue/channel_socket_adapter.h +++ b/jingle/glue/channel_socket_adapter.h @@ -8,9 +8,9 @@ #include "base/callback_forward.h" #include "base/compiler_specific.h" #include "net/socket/socket.h" -#include "third_party/webrtc/base/asyncpacketsocket.h" -#include "third_party/webrtc/base/sigslot.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" +#include "third_party/libjingle/source/talk/base/socketaddress.h" +#include "third_party/libjingle/source/talk/base/sigslot.h" namespace base { class MessageLoop; @@ -55,7 +55,7 @@ class TransportChannelSocketAdapter : public net::Socket, void OnNewPacket(cricket::TransportChannel* channel, const char* data, size_t data_size, - const rtc::PacketTime& packet_time, + const talk_base::PacketTime& packet_time, int flags); void OnWritableState(cricket::TransportChannel* channel); void OnChannelDestroyed(cricket::TransportChannel* channel); diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc index 2baa37f..436f8f7 100644 --- a/jingle/glue/channel_socket_adapter_unittest.cc +++ b/jingle/glue/channel_socket_adapter_unittest.cc @@ -36,19 +36,19 @@ class MockTransportChannel : public cricket::TransportChannel { MOCK_METHOD4(SendPacket, int(const char* data, size_t len, - const rtc::PacketOptions& options, + const talk_base::PacketOptions& options, int flags)); - MOCK_METHOD2(SetOption, int(rtc::Socket::Option opt, int value)); + MOCK_METHOD2(SetOption, int(talk_base::Socket::Option opt, int value)); MOCK_METHOD0(GetError, int()); MOCK_CONST_METHOD0(GetIceRole, cricket::IceRole()); MOCK_METHOD1(GetStats, bool(cricket::ConnectionInfos* infos)); MOCK_CONST_METHOD0(IsDtlsActive, bool()); - MOCK_CONST_METHOD1(GetSslRole, bool(rtc::SSLRole* role)); + MOCK_CONST_METHOD1(GetSslRole, bool(talk_base::SSLRole* role)); MOCK_METHOD1(SetSrtpCiphers, bool(const std::vector<std::string>& ciphers)); MOCK_METHOD1(GetSrtpCipher, bool(std::string* cipher)); - MOCK_CONST_METHOD1(GetLocalIdentity, bool(rtc::SSLIdentity** identity)); + MOCK_CONST_METHOD1(GetLocalIdentity, bool(talk_base::SSLIdentity** identity)); MOCK_CONST_METHOD1(GetRemoteCertificate, - bool(rtc::SSLCertificate** cert)); + bool(talk_base::SSLCertificate** cert)); MOCK_METHOD6(ExportKeyingMaterial, bool(const std::string& label, const uint8* context, size_t context_len, @@ -89,7 +89,7 @@ TEST_F(TransportChannelSocketAdapterTest, Read) { ASSERT_EQ(net::ERR_IO_PENDING, result); channel_.SignalReadPacket(&channel_, kTestData, kTestDataSize, - rtc::CreatePacketTime(0), 0); + talk_base::CreatePacketTime(0), 0); EXPECT_EQ(kTestDataSize, callback_result_); } diff --git a/jingle/glue/chrome_async_socket.cc b/jingle/glue/chrome_async_socket.cc index dc42e7e..2c9812c 100644 --- a/jingle/glue/chrome_async_socket.cc +++ b/jingle/glue/chrome_async_socket.cc @@ -22,7 +22,7 @@ #include "net/socket/ssl_client_socket.h" #include "net/socket/tcp_client_socket.h" #include "net/ssl/ssl_config_service.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/libjingle/source/talk/base/socketaddress.h" namespace jingle_glue { @@ -84,7 +84,7 @@ void ChromeAsyncSocket::DoNetErrorFromStatus(int status) { // STATE_CLOSED -> STATE_CONNECTING -bool ChromeAsyncSocket::Connect(const rtc::SocketAddress& address) { +bool ChromeAsyncSocket::Connect(const talk_base::SocketAddress& address) { if (state_ != STATE_CLOSED) { LOG(DFATAL) << "Connect() called on non-closed socket"; DoNonNetError(ERROR_WRONGSTATE); diff --git a/jingle/glue/chrome_async_socket.h b/jingle/glue/chrome_async_socket.h index 18c83ca..7253ded 100644 --- a/jingle/glue/chrome_async_socket.h +++ b/jingle/glue/chrome_async_socket.h @@ -72,7 +72,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // Otherwise, starts the connection process and returns true. // SignalConnected will be raised when the connection is successful; // otherwise, SignalClosed will be raised with a net error set. - virtual bool Connect(const rtc::SocketAddress& address) OVERRIDE; + virtual bool Connect(const talk_base::SocketAddress& address) OVERRIDE; // Tries to read at most |len| bytes into |data|. // diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc index a26c136..b3c81b1 100644 --- a/jingle/glue/chrome_async_socket_unittest.cc +++ b/jingle/glue/chrome_async_socket_unittest.cc @@ -23,9 +23,9 @@ #include "net/ssl/ssl_config_service.h" #include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/webrtc/base/ipaddress.h" -#include "third_party/webrtc/base/sigslot.h" -#include "third_party/webrtc/base/socketaddress.h" +#include "third_party/libjingle/source/talk/base/ipaddress.h" +#include "third_party/libjingle/source/talk/base/sigslot.h" +#include "third_party/libjingle/source/talk/base/socketaddress.h" namespace jingle_glue { @@ -431,7 +431,7 @@ class ChromeAsyncSocketTest scoped_ptr<ChromeAsyncSocket> chrome_async_socket_; std::deque<SignalSocketState> signal_socket_states_; - const rtc::SocketAddress addr_; + const talk_base::SocketAddress addr_; private: DISALLOW_COPY_AND_ASSIGN(ChromeAsyncSocketTest); @@ -473,9 +473,9 @@ TEST_F(ChromeAsyncSocketTest, DoubleClose) { } TEST_F(ChromeAsyncSocketTest, NoHostnameConnect) { - rtc::IPAddress ip_address; - EXPECT_TRUE(rtc::IPFromString("127.0.0.1", &ip_address)); - const rtc::SocketAddress no_hostname_addr(ip_address, addr_.port()); + talk_base::IPAddress ip_address; + EXPECT_TRUE(talk_base::IPFromString("127.0.0.1", &ip_address)); + const talk_base::SocketAddress no_hostname_addr(ip_address, addr_.port()); EXPECT_FALSE(chrome_async_socket_->Connect(no_hostname_addr)); ExpectErrorState(ChromeAsyncSocket::STATE_CLOSED, ChromeAsyncSocket::ERROR_DNS); @@ -485,7 +485,7 @@ TEST_F(ChromeAsyncSocketTest, NoHostnameConnect) { } TEST_F(ChromeAsyncSocketTest, ZeroPortConnect) { - const rtc::SocketAddress zero_port_addr(addr_.hostname(), 0); + const talk_base::SocketAddress zero_port_addr(addr_.hostname(), 0); EXPECT_FALSE(chrome_async_socket_->Connect(zero_port_addr)); ExpectErrorState(ChromeAsyncSocket::STATE_CLOSED, ChromeAsyncSocket::ERROR_DNS); diff --git a/jingle/glue/jingle_glue_mock_objects.h b/jingle/glue/jingle_glue_mock_objects.h index f34e6b0..e2cd704 100644 --- a/jingle/glue/jingle_glue_mock_objects.h +++ b/jingle/glue/jingle_glue_mock_objects.h @@ -6,24 +6,24 @@ #define JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_ #include "testing/gmock/include/gmock/gmock.h" -#include "third_party/webrtc/base/stream.h" +#include "third_party/libjingle/source/talk/base/stream.h" namespace jingle_glue { -class MockStream : public rtc::StreamInterface { +class MockStream : public talk_base::StreamInterface { public: MockStream(); virtual ~MockStream(); - MOCK_CONST_METHOD0(GetState, rtc::StreamState()); + MOCK_CONST_METHOD0(GetState, talk_base::StreamState()); - MOCK_METHOD4(Read, rtc::StreamResult(void*, size_t, size_t*, int*)); - MOCK_METHOD4(Write, rtc::StreamResult(const void*, size_t, + MOCK_METHOD4(Read, talk_base::StreamResult(void*, size_t, size_t*, int*)); + MOCK_METHOD4(Write, talk_base::StreamResult(const void*, size_t, size_t*, int*)); MOCK_CONST_METHOD1(GetAvailable, bool(size_t*)); MOCK_METHOD0(Close, void()); - MOCK_METHOD3(PostEvent, void(rtc::Thread*, int, int)); + MOCK_METHOD3(PostEvent, void(talk_base::Thread*, int, int)); MOCK_METHOD2(PostEvent, void(int, int)); }; diff --git a/jingle/glue/logging_unittest.cc b/jingle/glue/logging_unittest.cc index 1cbf01a..ba1f8594 100644 --- a/jingle/glue/logging_unittest.cc +++ b/jingle/glue/logging_unittest.cc @@ -9,9 +9,9 @@ // The following include must be first in this file. It ensures that // libjingle style logging is used. -#define LOGGING_INSIDE_WEBRTC +#define LOGGING_INSIDE_LIBJINGLE -#include "third_party/webrtc/overrides/webrtc/base/logging.h" +#include "third_party/libjingle/overrides/talk/base/logging.h" #include "base/command_line.h" #include "base/file_util.h" @@ -25,17 +25,17 @@ static const char* const log_file_name = "libjingle_logging.log"; static const int kDefaultVerbosity = 0; -static const char* AsString(rtc::LoggingSeverity severity) { +static const char* AsString(talk_base::LoggingSeverity severity) { switch (severity) { - case rtc::LS_ERROR: + case talk_base::LS_ERROR: return "LS_ERROR"; - case rtc::LS_WARNING: + case talk_base::LS_WARNING: return "LS_WARNING"; - case rtc::LS_INFO: + case talk_base::LS_INFO: return "LS_INFO"; - case rtc::LS_VERBOSE: + case talk_base::LS_VERBOSE: return "LS_VERBOSE"; - case rtc::LS_SENSITIVE: + case talk_base::LS_SENSITIVE: return "LS_SENSITIVE"; default: return ""; @@ -75,11 +75,11 @@ TEST(LibjingleLogTest, DefaultConfiguration) { ASSERT_TRUE(Initialize(kDefaultVerbosity)); // In the default configuration nothing should be logged. - LOG_V(rtc::LS_ERROR) << AsString(rtc::LS_ERROR); - LOG_V(rtc::LS_WARNING) << AsString(rtc::LS_WARNING); - LOG_V(rtc::LS_INFO) << AsString(rtc::LS_INFO); - LOG_V(rtc::LS_VERBOSE) << AsString(rtc::LS_VERBOSE); - LOG_V(rtc::LS_SENSITIVE) << AsString(rtc::LS_SENSITIVE); + LOG_V(talk_base::LS_ERROR) << AsString(talk_base::LS_ERROR); + LOG_V(talk_base::LS_WARNING) << AsString(talk_base::LS_WARNING); + LOG_V(talk_base::LS_INFO) << AsString(talk_base::LS_INFO); + LOG_V(talk_base::LS_VERBOSE) << AsString(talk_base::LS_VERBOSE); + LOG_V(talk_base::LS_SENSITIVE) << AsString(talk_base::LS_SENSITIVE); // Read file to string. base::FilePath file_path(log_file_name); @@ -87,26 +87,26 @@ TEST(LibjingleLogTest, DefaultConfiguration) { base::ReadFileToString(file_path, &contents_of_file); // Make sure string contains the expected values. - EXPECT_FALSE(ContainsString(contents_of_file, AsString(rtc::LS_ERROR))); + EXPECT_FALSE(ContainsString(contents_of_file, AsString(talk_base::LS_ERROR))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(rtc::LS_WARNING))); - EXPECT_FALSE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); + AsString(talk_base::LS_WARNING))); + EXPECT_FALSE(ContainsString(contents_of_file, AsString(talk_base::LS_INFO))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(rtc::LS_VERBOSE))); + AsString(talk_base::LS_VERBOSE))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(rtc::LS_SENSITIVE))); + AsString(talk_base::LS_SENSITIVE))); } TEST(LibjingleLogTest, InfoConfiguration) { - ASSERT_TRUE(Initialize(rtc::LS_INFO)); + ASSERT_TRUE(Initialize(talk_base::LS_INFO)); // In this configuration everything lower or equal to LS_INFO should be // logged. - LOG_V(rtc::LS_ERROR) << AsString(rtc::LS_ERROR); - LOG_V(rtc::LS_WARNING) << AsString(rtc::LS_WARNING); - LOG_V(rtc::LS_INFO) << AsString(rtc::LS_INFO); - LOG_V(rtc::LS_VERBOSE) << AsString(rtc::LS_VERBOSE); - LOG_V(rtc::LS_SENSITIVE) << AsString(rtc::LS_SENSITIVE); + LOG_V(talk_base::LS_ERROR) << AsString(talk_base::LS_ERROR); + LOG_V(talk_base::LS_WARNING) << AsString(talk_base::LS_WARNING); + LOG_V(talk_base::LS_INFO) << AsString(talk_base::LS_INFO); + LOG_V(talk_base::LS_VERBOSE) << AsString(talk_base::LS_VERBOSE); + LOG_V(talk_base::LS_SENSITIVE) << AsString(talk_base::LS_SENSITIVE); // Read file to string. base::FilePath file_path(log_file_name); @@ -114,14 +114,14 @@ TEST(LibjingleLogTest, InfoConfiguration) { base::ReadFileToString(file_path, &contents_of_file); // Make sure string contains the expected values. - EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_ERROR))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_ERROR))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(rtc::LS_WARNING))); - EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); + AsString(talk_base::LS_WARNING))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_INFO))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(rtc::LS_VERBOSE))); + AsString(talk_base::LS_VERBOSE))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(rtc::LS_SENSITIVE))); + AsString(talk_base::LS_SENSITIVE))); // Also check that the log is proper. EXPECT_TRUE(ContainsString(contents_of_file, "logging_unittest.cc")); @@ -130,17 +130,17 @@ TEST(LibjingleLogTest, InfoConfiguration) { } TEST(LibjingleLogTest, LogEverythingConfiguration) { - ASSERT_TRUE(Initialize(rtc::LS_SENSITIVE)); + ASSERT_TRUE(Initialize(talk_base::LS_SENSITIVE)); // In this configuration everything should be logged. - LOG_V(rtc::LS_ERROR) << AsString(rtc::LS_ERROR); - LOG_V(rtc::LS_WARNING) << AsString(rtc::LS_WARNING); - LOG(LS_INFO) << AsString(rtc::LS_INFO); + LOG_V(talk_base::LS_ERROR) << AsString(talk_base::LS_ERROR); + LOG_V(talk_base::LS_WARNING) << AsString(talk_base::LS_WARNING); + LOG(LS_INFO) << AsString(talk_base::LS_INFO); static const int kFakeError = 1; - LOG_E(LS_INFO, EN, kFakeError) << "LOG_E(" << AsString(rtc::LS_INFO) << + LOG_E(LS_INFO, EN, kFakeError) << "LOG_E(" << AsString(talk_base::LS_INFO) << ")"; - LOG_V(rtc::LS_VERBOSE) << AsString(rtc::LS_VERBOSE); - LOG_V(rtc::LS_SENSITIVE) << AsString(rtc::LS_SENSITIVE); + LOG_V(talk_base::LS_VERBOSE) << AsString(talk_base::LS_VERBOSE); + LOG_V(talk_base::LS_SENSITIVE) << AsString(talk_base::LS_SENSITIVE); // Read file to string. base::FilePath file_path(log_file_name); @@ -148,14 +148,14 @@ TEST(LibjingleLogTest, LogEverythingConfiguration) { base::ReadFileToString(file_path, &contents_of_file); // Make sure string contains the expected values. - EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_ERROR))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_ERROR))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(rtc::LS_WARNING))); - EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); + AsString(talk_base::LS_WARNING))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_INFO))); // LOG_E EXPECT_TRUE(ContainsString(contents_of_file, strerror(kFakeError))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(rtc::LS_VERBOSE))); + AsString(talk_base::LS_VERBOSE))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(rtc::LS_SENSITIVE))); + AsString(talk_base::LS_SENSITIVE))); } diff --git a/jingle/glue/mock_task.cc b/jingle/glue/mock_task.cc index f9de76c..8894fbe 100644 --- a/jingle/glue/mock_task.cc +++ b/jingle/glue/mock_task.cc @@ -6,7 +6,7 @@ namespace jingle_glue { -MockTask::MockTask(TaskParent* parent) : rtc::Task(parent) {} +MockTask::MockTask(TaskParent* parent) : talk_base::Task(parent) {} MockTask::~MockTask() {} diff --git a/jingle/glue/mock_task.h b/jingle/glue/mock_task.h index 676de0f..7fdaddf 100644 --- a/jingle/glue/mock_task.h +++ b/jingle/glue/mock_task.h @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// A mock of rtc::Task. +// A mock of talk_base::Task. #ifndef JINGLE_GLUE_MOCK_TASK_H_ #define JINGLE_GLUE_MOCK_TASK_H_ #include "testing/gmock/include/gmock/gmock.h" -#include "third_party/webrtc/base/task.h" +#include "third_party/libjingle/source/talk/base/task.h" namespace jingle_glue { -class MockTask : public rtc::Task { +class MockTask : public talk_base::Task { public: MockTask(TaskParent* parent); diff --git a/jingle/glue/task_pump.h b/jingle/glue/task_pump.h index aae8f7db..a90cab6 100644 --- a/jingle/glue/task_pump.h +++ b/jingle/glue/task_pump.h @@ -8,18 +8,18 @@ #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" -#include "third_party/webrtc/base/taskrunner.h" +#include "third_party/libjingle/source/talk/base/taskrunner.h" namespace jingle_glue { -// rtc::TaskRunner implementation that works on chromium threads. -class TaskPump : public rtc::TaskRunner, public base::NonThreadSafe { +// talk_base::TaskRunner implementation that works on chromium threads. +class TaskPump : public talk_base::TaskRunner, public base::NonThreadSafe { public: TaskPump(); virtual ~TaskPump(); - // rtc::TaskRunner implementation. + // talk_base::TaskRunner implementation. virtual void WakeTasks() OVERRIDE; virtual int64 CurrentTime() OVERRIDE; diff --git a/jingle/glue/task_pump_unittest.cc b/jingle/glue/task_pump_unittest.cc index 0782f8f..a9d5c5c 100644 --- a/jingle/glue/task_pump_unittest.cc +++ b/jingle/glue/task_pump_unittest.cc @@ -23,7 +23,7 @@ TEST_F(TaskPumpTest, Basic) { TaskPump task_pump; MockTask* task = new MockTask(&task_pump); // We have to do this since the state enum is protected in - // rtc::Task. + // talk_base::Task. const int TASK_STATE_DONE = 2; EXPECT_CALL(*task, ProcessStart()).WillOnce(Return(TASK_STATE_DONE)); task->Start(); @@ -35,7 +35,7 @@ TEST_F(TaskPumpTest, Stop) { TaskPump task_pump; MockTask* task = new MockTask(&task_pump); // We have to do this since the state enum is protected in - // rtc::Task. + // talk_base::Task. const int TASK_STATE_ERROR = 3; ON_CALL(*task, ProcessStart()).WillByDefault(Return(TASK_STATE_ERROR)); EXPECT_CALL(*task, ProcessStart()).Times(0); diff --git a/jingle/glue/thread_wrapper.cc b/jingle/glue/thread_wrapper.cc index af69c24..e2109fe 100644 --- a/jingle/glue/thread_wrapper.cc +++ b/jingle/glue/thread_wrapper.cc @@ -8,12 +8,12 @@ #include "base/bind_helpers.h" #include "base/lazy_instance.h" #include "base/threading/thread_local.h" -#include "third_party/webrtc/base/nullsocketserver.h" +#include "third_party/libjingle/source/talk/base/nullsocketserver.h" namespace jingle_glue { struct JingleThreadWrapper::PendingSend { - PendingSend(const rtc::Message& message_value) + PendingSend(const talk_base::Message& message_value) : sending_thread(JingleThreadWrapper::current()), message(message_value), done_event(true, false) { @@ -21,7 +21,7 @@ struct JingleThreadWrapper::PendingSend { } JingleThreadWrapper* sending_thread; - rtc::Message message; + talk_base::Message message; base::WaitableEvent done_event; }; @@ -37,7 +37,7 @@ void JingleThreadWrapper::EnsureForCurrentMessageLoop() { message_loop->AddDestructionObserver(current()); } - DCHECK_EQ(rtc::Thread::Current(), current()); + DCHECK_EQ(talk_base::Thread::Current(), current()); } // static @@ -47,48 +47,48 @@ JingleThreadWrapper* JingleThreadWrapper::current() { JingleThreadWrapper::JingleThreadWrapper( scoped_refptr<base::SingleThreadTaskRunner> task_runner) - : rtc::Thread(new rtc::NullSocketServer()), + : talk_base::Thread(new talk_base::NullSocketServer()), task_runner_(task_runner), send_allowed_(false), last_task_id_(0), pending_send_event_(true, false), weak_ptr_factory_(this) { DCHECK(task_runner->BelongsToCurrentThread()); - DCHECK(!rtc::Thread::Current()); + DCHECK(!talk_base::Thread::Current()); weak_ptr_ = weak_ptr_factory_.GetWeakPtr(); - rtc::MessageQueueManager::Add(this); + talk_base::MessageQueueManager::Add(this); WrapCurrent(); } JingleThreadWrapper::~JingleThreadWrapper() { - Clear(NULL, rtc::MQID_ANY, NULL); + Clear(NULL, talk_base::MQID_ANY, NULL); } void JingleThreadWrapper::WillDestroyCurrentMessageLoop() { - DCHECK_EQ(rtc::Thread::Current(), current()); + DCHECK_EQ(talk_base::Thread::Current(), current()); UnwrapCurrent(); g_jingle_thread_wrapper.Get().Set(NULL); - rtc::ThreadManager::Instance()->SetCurrentThread(NULL); - rtc::MessageQueueManager::Remove(this); - rtc::SocketServer* ss = socketserver(); + talk_base::ThreadManager::Instance()->SetCurrentThread(NULL); + talk_base::MessageQueueManager::Remove(this); + talk_base::SocketServer* ss = socketserver(); delete this; delete ss; } void JingleThreadWrapper::Post( - rtc::MessageHandler* handler, uint32 message_id, - rtc::MessageData* data, bool time_sensitive) { + talk_base::MessageHandler* handler, uint32 message_id, + talk_base::MessageData* data, bool time_sensitive) { PostTaskInternal(0, handler, message_id, data); } void JingleThreadWrapper::PostDelayed( - int delay_ms, rtc::MessageHandler* handler, - uint32 message_id, rtc::MessageData* data) { + int delay_ms, talk_base::MessageHandler* handler, + uint32 message_id, talk_base::MessageData* data) { PostTaskInternal(delay_ms, handler, message_id, data); } -void JingleThreadWrapper::Clear(rtc::MessageHandler* handler, uint32 id, - rtc::MessageList* removed) { +void JingleThreadWrapper::Clear(talk_base::MessageHandler* handler, uint32 id, + talk_base::MessageList* removed) { base::AutoLock auto_lock(lock_); for (MessagesQueue::iterator it = messages_.begin(); @@ -127,8 +127,8 @@ void JingleThreadWrapper::Clear(rtc::MessageHandler* handler, uint32 id, } } -void JingleThreadWrapper::Send(rtc::MessageHandler *handler, uint32 id, - rtc::MessageData *data) { +void JingleThreadWrapper::Send(talk_base::MessageHandler *handler, uint32 id, + talk_base::MessageData *data) { if (fStop_) return; @@ -136,7 +136,7 @@ void JingleThreadWrapper::Send(rtc::MessageHandler *handler, uint32 id, DCHECK(current_thread != NULL) << "Send() can be called only from a " "thread that has JingleThreadWrapper."; - rtc::Message message; + talk_base::Message message; message.phandler = handler; message.message_id = id; message.pdata = data; @@ -200,17 +200,17 @@ void JingleThreadWrapper::ProcessPendingSends() { } void JingleThreadWrapper::PostTaskInternal( - int delay_ms, rtc::MessageHandler* handler, - uint32 message_id, rtc::MessageData* data) { + int delay_ms, talk_base::MessageHandler* handler, + uint32 message_id, talk_base::MessageData* data) { int task_id; - rtc::Message message; + talk_base::Message message; message.phandler = handler; message.message_id = message_id; message.pdata = data; { base::AutoLock auto_lock(lock_); task_id = ++last_task_id_; - messages_.insert(std::pair<int, rtc::Message>(task_id, message)); + messages_.insert(std::pair<int, talk_base::Message>(task_id, message)); } if (delay_ms <= 0) { @@ -227,7 +227,7 @@ void JingleThreadWrapper::PostTaskInternal( void JingleThreadWrapper::RunTask(int task_id) { bool have_message = false; - rtc::Message message; + talk_base::Message message; { base::AutoLock auto_lock(lock_); MessagesQueue::iterator it = messages_.find(task_id); @@ -239,7 +239,7 @@ void JingleThreadWrapper::RunTask(int task_id) { } if (have_message) { - if (message.message_id == rtc::MQID_DISPOSE) { + if (message.message_id == talk_base::MQID_DISPOSE) { DCHECK(message.phandler == NULL); delete message.pdata; } else { @@ -263,22 +263,22 @@ void JingleThreadWrapper::Restart() { NOTREACHED(); } -bool JingleThreadWrapper::Get(rtc::Message*, int, bool) { +bool JingleThreadWrapper::Get(talk_base::Message*, int, bool) { NOTREACHED(); return false; } -bool JingleThreadWrapper::Peek(rtc::Message*, int) { +bool JingleThreadWrapper::Peek(talk_base::Message*, int) { NOTREACHED(); return false; } -void JingleThreadWrapper::PostAt(uint32, rtc::MessageHandler*, - uint32, rtc::MessageData*) { +void JingleThreadWrapper::PostAt(uint32, talk_base::MessageHandler*, + uint32, talk_base::MessageData*) { NOTREACHED(); } -void JingleThreadWrapper::Dispatch(rtc::Message* message) { +void JingleThreadWrapper::Dispatch(talk_base::Message* message) { NOTREACHED(); } diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h index e1365c9..97e8588 100644 --- a/jingle/glue/thread_wrapper.h +++ b/jingle/glue/thread_wrapper.h @@ -12,11 +12,11 @@ #include "base/message_loop/message_loop.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" -#include "third_party/webrtc/base/thread.h" +#include "third_party/libjingle/source/talk/base/thread.h" namespace jingle_glue { -// JingleThreadWrapper implements rtc::Thread interface on top of +// JingleThreadWrapper implements talk_base::Thread interface on top of // Chromium's SingleThreadTaskRunner interface. Currently only the bare minimum // that is used by P2P part of libjingle is implemented. There are two ways to // create this object: @@ -28,7 +28,7 @@ namespace jingle_glue { // must pass a valid task runner for the current thread and also delete the // wrapper later. class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, - public rtc::Thread { + public talk_base::Thread { public: // Create JingleThreadWrapper for the current thread if it hasn't been created // yet. The thread wrapper is destroyed automatically when the current @@ -54,21 +54,21 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, // MessageLoop::DestructionObserver implementation. virtual void WillDestroyCurrentMessageLoop() OVERRIDE; - // rtc::MessageQueue overrides. - virtual void Post(rtc::MessageHandler *phandler, + // talk_base::MessageQueue overrides. + virtual void Post(talk_base::MessageHandler *phandler, uint32 id, - rtc::MessageData *pdata, + talk_base::MessageData *pdata, bool time_sensitive) OVERRIDE; virtual void PostDelayed(int delay_ms, - rtc::MessageHandler* handler, + talk_base::MessageHandler* handler, uint32 id, - rtc::MessageData* data) OVERRIDE; - virtual void Clear(rtc::MessageHandler* handler, + talk_base::MessageData* data) OVERRIDE; + virtual void Clear(talk_base::MessageHandler* handler, uint32 id, - rtc::MessageList* removed) OVERRIDE; - virtual void Send(rtc::MessageHandler *handler, + talk_base::MessageList* removed) OVERRIDE; + virtual void Send(talk_base::MessageHandler *handler, uint32 id, - rtc::MessageData *data) OVERRIDE; + talk_base::MessageData *data) OVERRIDE; // Following methods are not supported.They are overriden just to // ensure that they are not called (each of them contain NOTREACHED @@ -77,30 +77,30 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, virtual void Quit() OVERRIDE; virtual bool IsQuitting() OVERRIDE; virtual void Restart() OVERRIDE; - virtual bool Get(rtc::Message* message, + virtual bool Get(talk_base::Message* message, int delay_ms, bool process_io) OVERRIDE; - virtual bool Peek(rtc::Message* message, + virtual bool Peek(talk_base::Message* message, int delay_ms) OVERRIDE; virtual void PostAt(uint32 timestamp, - rtc::MessageHandler* handler, + talk_base::MessageHandler* handler, uint32 id, - rtc::MessageData* data) OVERRIDE; - virtual void Dispatch(rtc::Message* message) OVERRIDE; + talk_base::MessageData* data) OVERRIDE; + virtual void Dispatch(talk_base::Message* message) OVERRIDE; virtual void ReceiveSends() OVERRIDE; virtual int GetDelay() OVERRIDE; - // rtc::Thread overrides. + // talk_base::Thread overrides. virtual void Stop() OVERRIDE; virtual void Run() OVERRIDE; private: - typedef std::map<int, rtc::Message> MessagesQueue; + typedef std::map<int, talk_base::Message> MessagesQueue; struct PendingSend; void PostTaskInternal( - int delay_ms, rtc::MessageHandler* handler, - uint32 message_id, rtc::MessageData* data); + int delay_ms, talk_base::MessageHandler* handler, + uint32 message_id, talk_base::MessageData* data); void RunTask(int task_id); void ProcessPendingSends(); diff --git a/jingle/glue/thread_wrapper_unittest.cc b/jingle/glue/thread_wrapper_unittest.cc index 8eabe98..3657780 100644 --- a/jingle/glue/thread_wrapper_unittest.cc +++ b/jingle/glue/thread_wrapper_unittest.cc @@ -28,9 +28,9 @@ static const int kMaxTestDelay = 40; namespace { -class MockMessageHandler : public rtc::MessageHandler { +class MockMessageHandler : public talk_base::MessageHandler { public: - MOCK_METHOD1(OnMessage, void(rtc::Message* msg)); + MOCK_METHOD1(OnMessage, void(talk_base::Message* msg)); }; MATCHER_P3(MatchMessage, handler, message_id, data, "") { @@ -66,7 +66,7 @@ class ThreadWrapperTest : public testing::Test { // This method is used by the SendDuringSend test. It sends message to the // main thread synchronously using Send(). void PingMainThread() { - rtc::MessageData* data = new rtc::MessageData(); + talk_base::MessageData* data = new talk_base::MessageData(); MockMessageHandler handler; EXPECT_CALL(handler, OnMessage( @@ -82,21 +82,21 @@ class ThreadWrapperTest : public testing::Test { virtual void SetUp() OVERRIDE { JingleThreadWrapper::EnsureForCurrentMessageLoop(); - thread_ = rtc::Thread::Current(); + thread_ = talk_base::Thread::Current(); } // ThreadWrapper destroyes itself when |message_loop_| is destroyed. base::MessageLoop message_loop_; - rtc::Thread* thread_; + talk_base::Thread* thread_; MockMessageHandler handler1_; MockMessageHandler handler2_; }; TEST_F(ThreadWrapperTest, Post) { - rtc::MessageData* data1 = new rtc::MessageData(); - rtc::MessageData* data2 = new rtc::MessageData(); - rtc::MessageData* data3 = new rtc::MessageData(); - rtc::MessageData* data4 = new rtc::MessageData(); + talk_base::MessageData* data1 = new talk_base::MessageData(); + talk_base::MessageData* data2 = new talk_base::MessageData(); + talk_base::MessageData* data3 = new talk_base::MessageData(); + talk_base::MessageData* data4 = new talk_base::MessageData(); thread_->Post(&handler1_, kTestMessage1, data1); thread_->Post(&handler1_, kTestMessage2, data2); @@ -122,10 +122,10 @@ TEST_F(ThreadWrapperTest, Post) { } TEST_F(ThreadWrapperTest, PostDelayed) { - rtc::MessageData* data1 = new rtc::MessageData(); - rtc::MessageData* data2 = new rtc::MessageData(); - rtc::MessageData* data3 = new rtc::MessageData(); - rtc::MessageData* data4 = new rtc::MessageData(); + talk_base::MessageData* data1 = new talk_base::MessageData(); + talk_base::MessageData* data2 = new talk_base::MessageData(); + talk_base::MessageData* data3 = new talk_base::MessageData(); + talk_base::MessageData* data4 = new talk_base::MessageData(); thread_->PostDelayed(kTestDelayMs1, &handler1_, kTestMessage1, data1); thread_->PostDelayed(kTestDelayMs2, &handler1_, kTestMessage2, data2); @@ -164,7 +164,7 @@ TEST_F(ThreadWrapperTest, Clear) { InSequence in_seq; - rtc::MessageData* null_data = NULL; + talk_base::MessageData* null_data = NULL; EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, null_data))) .WillOnce(DeleteMessageData()); @@ -188,7 +188,7 @@ TEST_F(ThreadWrapperTest, ClearDelayed) { InSequence in_seq; - rtc::MessageData* null_data = NULL; + talk_base::MessageData* null_data = NULL; EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, null_data))) .WillOnce(DeleteMessageData()); @@ -214,15 +214,15 @@ TEST_F(ThreadWrapperTest, ClearDestoroyed) { handler_ptr = &handler; thread_->Post(&handler, kTestMessage1, NULL); } - rtc::MessageList removed; - thread_->Clear(handler_ptr, rtc::MQID_ANY, &removed); + talk_base::MessageList removed; + thread_->Clear(handler_ptr, talk_base::MQID_ANY, &removed); DCHECK_EQ(0U, removed.size()); } // Verify that Send() calls handler synchronously when called on the // same thread. TEST_F(ThreadWrapperTest, SendSameThread) { - rtc::MessageData* data = new rtc::MessageData(); + talk_base::MessageData* data = new talk_base::MessageData(); EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) @@ -230,7 +230,7 @@ TEST_F(ThreadWrapperTest, SendSameThread) { thread_->Send(&handler1_, kTestMessage1, data); } -void InitializeWrapperForNewThread(rtc::Thread** thread, +void InitializeWrapperForNewThread(talk_base::Thread** thread, base::WaitableEvent* done_event) { JingleThreadWrapper::EnsureForCurrentMessageLoop(); JingleThreadWrapper::current()->set_send_allowed(true); @@ -247,7 +247,7 @@ TEST_F(ThreadWrapperTest, SendToOtherThread) { second_thread.Start(); base::WaitableEvent initialized_event(true, false); - rtc::Thread* target; + talk_base::Thread* target; second_thread.message_loop()->PostTask( FROM_HERE, base::Bind(&InitializeWrapperForNewThread, &target, &initialized_event)); @@ -255,7 +255,7 @@ TEST_F(ThreadWrapperTest, SendToOtherThread) { ASSERT_TRUE(target != NULL); - rtc::MessageData* data = new rtc::MessageData(); + talk_base::MessageData* data = new talk_base::MessageData(); EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) @@ -276,7 +276,7 @@ TEST_F(ThreadWrapperTest, SendDuringSend) { second_thread.Start(); base::WaitableEvent initialized_event(true, false); - rtc::Thread* target; + talk_base::Thread* target; second_thread.message_loop()->PostTask( FROM_HERE, base::Bind(&InitializeWrapperForNewThread, &target, &initialized_event)); @@ -284,7 +284,7 @@ TEST_F(ThreadWrapperTest, SendDuringSend) { ASSERT_TRUE(target != NULL); - rtc::MessageData* data = new rtc::MessageData(); + talk_base::MessageData* data = new talk_base::MessageData(); EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) diff --git a/jingle/glue/utils.cc b/jingle/glue/utils.cc index acf45cb..5350631 100644 --- a/jingle/glue/utils.cc +++ b/jingle/glue/utils.cc @@ -11,21 +11,21 @@ #include "base/values.h" #include "net/base/ip_endpoint.h" #include "net/base/net_util.h" +#include "third_party/libjingle/source/talk/base/byteorder.h" +#include "third_party/libjingle/source/talk/base/socketaddress.h" #include "third_party/libjingle/source/talk/p2p/base/candidate.h" -#include "third_party/webrtc/base/byteorder.h" -#include "third_party/webrtc/base/socketaddress.h" namespace jingle_glue { bool IPEndPointToSocketAddress(const net::IPEndPoint& ip_endpoint, - rtc::SocketAddress* address) { + talk_base::SocketAddress* address) { sockaddr_storage addr; socklen_t len = sizeof(addr); return ip_endpoint.ToSockAddr(reinterpret_cast<sockaddr*>(&addr), &len) && - rtc::SocketAddressFromSockAddrStorage(addr, address); + talk_base::SocketAddressFromSockAddrStorage(addr, address); } -bool SocketAddressToIPEndPoint(const rtc::SocketAddress& address, +bool SocketAddressToIPEndPoint(const talk_base::SocketAddress& address, net::IPEndPoint* ip_endpoint) { sockaddr_storage addr; int size = address.ToSockAddrStorage(&addr); @@ -81,7 +81,7 @@ bool DeserializeP2PCandidate(const std::string& candidate_str, return false; } - candidate->set_address(rtc::SocketAddress(ip, port)); + candidate->set_address(talk_base::SocketAddress(ip, port)); candidate->set_type(type); candidate->set_protocol(protocol); candidate->set_username(username); diff --git a/jingle/glue/utils.h b/jingle/glue/utils.h index cb42b4b..a655f71 100644 --- a/jingle/glue/utils.h +++ b/jingle/glue/utils.h @@ -11,9 +11,9 @@ namespace net { class IPEndPoint; } // namespace net -namespace rtc { +namespace talk_base { class SocketAddress; -} // namespace rtc +} // namespace talk_base namespace cricket { class Candidate; @@ -25,8 +25,8 @@ namespace jingle_glue { // following two functions are used to convert addresses from one // representation to another. bool IPEndPointToSocketAddress(const net::IPEndPoint& ip_endpoint, - rtc::SocketAddress* address); -bool SocketAddressToIPEndPoint(const rtc::SocketAddress& address, + talk_base::SocketAddress* address); +bool SocketAddressToIPEndPoint(const talk_base::SocketAddress& address, net::IPEndPoint* ip_endpoint); // Helper functions to serialize and deserialize P2P candidates. |