summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 02:34:21 +0000
committerddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 02:34:21 +0000
commit8d6d7865dfd751f621fd14632d5eac9762789dba (patch)
tree6981face739bfd92084d1cd0940b19edb6bc8b11
parent107c053fd372481a12eac60ecbc791369b71fe48 (diff)
downloadchromium_src-8d6d7865dfd751f621fd14632d5eac9762789dba.zip
chromium_src-8d6d7865dfd751f621fd14632d5eac9762789dba.tar.gz
chromium_src-8d6d7865dfd751f621fd14632d5eac9762789dba.tar.bz2
Do not attempt to gtk_widget_destroy when no widget was created.
http://trac.webkit.org/changeset/141731 does not call RenderWidget::show() for Helper Plugins (WebPopupTypeHelperPlugin). As a result, RenderWidgetHostViewGtk::InitAsPopup() does not get called and gtk_widget is created. This CL adds code to handle this case and not assert in the GTK code called by RenderWidgetHostViewGtk::Destroy(). BUG=chromium-os:38047 TEST=content_browsertests do not assert on GTK. Review URL: https://chromiumcodereview.appspot.com/12213003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180870 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/media/encrypted_media_browsertest.cc32
-rw-r--r--content/browser/renderer_host/render_widget_host_view_gtk.cc36
2 files changed, 19 insertions, 49 deletions
diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc
index 77e15a0..45bd912 100644
--- a/content/browser/media/encrypted_media_browsertest.cc
+++ b/content/browser/media/encrypted_media_browsertest.cc
@@ -125,67 +125,35 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, InvalidKeySystem) {
"com.example.invalid", kExpected));
}
-#if defined(OS_LINUX) && !defined(NDEBUG)
-// http://crbug.com/174294; not using MAYBE_ because IN_PROC_BROWSER_TEST_P does
-// not expand the test name macro correctly, TODO(vabr, bauerb)
-IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, DISABLED_BasicPlayback_AudioOnly) {
-#else
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, BasicPlayback_AudioOnly) {
-#endif
const string16 kExpected = ASCIIToUTF16("ENDED");
ASSERT_NO_FATAL_FAILURE(
TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly,
GetParam(), kExpected));
}
-#if defined(OS_LINUX) && !defined(NDEBUG)
-// http://crbug.com/174294; not using MAYBE_ because IN_PROC_BROWSER_TEST_P does
-// not expand the test name macro correctly, TODO(vabr, bauerb)
-IN_PROC_BROWSER_TEST_P(EncryptedMediaTest,
- DISABLED_BasicPlayback_AudioClearVideo) {
-#else
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, BasicPlayback_AudioClearVideo) {
-#endif
const string16 kExpected = ASCIIToUTF16("ENDED");
ASSERT_NO_FATAL_FAILURE(
TestSimplePlayback("bear-320x240-av-enc_a.webm", kWebMAudioVideo,
GetParam(), kExpected));
}
-#if defined(OS_LINUX) && !defined(NDEBUG)
-// http://crbug.com/174294; not using MAYBE_ because IN_PROC_BROWSER_TEST_P does
-// not expand the test name macro correctly, TODO(vabr, bauerb)
-IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, DISABLED_BasicPlayback_VideoAudio) {
-#else
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, BasicPlayback_VideoAudio) {
-#endif
const string16 kExpected = ASCIIToUTF16("ENDED");
ASSERT_NO_FATAL_FAILURE(
TestSimplePlayback("bear-320x240-av-enc_av.webm", kWebMAudioVideo,
GetParam(), kExpected));
}
-#if defined(OS_LINUX) && !defined(NDEBUG)
-// http://crbug.com/174294; not using MAYBE_ because IN_PROC_BROWSER_TEST_P does
-// not expand the test name macro correctly, TODO(vabr, bauerb)
-IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, DISABLED_BasicPlayback_VideoOnly) {
-#else
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, BasicPlayback_VideoOnly) {
-#endif
const string16 kExpected = ASCIIToUTF16("ENDED");
ASSERT_NO_FATAL_FAILURE(
TestSimplePlayback("bear-320x240-v-enc_v.webm", kWebMVideoOnly,
GetParam(), kExpected));
}
-#if defined(OS_LINUX) && !defined(NDEBUG)
-// http://crbug.com/174294; not using MAYBE_ because IN_PROC_BROWSER_TEST_P does
-// not expand the test name macro correctly, TODO(vabr, bauerb)
-IN_PROC_BROWSER_TEST_P(EncryptedMediaTest,
- DISABLED_BasicPlayback_VideoClearAudio) {
-#else
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, BasicPlayback_VideoClearAudio) {
-#endif
const string16 kExpected = ASCIIToUTF16("ENDED");
ASSERT_NO_FATAL_FAILURE(
TestSimplePlayback("bear-320x240-av-enc_v.webm", kWebMAudioVideo,
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc
index e567dec..eb842d9 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -878,27 +878,29 @@ void RenderWidgetHostViewGtk::Destroy() {
gdk_display_keyboard_ungrab(display, GDK_CURRENT_TIME);
}
- // If this is a popup or fullscreen widget, then we need to destroy the window
- // that we created to hold it.
- if (IsPopup() || is_fullscreen_) {
- GtkWidget* window = gtk_widget_get_parent(view_.get());
+ if (view_.get()) {
+ // If this is a popup or fullscreen widget, then we need to destroy the
+ // window that we created to hold it.
+ if (IsPopup() || is_fullscreen_) {
+ GtkWidget* window = gtk_widget_get_parent(view_.get());
- ui::ActiveWindowWatcherX::RemoveObserver(this);
+ ui::ActiveWindowWatcherX::RemoveObserver(this);
- // Disconnect the destroy handler so that we don't try to shutdown twice.
- if (is_fullscreen_)
- g_signal_handler_disconnect(window, destroy_handler_id_);
+ // Disconnect the destroy handler so that we don't try to shutdown twice.
+ if (is_fullscreen_)
+ g_signal_handler_disconnect(window, destroy_handler_id_);
- gtk_widget_destroy(window);
- }
+ gtk_widget_destroy(window);
+ }
- // Remove |view_| from all containers now, so nothing else can hold a
- // reference to |view_|'s widget except possibly a gtk signal handler if
- // this code is currently executing within the context of a gtk signal
- // handler. Note that |view_| is still alive after this call. It will be
- // deallocated in the destructor.
- // See http://crbug.com/11847 for details.
- gtk_widget_destroy(view_.get());
+ // Remove |view_| from all containers now, so nothing else can hold a
+ // reference to |view_|'s widget except possibly a gtk signal handler if
+ // this code is currently executing within the context of a gtk signal
+ // handler. Note that |view_| is still alive after this call. It will be
+ // deallocated in the destructor.
+ // See http://crbug.com/11847 for details.
+ gtk_widget_destroy(view_.get());
+ }
// The RenderWidgetHost's destruction led here, so don't call it.
host_ = NULL;