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

Side by Side Diff: base/android/scoped_java_ref.h

Issue 1127983002: Add connectivity check for Android feedback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move test to new test package, and merge with upstream (conflict in chrome_jni_registrar.cc) Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityChecker.java » ('j') | 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) 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 #ifndef BASE_ANDROID_SCOPED_JAVA_REF_H_ 5 #ifndef BASE_ANDROID_SCOPED_JAVA_REF_H_
6 #define BASE_ANDROID_SCOPED_JAVA_REF_H_ 6 #define BASE_ANDROID_SCOPED_JAVA_REF_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // imposed by the underlying Java object that it references). 171 // imposed by the underlying Java object that it references).
172 template<typename T> 172 template<typename T>
173 class ScopedJavaGlobalRef : public JavaRef<T> { 173 class ScopedJavaGlobalRef : public JavaRef<T> {
174 public: 174 public:
175 ScopedJavaGlobalRef() {} 175 ScopedJavaGlobalRef() {}
176 176
177 explicit ScopedJavaGlobalRef(const ScopedJavaGlobalRef<T>& other) { 177 explicit ScopedJavaGlobalRef(const ScopedJavaGlobalRef<T>& other) {
178 this->Reset(other); 178 this->Reset(other);
179 } 179 }
180 180
181 ScopedJavaGlobalRef(JNIEnv* env, T obj) { this->Reset(env, obj); }
182
181 template<typename U> 183 template<typename U>
182 explicit ScopedJavaGlobalRef(const U& other) { 184 explicit ScopedJavaGlobalRef(const U& other) {
183 this->Reset(other); 185 this->Reset(other);
184 } 186 }
185 187
186 ~ScopedJavaGlobalRef() { 188 ~ScopedJavaGlobalRef() {
187 this->Reset(); 189 this->Reset();
188 } 190 }
189 191
190 void Reset() { 192 void Reset() {
(...skipping 15 matching lines...) Expand all
206 // global reference when it is done with it. 208 // global reference when it is done with it.
207 T Release() { 209 T Release() {
208 return static_cast<T>(this->ReleaseInternal()); 210 return static_cast<T>(this->ReleaseInternal());
209 } 211 }
210 }; 212 };
211 213
212 } // namespace android 214 } // namespace android
213 } // namespace base 215 } // namespace base
214 216
215 #endif // BASE_ANDROID_SCOPED_JAVA_REF_H_ 217 #endif // BASE_ANDROID_SCOPED_JAVA_REF_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityChecker.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698