Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: content/renderer/media/mock_media_stream_dispatcher.h

Issue 10928043: Media Related changes for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/renderer/media/media_stream_dispatcher.h" 10 #include "content/renderer/media/media_stream_dispatcher.h"
11 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 12
13 // This class is a mock implementation of MediaStreamDispatcher. 13 // This class is a mock implementation of MediaStreamDispatcher.
14 class MockMediaStreamDispatcher : public MediaStreamDispatcher { 14 class MockMediaStreamDispatcher : public MediaStreamDispatcher {
15 public: 15 public:
16 MockMediaStreamDispatcher(); 16 MockMediaStreamDispatcher();
17 virtual ~MockMediaStreamDispatcher(); 17 virtual ~MockMediaStreamDispatcher();
18 18
19 virtual void GenerateStream( 19 virtual void GenerateStream(
20 int request_id, 20 int request_id,
21 const base::WeakPtr<MediaStreamDispatcherEventHandler>&, 21 const base::WeakPtr<MediaStreamDispatcherEventHandler>&,
22 media_stream::StreamOptions components, 22 media_stream::StreamOptions components,
23 const GURL&) OVERRIDE; 23 const GURL&) OVERRIDE;
24 virtual void GenerateStreamForDevice(
25 int request_id,
26 const base::WeakPtr<MediaStreamDispatcherEventHandler>&,
27 media_stream::StreamOptions components,
28 const std::string& device_id,
29 const GURL&) OVERRIDE;
30 virtual void StopStream(const std::string& label) OVERRIDE; 24 virtual void StopStream(const std::string& label) OVERRIDE;
31 virtual bool IsStream(const std::string& label) OVERRIDE; 25 virtual bool IsStream(const std::string& label) OVERRIDE;
32 virtual int video_session_id(const std::string& label, int index) OVERRIDE; 26 virtual int video_session_id(const std::string& label, int index) OVERRIDE;
33 virtual int audio_session_id(const std::string& label, int index) OVERRIDE; 27 virtual int audio_session_id(const std::string& label, int index) OVERRIDE;
34 28
35 int request_id() const { return request_id_; } 29 int request_id() const { return request_id_; }
36 int stop_stream_counter() const { return stop_stream_counter_; } 30 int stop_stream_counter() const { return stop_stream_counter_; }
37 const std::string& stream_label() const { return stream_label_;} 31 const std::string& stream_label() const { return stream_label_;}
38 media_stream::StreamDeviceInfoArray audio_array() const { 32 media_stream::StreamDeviceInfoArray audio_array() const {
39 return audio_array_; 33 return audio_array_;
40 } 34 }
41 media_stream::StreamDeviceInfoArray video_array() const { 35 media_stream::StreamDeviceInfoArray video_array() const {
42 return video_array_; 36 return video_array_;
43 } 37 }
44 38
45 private: 39 private:
46 int request_id_; 40 int request_id_;
47 base::WeakPtr<MediaStreamDispatcherEventHandler> event_handler_; 41 base::WeakPtr<MediaStreamDispatcherEventHandler> event_handler_;
48 int stop_stream_counter_; 42 int stop_stream_counter_;
49 43
50 std::string stream_label_; 44 std::string stream_label_;
51 media_stream::StreamDeviceInfoArray audio_array_; 45 media_stream::StreamDeviceInfoArray audio_array_;
52 media_stream::StreamDeviceInfoArray video_array_; 46 media_stream::StreamDeviceInfoArray video_array_;
53 47
54 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher); 48 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher);
55 }; 49 };
56 50
57 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ 51 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698