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

Unified Diff: remoting/client/jni/jni_frame_consumer.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/jni/jni_frame_consumer.h ('k') | remoting/client/normalizing_input_filter_cros_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/jni_frame_consumer.cc
diff --git a/remoting/client/jni/jni_frame_consumer.cc b/remoting/client/jni/jni_frame_consumer.cc
index 066110c16647b65207e5363efda3f7e0e530b9fb..1e3fc0951e65ed73cc880feb51ba76b7097aeed2 100644
--- a/remoting/client/jni/jni_frame_consumer.cc
+++ b/remoting/client/jni/jni_frame_consumer.cc
@@ -9,6 +9,7 @@
#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "remoting/base/util.h"
#include "remoting/client/jni/chromoting_jni_instance.h"
#include "remoting/client/jni/chromoting_jni_runtime.h"
@@ -25,7 +26,7 @@ class JniFrameConsumer::Renderer {
DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread());
}
- void RenderFrame(scoped_ptr<webrtc::DesktopFrame> frame);
+ void RenderFrame(std::unique_ptr<webrtc::DesktopFrame> frame);
private:
// Used to obtain task runner references and make calls to Java methods.
@@ -39,12 +40,12 @@ class JniFrameConsumer::Renderer {
// Reference to the frame bitmap that is passed to Java when the frame is
// allocated. This provides easy access to the underlying pixels.
- scoped_ptr<gfx::JavaBitmap> bitmap_;
+ std::unique_ptr<gfx::JavaBitmap> bitmap_;
};
// Function called on the display thread to render the frame.
void JniFrameConsumer::Renderer::RenderFrame(
- scoped_ptr<webrtc::DesktopFrame> frame) {
+ std::unique_ptr<webrtc::DesktopFrame> frame) {
DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread());
if (!bitmap_ || bitmap_->size().width() != frame->size().width() ||
@@ -91,12 +92,12 @@ JniFrameConsumer::~JniFrameConsumer() {
renderer_.release());
}
-scoped_ptr<webrtc::DesktopFrame> JniFrameConsumer::AllocateFrame(
+std::unique_ptr<webrtc::DesktopFrame> JniFrameConsumer::AllocateFrame(
const webrtc::DesktopSize& size) {
- return make_scoped_ptr(new webrtc::BasicDesktopFrame(size));
+ return base::WrapUnique(new webrtc::BasicDesktopFrame(size));
}
-void JniFrameConsumer::DrawFrame(scoped_ptr<webrtc::DesktopFrame> frame,
+void JniFrameConsumer::DrawFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
const base::Closure& done) {
DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread());
« no previous file with comments | « remoting/client/jni/jni_frame_consumer.h ('k') | remoting/client/normalizing_input_filter_cros_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698