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

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: 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..8115a23dfadcadcfa1f90f8280e4ad7b6dc9acf8 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,10 @@ class CastWindowAndroid : public content::WebContentsDelegate,
virtual ~CastWindowAndroid();
void LoadURL(const GURL& url);
+ // Gives a time interval to deliver window.unload event before window close.
lcwu1 2014/09/25 19:10:54 I think the comment should be something like "this
gunsch 2014/09/25 19:18:15 Done.
void Close();
+ // Destroys this window immediately.
+ void Destroy();
// Registers the JNI methods for CastWindowAndroid.
static bool RegisterJni(JNIEnv* env);
@@ -81,6 +85,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