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

Side by Side Diff: content/browser/android/content_video_view.cc

Issue 1308363003: Revert of jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
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 #include "content/browser/android/content_video_view.h" 5 #include "content/browser/android/content_video_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 13 matching lines...) Expand all
24 24
25 namespace content { 25 namespace content {
26 26
27 namespace { 27 namespace {
28 // There can only be one content video view at a time, this holds onto that 28 // There can only be one content video view at a time, this holds onto that
29 // singleton instance. 29 // singleton instance.
30 ContentVideoView* g_content_video_view = NULL; 30 ContentVideoView* g_content_video_view = NULL;
31 31
32 } // namespace 32 } // namespace
33 33
34 static ScopedJavaLocalRef<jobject> GetSingletonJavaContentVideoView(JNIEnv* env, 34 static jobject GetSingletonJavaContentVideoView(JNIEnv*env, jclass) {
35 jclass) {
36 if (g_content_video_view) 35 if (g_content_video_view)
37 return g_content_video_view->GetJavaObject(env); 36 return g_content_video_view->GetJavaObject(env).Release();
38 else 37 else
39 return ScopedJavaLocalRef<jobject>(); 38 return NULL;
40 } 39 }
41 40
42 bool ContentVideoView::RegisterContentVideoView(JNIEnv* env) { 41 bool ContentVideoView::RegisterContentVideoView(JNIEnv* env) {
43 return RegisterNativesImpl(env); 42 return RegisterNativesImpl(env);
44 } 43 }
45 44
46 ContentVideoView* ContentVideoView::GetInstance() { 45 ContentVideoView* ContentVideoView::GetInstance() {
47 return g_content_video_view; 46 return g_content_video_view;
48 } 47 }
49 48
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return JavaObjectWeakGlobalRef(env, nullptr); 205 return JavaObjectWeakGlobalRef(env, nullptr);
207 206
208 return JavaObjectWeakGlobalRef( 207 return JavaObjectWeakGlobalRef(
209 env, 208 env,
210 Java_ContentVideoView_createContentVideoView( 209 Java_ContentVideoView_createContentVideoView(
211 env, 210 env,
212 j_content_view_core.obj(), 211 j_content_view_core.obj(),
213 reinterpret_cast<intptr_t>(this)).obj()); 212 reinterpret_cast<intptr_t>(this)).obj());
214 } 213 }
215 } // namespace content 214 } // namespace content
OLDNEW
« no previous file with comments | « components/variations/android/variations_associated_data_android.cc ('k') | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698