diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-08 06:22:09 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-08 06:22:09 +0000 |
commit | f6028ee8661996ba41763a6601469ebd599480f5 (patch) | |
tree | 58dfa6354db85dd0a10c974dbbbac79ba341ba56 | |
parent | f0961cfdecddaaac9c89fb65c67ba3377d066043 (diff) | |
download | chromium_src-f6028ee8661996ba41763a6601469ebd599480f5.zip chromium_src-f6028ee8661996ba41763a6601469ebd599480f5.tar.gz chromium_src-f6028ee8661996ba41763a6601469ebd599480f5.tar.bz2 |
A temporary experiment to try to solve the autofill perf regression.
The goal is to see if registering a listener on the body of a document causes any perf regression.
Review URL: http://codereview.chromium.org/9724
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5062 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/webframeloaderclient_impl.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index 6c50037..3213bbf 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -14,6 +14,7 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "Document.h" #include "DocumentLoader.h" #include "Element.h" +#include "EventNames.h" #include "HistoryItem.h" #include "HTMLFormElement.h" // needed by FormState.h #include "HTMLFormControlElement.h" @@ -335,6 +336,11 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, } } +class TestBodyEventListener : public WebCore::EventListener { + virtual void handleEvent(Event* event, bool isWindowEvent) { + } +}; + void WebFrameLoaderClient::dispatchDidFinishDocumentLoad() { WebViewImpl* webview = webframe_->webview_impl(); WebViewDelegate* d = webview->delegate(); @@ -343,6 +349,18 @@ void WebFrameLoaderClient::dispatchDidFinishDocumentLoad() { PassRefPtr<WebCore::HTMLCollection> forms = webframe_->frame()->document()->forms(); + + // This is a temporary test to assess the performance impact of a body + // listener on the perf tests. + HTMLElement* body = webframe_->frame()->document()->body(); + TestBodyEventListener* body_listener = new TestBodyEventListener(); + body->addEventListener(WebCore::EventNames::DOMFocusOutEvent, + body_listener, + false); + body->addEventListener(WebCore::EventNames::inputEvent, + body_listener, + false); + std::vector<PasswordForm> actions; unsigned int form_count = forms->length(); for (unsigned int i = 0; i < form_count; ++i) { |