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

Unified Diff: chromecast/shell/browser/android/cast_window_android.h

Issue 601293002: Chromecast: call ClosePage(), wait 50ms before deleting WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment nit, rebase Created 6 years, 3 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: chromecast/shell/browser/android/cast_window_android.h
diff --git a/chromecast/shell/browser/android/cast_window_android.h b/chromecast/shell/browser/android/cast_window_android.h
index 512e5e8c6738cc07fbff7a69020eb6663b60b286..bcb5c1f7efb9b00cbb3717b6757dc5b2d1d017be 100644
--- a/chromecast/shell/browser/android/cast_window_android.h
+++ b/chromecast/shell/browser/android/cast_window_android.h
@@ -15,6 +15,7 @@
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -45,7 +46,11 @@ class CastWindowAndroid : public content::WebContentsDelegate,
virtual ~CastWindowAndroid();
void LoadURL(const GURL& url);
+ // Calls RVH::ClosePage() and waits for acknowledgement before closing/
+ // deleting the window.
void Close();
+ // Destroys this window immediately.
+ void Destroy();
// Registers the JNI methods for CastWindowAndroid.
static bool RegisterJni(JNIEnv* env);
@@ -81,6 +86,8 @@ class CastWindowAndroid : public content::WebContentsDelegate,
base::android::ScopedJavaGlobalRef<jobject> java_object_;
scoped_ptr<content::WebContents> web_contents_;
+ base::WeakPtrFactory<CastWindowAndroid> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(CastWindowAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698