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

Side by Side Diff: webkit/support/webkit_support.cc

Issue 15993018: Reland: Use a shared thread for media operations (round 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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
« no previous file with comments | « webkit/renderer/media/webmediaplayer_params.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "webkit/support/webkit_support.h" 5 #include "webkit/support/webkit_support.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // file-over-http bridge. 199 // file-over-http bridge.
200 void set_mock_current_directory(const base::FilePath& directory) { 200 void set_mock_current_directory(const base::FilePath& directory) {
201 mock_current_directory_ = directory; 201 mock_current_directory_ = directory;
202 } 202 }
203 203
204 base::FilePath mock_current_directory() const { 204 base::FilePath mock_current_directory() const {
205 return mock_current_directory_; 205 return mock_current_directory_;
206 } 206 }
207 #endif 207 #endif
208 208
209 scoped_refptr<base::MessageLoopProxy> GetMediaThreadMessageLoopProxy() {
210 if (!media_thread_) {
211 media_thread_.reset(new base::Thread("Media"));
212 CHECK(media_thread_->Start());
213 }
214 return media_thread_->message_loop_proxy();
215 }
216
209 private: 217 private:
210 // Data member at_exit_manager_ will take the ownership of the input 218 // Data member at_exit_manager_ will take the ownership of the input
211 // AtExitManager and manage its lifecycle. 219 // AtExitManager and manage its lifecycle.
212 scoped_ptr<base::AtExitManager> at_exit_manager_; 220 scoped_ptr<base::AtExitManager> at_exit_manager_;
213 scoped_ptr<MessageLoopType> main_message_loop_; 221 scoped_ptr<MessageLoopType> main_message_loop_;
214 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_; 222 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_;
215 223
224 scoped_ptr<base::Thread> media_thread_;
225
216 #if defined(OS_ANDROID) 226 #if defined(OS_ANDROID)
217 base::FilePath mock_current_directory_; 227 base::FilePath mock_current_directory_;
218 #endif 228 #endif
219 }; 229 };
220 230
221 class WebPluginImplWithPageDelegate 231 class WebPluginImplWithPageDelegate
222 : public webkit_support::TestWebPluginPageDelegate, 232 : public webkit_support::TestWebPluginPageDelegate,
223 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>, 233 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>,
224 public webkit::npapi::WebPluginImpl { 234 public webkit::npapi::WebPluginImpl {
225 public: 235 public:
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 client, 407 client,
398 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), 408 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(),
399 media_stream_client, 409 media_stream_client,
400 new media::MediaLog()); 410 new media::MediaLog());
401 } 411 }
402 412
403 #if defined(OS_ANDROID) 413 #if defined(OS_ANDROID)
404 return NULL; 414 return NULL;
405 #else 415 #else
406 webkit_media::WebMediaPlayerParams params( 416 webkit_media::WebMediaPlayerParams params(
417 test_environment->GetMediaThreadMessageLoopProxy(),
407 NULL, NULL, new media::MediaLog()); 418 NULL, NULL, new media::MediaLog());
408 return new webkit_media::WebMediaPlayerImpl( 419 return new webkit_media::WebMediaPlayerImpl(
409 frame, 420 frame,
410 client, 421 client,
411 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), 422 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(),
412 params); 423 params);
413 #endif 424 #endif
414 } 425 }
415 426
416 WebKit::WebMediaPlayer* CreateMediaPlayer( 427 WebKit::WebMediaPlayer* CreateMediaPlayer(
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 // Logging 852 // Logging
842 void EnableWebCoreLogChannels(const std::string& channels) { 853 void EnableWebCoreLogChannels(const std::string& channels) {
843 webkit_glue::EnableWebCoreLogChannels(channels); 854 webkit_glue::EnableWebCoreLogChannels(channels);
844 } 855 }
845 856
846 void SetGamepadData(const WebKit::WebGamepads& pads) { 857 void SetGamepadData(const WebKit::WebGamepads& pads) {
847 test_environment->webkit_platform_support()->setGamepadData(pads); 858 test_environment->webkit_platform_support()->setGamepadData(pads);
848 } 859 }
849 860
850 } // namespace webkit_support 861 } // namespace webkit_support
OLDNEW
« no previous file with comments | « webkit/renderer/media/webmediaplayer_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698