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

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

Issue 278353003: Make RendererMediaPlayerManager a RenderFrameObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 #if defined(ENABLE_WEBRTC) 113 #if defined(ENABLE_WEBRTC)
114 #include "content/renderer/media/rtc_peer_connection_handler.h" 114 #include "content/renderer/media/rtc_peer_connection_handler.h"
115 #endif 115 #endif
116 116
117 #if defined(OS_ANDROID) 117 #if defined(OS_ANDROID)
118 #include <cpu-features.h> 118 #include <cpu-features.h>
119 119
120 #include "content/common/gpu/client/context_provider_command_buffer.h" 120 #include "content/common/gpu/client/context_provider_command_buffer.h"
121 #include "content/renderer/android/synchronous_compositor_factory.h" 121 #include "content/renderer/android/synchronous_compositor_factory.h"
122 #include "content/renderer/media/android/renderer_media_player_manager.h"
122 #include "content/renderer/media/android/stream_texture_factory_impl.h" 123 #include "content/renderer/media/android/stream_texture_factory_impl.h"
123 #include "content/renderer/media/android/webmediaplayer_android.h" 124 #include "content/renderer/media/android/webmediaplayer_android.h"
124 #endif 125 #endif
125 126
126 using blink::WebContextMenuData; 127 using blink::WebContextMenuData;
127 using blink::WebData; 128 using blink::WebData;
128 using blink::WebDataSource; 129 using blink::WebDataSource;
129 using blink::WebDocument; 130 using blink::WebDocument;
130 using blink::WebElement; 131 using blink::WebElement;
131 using blink::WebFrame; 132 using blink::WebFrame;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 routing_id_(routing_id), 357 routing_id_(routing_id),
357 is_swapped_out_(false), 358 is_swapped_out_(false),
358 is_detaching_(false), 359 is_detaching_(false),
359 cookie_jar_(this), 360 cookie_jar_(this),
360 selection_text_offset_(0), 361 selection_text_offset_(0),
361 selection_range_(gfx::Range::InvalidRange()), 362 selection_range_(gfx::Range::InvalidRange()),
362 handling_select_range_(false), 363 handling_select_range_(false),
363 notification_provider_(NULL), 364 notification_provider_(NULL),
364 media_stream_client_(NULL), 365 media_stream_client_(NULL),
365 web_user_media_client_(NULL), 366 web_user_media_client_(NULL),
367 #if defined(OS_ANDROID)
368 media_player_manager_(NULL),
369 #endif
366 weak_factory_(this) { 370 weak_factory_(this) {
367 RenderThread::Get()->AddRoute(routing_id_, this); 371 RenderThread::Get()->AddRoute(routing_id_, this);
368 372
369 #if defined(OS_ANDROID) 373 #if defined(OS_ANDROID)
370 new JavaBridgeDispatcher(this); 374 new JavaBridgeDispatcher(this);
371 #endif 375 #endif
372 376
373 #if defined(ENABLE_NOTIFICATIONS) 377 #if defined(ENABLE_NOTIFICATIONS)
374 notification_provider_ = new NotificationProvider(this); 378 notification_provider_ = new NotificationProvider(this);
375 #endif 379 #endif
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3384 } 3388 }
3385 3389
3386 stream_texture_factory = StreamTextureFactoryImpl::Create( 3390 stream_texture_factory = StreamTextureFactoryImpl::Create(
3387 context_provider, gpu_channel_host, render_view_->routing_id_); 3391 context_provider, gpu_channel_host, render_view_->routing_id_);
3388 } 3392 }
3389 3393
3390 return new WebMediaPlayerAndroid( 3394 return new WebMediaPlayerAndroid(
3391 frame_, 3395 frame_,
3392 client, 3396 client,
3393 weak_factory_.GetWeakPtr(), 3397 weak_factory_.GetWeakPtr(),
3394 render_view_->media_player_manager_, 3398 GetMediaPlayerManager(),
3395 stream_texture_factory, 3399 stream_texture_factory,
3396 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), 3400 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(),
3397 new RenderMediaLog()); 3401 new RenderMediaLog());
3398 } 3402 }
3399 3403
3400 #endif 3404 RendererMediaPlayerManager* RenderFrameImpl::GetMediaPlayerManager() {
3405 if (!media_player_manager_)
3406 media_player_manager_ = new RendererMediaPlayerManager(this);
3407 return media_player_manager_;
3408 }
3409
3410 #endif // defined(OS_ANDROID)
3401 3411
3402 } // namespace content 3412 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698