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

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

Issue 23618031: [Android WebView] Clean up global GL resource pt.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not fail video if cannot create context Created 7 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after
3011 GpuChannelHost* gpu_channel_host = 3011 GpuChannelHost* gpu_channel_host =
3012 RenderThreadImpl::current()->EstablishGpuChannelSync( 3012 RenderThreadImpl::current()->EstablishGpuChannelSync(
3013 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 3013 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
3014 if (!gpu_channel_host) { 3014 if (!gpu_channel_host) {
3015 LOG(ERROR) << "Failed to establish GPU channel for media player"; 3015 LOG(ERROR) << "Failed to establish GPU channel for media player";
3016 return NULL; 3016 return NULL;
3017 } 3017 }
3018 3018
3019 scoped_refptr<cc::ContextProvider> context_provider = 3019 scoped_refptr<cc::ContextProvider> context_provider =
3020 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); 3020 RenderThreadImpl::current()->OffscreenContextProviderForMainThread();
3021 if (!context_provider.get()) { 3021 scoped_ptr<StreamTextureFactory> stream_texture_factory;
3022 LOG(ERROR) << "Failed to get context3d for media player"; 3022 if (UsingSynchronousRendererCompositor()) {
3023 return NULL; 3023 SynchronousCompositorFactory* factory =
3024 SynchronousCompositorFactory::GetInstance();
3025 stream_texture_factory = factory->CreateStreamTextureFactory(routing_id_);
3026 } else {
3027 if (!context_provider.get()) {
3028 LOG(ERROR) << "Failed to get context3d for media player";
3029 return NULL;
3030 }
3031
3032 stream_texture_factory.reset(new StreamTextureFactoryImpl(
3033 context_provider->Context3d(), gpu_channel_host, routing_id_));
3024 } 3034 }
3025 3035
3026 if (!media_player_proxy_) { 3036 if (!media_player_proxy_) {
3027 media_player_proxy_ = new WebMediaPlayerProxyAndroid( 3037 media_player_proxy_ = new WebMediaPlayerProxyAndroid(
3028 this, media_player_manager_.get()); 3038 this, media_player_manager_.get());
3029 } 3039 }
3030 3040
3031 scoped_ptr<StreamTextureFactory> stream_texture_factory;
3032 if (UsingSynchronousRendererCompositor()) {
3033 SynchronousCompositorFactory* factory =
3034 SynchronousCompositorFactory::GetInstance();
3035 stream_texture_factory = factory->CreateStreamTextureFactory(routing_id_);
3036 } else {
3037 stream_texture_factory.reset(new StreamTextureFactoryImpl(
3038 context_provider->Context3d(), gpu_channel_host, routing_id_));
3039 }
3040
3041 scoped_ptr<WebMediaPlayerAndroid> web_media_player_android( 3041 scoped_ptr<WebMediaPlayerAndroid> web_media_player_android(
3042 new WebMediaPlayerAndroid( 3042 new WebMediaPlayerAndroid(
3043 frame, 3043 frame,
3044 client, 3044 client,
3045 AsWeakPtr(), 3045 AsWeakPtr(),
3046 media_player_manager_.get(), 3046 media_player_manager_.get(),
3047 media_player_proxy_, 3047 media_player_proxy_,
3048 stream_texture_factory.release(), 3048 stream_texture_factory.release(),
3049 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), 3049 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(),
3050 new RenderMediaLog())); 3050 new RenderMediaLog()));
(...skipping 3469 matching lines...) Expand 10 before | Expand all | Expand 10 after
6520 for (size_t i = 0; i < icon_urls.size(); i++) { 6520 for (size_t i = 0; i < icon_urls.size(); i++) {
6521 WebURL url = icon_urls[i].iconURL(); 6521 WebURL url = icon_urls[i].iconURL();
6522 if (!url.isEmpty()) 6522 if (!url.isEmpty())
6523 urls.push_back(FaviconURL(url, 6523 urls.push_back(FaviconURL(url,
6524 ToFaviconType(icon_urls[i].iconType()))); 6524 ToFaviconType(icon_urls[i].iconType())));
6525 } 6525 }
6526 SendUpdateFaviconURL(urls); 6526 SendUpdateFaviconURL(urls);
6527 } 6527 }
6528 6528
6529 } // namespace content 6529 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698