Commit 3609c963 authored by kouhei@chromium.org's avatar kouhei@chromium.org

Flush form cache when next document is loaded to avoid Document leak.

This should fix a document leak from r270279.

BUG=392121

Review URL: https://codereview.chromium.org/380533003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282524 0039d316-1c4b-4281-b951-d872f2087c98
parent 63f02188
......@@ -180,6 +180,11 @@ void AutofillAgent::DidFinishDocumentLoad(WebLocalFrame* frame) {
ProcessForms(*frame);
}
void AutofillAgent::DidCommitProvisionalLoad(WebLocalFrame* frame,
bool is_new_navigation) {
form_cache_.ResetFrame(*frame);
}
void AutofillAgent::FrameDetached(WebFrame* frame) {
form_cache_.ResetFrame(*frame);
}
......
......@@ -59,6 +59,8 @@ class AutofillAgent : public content::RenderViewObserver,
// content::RenderViewObserver:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void DidFinishDocumentLoad(blink::WebLocalFrame* frame) OVERRIDE;
virtual void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
bool is_new_navigation) OVERRIDE;
virtual void FrameDetached(blink::WebFrame* frame) OVERRIDE;
virtual void FrameWillClose(blink::WebFrame* frame) OVERRIDE;
virtual void WillSubmitForm(blink::WebLocalFrame* frame,
......
......@@ -17,6 +17,6 @@ class InspectorMemoryTest(tab_test_case.TabTestCase):
self.Navigate('dom_counter_sample.html')
counts = self._tab.dom_stats
self.assertEqual(counts['document_count'], 2)
self.assertEqual(counts['node_count'], 18)
self.assertEqual(counts['document_count'], 1)
self.assertEqual(counts['node_count'], 14)
self.assertEqual(counts['event_listener_count'], 2)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment