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

Unified Diff: webkit/support/webkit_support.cc

Issue 15005005: Use a shared thread for media operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « webkit/mocks/test_media_stream_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/webkit_support.cc
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index fd20943ce5275d5cda40646304e43eeaa7e43efa..abf77c9517de4bf10a4e1650f740940bc40d832e 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -210,6 +210,14 @@ class TestEnvironment {
}
#endif
+ scoped_refptr<base::MessageLoopProxy> GetMediaThreadMessageLoopProxy() {
+ if (!media_thread_) {
+ media_thread_.reset(new base::Thread("Media"));
+ CHECK(media_thread_->Start());
+ }
+ return media_thread_->message_loop_proxy();
+ }
+
private:
// Data member at_exit_manager_ will take the ownership of the input
// AtExitManager and manage its lifecycle.
@@ -218,6 +226,8 @@ class TestEnvironment {
scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_;
scoped_ptr<TestWebIDBFactory> idb_factory_;
+ scoped_ptr<base::Thread> media_thread_;
+
#if defined(OS_ANDROID)
base::FilePath mock_current_directory_;
#endif
@@ -409,6 +419,7 @@ WebKit::WebMediaPlayer* CreateMediaPlayer(
return NULL;
#else
webkit_media::WebMediaPlayerParams params(
+ test_environment->GetMediaThreadMessageLoopProxy(),
NULL, NULL, new media::MediaLog());
return new webkit_media::WebMediaPlayerImpl(
frame,
« no previous file with comments | « webkit/mocks/test_media_stream_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698