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

Unified Diff: content/renderer/render_frame_impl.h

Issue 2905613003: Extract media code from RenderFrameImpl (Closed)
Patch Set: Created 3 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
Index: content/renderer/render_frame_impl.h
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 37c5efccfc51d7c8e536460ac4ecd74b7c2b65e9..43af5814c7a6a1711b6c80f2bfd98916fc3406a2 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -20,7 +20,6 @@
#include "base/gtest_prod_util.h"
#include "base/id_map.h"
#include "base/macros.h"
-#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
@@ -42,6 +41,7 @@
#include "content/public/common/javascript_dialog_type.h"
#include "content/public/common/previews_state.h"
#include "content/public/common/referrer.h"
+#include "content/public/common/renderer_preferences.h"
#include "content/public/common/request_context_type.h"
#include "content/public/common/stop_find_action.h"
#include "content/public/renderer/render_frame.h"
@@ -52,9 +52,6 @@
#include "ipc/ipc_message.h"
#include "ipc/ipc_platform_file.h"
#include "media/base/routing_token_callback.h"
-#include "media/blink/webmediaplayer_delegate.h"
-#include "media/blink/webmediaplayer_params.h"
-#include "media/mojo/interfaces/remoting.mojom.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/binding_set.h"
@@ -87,10 +84,6 @@
#include "content/renderer/pepper/plugin_power_saver_helper.h"
#endif
-#if defined(OS_ANDROID)
-#include "content/renderer/media/android/renderer_media_player_manager.h"
-#endif
-
struct FrameMsg_CommitDataNetworkService_Params;
struct FrameMsg_MixedContentFound_Params;
struct FrameMsg_PostMessage_Params;
@@ -116,19 +109,8 @@ class Range;
}
namespace media {
-class CdmFactory;
-class DecoderFactory;
class MediaPermission;
-class RendererWebMediaPlayerDelegate;
-class SurfaceManager;
-class UrlIndex;
-class WebEncryptedMediaClientImpl;
-
-namespace remoting {
-class SinkAvailabilityObserver;
-} // namespace remoting
-
-} // namespace media
+}
namespace service_manager {
class BinderRegistry;
@@ -150,17 +132,14 @@ class DocumentState;
class ExternalPopupMenu;
class HistoryEntry;
class ManifestManager;
-class MediaInterfaceProvider;
class MediaStreamDispatcher;
-class MediaStreamRendererFactory;
-class MediaPermissionDispatcher;
class NavigationState;
class PepperPluginInstanceImpl;
class PresentationDispatcher;
class PushMessagingClient;
class RelatedAppsFetcher;
class RenderAccessibilityImpl;
-class RendererMediaPlayerManager;
+class RenderMediaHelper;
class RendererPpapiHost;
class RenderFrameObserver;
class RenderViewImpl;
@@ -762,6 +741,8 @@ class CONTENT_EXPORT RenderFrameImpl
void OnSetPepperVolume(int32_t pp_instance, double volume);
#endif // ENABLE_PLUGINS
+ const RendererPreferences& GetRendererPreferences() const;
+
protected:
explicit RenderFrameImpl(const CreateParams& params);
@@ -1042,14 +1023,6 @@ class CONTENT_EXPORT RenderFrameImpl
// |web_user_media_client_| will remain NULL.
void InitializeUserMediaClient();
- blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream(
- blink::WebMediaPlayerClient* client,
- const blink::WebString& sink_id,
- const blink::WebSecurityOrigin& security_origin);
-
- // Creates a factory object used for creating audio and video renderers.
- std::unique_ptr<MediaStreamRendererFactory> CreateRendererFactory();
-
// Does preparation for the navigation to |url|.
void PrepareRenderViewForNavigation(
const GURL& url,
@@ -1094,23 +1067,8 @@ class CONTENT_EXPORT RenderFrameImpl
bool was_within_same_page,
bool content_initiated);
-#if defined(OS_ANDROID)
- RendererMediaPlayerManager* GetMediaPlayerManager();
-#endif
-
bool AreSecureCodecsSupported();
-#if defined(ENABLE_MOJO_MEDIA)
- service_manager::mojom::InterfaceProvider* GetMediaInterfaceProvider();
-#endif
-
-#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
- media::mojom::RemoterFactory* GetRemoterFactory();
-#endif
-
- media::CdmFactory* GetCdmFactory();
- media::DecoderFactory* GetDecoderFactory();
-
#if BUILDFLAG(ENABLE_PLUGINS)
void HandlePepperImeCommit(const base::string16& text);
#endif // ENABLE_PLUGINS
@@ -1123,10 +1081,6 @@ class CONTENT_EXPORT RenderFrameImpl
void OnHostZoomClientRequest(mojom::HostZoomAssociatedRequest request);
- // Returns the media delegate for WebMediaPlayer usage. If
- // |media_player_delegate_| is NULL, one is created.
- media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate();
-
// Called to get the WebPlugin to handle find requests in the document.
// Returns nullptr if there is no such WebPlugin.
blink::WebPlugin* GetWebPluginForFind();
@@ -1147,6 +1101,8 @@ class CONTENT_EXPORT RenderFrameImpl
// Send |callback| our AndroidOverlay routing token when it arrives. We may
// call |callback| before returning.
+ // TODO - consider moving this. Right now we're just friending the media
+ // helper.
void RequestOverlayRoutingToken(media::RoutingTokenCallback callback);
// Ask the host to send our AndroidOverlay routing token to us.
@@ -1272,48 +1228,7 @@ class CONTENT_EXPORT RenderFrameImpl
// Destroyed via the RenderFrameObserver::OnDestruct() mechanism.
UserMediaClientImpl* web_user_media_client_;
- // EncryptedMediaClient attached to this frame; lazily initialized.
- std::unique_ptr<media::WebEncryptedMediaClientImpl>
- web_encrypted_media_client_;
-
- // The media permission dispatcher attached to this frame.
- std::unique_ptr<MediaPermissionDispatcher> media_permission_dispatcher_;
-
-#if defined(ENABLE_MOJO_MEDIA)
- // The media interface provider attached to this frame, lazily initialized.
- std::unique_ptr<MediaInterfaceProvider> media_interface_provider_;
-#endif
-
-#if defined(OS_ANDROID)
- // Manages all media players and sessions in this render frame for
- // communicating with the real media player and sessions in the
- // browser process. It's okay to use raw pointers since they're both
- // RenderFrameObservers.
- RendererMediaPlayerManager* media_player_manager_;
-#endif
-
- media::SurfaceManager* media_surface_manager_;
-
-#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
- // Lazy-bound pointer to the RemoterFactory service in the browser
- // process. Always use the GetRemoterFactory() accessor instead of this.
- media::mojom::RemoterFactoryPtr remoter_factory_;
-
- // An observer for the remoting sink availability that is used by
- // media::RemotingCdmFactory to initialize media::RemotingSourceImpl. Created
- // in the constructor of RenderFrameImpl to make sure
- // media::RemotingSourceImpl be intialized with correct availability info.
- // Own by media::RemotingCdmFactory after it is created.
- std::unique_ptr<media::remoting::SinkAvailabilityObserver>
- remoting_sink_observer_;
-#endif
-
- // The CDM and decoder factory attached to this frame, lazily initialized.
- std::unique_ptr<media::CdmFactory> cdm_factory_;
- std::unique_ptr<media::DecoderFactory> decoder_factory_;
-
- // Media resource cache, lazily initialized.
- linked_ptr<media::UrlIndex> url_index_;
+ std::unique_ptr<RenderMediaHelper> media_helper_;
// The devtools agent for this frame; only created for main frame and
// local roots.
@@ -1356,10 +1271,6 @@ class CONTENT_EXPORT RenderFrameImpl
std::unique_ptr<RelatedAppsFetcher> related_apps_fetcher_;
- // Manages play, pause notifications for WebMediaPlayer implementations; its
- // lifetime is tied to the RenderFrame via the RenderFrameObserver interface.
- media::RendererWebMediaPlayerDelegate* media_player_delegate_;
-
// The PreviewsState of this RenderFrame that indicates which Previews can
// be used. The PreviewsState is a bitmask of potentially several Previews
// optimizations.

Powered by Google App Engine
This is Rietveld 408576698