Inject config when creating channels to override the existing one.

BUG=
R=xians@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5116 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/voice_engine/channel_manager.cc b/voice_engine/channel_manager.cc
index b56c54a..9386257 100644
--- a/voice_engine/channel_manager.cc
+++ b/voice_engine/channel_manager.cc
@@ -8,6 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include "webrtc/common.h"
 #include "webrtc/voice_engine/channel_manager.h"
 
 #include "webrtc/voice_engine/channel.h"
@@ -51,8 +52,16 @@
       config_(config) {}
 
 ChannelOwner ChannelManager::CreateChannel() {
+  return CreateChannelInternal(config_);
+}
+
+ChannelOwner ChannelManager::CreateChannel(const Config& external_config) {
+  return CreateChannelInternal(external_config);
+}
+
+ChannelOwner ChannelManager::CreateChannelInternal(const Config& config) {
   Channel* channel;
-  Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, config_);
+  Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, config);
   ChannelOwner channel_owner(channel);
 
   CriticalSectionScoped crit(lock_.get());