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

Unified Diff: content/renderer/media/android/stream_texture_factory.cc

Issue 2530443002: Fix OnChannelError() in StreamTextureHost (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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/media/android/stream_texture_factory.cc
diff --git a/content/renderer/media/android/stream_texture_factory.cc b/content/renderer/media/android/stream_texture_factory.cc
index dc785addf5e33f7bdb79fbeec0806c4c946e4b9b..8064b99a6c72209d582acc68445eaeaf27f6e2a8 100644
--- a/content/renderer/media/android/stream_texture_factory.cc
+++ b/content/renderer/media/android/stream_texture_factory.cc
@@ -5,6 +5,7 @@
#include "content/renderer/media/android/stream_texture_factory.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "cc/output/context_provider.h"
#include "content/common/gpu/client/context_provider_command_buffer.h"
#include "gpu/command_buffer/client/gles2_interface.h"
@@ -15,7 +16,8 @@
namespace content {
-StreamTextureProxy::StreamTextureProxy(StreamTextureHost* host) : host_(host) {}
+StreamTextureProxy::StreamTextureProxy(std::unique_ptr<StreamTextureHost> host)
+ : host_(std::move(host)) {}
StreamTextureProxy::~StreamTextureProxy() {}
@@ -94,16 +96,16 @@ StreamTextureFactory::StreamTextureFactory(
StreamTextureFactory::~StreamTextureFactory() {}
-StreamTextureProxy* StreamTextureFactory::CreateProxy(
+ScopedStreamTextureProxy StreamTextureFactory::CreateProxy(
unsigned texture_target,
unsigned* texture_id,
gpu::Mailbox* texture_mailbox) {
int32_t route_id =
CreateStreamTexture(texture_target, texture_id, texture_mailbox);
if (!route_id)
- return nullptr;
- StreamTextureHost* host = new StreamTextureHost(channel_, route_id);
- return new StreamTextureProxy(host);
+ return ScopedStreamTextureProxy();
+ return ScopedStreamTextureProxy(new StreamTextureProxy(
+ base::MakeUnique<StreamTextureHost>(channel_, route_id)));
}
unsigned StreamTextureFactory::CreateStreamTexture(
« no previous file with comments | « content/renderer/media/android/stream_texture_factory.h ('k') | content/renderer/media/android/stream_texture_wrapper_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698