Changeset 83375 in webkit
- Timestamp:
- Apr 9, 2011 1:01:20 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83373 r83375 1 2011-04-09 Sreeram Ramachandran <sreeram@google.com> 2 3 Reviewed by Ryosuke Niwa. 4 5 Gather data on modal dialogs shown during unload events 6 https://bugs.webkit.org/show_bug.cgi?id=58115 7 8 Add a new method to the ChromeClient API to allow clients to receive 9 notifications of modal dialogs dispatched during page dismissal events. 10 The new method has a default empty definition; only chromium overrides 11 it to keep track of histograms. 12 13 No tests because this is a no-op for all ports except chromium (and it's 14 not clear how to test chromium histograms from webkit). 15 16 * page/Chrome.cpp: 17 (WebCore::isDuringPageDismissal): 18 (WebCore::willRunModalDialog): 19 (WebCore::Chrome::runJavaScriptAlert): 20 (WebCore::Chrome::runJavaScriptConfirm): 21 (WebCore::Chrome::runJavaScriptPrompt): 22 (WebCore::Chrome::willRunModalHTMLDialog): 23 * page/Chrome.h: 24 * page/ChromeClient.h: 25 (WebCore::ChromeClient::willRunModalDialogDuringPageDismissal): 26 * page/DOMWindow.cpp: 27 (WebCore::DOMWindow::showModalDialog): 28 1 29 2011-04-08 David Humphrey <david.humphrey@senecac.on.ca> 2 30 -
trunk/Source/WebCore/page/Chrome.cpp
r80716 r83375 281 281 } 282 282 283 static inline void willRunModalDialog(const Frame* frame, const ChromeClient::DialogType& dialogType, const ChromeClient* client) 284 { 285 if (frame->loader()->pageDismissalEventBeingDispatched()) 286 client->willRunModalDialogDuringPageDismissal(dialogType); 287 } 288 283 289 void Chrome::runJavaScriptAlert(Frame* frame, const String& message) 284 290 { 291 willRunModalDialog(frame, ChromeClient::AlertDialog, m_client); 292 285 293 // Defer loads in case the client method runs a new event loop that would 286 294 // otherwise cause the load to continue while we're in the middle of executing JavaScript. … … 293 301 bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message) 294 302 { 303 willRunModalDialog(frame, ChromeClient::ConfirmDialog, m_client); 304 295 305 // Defer loads in case the client method runs a new event loop that would 296 306 // otherwise cause the load to continue while we're in the middle of executing JavaScript. … … 303 313 bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const String& defaultValue, String& result) 304 314 { 315 willRunModalDialog(frame, ChromeClient::PromptDialog, m_client); 316 305 317 // Defer loads in case the client method runs a new event loop that would 306 318 // otherwise cause the load to continue while we're in the middle of executing JavaScript. … … 548 560 } 549 561 562 void Chrome::willRunModalHTMLDialog(const Frame* frame) const 563 { 564 willRunModalDialog(frame, ChromeClient::HTMLDialog, m_client); 565 } 566 550 567 } // namespace WebCore -
trunk/Source/WebCore/page/Chrome.h
r80716 r83375 176 176 #endif 177 177 178 void willRunModalHTMLDialog(const Frame*) const; 179 178 180 private: 179 181 Page* m_page; -
trunk/Source/WebCore/page/ChromeClient.h
r82084 r83375 304 304 virtual void didCompleteRubberBandForMainFrame(const IntSize&) const { } 305 305 306 enum DialogType { 307 AlertDialog = 0, 308 ConfirmDialog = 1, 309 PromptDialog = 2, 310 HTMLDialog = 3, 311 NumDialogTypes = 4 312 }; 313 virtual void willRunModalDialogDuringPageDismissal(const DialogType&) const { } 314 306 315 protected: 307 316 virtual ~ChromeClient() { } -
trunk/Source/WebCore/page/DOMWindow.cpp
r81932 r83375 1839 1839 return; 1840 1840 1841 if (m_frame->page()) 1842 m_frame->page()->chrome()->willRunModalHTMLDialog(m_frame); 1843 1841 1844 if (!canShowModalDialogNow(m_frame) || !firstWindow->allowPopUp()) 1842 1845 return; -
trunk/Source/WebKit/chromium/ChangeLog
r83366 r83375 1 2011-04-09 Sreeram Ramachandran <sreeram@google.com> 2 3 Reviewed by Ryosuke Niwa. 4 5 Gather data on modal dialogs shown during unload events 6 https://bugs.webkit.org/show_bug.cgi?id=58115 7 8 Implementation of the new API to receive notifications of modal dialogs 9 dispatched during unload events. Count the notifications through a histogram. 10 11 No tests because it's not clear how to test chromium histograms from webkit. 12 13 * src/ChromeClientImpl.cpp: 14 (WebKit::ChromeClientImpl::willRunModalDialogDuringPageDismissal): 15 * src/ChromeClientImpl.h: 16 1 17 2011-04-08 Aaron Boodman <aa@chromium.org> 2 18 -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r82221 r83375 55 55 #include "NotificationPresenterImpl.h" 56 56 #include "Page.h" 57 #include "PlatformBridge.h" 57 58 #include "PopupMenuChromium.h" 58 59 #include "RenderWidget.h" … … 906 907 } 907 908 909 void ChromeClientImpl::willRunModalDialogDuringPageDismissal(const DialogType& dialogType) const 910 { 911 PlatformBridge::histogramEnumeration("Renderer.ModalDialogsDuringPageDismissal", static_cast<int>(dialogType), static_cast<int>(NumDialogTypes)); 912 } 913 908 914 } // namespace WebKit -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.h
r82221 r83375 192 192 #endif 193 193 194 virtual void willRunModalDialogDuringPageDismissal(const DialogType&) const; 195 194 196 private: 195 197 void getPopupMenuInfo(WebCore::PopupContainer*, WebPopupMenuInfo*);
Note: See TracChangeset
for help on using the changeset viewer.