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

Side by Side Diff: ui/gl/android/scoped_java_surface.cc

Issue 1407443002: Remove old C++03 move emulation code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: std::move and reflow Created 5 years 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
« no previous file with comments | « ui/gl/android/scoped_java_surface.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/gl/android/scoped_java_surface.h" 5 #include "ui/gl/android/scoped_java_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "jni/Surface_jni.h" 8 #include "jni/Surface_jni.h"
9 #include "ui/gl/android/surface_texture.h" 9 #include "ui/gl/android/surface_texture.h"
10 10
(...skipping 30 matching lines...) Expand all
41 : auto_release_(true), 41 : auto_release_(true),
42 is_protected_(false) { 42 is_protected_(false) {
43 JNIEnv* env = base::android::AttachCurrentThread(); 43 JNIEnv* env = base::android::AttachCurrentThread();
44 RegisterNativesIfNeeded(env); 44 RegisterNativesIfNeeded(env);
45 ScopedJavaLocalRef<jobject> tmp(JNI_Surface::Java_Surface_Constructor( 45 ScopedJavaLocalRef<jobject> tmp(JNI_Surface::Java_Surface_Constructor(
46 env, surface_texture->j_surface_texture().obj())); 46 env, surface_texture->j_surface_texture().obj()));
47 DCHECK(!tmp.is_null()); 47 DCHECK(!tmp.is_null());
48 j_surface_.Reset(tmp); 48 j_surface_.Reset(tmp);
49 } 49 }
50 50
51 ScopedJavaSurface::ScopedJavaSurface(RValue rvalue) { 51 ScopedJavaSurface::ScopedJavaSurface(ScopedJavaSurface&& rvalue) {
52 MoveFrom(*rvalue.object); 52 MoveFrom(rvalue);
53 } 53 }
54 54
55 ScopedJavaSurface& ScopedJavaSurface::operator=(RValue rhs) { 55 ScopedJavaSurface& ScopedJavaSurface::operator=(ScopedJavaSurface&& rhs) {
56 MoveFrom(*rhs.object); 56 MoveFrom(rhs);
57 return *this; 57 return *this;
58 } 58 }
59 59
60 ScopedJavaSurface::~ScopedJavaSurface() { 60 ScopedJavaSurface::~ScopedJavaSurface() {
61 if (auto_release_ && !j_surface_.is_null()) { 61 if (auto_release_ && !j_surface_.is_null()) {
62 JNIEnv* env = base::android::AttachCurrentThread(); 62 JNIEnv* env = base::android::AttachCurrentThread();
63 JNI_Surface::Java_Surface_release(env, j_surface_.obj()); 63 JNI_Surface::Java_Surface_release(env, j_surface_.obj());
64 } 64 }
65 } 65 }
66 66
(...skipping 13 matching lines...) Expand all
80 JNIEnv* env = base::android::AttachCurrentThread(); 80 JNIEnv* env = base::android::AttachCurrentThread();
81 ScopedJavaLocalRef<jobject> surface_ref; 81 ScopedJavaLocalRef<jobject> surface_ref;
82 surface_ref.Reset(env, surface); 82 surface_ref.Reset(env, surface);
83 gfx::ScopedJavaSurface scoped_surface(surface_ref); 83 gfx::ScopedJavaSurface scoped_surface(surface_ref);
84 scoped_surface.auto_release_ = false; 84 scoped_surface.auto_release_ = false;
85 scoped_surface.is_protected_ = true; 85 scoped_surface.is_protected_ = true;
86 return scoped_surface; 86 return scoped_surface;
87 } 87 }
88 88
89 } // namespace gfx 89 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/android/scoped_java_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698