Index: sky/shell/android/platform_view_android.h |
diff --git a/sky/shell/android/platform_view_android.h b/sky/shell/android/platform_view_android.h |
index 72c8bba079a76cc04a642537a3a1b5b16466f0bc..dce4ee9a2300b41b3cbbe909e00b4625838db65b 100644 |
--- a/sky/shell/android/platform_view_android.h |
+++ b/sky/shell/android/platform_view_android.h |
@@ -11,10 +11,13 @@ struct ANativeWindow; |
namespace sky { |
namespace shell { |
+class Instance; |
class PlatformViewAndroid : public PlatformView { |
public: |
static bool Register(JNIEnv* env); |
+ |
+ PlatformViewAndroid(const Config& config); |
~PlatformViewAndroid() override; |
// Called from Java |
@@ -22,9 +25,17 @@ class PlatformViewAndroid : public PlatformView { |
void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface); |
void SurfaceDestroyed(JNIEnv* env, jobject obj); |
+ void SetInstance(scoped_ptr<Instance> instance); |
+ |
private: |
void ReleaseWindow(); |
+ // In principle, the Instance should own the PlatformView, but because our |
+ // lifetime is controlled by the Android view hierarchy, we flip around the |
+ // ownership and have the Instance owned by Java. We reset this pointer in |
+ // |Detach|, which will eventually cause |~PlatformViewAndroid|. |
+ scoped_ptr<Instance> instance_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); |
}; |