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

Unified Diff: content/shell/renderer/shell_media_stream_client.cc

Issue 18590002: Migrate MediaStream test code from content/shell/renderer/ to content/test/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/shell_media_stream_client.cc
diff --git a/content/shell/renderer/shell_media_stream_client.cc b/content/shell/renderer/shell_media_stream_client.cc
deleted file mode 100644
index 48580a6d6901583152568fb575165324408f3e36..0000000000000000000000000000000000000000
--- a/content/shell/renderer/shell_media_stream_client.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/shell/renderer/shell_media_stream_client.h"
-
-#include "content/shell/renderer/shell_video_frame_provider.h"
-#include "googleurl/src/gurl.h"
-#include "third_party/WebKit/public/platform/WebMediaStream.h"
-#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
-#include "third_party/WebKit/public/platform/WebVector.h"
-#include "third_party/WebKit/public/web/WebMediaStreamRegistry.h"
-#include "webkit/renderer/media/media_stream_audio_renderer.h"
-
-using namespace WebKit;
-
-namespace {
-
-static const int kVideoCaptureWidth = 352;
-static const int kVideoCaptureHeight = 288;
-static const int kVideoCaptureFrameDurationMs = 33;
-
-bool IsMockMediaStreamWithVideo(const WebURL& url) {
-#if ENABLE_WEBRTC
- WebMediaStream descriptor(
- WebMediaStreamRegistry::lookupMediaStreamDescriptor(url));
- if (descriptor.isNull())
- return false;
- WebVector<WebMediaStreamTrack> videoSources;
- descriptor.videoSources(videoSources);
- return videoSources.size() > 0;
-#else
- return false;
-#endif
-}
-
-} // namespace
-
-namespace content {
-
-ShellMediaStreamClient::ShellMediaStreamClient() {}
-
-ShellMediaStreamClient::~ShellMediaStreamClient() {}
-
-bool ShellMediaStreamClient::IsMediaStream(const GURL& url) {
- return IsMockMediaStreamWithVideo(url);
-}
-
-scoped_refptr<webkit_media::VideoFrameProvider>
-ShellMediaStreamClient::GetVideoFrameProvider(
- const GURL& url,
- const base::Closure& error_cb,
- const webkit_media::VideoFrameProvider::RepaintCB& repaint_cb) {
- if (!IsMockMediaStreamWithVideo(url))
- return NULL;
-
- return new ShellVideoFrameProvider(
- gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight),
- base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs),
- error_cb,
- repaint_cb);
-}
-
-scoped_refptr<webkit_media::MediaStreamAudioRenderer>
-ShellMediaStreamClient::GetAudioRenderer(const GURL& url) {
- return NULL;
-}
-
-} // namespace content
« no previous file with comments | « content/shell/renderer/shell_media_stream_client.h ('k') | content/shell/renderer/shell_video_frame_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698