Revert 8237 "Cleanup and prepare for bundling."

libjingle_peerconnection_objc_test consistently failing on Mac64 Debug.

> Cleanup and prepare for bundling.
> 
> - Add a GetOptions function. Needed for eventual bundle testing to
>   confirm that channel options are preserved.
> - Simplify unit tests and cleanup unused code.
> 
> BUG=1574
> R=pthatcher@webrtc.org, tommi@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/39699004

TBR=pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34959004

Cr-Commit-Position: refs/heads/master@{#8241}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8241 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc
index 2dce562..bc16e5e 100644
--- a/talk/app/webrtc/peerconnection.cc
+++ b/talk/app/webrtc/peerconnection.cc
@@ -323,16 +323,28 @@
     PortAllocatorFactoryInterface* allocator_factory,
     DTLSIdentityServiceInterface* dtls_identity_service,
     PeerConnectionObserver* observer) {
-  ASSERT(observer != NULL);
-  if (!observer)
-    return false;
-  observer_ = observer;
-
   std::vector<PortAllocatorFactoryInterface::StunConfiguration> stun_config;
   std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turn_config;
   if (!ParseIceServers(configuration.servers, &stun_config, &turn_config)) {
     return false;
   }
+
+  return DoInitialize(configuration.type, stun_config, turn_config, constraints,
+                      allocator_factory, dtls_identity_service, observer);
+}
+
+bool PeerConnection::DoInitialize(
+    IceTransportsType type,
+    const StunConfigurations& stun_config,
+    const TurnConfigurations& turn_config,
+    const MediaConstraintsInterface* constraints,
+    webrtc::PortAllocatorFactoryInterface* allocator_factory,
+    DTLSIdentityServiceInterface* dtls_identity_service,
+    PeerConnectionObserver* observer) {
+  ASSERT(observer != NULL);
+  if (!observer)
+    return false;
+  observer_ = observer;
   port_allocator_.reset(
       allocator_factory->CreatePortAllocator(stun_config, turn_config));
 
@@ -372,9 +384,7 @@
 
   // Initialize the WebRtcSession. It creates transport channels etc.
   if (!session_->Initialize(factory_->options(), constraints,
-                            dtls_identity_service,
-                            configuration.type,
-                            configuration.bundle_policy))
+                            dtls_identity_service, type))
     return false;
 
   // Register PeerConnection as receiver of local ice candidates.
diff --git a/talk/app/webrtc/peerconnectioninterface.h b/talk/app/webrtc/peerconnectioninterface.h
index 1b52a56..35ba705 100644
--- a/talk/app/webrtc/peerconnectioninterface.h
+++ b/talk/app/webrtc/peerconnectioninterface.h
@@ -506,13 +506,13 @@
   // http://dev.w3.org/2011/webrtc/editor/webrtc.html
   inline rtc::scoped_refptr<PeerConnectionInterface>
       CreatePeerConnection(
-          const PeerConnectionInterface::IceServers& servers,
+          const PeerConnectionInterface::IceServers& configuration,
           const MediaConstraintsInterface* constraints,
           PortAllocatorFactoryInterface* allocator_factory,
           DTLSIdentityServiceInterface* dtls_identity_service,
           PeerConnectionObserver* observer) {
       PeerConnectionInterface::RTCConfiguration rtc_config;
-      rtc_config.servers = servers;
+      rtc_config.servers = configuration;
       return CreatePeerConnection(rtc_config, constraints, allocator_factory,
                                   dtls_identity_service, observer);
   }
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index 83e613e..0145243 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -466,12 +466,11 @@
   bool ice_restart_;
 };
 
-WebRtcSession::WebRtcSession(
-    cricket::ChannelManager* channel_manager,
-    rtc::Thread* signaling_thread,
-    rtc::Thread* worker_thread,
-    cricket::PortAllocator* port_allocator,
-    MediaStreamSignaling* mediastream_signaling)
+WebRtcSession::WebRtcSession(cricket::ChannelManager* channel_manager,
+                             rtc::Thread* signaling_thread,
+                             rtc::Thread* worker_thread,
+                             cricket::PortAllocator* port_allocator,
+                             MediaStreamSignaling* mediastream_signaling)
     : cricket::BaseSession(signaling_thread,
                            worker_thread,
                            port_allocator,
@@ -517,10 +516,7 @@
     const PeerConnectionFactoryInterface::Options& options,
     const MediaConstraintsInterface*  constraints,
     DTLSIdentityServiceInterface* dtls_identity_service,
-    PeerConnectionInterface::IceTransportsType ice_transport_type,
-    PeerConnectionInterface::BundlePolicy bundle_policy) {
-  bundle_policy_ = bundle_policy;
-
+    PeerConnectionInterface::IceTransportsType ice_transport) {
   // TODO(perkj): Take |constraints| into consideration. Return false if not all
   // mandatory constraints can be fulfilled. Note that |constraints|
   // can be null.
@@ -663,7 +659,7 @@
     webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED);
   }
   port_allocator()->set_candidate_filter(
-      ConvertIceTransportTypeToCandidateFilter(ice_transport_type));
+      ConvertIceTransportTypeToCandidateFilter(ice_transport));
   return true;
 }
 
diff --git a/talk/app/webrtc/webrtcsession.h b/talk/app/webrtc/webrtcsession.h
index 4f37340..8a77923 100644
--- a/talk/app/webrtc/webrtcsession.h
+++ b/talk/app/webrtc/webrtcsession.h
@@ -118,8 +118,7 @@
   bool Initialize(const PeerConnectionFactoryInterface::Options& options,
                   const MediaConstraintsInterface* constraints,
                   DTLSIdentityServiceInterface* dtls_identity_service,
-                  PeerConnectionInterface::IceTransportsType ice_transport_type,
-                  PeerConnectionInterface::BundlePolicy bundle_policy);
+                  PeerConnectionInterface::IceTransportsType ice_transport);
   // Deletes the voice, video and data channel and changes the session state
   // to STATE_RECEIVEDTERMINATE.
   void Terminate();
@@ -373,9 +372,6 @@
   cricket::VideoOptions video_options_;
   MetricsObserverInterface* metrics_observer_;
 
-  // Declares the bundle policy for the WebRTCSession.
-  PeerConnectionInterface::BundlePolicy bundle_policy_;
-
   DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
 };
 }  // namespace webrtc
diff --git a/talk/app/webrtc/webrtcsession_unittest.cc b/talk/app/webrtc/webrtcsession_unittest.cc
index a8ca497..d0fb805 100644
--- a/talk/app/webrtc/webrtcsession_unittest.cc
+++ b/talk/app/webrtc/webrtcsession_unittest.cc
@@ -342,7 +342,8 @@
       stun_server_(cricket::TestStunServer::Create(Thread::Current(),
                                                    stun_socket_addr_)),
       turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr),
-      mediastream_signaling_(channel_manager_.get()) {
+      mediastream_signaling_(channel_manager_.get()),
+      ice_type_(PeerConnectionInterface::kAll) {
     tdesc_factory_->set_protocol(cricket::ICEPROTO_HYBRID);
 
     cricket::ServerAddresses stun_servers;
@@ -364,10 +365,11 @@
     network_manager_.AddInterface(addr);
   }
 
-  void Init(
-      DTLSIdentityServiceInterface* identity_service,
-      PeerConnectionInterface::IceTransportsType ice_transport_type,
-      PeerConnectionInterface::BundlePolicy bundle_policy) {
+  void SetIceTransportType(PeerConnectionInterface::IceTransportsType type) {
+    ice_type_ = type;
+  }
+
+  void Init(DTLSIdentityServiceInterface* identity_service) {
     ASSERT_TRUE(session_.get() == NULL);
     session_.reset(new WebRtcSessionForTest(
         channel_manager_.get(), rtc::Thread::Current(),
@@ -381,35 +383,10 @@
         observer_.ice_gathering_state_);
 
     EXPECT_TRUE(session_->Initialize(options_, constraints_.get(),
-                                     identity_service, ice_transport_type,
-                                     bundle_policy));
+                                     identity_service, ice_type_));
     session_->set_metrics_observer(&metrics_observer_);
   }
 
-  void Init() {
-    Init(NULL, PeerConnectionInterface::kAll,
-            PeerConnectionInterface::kBundlePolicyBalanced);
-  }
-
-  void InitWithIceTransport(
-      PeerConnectionInterface::IceTransportsType ice_transport_type) {
-    Init(NULL, ice_transport_type,
-         PeerConnectionInterface::kBundlePolicyBalanced);
-  }
-
-  void InitWithBundlePolicy(
-      PeerConnectionInterface::BundlePolicy bundle_policy) {
-    Init(NULL, PeerConnectionInterface::kAll, bundle_policy);
-  }
-
-  void InitWithDtls(bool identity_request_should_fail = false) {
-    FakeIdentityService* identity_service = new FakeIdentityService();
-    identity_service->set_should_fail(identity_request_should_fail);
-    Init(identity_service,
-            PeerConnectionInterface::kAll,
-            PeerConnectionInterface::kBundlePolicyBalanced);
-  }
-
   void InitWithDtmfCodec() {
     // Add kTelephoneEventCodec for dtmf test.
     const cricket::AudioCodec kTelephoneEventCodec(
@@ -418,7 +395,13 @@
     codecs.push_back(kTelephoneEventCodec);
     media_engine_->SetAudioCodecs(codecs);
     desc_factory_->set_audio_codecs(codecs);
-    Init();
+    Init(NULL);
+  }
+
+  void InitWithDtls(bool identity_request_should_fail = false) {
+    FakeIdentityService* identity_service = new FakeIdentityService();
+    identity_service->set_should_fail(identity_request_should_fail);
+    Init(identity_service);
   }
 
   // Creates a local offer and applies it. Starts ice.
@@ -589,7 +572,7 @@
         webrtc::MediaConstraintsInterface::kNumUnsignalledRecvStreams,
         value_set);
     session_.reset();
-    Init();
+    Init(NULL);
     mediastream_signaling_.SendAudioVideoStream1();
     SessionDescriptionInterface* offer = CreateOffer();
 
@@ -908,7 +891,7 @@
 
   void TestSessionCandidatesWithBundleRtcpMux(bool bundle, bool rtcp_mux) {
     AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
-    Init();
+    Init(NULL);
     mediastream_signaling_.SendAudioVideoStream1();
 
     PeerConnectionInterface::RTCOfferAnswerOptions options;
@@ -960,7 +943,7 @@
     if (can) {
       InitWithDtmfCodec();
     } else {
-      Init();
+      Init(NULL);
     }
     mediastream_signaling_.SendAudioVideoStream1();
     CreateAndSetRemoteOfferAndLocalAnswer();
@@ -1067,7 +1050,7 @@
 
   void TestLoopbackCall(const LoopbackNetworkConfiguration& config) {
     LoopbackNetworkManager loopback_network_manager(this, config);
-    Init();
+    Init(NULL);
     mediastream_signaling_.SendAudioVideoStream1();
     SessionDescriptionInterface* offer = CreateOffer();
 
@@ -1257,6 +1240,7 @@
   MockIceObserver observer_;
   cricket::FakeVideoMediaChannel* video_channel_;
   cricket::FakeVoiceMediaChannel* voice_channel_;
+  PeerConnectionInterface::IceTransportsType ice_type_;
   FakeMetricsObserver metrics_observer_;
 };
 
@@ -1267,7 +1251,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestInitializeWithoutDtls) {
-  Init();
+  Init(NULL);
   // SDES is required if DTLS is off.
   EXPECT_EQ(cricket::SEC_REQUIRED, session_->SdesPolicy());
 }
@@ -1289,7 +1273,7 @@
 TEST_F(WebRtcSessionTest, TestMultihomeCandidates) {
   AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
   AddInterface(rtc::SocketAddress(kClientAddrHost2, kClientAddrPort));
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   InitiateCall();
   EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout);
@@ -1304,7 +1288,7 @@
                 rtc::FP_UDP,
                 rtc::FD_ANY,
                 rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   InitiateCall();
   // Since kClientAddrHost1 is blocked, not expecting stun candidates for it.
@@ -1316,7 +1300,8 @@
 // Test session delivers no candidates gathered when constraint set to "none".
 TEST_F(WebRtcSessionTest, TestIceTransportsNone) {
   AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
-  InitWithIceTransport(PeerConnectionInterface::kNone);
+  SetIceTransportType(PeerConnectionInterface::kNone);
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   InitiateCall();
   EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout);
@@ -1329,7 +1314,8 @@
 TEST_F(WebRtcSessionTest, TestIceTransportsRelay) {
   AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
   ConfigureAllocatorWithTurn();
-  InitWithIceTransport(PeerConnectionInterface::kRelay);
+  SetIceTransportType(PeerConnectionInterface::kRelay);
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   InitiateCall();
   EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout);
@@ -1348,7 +1334,8 @@
 // Test session delivers all candidates gathered when constaint set to "all".
 TEST_F(WebRtcSessionTest, TestIceTransportsAll) {
   AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
-  InitWithIceTransport(PeerConnectionInterface::kAll);
+  SetIceTransportType(PeerConnectionInterface::kAll);
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   InitiateCall();
   EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout);
@@ -1358,7 +1345,7 @@
 }
 
 TEST_F(WebRtcSessionTest, SetSdpFailedOnInvalidSdp) {
-  Init();
+  Init(NULL);
   SessionDescriptionInterface* offer = NULL;
   // Since |offer| is NULL, there's no way to tell if it's an offer or answer.
   std::string unknown_action;
@@ -1369,7 +1356,7 @@
 // Test creating offers and receive answers and make sure the
 // media engine creates the expected send and receive streams.
 TEST_F(WebRtcSessionTest, TestCreateSdesOfferReceiveSdesAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
   const std::string session_id_orig = offer->session_id();
@@ -1423,7 +1410,7 @@
 // Test receiving offers and creating answers and make sure the
 // media engine creates the expected send and receive streams.
 TEST_F(WebRtcSessionTest, TestReceiveSdesOfferCreateSdesAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream2();
   SessionDescriptionInterface* offer = CreateOffer();
   VerifyCryptoParams(offer->description());
@@ -1479,7 +1466,7 @@
 }
 
 TEST_F(WebRtcSessionTest, SetLocalSdpFailedOnCreateChannel) {
-  Init();
+  Init(NULL);
   media_engine_->set_fail_create_channel(true);
 
   SessionDescriptionInterface* offer = CreateOffer();
@@ -1525,7 +1512,7 @@
 // Test that we return a failure when applying a remote/local offer that doesn't
 // have cryptos enabled when DTLS is off.
 TEST_F(WebRtcSessionTest, TestSetNonSdesOfferWhenSdesOn) {
-  Init();
+  Init(NULL);
   cricket::MediaSessionOptions options;
   options.recv_video = true;
   JsepSessionDescription* offer = CreateRemoteOffer(
@@ -1543,7 +1530,7 @@
 // Test that we return a failure when applying a local answer that doesn't have
 // cryptos enabled when DTLS is off.
 TEST_F(WebRtcSessionTest, TestSetLocalNonSdesAnswerWhenSdesOn) {
-  Init();
+  Init(NULL);
   SessionDescriptionInterface* offer = NULL;
   SessionDescriptionInterface* answer = NULL;
   CreateCryptoOfferAndNonCryptoAnswer(&offer, &answer);
@@ -1556,7 +1543,7 @@
 // Test we will return fail when apply an remote answer that doesn't have
 // crypto enabled when DTLS is off.
 TEST_F(WebRtcSessionTest, TestSetRemoteNonSdesAnswerWhenSdesOn) {
-  Init();
+  Init(NULL);
   SessionDescriptionInterface* offer = NULL;
   SessionDescriptionInterface* answer = NULL;
   CreateCryptoOfferAndNonCryptoAnswer(&offer, &answer);
@@ -1741,7 +1728,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetLocalOfferTwice) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   // SetLocalDescription take ownership of offer.
   SessionDescriptionInterface* offer = CreateOffer();
@@ -1753,7 +1740,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetRemoteOfferTwice) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   // SetLocalDescription take ownership of offer.
   SessionDescriptionInterface* offer = CreateOffer();
@@ -1764,7 +1751,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetLocalAndRemoteOffer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   SessionDescriptionInterface* offer = CreateOffer();
   SetLocalDescriptionWithoutError(offer);
@@ -1774,7 +1761,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetRemoteAndLocalOffer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   SessionDescriptionInterface* offer = CreateOffer();
   SetRemoteDescriptionWithoutError(offer);
@@ -1784,7 +1771,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetLocalPrAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   SessionDescriptionInterface* offer = CreateRemoteOffer();
   SetRemoteDescriptionExpectState(offer, BaseSession::STATE_RECEIVEDINITIATE);
@@ -1807,7 +1794,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetRemotePrAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   SessionDescriptionInterface* offer = CreateOffer();
   SetLocalDescriptionExpectState(offer, BaseSession::STATE_SENTINITIATE);
@@ -1834,7 +1821,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetLocalAnswerWithoutOffer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
@@ -1845,7 +1832,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSetRemoteAnswerWithoutOffer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendNothing();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
@@ -1856,7 +1843,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestAddRemoteCandidate) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
 
   cricket::Candidate candidate;
@@ -1905,7 +1892,7 @@
 // Test that a remote candidate is added to the remote session description and
 // that it is retained if the remote session description is changed.
 TEST_F(WebRtcSessionTest, TestRemoteCandidatesAddedToSessionDescription) {
-  Init();
+  Init(NULL);
   cricket::Candidate candidate1;
   candidate1.set_component(1);
   JsepIceCandidate ice_candidate1(kMediaContentName0, kMediaContentIndex0,
@@ -1958,7 +1945,7 @@
 // that they are retained if the local session description is changed.
 TEST_F(WebRtcSessionTest, TestLocalCandidatesAddedToSessionDescription) {
   AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   CreateAndSetRemoteOfferAndLocalAnswer();
 
@@ -1993,7 +1980,7 @@
 
 // Test that we can set a remote session description with remote candidates.
 TEST_F(WebRtcSessionTest, TestSetRemoteSessionDescriptionWithCandidates) {
-  Init();
+  Init(NULL);
 
   cricket::Candidate candidate1;
   candidate1.set_component(1);
@@ -2022,7 +2009,7 @@
 // been gathered.
 TEST_F(WebRtcSessionTest, TestSetLocalAndRemoteDescriptionWithCandidates) {
   AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   // Ice is started but candidates are not provided until SetLocalDescription
   // is called.
@@ -2055,7 +2042,7 @@
 // Verifies TransportProxy and media channels are created with content names
 // present in the SessionDescription.
 TEST_F(WebRtcSessionTest, TestChannelCreationsWithContentNames) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
@@ -2099,7 +2086,7 @@
 // Test that an offer contains the correct media content descriptions based on
 // the send streams when no constraints have been set.
 TEST_F(WebRtcSessionTest, CreateOfferWithoutConstraintsOrStreams) {
-  Init();
+  Init(NULL);
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
   ASSERT_TRUE(offer != NULL);
@@ -2113,7 +2100,7 @@
 // Test that an offer contains the correct media content descriptions based on
 // the send streams when no constraints have been set.
 TEST_F(WebRtcSessionTest, CreateOfferWithoutConstraints) {
-  Init();
+  Init(NULL);
   // Test Audio only offer.
   mediastream_signaling_.UseOptionsAudioOnly();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
@@ -2136,7 +2123,7 @@
 // Test that an offer contains no media content descriptions if
 // kOfferToReceiveVideo and kOfferToReceiveAudio constraints are set to false.
 TEST_F(WebRtcSessionTest, CreateOfferWithConstraintsWithoutStreams) {
-  Init();
+  Init(NULL);
   PeerConnectionInterface::RTCOfferAnswerOptions options;
   options.offer_to_receive_audio = 0;
   options.offer_to_receive_video = 0;
@@ -2155,7 +2142,7 @@
 // Test that an offer contains only audio media content descriptions if
 // kOfferToReceiveAudio constraints are set to true.
 TEST_F(WebRtcSessionTest, CreateAudioOnlyOfferWithConstraints) {
-  Init();
+  Init(NULL);
   PeerConnectionInterface::RTCOfferAnswerOptions options;
   options.offer_to_receive_audio =
       RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
@@ -2173,7 +2160,7 @@
 // Test that an offer contains audio and video media content descriptions if
 // kOfferToReceiveAudio and kOfferToReceiveVideo constraints are set to true.
 TEST_F(WebRtcSessionTest, CreateOfferWithConstraints) {
-  Init();
+  Init(NULL);
   // Test Audio / Video offer.
   PeerConnectionInterface::RTCOfferAnswerOptions options;
   options.offer_to_receive_audio =
@@ -2206,7 +2193,7 @@
 // Test that an answer can not be created if the last remote description is not
 // an offer.
 TEST_F(WebRtcSessionTest, CreateAnswerWithoutAnOffer) {
-  Init();
+  Init(NULL);
   SessionDescriptionInterface* offer = CreateOffer();
   SetLocalDescriptionWithoutError(offer);
   SessionDescriptionInterface* answer = CreateRemoteAnswer(offer);
@@ -2217,7 +2204,7 @@
 // Test that an answer contains the correct media content descriptions when no
 // constraints have been set.
 TEST_F(WebRtcSessionTest, CreateAnswerWithoutConstraintsOrStreams) {
-  Init();
+  Init(NULL);
   // Create a remote offer with audio and video content.
   rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
   SetRemoteDescriptionWithoutError(offer.release());
@@ -2236,7 +2223,7 @@
 // Test that an answer contains the correct media content descriptions when no
 // constraints have been set and the offer only contain audio.
 TEST_F(WebRtcSessionTest, CreateAudioAnswerWithoutConstraintsOrStreams) {
-  Init();
+  Init(NULL);
   // Create a remote offer with audio only.
   cricket::MediaSessionOptions options;
 
@@ -2259,7 +2246,7 @@
 // Test that an answer contains the correct media content descriptions when no
 // constraints have been set.
 TEST_F(WebRtcSessionTest, CreateAnswerWithoutConstraints) {
-  Init();
+  Init(NULL);
   // Create a remote offer with audio and video content.
   rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
   SetRemoteDescriptionWithoutError(offer.release());
@@ -2280,7 +2267,7 @@
 // Test that an answer contains the correct media content descriptions when
 // constraints have been set but no stream is sent.
 TEST_F(WebRtcSessionTest, CreateAnswerWithConstraintsWithoutStreams) {
-  Init();
+  Init(NULL);
   // Create a remote offer with audio and video content.
   rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
   SetRemoteDescriptionWithoutError(offer.release());
@@ -2304,7 +2291,7 @@
 // Test that an answer contains the correct media content descriptions when
 // constraints have been set and streams are sent.
 TEST_F(WebRtcSessionTest, CreateAnswerWithConstraints) {
-  Init();
+  Init(NULL);
   // Create a remote offer with audio and video content.
   rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
   SetRemoteDescriptionWithoutError(offer.release());
@@ -2332,7 +2319,7 @@
 
 TEST_F(WebRtcSessionTest, CreateOfferWithoutCNCodecs) {
   AddCNCodecs();
-  Init();
+  Init(NULL);
   PeerConnectionInterface::RTCOfferAnswerOptions options;
   options.offer_to_receive_audio =
       RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
@@ -2349,7 +2336,7 @@
 
 TEST_F(WebRtcSessionTest, CreateAnswerWithoutCNCodecs) {
   AddCNCodecs();
-  Init();
+  Init(NULL);
   // Create a remote offer with audio and video content.
   rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
   SetRemoteDescriptionWithoutError(offer.release());
@@ -2367,7 +2354,7 @@
 // This test verifies the call setup when remote answer with audio only and
 // later updates with video.
 TEST_F(WebRtcSessionTest, TestAVOfferWithAudioOnlyAnswer) {
-  Init();
+  Init(NULL);
   EXPECT_TRUE(media_engine_->GetVideoChannel(0) == NULL);
   EXPECT_TRUE(media_engine_->GetVoiceChannel(0) == NULL);
 
@@ -2424,7 +2411,7 @@
 // This test verifies the call setup when remote answer with video only and
 // later updates with audio.
 TEST_F(WebRtcSessionTest, TestAVOfferWithVideoOnlyAnswer) {
-  Init();
+  Init(NULL);
   EXPECT_TRUE(media_engine_->GetVideoChannel(0) == NULL);
   EXPECT_TRUE(media_engine_->GetVoiceChannel(0) == NULL);
   mediastream_signaling_.SendAudioVideoStream1();
@@ -2477,7 +2464,7 @@
 }
 
 TEST_F(WebRtcSessionTest, VerifyCryptoParamsInSDP) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
   VerifyCryptoParams(offer->description());
@@ -2488,26 +2475,26 @@
 
 TEST_F(WebRtcSessionTest, VerifyNoCryptoParamsInSDP) {
   options_.disable_encryption = true;
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
   VerifyNoCryptoParams(offer->description(), false);
 }
 
 TEST_F(WebRtcSessionTest, VerifyAnswerFromNonCryptoOffer) {
-  Init();
+  Init(NULL);
   VerifyAnswerFromNonCryptoOffer();
 }
 
 TEST_F(WebRtcSessionTest, VerifyAnswerFromCryptoOffer) {
-  Init();
+  Init(NULL);
   VerifyAnswerFromCryptoOffer();
 }
 
 // This test verifies that setLocalDescription fails if
 // no a=ice-ufrag and a=ice-pwd lines are present in the SDP.
 TEST_F(WebRtcSessionTest, TestSetLocalDescriptionWithoutIce) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
@@ -2521,7 +2508,7 @@
 // This test verifies that setRemoteDescription fails if
 // no a=ice-ufrag and a=ice-pwd lines are present in the SDP.
 TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionWithoutIce) {
-  Init();
+  Init(NULL);
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
   std::string sdp;
   RemoveIceUfragPwdLines(offer.get(), &sdp);
@@ -2533,7 +2520,7 @@
 // This test verifies that setLocalDescription fails if local offer has
 // too short ice ufrag and pwd strings.
 TEST_F(WebRtcSessionTest, TestSetLocalDescriptionInvalidIceCredentials) {
-  Init();
+  Init(NULL);
   tdesc_factory_->set_protocol(cricket::ICEPROTO_RFC5245);
   mediastream_signaling_.SendAudioVideoStream1();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
@@ -2559,7 +2546,7 @@
 // This test verifies that setRemoteDescription fails if remote offer has
 // too short ice ufrag and pwd strings.
 TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionInvalidIceCredentials) {
-  Init();
+  Init(NULL);
   tdesc_factory_->set_protocol(cricket::ICEPROTO_RFC5245);
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
   std::string sdp;
@@ -2583,7 +2570,7 @@
   // This test verifies BUNDLE flag in PortAllocator, if BUNDLE information in
   // local description is removed by the application, BUNDLE flag should be
   // disabled in PortAllocator. By default BUNDLE is enabled in the WebRtc.
-  Init();
+  Init(NULL);
   EXPECT_TRUE((cricket::PORTALLOCATOR_ENABLE_BUNDLE &
       allocator_->flags()) == cricket::PORTALLOCATOR_ENABLE_BUNDLE);
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
@@ -2600,7 +2587,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestDisabledBundleInAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   EXPECT_TRUE((cricket::PORTALLOCATOR_ENABLE_BUNDLE &
       allocator_->flags()) == cricket::PORTALLOCATOR_ENABLE_BUNDLE);
@@ -2641,7 +2628,7 @@
 // This test verifies that SetLocalDescription and SetRemoteDescription fails
 // if BUNDLE is enabled but rtcp-mux is disabled in m-lines.
 TEST_F(WebRtcSessionTest, TestDisabledRtcpMuxWithBundleEnabled) {
-  Init();
+  WebRtcSessionTest::Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   EXPECT_TRUE((cricket::PORTALLOCATOR_ENABLE_BUNDLE &
       allocator_->flags()) == cricket::PORTALLOCATOR_ENABLE_BUNDLE);
@@ -2671,7 +2658,7 @@
 }
 
 TEST_F(WebRtcSessionTest, SetAudioPlayout) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   CreateAndSetRemoteOfferAndLocalAnswer();
   cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0);
@@ -2696,7 +2683,7 @@
 }
 
 TEST_F(WebRtcSessionTest, SetAudioSend) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   CreateAndSetRemoteOfferAndLocalAnswer();
   cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0);
@@ -2726,7 +2713,7 @@
 }
 
 TEST_F(WebRtcSessionTest, AudioRendererForLocalStream) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   CreateAndSetRemoteOfferAndLocalAnswer();
   cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0);
@@ -2749,7 +2736,7 @@
 }
 
 TEST_F(WebRtcSessionTest, SetVideoPlayout) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   CreateAndSetRemoteOfferAndLocalAnswer();
   cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0);
@@ -2766,7 +2753,7 @@
 }
 
 TEST_F(WebRtcSessionTest, SetVideoSend) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   CreateAndSetRemoteOfferAndLocalAnswer();
   cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0);
@@ -2791,7 +2778,7 @@
 
 TEST_F(WebRtcSessionTest, InsertDtmf) {
   // Setup
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   CreateAndSetRemoteOfferAndLocalAnswer();
   FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0);
@@ -2817,7 +2804,7 @@
 
 // This test verifies the |initiator| flag when session initiates the call.
 TEST_F(WebRtcSessionTest, TestInitiatorFlagAsOriginator) {
-  Init();
+  Init(NULL);
   EXPECT_FALSE(session_->initiator());
   SessionDescriptionInterface* offer = CreateOffer();
   SessionDescriptionInterface* answer = CreateRemoteAnswer(offer);
@@ -2829,7 +2816,7 @@
 
 // This test verifies the |initiator| flag when session receives the call.
 TEST_F(WebRtcSessionTest, TestInitiatorFlagAsReceiver) {
-  Init();
+  Init(NULL);
   EXPECT_FALSE(session_->initiator());
   SessionDescriptionInterface* offer = CreateRemoteOffer();
   SetRemoteDescriptionWithoutError(offer);
@@ -2843,7 +2830,7 @@
 // This test verifies the ice protocol type at initiator of the call
 // if |a=ice-options:google-ice| is present in answer.
 TEST_F(WebRtcSessionTest, TestInitiatorGIceInAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
   rtc::scoped_ptr<SessionDescriptionInterface> answer(
@@ -2865,7 +2852,7 @@
 // This test verifies the ice protocol type at initiator of the call
 // if ICE RFC5245 is supported in answer.
 TEST_F(WebRtcSessionTest, TestInitiatorIceInAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
   SessionDescriptionInterface* answer = CreateRemoteAnswer(offer);
@@ -2879,7 +2866,7 @@
 // This test verifies the ice protocol type at receiver side of the call if
 // receiver decides to use google-ice.
 TEST_F(WebRtcSessionTest, TestReceiverGIceInOffer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
   SetRemoteDescriptionWithoutError(offer);
@@ -2901,7 +2888,7 @@
 // This test verifies the ice protocol type at receiver side of the call if
 // receiver decides to use ice RFC 5245.
 TEST_F(WebRtcSessionTest, TestReceiverIceInOffer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
   SetRemoteDescriptionWithoutError(offer);
@@ -2914,7 +2901,7 @@
 // This test verifies the session state when ICE RFC5245 in offer and
 // ICE google-ice in answer.
 TEST_F(WebRtcSessionTest, TestIceOfferGIceOnlyAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
@@ -2946,7 +2933,7 @@
 
 // Verifing local offer and remote answer have matching m-lines as per RFC 3264.
 TEST_F(WebRtcSessionTest, TestIncorrectMLinesInRemoteAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
   SetLocalDescriptionWithoutError(offer);
@@ -2994,7 +2981,7 @@
 // Verifying remote offer and local answer have matching m-lines as per
 // RFC 3264.
 TEST_F(WebRtcSessionTest, TestIncorrectMLinesInLocalAnswer) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateRemoteOffer();
   SetRemoteDescriptionWithoutError(offer);
@@ -3015,7 +3002,7 @@
 // This test verifies that WebRtcSession does not start candidate allocation
 // before SetLocalDescription is called.
 TEST_F(WebRtcSessionTest, TestIceStartAfterSetLocalDescriptionOnly) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateRemoteOffer();
   cricket::Candidate candidate;
@@ -3047,7 +3034,7 @@
 // This test verifies that crypto parameter is updated in local session
 // description as per security policy set in MediaSessionDescriptionFactory.
 TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescription) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
@@ -3066,7 +3053,7 @@
 // This test verifies the crypto parameter when security is disabled.
 TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescriptionWithDisabled) {
   options_.disable_encryption = true;
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
 
@@ -3085,7 +3072,7 @@
 // This test verifies that an answer contains new ufrag and password if an offer
 // with new ufrag and password is received.
 TEST_F(WebRtcSessionTest, TestCreateAnswerWithNewUfragAndPassword) {
-  Init();
+  Init(NULL);
   cricket::MediaSessionOptions options;
   options.recv_video = true;
   rtc::scoped_ptr<JsepSessionDescription> offer(
@@ -3116,7 +3103,7 @@
 // This test verifies that an answer contains old ufrag and password if an offer
 // with old ufrag and password is received.
 TEST_F(WebRtcSessionTest, TestCreateAnswerWithOldUfragAndPassword) {
-  Init();
+  Init(NULL);
   cricket::MediaSessionOptions options;
   options.recv_video = true;
   rtc::scoped_ptr<JsepSessionDescription> offer(
@@ -3145,7 +3132,7 @@
 }
 
 TEST_F(WebRtcSessionTest, TestSessionContentError) {
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
   const std::string session_id_orig = offer->session_id();
@@ -3197,7 +3184,7 @@
 }
 
 TEST_F(WebRtcSessionTest, SetSdpFailedOnSessionError) {
-  Init();
+  Init(NULL);
   cricket::MediaSessionOptions options;
   options.recv_video = true;
 
@@ -3222,7 +3209,7 @@
   constraints_.reset(new FakeConstraints());
   constraints_->AddOptional(
       webrtc::MediaConstraintsInterface::kEnableRtpDataChannels, true);
-  Init();
+  Init(NULL);
 
   SetLocalDescriptionWithDataChannel();
   EXPECT_EQ(cricket::DCT_RTP, data_engine_->last_channel_type());
@@ -3452,7 +3439,7 @@
 // offer has no SDES crypto but only DTLS fingerprint.
 TEST_F(WebRtcSessionTest, TestSetRemoteOfferFailIfDtlsDisabledAndNoCrypto) {
   // Init without DTLS.
-  Init();
+  Init(NULL);
   // Create a remote offer with secured transport disabled.
   cricket::MediaSessionOptions options;
   JsepSessionDescription* offer(CreateRemoteOffer(
@@ -3474,7 +3461,7 @@
   constraints_.reset(new FakeConstraints());
   constraints_->AddOptional(
       webrtc::MediaConstraintsInterface::kEnableDscp, true);
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
 
@@ -3500,7 +3487,7 @@
   constraints_->AddOptional(
       webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate,
       true);
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
 
@@ -3529,7 +3516,7 @@
   constraints_->AddOptional(
       webrtc::MediaConstraintsInterface::kCombinedAudioVideoBwe,
       true);
-  Init();
+  Init(NULL);
   mediastream_signaling_.SendAudioVideoStream1();
   SessionDescriptionInterface* offer = CreateOffer();
 
diff --git a/webrtc/p2p/base/dtlstransportchannel.h b/webrtc/p2p/base/dtlstransportchannel.h
index 4c9c879..e629bb5 100644
--- a/webrtc/p2p/base/dtlstransportchannel.h
+++ b/webrtc/p2p/base/dtlstransportchannel.h
@@ -126,9 +126,6 @@
   virtual int SetOption(rtc::Socket::Option opt, int value) {
     return channel_->SetOption(opt, value);
   }
-  virtual bool GetOption(rtc::Socket::Option opt, int* value) {
-    return channel_->GetOption(opt, value);
-  }
   virtual int GetError() {
     return channel_->GetError();
   }
diff --git a/webrtc/p2p/base/fakesession.h b/webrtc/p2p/base/fakesession.h
index 13eceef..375d36d 100644
--- a/webrtc/p2p/base/fakesession.h
+++ b/webrtc/p2p/base/fakesession.h
@@ -198,9 +198,6 @@
   virtual int SetOption(rtc::Socket::Option opt, int value) {
     return true;
   }
-  virtual bool GetOption(rtc::Socket::Option opt, int* value) {
-    return true;
-  }
   virtual int GetError() {
     return 0;
   }
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index 735dbd5..4bbe9cf 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -817,7 +817,6 @@
 // Set options on ourselves is simply setting options on all of our available
 // port objects.
 int P2PTransportChannel::SetOption(rtc::Socket::Option opt, int value) {
-  ASSERT(worker_thread_ == rtc::Thread::Current());
   OptionMap::iterator it = options_.find(opt);
   if (it == options_.end()) {
     options_.insert(std::make_pair(opt, value));
@@ -839,17 +838,6 @@
   return 0;
 }
 
-bool P2PTransportChannel::GetOption(rtc::Socket::Option opt, int* value) {
-  ASSERT(worker_thread_ == rtc::Thread::Current());
-
-  const auto& found = options_.find(opt);
-  if (found == options_.end()) {
-    return false;
-  }
-  *value = found->second;
-  return true;
-}
-
 // Send data to the other side, using our best connection.
 int P2PTransportChannel::SendPacket(const char *data, size_t len,
                                     const rtc::PacketOptions& options,
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h
index f8756dc..10e19f0 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -79,7 +79,6 @@
   virtual int SendPacket(const char *data, size_t len,
                          const rtc::PacketOptions& options, int flags);
   virtual int SetOption(rtc::Socket::Option opt, int value);
-  virtual bool GetOption(rtc::Socket::Option opt, int* value);
   virtual int GetError() { return error_; }
   virtual bool GetStats(std::vector<ConnectionInfo>* stats);
 
diff --git a/webrtc/p2p/base/rawtransportchannel.cc b/webrtc/p2p/base/rawtransportchannel.cc
index b032e63..f0d7d5d 100644
--- a/webrtc/p2p/base/rawtransportchannel.cc
+++ b/webrtc/p2p/base/rawtransportchannel.cc
@@ -72,10 +72,6 @@
   return port_->SetOption(opt, value);
 }
 
-bool RawTransportChannel::GetOption(rtc::Socket::Option opt, int* value) {
-  return false;
-}
-
 int RawTransportChannel::GetError() {
   return (port_ != NULL) ? port_->GetError() : 0;
 }
diff --git a/webrtc/p2p/base/rawtransportchannel.h b/webrtc/p2p/base/rawtransportchannel.h
index a4d9ce0..bc84316 100644
--- a/webrtc/p2p/base/rawtransportchannel.h
+++ b/webrtc/p2p/base/rawtransportchannel.h
@@ -50,7 +50,6 @@
   virtual int SendPacket(const char *data, size_t len,
                          const rtc::PacketOptions& options, int flags);
   virtual int SetOption(rtc::Socket::Option opt, int value);
-  virtual bool GetOption(rtc::Socket::Option opt, int* value);
   virtual int GetError();
 
   // Implements TransportChannelImpl.
diff --git a/webrtc/p2p/base/session.cc b/webrtc/p2p/base/session.cc
index 69b6a9c..1a126a6 100644
--- a/webrtc/p2p/base/session.cc
+++ b/webrtc/p2p/base/session.cc
@@ -823,11 +823,8 @@
 bool BaseSession::IsCandidateAllocationDone() const {
   for (TransportMap::const_iterator iter = transports_.begin();
        iter != transports_.end(); ++iter) {
-    if (!iter->second->candidates_allocated()) {
-      LOG(LS_INFO) << "Candidate allocation not done for "
-                   << iter->second->content_name();
+    if (!iter->second->candidates_allocated())
       return false;
-    }
   }
   return true;
 }
diff --git a/webrtc/p2p/base/session.h b/webrtc/p2p/base/session.h
index 7e89123..f809b30 100644
--- a/webrtc/p2p/base/session.h
+++ b/webrtc/p2p/base/session.h
@@ -427,8 +427,6 @@
   virtual void OnMessage(rtc::Message *pmsg);
 
  protected:
-  bool IsCandidateAllocationDone() const;
-
   State state_;
   Error error_;
   std::string error_desc_;
@@ -442,6 +440,7 @@
       const SessionDescription* sdesc, ContentAction action,
       std::string* error_desc);
 
+  bool IsCandidateAllocationDone() const;
   void MaybeCandidateAllocationDone();
 
   // This method will delete the Transport and TransportChannelImpls and
diff --git a/webrtc/p2p/base/transportchannel.h b/webrtc/p2p/base/transportchannel.h
index fb592e5..d50f025 100644
--- a/webrtc/p2p/base/transportchannel.h
+++ b/webrtc/p2p/base/transportchannel.h
@@ -81,7 +81,6 @@
   // Sets a socket option on this channel.  Note that not all options are
   // supported by all transport types.
   virtual int SetOption(rtc::Socket::Option opt, int value) = 0;
-  virtual bool GetOption(rtc::Socket::Option opt, int* value) = 0;
 
   // Returns the most recent error that occurred on this channel.
   virtual int GetError() = 0;
diff --git a/webrtc/p2p/base/transportchannelproxy.cc b/webrtc/p2p/base/transportchannelproxy.cc
index a8535fa..e6fb557 100644
--- a/webrtc/p2p/base/transportchannelproxy.cc
+++ b/webrtc/p2p/base/transportchannelproxy.cc
@@ -104,21 +104,6 @@
   return impl_->SetOption(opt, value);
 }
 
-bool TransportChannelProxy::GetOption(rtc::Socket::Option opt, int* value) {
-  ASSERT(rtc::Thread::Current() == worker_thread_);
-  if (impl_) {
-    return impl_->GetOption(opt, value);
-  }
-
-  for (const auto& pending : pending_options_) {
-    if (pending.first == opt) {
-      *value = pending.second;
-      return true;
-    }
-  }
-  return false;
-}
-
 int TransportChannelProxy::GetError() {
   ASSERT(rtc::Thread::Current() == worker_thread_);
   if (!impl_) {
diff --git a/webrtc/p2p/base/transportchannelproxy.h b/webrtc/p2p/base/transportchannelproxy.h
index 46803f7..188039e 100644
--- a/webrtc/p2p/base/transportchannelproxy.h
+++ b/webrtc/p2p/base/transportchannelproxy.h
@@ -52,7 +52,6 @@
                          const rtc::PacketOptions& options,
                          int flags);
   virtual int SetOption(rtc::Socket::Option opt, int value);
-  virtual bool GetOption(rtc::Socket::Option opt, int* value);
   virtual int GetError();
   virtual IceRole GetIceRole() const;
   virtual bool GetStats(ConnectionInfos* infos);