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..4f3f908e6119c1cb91b41d47c650778306aefe2b 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 ShellView; |
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 SetShellView(scoped_ptr<ShellView> shell_view); |
+ |
private: |
void ReleaseWindow(); |
+ // In principle, the ShellView should own the PlatformView, but because our |
+ // lifetime is controlled by the Android view hierarchy, we flip around the |
+ // ownership and have the shell_view owned by Java. We reset this pointer in |
+ // |Detach|, which will eventually cause |~PlatformViewAndroid|. |
+ scoped_ptr<ShellView> shell_view_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); |
}; |