summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authoranujk.sharma <anujk.sharma@samsung.com>2015-05-04 22:34:37 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-05 05:36:10 +0000
commit07f0d74ab9b57a7a7aa28c035a0133b0fca2e3e2 (patch)
treeef153c48fae2a1f5430bed4037f840436bd46969 /content
parent878f421a2f1a378c84d6ea999b4f0e40f0f6a7ac (diff)
downloadchromium_src-07f0d74ab9b57a7a7aa28c035a0133b0fca2e3e2.zip
chromium_src-07f0d74ab9b57a7a7aa28c035a0133b0fca2e3e2.tar.gz
chromium_src-07f0d74ab9b57a7a7aa28c035a0133b0fca2e3e2.tar.bz2
Replace MessageLoopProxy usage with ThreadTaskRunnerHandle in content/browser/media module.
MessageLoopProxy is deprecated. This basically does a search and replace: MessageLoopProxy::current() -> ThreadTaskRunnerHandle::Get(). BUG=391045 Review URL: https://codereview.chromium.org/1112333002 Cr-Commit-Position: refs/heads/master@{#328285}
Diffstat (limited to 'content')
-rw-r--r--content/browser/media/android/media_drm_credential_manager.cc5
-rw-r--r--content/browser/media/capture/web_contents_audio_input_stream_unittest.cc3
-rw-r--r--content/browser/media/capture/web_contents_tracker.cc16
-rw-r--r--content/browser/media/capture/web_contents_tracker.h6
4 files changed, 16 insertions, 14 deletions
diff --git a/content/browser/media/android/media_drm_credential_manager.cc b/content/browser/media/android/media_drm_credential_manager.cc
index e419b04..50d6653 100644
--- a/content/browser/media/android/media_drm_credential_manager.cc
+++ b/content/browser/media/android/media_drm_credential_manager.cc
@@ -9,7 +9,8 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/location.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "jni/MediaDrmCredentialManager_jni.h"
#include "media/base/android/media_drm_bridge.h"
#include "url/gurl.h"
@@ -101,7 +102,7 @@ bool MediaDrmCredentialManager::ResetCredentialsInternal(
if (!media_drm_bridge_->SetSecurityLevel(security_level)) {
// No need to reset credentials for unsupported |security_level|.
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(reset_credentials_cb, true));
return true;
}
diff --git a/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc b/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc
index c107808..ffe8b4b 100644
--- a/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc
+++ b/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/message_loop/message_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "content/browser/media/capture/audio_mirroring_manager.h"
@@ -86,7 +87,7 @@ class MockWebContentsTracker : public WebContentsTracker {
class MockVirtualAudioInputStream : public VirtualAudioInputStream {
public:
explicit MockVirtualAudioInputStream(
- const scoped_refptr<base::MessageLoopProxy>& worker_loop)
+ const scoped_refptr<base::SingleThreadTaskRunner>& worker_loop)
: VirtualAudioInputStream(TestAudioParameters(), worker_loop,
VirtualAudioInputStream::AfterCloseCallback()),
real_(TestAudioParameters(), worker_loop,
diff --git a/content/browser/media/capture/web_contents_tracker.cc b/content/browser/media/capture/web_contents_tracker.cc
index 6810ac0..a9e161f 100644
--- a/content/browser/media/capture/web_contents_tracker.cc
+++ b/content/browser/media/capture/web_contents_tracker.cc
@@ -4,7 +4,7 @@
#include "content/browser/media/capture/web_contents_tracker.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/thread_task_runner_handle.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/browser_thread.h"
@@ -24,10 +24,10 @@ WebContentsTracker::~WebContentsTracker() {
void WebContentsTracker::Start(int render_process_id, int main_render_frame_id,
const ChangeCallback& callback) {
- DCHECK(!message_loop_.get() || message_loop_->BelongsToCurrentThread());
+ DCHECK(!task_runner_.get() || task_runner_->BelongsToCurrentThread());
- message_loop_ = base::MessageLoopProxy::current();
- DCHECK(message_loop_.get());
+ task_runner_ = base::ThreadTaskRunnerHandle::Get();
+ DCHECK(task_runner_.get());
callback_ = callback;
if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
@@ -41,7 +41,7 @@ void WebContentsTracker::Start(int render_process_id, int main_render_frame_id,
}
void WebContentsTracker::Stop() {
- DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
callback_.Reset();
@@ -88,17 +88,17 @@ void WebContentsTracker::OnPossibleTargetChange(bool force_callback_run) {
<< " to RenderWidgetHost@" << rwh;
last_target_ = rwh;
- if (message_loop_->BelongsToCurrentThread()) {
+ if (task_runner_->BelongsToCurrentThread()) {
MaybeDoCallback(rwh);
} else {
- message_loop_->PostTask(
+ task_runner_->PostTask(
FROM_HERE,
base::Bind(&WebContentsTracker::MaybeDoCallback, this, rwh));
}
}
void WebContentsTracker::MaybeDoCallback(RenderWidgetHost* rwh) {
- DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
if (!callback_.is_null())
callback_.Run(rwh);
diff --git a/content/browser/media/capture/web_contents_tracker.h b/content/browser/media/capture/web_contents_tracker.h
index f124eaa..613c971 100644
--- a/content/browser/media/capture/web_contents_tracker.h
+++ b/content/browser/media/capture/web_contents_tracker.h
@@ -22,7 +22,7 @@
#include "content/public/browser/web_contents_observer.h"
namespace base {
-class MessageLoopProxy;
+class SingleThreadTaskRunner;
}
namespace content {
@@ -99,8 +99,8 @@ class CONTENT_EXPORT WebContentsTracker
// RenderWidgetHosts.
const bool track_fullscreen_rwh_;
- // MessageLoop corresponding to the thread that called Start().
- scoped_refptr<base::MessageLoopProxy> message_loop_;
+ // TaskRunner corresponding to the thread that called Start().
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
// Callback to run when the target RenderWidgetHost has changed.
ChangeCallback callback_;