Flutter Engine
 
Loading...
Searching...
No Matches
fml::jni::JavaObjectWeakGlobalRef Class Reference

#include <jni_weak_ref.h>

Public Member Functions

 JavaObjectWeakGlobalRef ()
 
 JavaObjectWeakGlobalRef (const JavaObjectWeakGlobalRef &orig)
 
 JavaObjectWeakGlobalRef (JNIEnv *env, jobject obj)
 
virtual ~JavaObjectWeakGlobalRef ()
 
void operator= (const JavaObjectWeakGlobalRef &rhs)
 
ScopedJavaLocalRef< jobject > get (JNIEnv *env) const
 
bool is_empty () const
 
void reset ()
 

Detailed Description

Definition at line 19 of file jni_weak_ref.h.

Constructor & Destructor Documentation

◆ JavaObjectWeakGlobalRef() [1/3]

fml::jni::JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef ( )

Definition at line 13 of file jni_weak_ref.cc.

13: obj_(NULL) {}

◆ JavaObjectWeakGlobalRef() [2/3]

fml::jni::JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef ( const JavaObjectWeakGlobalRef orig)

Definition at line 15 of file jni_weak_ref.cc.

17 : obj_(NULL) {
18 Assign(orig);
19}

◆ JavaObjectWeakGlobalRef() [3/3]

fml::jni::JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef ( JNIEnv *  env,
jobject  obj 
)

Definition at line 21 of file jni_weak_ref.cc.

22 : obj_(env->NewWeakGlobalRef(obj)) {
23 FML_DCHECK(obj_);
24}
#define FML_DCHECK(condition)
Definition logging.h:122

References FML_DCHECK.

◆ ~JavaObjectWeakGlobalRef()

fml::jni::JavaObjectWeakGlobalRef::~JavaObjectWeakGlobalRef ( )
virtual

Definition at line 26 of file jni_weak_ref.cc.

References reset().

Member Function Documentation

◆ get()

ScopedJavaLocalRef< jobject > fml::jni::JavaObjectWeakGlobalRef::get ( JNIEnv *  env) const

Definition at line 41 of file jni_weak_ref.cc.

41 {
42 return GetRealObject(env, obj_);
43}
ScopedJavaLocalRef< jobject > GetRealObject(JNIEnv *env, jweak obj)

References fml::jni::GetRealObject().

Referenced by flutter::PlatformViewAndroidJNIImpl::applyTransaction(), flutter::PlatformViewAndroidJNIImpl::createOverlaySurface2(), flutter::PlatformViewAndroidJNIImpl::createTransaction(), flutter::PlatformViewAndroidJNIImpl::destroyOverlaySurface2(), flutter::PlatformViewAndroidJNIImpl::FlutterViewBeginFrame(), flutter::PlatformViewAndroidJNIImpl::FlutterViewComputePlatformResolvedLocale(), flutter::PlatformViewAndroidJNIImpl::FlutterViewCreateOverlaySurface(), flutter::PlatformViewAndroidJNIImpl::FlutterViewDestroyOverlaySurfaces(), flutter::PlatformViewAndroidJNIImpl::FlutterViewDisplayOverlaySurface(), flutter::PlatformViewAndroidJNIImpl::FlutterViewEndFrame(), flutter::PlatformViewAndroidJNIImpl::FlutterViewGetScaledFontSize(), flutter::PlatformViewAndroidJNIImpl::FlutterViewHandlePlatformMessage(), flutter::PlatformViewAndroidJNIImpl::FlutterViewHandlePlatformMessageResponse(), flutter::PlatformViewAndroidJNIImpl::FlutterViewOnDisplayPlatformView(), flutter::PlatformViewAndroidJNIImpl::FlutterViewOnFirstFrame(), flutter::PlatformViewAndroidJNIImpl::FlutterViewOnPreEngineRestart(), flutter::PlatformViewAndroidJNIImpl::FlutterViewSetApplicationLocale(), flutter::PlatformViewAndroidJNIImpl::FlutterViewUpdateCustomAccessibilityActions(), flutter::PlatformViewAndroidJNIImpl::FlutterViewUpdateSemantics(), flutter::PlatformViewAndroidJNIImpl::GetDisplayDensity(), flutter::PlatformViewAndroidJNIImpl::GetDisplayHeight(), flutter::PlatformViewAndroidJNIImpl::GetDisplayRefreshRate(), flutter::PlatformViewAndroidJNIImpl::GetDisplayWidth(), flutter::PlatformViewAndroidJNIImpl::hideOverlaySurface2(), flutter::PlatformViewAndroidJNIImpl::hidePlatformView2(), flutter::PlatformViewAndroidJNIImpl::onDisplayPlatformView2(), flutter::PlatformViewAndroidJNIImpl::onEndFrame2(), flutter::PlatformViewAndroidJNIImpl::RequestDartDeferredLibrary(), flutter::PlatformViewAndroidJNIImpl::showOverlaySurface2(), and flutter::PlatformViewAndroidJNIImpl::swapTransaction().

◆ is_empty()

bool fml::jni::JavaObjectWeakGlobalRef::is_empty ( ) const
inline

Definition at line 33 of file jni_weak_ref.h.

33{ return obj_ == NULL; }

◆ operator=()

void fml::jni::JavaObjectWeakGlobalRef::operator= ( const JavaObjectWeakGlobalRef rhs)

Definition at line 30 of file jni_weak_ref.cc.

30 {
31 Assign(rhs);
32}

◆ reset()

void fml::jni::JavaObjectWeakGlobalRef::reset ( )

Definition at line 34 of file jni_weak_ref.cc.

34 {
35 if (obj_) {
36 AttachCurrentThread()->DeleteWeakGlobalRef(obj_);
37 obj_ = NULL;
38 }
39}
JNIEnv * AttachCurrentThread()
Definition jni_util.cc:34

References fml::jni::AttachCurrentThread().

Referenced by ~JavaObjectWeakGlobalRef().


The documentation for this class was generated from the following files: