| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/mock_media_stream_dispatcher.h" | 5 #include "content/renderer/media/mock_media_stream_dispatcher.h" |
| 6 | 6 |
| 7 MockMediaStreamDispatcher::MockMediaStreamDispatcher() | 7 MockMediaStreamDispatcher::MockMediaStreamDispatcher() |
| 8 : MediaStreamDispatcher(NULL), | 8 : MediaStreamDispatcher(NULL), |
| 9 request_id_(-1), | 9 request_id_(-1), |
| 10 components_(NULL), | 10 components_(NULL), |
| 11 stop_stream_counter_(0) { | 11 stop_stream_counter_(0) { |
| 12 } | 12 } |
| 13 | 13 |
| 14 MockMediaStreamDispatcher::~MockMediaStreamDispatcher() {} | 14 MockMediaStreamDispatcher::~MockMediaStreamDispatcher() {} |
| 15 | 15 |
| 16 void MockMediaStreamDispatcher::GenerateStream( | 16 void MockMediaStreamDispatcher::GenerateStream( |
| 17 int request_id, | 17 int request_id, |
| 18 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, | 18 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, |
| 19 media_stream::StreamOptions components, | 19 media_stream::StreamOptions components, |
| 20 const std::string& security_origin) { | 20 const std::string& security_origin) { |
| 21 request_id_ = request_id; | 21 request_id_ = request_id; |
| 22 event_handler_ = event_handler; | 22 event_handler_ = event_handler; |
| 23 delete components_; | 23 delete components_; |
| 24 components_ = new media_stream::StreamOptions(components.audio, | 24 components_ = new media_stream::StreamOptions(components.audio, |
| 25 components.video_option); | 25 components.video); |
| 26 security_origin_ = security_origin; | 26 security_origin_ = security_origin; |
| 27 } | 27 } |
| 28 | 28 |
| 29 void MockMediaStreamDispatcher::StopStream(const std::string& label) { | 29 void MockMediaStreamDispatcher::StopStream(const std::string& label) { |
| 30 ++stop_stream_counter_; | 30 ++stop_stream_counter_; |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool MockMediaStreamDispatcher::IsStream(const std::string& label) { | 33 bool MockMediaStreamDispatcher::IsStream(const std::string& label) { |
| 34 NOTIMPLEMENTED(); | 34 NOTIMPLEMENTED(); |
| 35 return false; | 35 return false; |
| 36 } | 36 } |
| 37 | 37 |
| 38 int MockMediaStreamDispatcher::video_session_id(const std::string& label, | 38 int MockMediaStreamDispatcher::video_session_id(const std::string& label, |
| 39 int index) { | 39 int index) { |
| 40 NOTIMPLEMENTED(); | 40 NOTIMPLEMENTED(); |
| 41 return -1; | 41 return -1; |
| 42 } | 42 } |
| 43 | 43 |
| 44 int MockMediaStreamDispatcher::audio_session_id(const std::string& label, | 44 int MockMediaStreamDispatcher::audio_session_id(const std::string& label, |
| 45 int index) { | 45 int index) { |
| 46 NOTIMPLEMENTED(); | 46 NOTIMPLEMENTED(); |
| 47 return -1; | 47 return -1; |
| 48 } | 48 } |
| OLD | NEW |