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

Unified Diff: ui/gfx/android/java_bitmap.h

Issue 2417263002: Pass JavaRef to Java methods in ui. (Closed)
Patch Set: Created 4 years, 2 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 | « ui/android/resources/resource_manager_impl.cc ('k') | ui/gfx/android/java_bitmap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/android/java_bitmap.h
diff --git a/ui/gfx/android/java_bitmap.h b/ui/gfx/android/java_bitmap.h
index 27826f809271a153b1ca6bf76044365547b6e7b3..919e62a91680c2db96301e10ce863efed2b92a17 100644
--- a/ui/gfx/android/java_bitmap.h
+++ b/ui/gfx/android/java_bitmap.h
@@ -30,7 +30,7 @@ enum BitmapFormat {
// various JNI methods.
class GFX_EXPORT JavaBitmap {
public:
- explicit JavaBitmap(jobject bitmap);
+ explicit JavaBitmap(const base::android::JavaRef<jobject>& bitmap);
~JavaBitmap();
inline void* pixels() { return pixels_; }
@@ -42,7 +42,7 @@ class GFX_EXPORT JavaBitmap {
inline int byte_count() const { return byte_count_; }
private:
- jobject bitmap_;
+ base::android::ScopedJavaGlobalRef<jobject> bitmap_;
Torne 2016/10/14 13:23:29 I'm not sure whether this replacement is actually
aelias_OOO_until_Jul13 2016/10/14 19:30:34 Seems OK. This code was written in 2012 and I thi
Ted C 2016/10/14 20:40:37 agreed...seems like something we can revisit if ne
void* pixels_;
gfx::Size size_;
int format_;
@@ -70,7 +70,8 @@ GFX_EXPORT base::android::ScopedJavaLocalRef<jobject> ConvertToJavaBitmap(
GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(const JavaBitmap& jbitmap);
// Returns a Skia color type value for the requested input java Bitmap.Config.
-GFX_EXPORT SkColorType ConvertToSkiaColorType(jobject jbitmap_config);
+GFX_EXPORT SkColorType
+ConvertToSkiaColorType(const base::android::JavaRef<jobject>& jbitmap_config);
} // namespace gfx
« no previous file with comments | « ui/android/resources/resource_manager_impl.cc ('k') | ui/gfx/android/java_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698