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

Side by Side Diff: content/renderer/render_frame_impl.h

Issue 294043015: Move creation of MediaStream renders from MediaStreamImpl to MediaStreamRenderFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed commments. Fixed build when enable_webrtc = 0 Created 6 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 | « content/renderer/media/webmediaplayer_ms.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 namespace gfx { 48 namespace gfx {
49 class Point; 49 class Point;
50 class Range; 50 class Range;
51 class Rect; 51 class Rect;
52 } 52 }
53 53
54 namespace content { 54 namespace content {
55 55
56 class ChildFrameCompositingHelper; 56 class ChildFrameCompositingHelper;
57 class MediaStreamClient; 57 class MediaStreamRendererFactory;
58 class NotificationProvider; 58 class NotificationProvider;
59 class PepperPluginInstanceImpl; 59 class PepperPluginInstanceImpl;
60 class RendererPpapiHost; 60 class RendererPpapiHost;
61 class RenderFrameObserver; 61 class RenderFrameObserver;
62 class RenderViewImpl; 62 class RenderViewImpl;
63 class RenderWidget; 63 class RenderWidget;
64 class RenderWidgetFullscreenPepper; 64 class RenderWidgetFullscreenPepper;
65 struct CustomContextMenuContext; 65 struct CustomContextMenuContext;
66 66
67 class CONTENT_EXPORT RenderFrameImpl 67 class CONTENT_EXPORT RenderFrameImpl
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 const base::string16& text, 181 const base::string16& text,
182 const std::vector<blink::WebCompositionUnderline>& underlines, 182 const std::vector<blink::WebCompositionUnderline>& underlines,
183 int selection_start, 183 int selection_start,
184 int selection_end); 184 int selection_end);
185 void OnImeConfirmComposition( 185 void OnImeConfirmComposition(
186 const base::string16& text, 186 const base::string16& text,
187 const gfx::Range& replacement_range, 187 const gfx::Range& replacement_range,
188 bool keep_selection); 188 bool keep_selection);
189 #endif // ENABLE_PLUGINS 189 #endif // ENABLE_PLUGINS
190 190
191 // Overrides the MediaStreamClient used when creating MediaStream players.
192 // Must be called before any players are created.
193 void SetMediaStreamClientForTesting(MediaStreamClient* media_stream_client);
194
195 // IPC::Sender 191 // IPC::Sender
196 virtual bool Send(IPC::Message* msg) OVERRIDE; 192 virtual bool Send(IPC::Message* msg) OVERRIDE;
197 193
198 // IPC::Listener 194 // IPC::Listener
199 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 195 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
200 196
201 // RenderFrame implementation: 197 // RenderFrame implementation:
202 virtual RenderView* GetRenderView() OVERRIDE; 198 virtual RenderView* GetRenderView() OVERRIDE;
203 virtual int GetRoutingID() OVERRIDE; 199 virtual int GetRoutingID() OVERRIDE;
204 virtual blink::WebFrame* GetWebFrame() OVERRIDE; 200 virtual blink::WebFrame* GetWebFrame() OVERRIDE;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // this back to private member. 385 // this back to private member.
390 void OnNavigate(const FrameMsg_Navigate_Params& params); 386 void OnNavigate(const FrameMsg_Navigate_Params& params);
391 387
392 protected: 388 protected:
393 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); 389 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id);
394 390
395 private: 391 private:
396 friend class RenderFrameObserver; 392 friend class RenderFrameObserver;
397 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, 393 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest,
398 AccessibilityMessagesQueueWhileSwappedOut); 394 AccessibilityMessagesQueueWhileSwappedOut);
399 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, 395 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
400 ShouldUpdateSelectionTextFromContextMenuParams); 396 ShouldUpdateSelectionTextFromContextMenuParams);
401 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, 397 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
402 OnExtendSelectionAndDelete); 398 OnExtendSelectionAndDelete);
403 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); 399 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut);
404 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); 400 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK);
405 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, 401 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
406 SetEditableSelectionAndComposition); 402 SetEditableSelectionAndComposition);
407 403
408 typedef std::map<GURL, double> HostZoomLevels; 404 typedef std::map<GURL, double> HostZoomLevels;
409 405
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 const base::string16& message, 500 const base::string16& message,
505 const base::string16& default_value, 501 const base::string16& default_value,
506 const GURL& frame_url, 502 const GURL& frame_url,
507 base::string16* result); 503 base::string16* result);
508 504
509 // Loads the appropriate error page for the specified failure into the frame. 505 // Loads the appropriate error page for the specified failure into the frame.
510 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request, 506 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request,
511 const blink::WebURLError& error, 507 const blink::WebURLError& error,
512 bool replace); 508 bool replace);
513 509
514 // Initializes |media_stream_client_|, returning true if successful. Returns 510 // Initializes |web_user_media_client_|, returning true if successful. Returns
515 // false if it wasn't possible to create a MediaStreamClient (e.g., WebRTC is 511 // false if it wasn't possible to create a MediaStreamClient (e.g., WebRTC is
516 // disabled) in which case |media_stream_client_| is NULL. 512 // disabled) in which case |web_user_media_client_| is NULL.
517 bool InitializeMediaStreamClient(); 513 bool InitializeUserMediaClient();
518 514
519 blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream( 515 blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream(
520 const blink::WebURL& url, 516 const blink::WebURL& url,
521 blink::WebMediaPlayerClient* client); 517 blink::WebMediaPlayerClient* client);
522 518
519 // Creates a factory object used for creating audio and video renderers.
520 // The method is virtual so that layouttests can override it.
521 virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory();
522
523 #if defined(OS_ANDROID) 523 #if defined(OS_ANDROID)
524 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer( 524 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer(
525 const blink::WebURL& url, 525 const blink::WebURL& url,
526 blink::WebMediaPlayerClient* client); 526 blink::WebMediaPlayerClient* client);
527 #endif 527 #endif
528 528
529 // Stores the WebLocalFrame we are associated with. 529 // Stores the WebLocalFrame we are associated with.
530 blink::WebLocalFrame* frame_; 530 blink::WebLocalFrame* frame_;
531 531
532 base::WeakPtr<RenderViewImpl> render_view_; 532 base::WeakPtr<RenderViewImpl> render_view_;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 // of handling a InputMsg_SelectRange IPC. 582 // of handling a InputMsg_SelectRange IPC.
583 bool handling_select_range_; 583 bool handling_select_range_;
584 584
585 // The next group of objects all implement RenderFrameObserver, so are deleted 585 // The next group of objects all implement RenderFrameObserver, so are deleted
586 // along with the RenderFrame automatically. This is why we just store weak 586 // along with the RenderFrame automatically. This is why we just store weak
587 // references. 587 // references.
588 588
589 // Holds a reference to the service which provides desktop notifications. 589 // Holds a reference to the service which provides desktop notifications.
590 NotificationProvider* notification_provider_; 590 NotificationProvider* notification_provider_;
591 591
592 // MediaStreamClient attached to this frame; lazily initialized.
593 MediaStreamClient* media_stream_client_;
594 blink::WebUserMediaClient* web_user_media_client_; 592 blink::WebUserMediaClient* web_user_media_client_;
595 593
596 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; 594 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
597 595
598 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); 596 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
599 }; 597 };
600 598
601 } // namespace content 599 } // namespace content
602 600
603 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 601 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698