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

Unified Diff: talk/app/webrtc/java/jni/native_handle_impl.cc

Issue 1487493002: Add helper KeepRefUntilDone (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changed back to use template Created 5 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
« no previous file with comments | « no previous file | webrtc/base/callback_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/native_handle_impl.cc
diff --git a/talk/app/webrtc/java/jni/native_handle_impl.cc b/talk/app/webrtc/java/jni/native_handle_impl.cc
index bb31ba648c76fb4b21cdcbb0f8f16d6775398acb..583a0380263659096660934cae8699babd5c7511 100644
--- a/talk/app/webrtc/java/jni/native_handle_impl.cc
+++ b/talk/app/webrtc/java/jni/native_handle_impl.cc
@@ -28,17 +28,13 @@
#include "talk/app/webrtc/java/jni/native_handle_impl.h"
#include "webrtc/base/checks.h"
-#include "webrtc/base/bind.h"
+#include "webrtc/base/keep_ref_until_done.h"
+#include "webrtc/base/scoped_ref_ptr.h"
-using rtc::scoped_refptr;
using webrtc::NativeHandleBuffer;
namespace webrtc_jni {
-namespace {
-void ScaledFrameNotInUse(scoped_refptr<NativeHandleBuffer> original) {}
-} // anonymous namespace
-
NativeHandleImpl::NativeHandleImpl(JNIEnv* jni,
jint j_oes_texture_id,
jfloatArray j_transform_matrix)
@@ -87,7 +83,7 @@ rtc::scoped_refptr<AndroidTextureBuffer> AndroidTextureBuffer::CropAndScale(
// will be decreased by one.
return new rtc::RefCountedObject<AndroidTextureBuffer>(
dst_widht, dst_height, native_handle_,
- rtc::Bind(&ScaledFrameNotInUse, this));
+ rtc::KeepRefUntilDone(this));
}
} // namespace webrtc_jni
« no previous file with comments | « no previous file | webrtc/base/callback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698