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

Side by Side Diff: content/common/android/surface_texture_bridge.cc

Issue 11038015: Android: lazy initialization for method id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/android/surface_callback.cc ('k') | media/base/android/media_player_bridge.cc » ('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 #include "content/common/android/surface_texture_bridge.h" 5 #include "content/common/android/surface_texture_bridge.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/common/android/surface_texture_listener.h" 9 #include "content/common/android/surface_texture_listener.h"
10 #include "jni/SurfaceTexture_jni.h" 10 #include "jni/SurfaceTexture_jni.h"
11 11
12 using base::android::AttachCurrentThread; 12 using base::android::AttachCurrentThread;
13 using base::android::CheckException; 13 using base::android::CheckException;
14 using base::android::GetClass; 14 using base::android::GetClass;
15 using base::android::GetMethodID;
16 using base::android::ScopedJavaLocalRef; 15 using base::android::ScopedJavaLocalRef;
17 16
18 namespace { 17 namespace {
19 bool g_jni_initialized = false; 18 bool g_jni_initialized = false;
20 19
21 void RegisterNativesIfNeeded(JNIEnv* env) { 20 void RegisterNativesIfNeeded(JNIEnv* env) {
22 if (!g_jni_initialized) { 21 if (!g_jni_initialized) {
23 JNI_SurfaceTexture::RegisterNativesImpl(env); 22 JNI_SurfaceTexture::RegisterNativesImpl(env);
24 g_jni_initialized = true; 23 g_jni_initialized = true;
25 } 24 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void SurfaceTextureBridge::SetDefaultBufferSize(int width, int height) { 97 void SurfaceTextureBridge::SetDefaultBufferSize(int width, int height) {
99 JNIEnv* env = AttachCurrentThread(); 98 JNIEnv* env = AttachCurrentThread();
100 CHECK(env); 99 CHECK(env);
101 100
102 JNI_SurfaceTexture::Java_SurfaceTexture_setDefaultBufferSize( 101 JNI_SurfaceTexture::Java_SurfaceTexture_setDefaultBufferSize(
103 env, j_surface_texture_.obj(), static_cast<jint>(width), 102 env, j_surface_texture_.obj(), static_cast<jint>(width),
104 static_cast<jint>(height)); 103 static_cast<jint>(height));
105 } 104 }
106 105
107 } // namespace content 106 } // namespace content
OLDNEW
« no previous file with comments | « content/common/android/surface_callback.cc ('k') | media/base/android/media_player_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698