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

Unified Diff: sky/shell/android/platform_view_android.h

Issue 1187503003: Refactor SkyShell to allow multiple SkyViews (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698