Commit d70e6a05 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in /content/renderer/media/webrtc

These changes were scripted as part of the effort to restrict exposure of the
raw MessageLoop*.

Note that many static methods exposed on MessageLoopCurrent are also deprecated
so it is very well possible that this is migrating to an already deprecated
method.

The goal of this pass is to reduce usage of MessageLoop::current() (and
ultimately make it impossible to obtain the MessageLoop* statically).

As such I will not edit this CL unless the script did something logically wrong.
I defer to owners to fix highlighted usage of already deprecated APIs.

Possible script screw ups / things to look out for in this review:
 - Storing MessageLoopCurrent in a MessageLoop* variable or comparing it against
   one (I will go over that in a separate pass).

Includes should have been stripped if that was the last usage of message_loop.h
in that file.

Please CQ if LGTY

This CL was uploaded by git cl split.

R=sergeyu@chromium.org

Bug: 825327
Change-Id: Ic3521abdd745c1c048dfd9828232eb0e6c351fc2
Reviewed-on: https://chromium-review.googlesource.com/1024760Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553362}
parent c6264ed3
...@@ -166,7 +166,7 @@ void PeerConnectionDependencyFactory::CreatePeerConnectionFactory() { ...@@ -166,7 +166,7 @@ void PeerConnectionDependencyFactory::CreatePeerConnectionFactory() {
webrtc::DisableRtcUseH264(); webrtc::DisableRtcUseH264();
#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) #endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
base::MessageLoop::current()->AddDestructionObserver(this); base::MessageLoopCurrent::Get()->AddDestructionObserver(this);
// To allow sending to the signaling/worker threads. // To allow sending to the signaling/worker threads.
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/files/file.h" #include "base/files/file.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_current.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
...@@ -46,7 +47,7 @@ class WebRtcAudioDeviceImpl; ...@@ -46,7 +47,7 @@ class WebRtcAudioDeviceImpl;
// Object factory for RTC PeerConnections. // Object factory for RTC PeerConnections.
class CONTENT_EXPORT PeerConnectionDependencyFactory class CONTENT_EXPORT PeerConnectionDependencyFactory
: base::MessageLoop::DestructionObserver { : base::MessageLoopCurrent::DestructionObserver {
public: public:
PeerConnectionDependencyFactory( PeerConnectionDependencyFactory(
P2PSocketDispatcher* p2p_socket_dispatcher); P2PSocketDispatcher* p2p_socket_dispatcher);
...@@ -110,7 +111,7 @@ class CONTENT_EXPORT PeerConnectionDependencyFactory ...@@ -110,7 +111,7 @@ class CONTENT_EXPORT PeerConnectionDependencyFactory
void EnsureWebRtcAudioDeviceImpl(); void EnsureWebRtcAudioDeviceImpl();
private: private:
// Implement base::MessageLoop::DestructionObserver. // Implement base::MessageLoopCurrent::DestructionObserver.
// This makes sure the libjingle PeerConnectionFactory is released before // This makes sure the libjingle PeerConnectionFactory is released before
// the renderer message loop is destroyed. // the renderer message loop is destroyed.
void WillDestroyCurrentMessageLoop() override; void WillDestroyCurrentMessageLoop() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment