Changeset 108631 in webkit
- Timestamp:
- Feb 23, 2012 8:38:02 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r108625 r108631 1 2012-02-23 Sergio Villar Senin <svillar@igalia.com> 2 3 [WK2][GTK] WebProcess SIGSEVs due to incorrect clipboard handling 4 https://bugs.webkit.org/show_bug.cgi?id=79252 5 6 Do not execute clipboard callbacks after the Frame associated with 7 it is destroyed. 8 9 This change is already covered by the TestWebViewEditor unit tests 10 (among others), they hang (because WebProcess dies) without this 11 patch in Debug builds. 12 13 * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: 14 (EditorClientFrameDestructionObserver): 15 (WebKit::EditorClientFrameDestructionObserver::EditorClientFrameDestructionObserver): 16 (WebKit::EditorClientFrameDestructionObserver::frameDestroyed): 17 (WebKit::EditorClientFrameDestructionObserver::destroyOnClosureFinalization): 18 (WebKit): 19 (WebKit::WebEditorClient::setSelectionPrimaryClipboardIfNeeded): 20 1 21 2012-02-23 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 22 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
r106000 r108631 22 22 23 23 #include "Frame.h" 24 #include "FrameDestructionObserver.h" 24 25 #include "PlatformKeyboardEvent.h" 25 26 #include "WebPage.h" … … 131 132 132 133 #if PLATFORM(X11) 134 class EditorClientFrameDestructionObserver : FrameDestructionObserver { 135 public: 136 EditorClientFrameDestructionObserver(Frame* frame, GClosure* closure) 137 : FrameDestructionObserver(frame) 138 , m_closure(closure) 139 { 140 g_closure_add_finalize_notifier(m_closure, this, destroyOnClosureFinalization); 141 } 142 143 void frameDestroyed() 144 { 145 g_closure_invalidate(m_closure); 146 FrameDestructionObserver::frameDestroyed(); 147 } 148 private: 149 GClosure* m_closure; 150 151 static void destroyOnClosureFinalization(gpointer data, GClosure* closure) { delete data; } 152 }; 153 133 154 static Frame* frameSettingClipboard; 155 134 156 static void collapseSelection(GtkClipboard* clipboard, Frame* frame) 135 157 { … … 157 179 frameSettingClipboard = frame; 158 180 GClosure* callback = g_cclosure_new(G_CALLBACK(collapseSelection), frame, 0); 181 // This observer will be self-destroyed on closure finalization, 182 // that will happen either after closure execution or after 183 // closure invalidation. 184 new EditorClientFrameDestructionObserver(frame, callback); 159 185 g_closure_set_marshal(callback, g_cclosure_marshal_VOID__VOID); 160 186 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard, PasteboardHelper::DoNotIncludeSmartPaste, callback);
Note: See TracChangeset
for help on using the changeset viewer.