summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/autofill/password_generation_manager.cc4
-rw-r--r--content/public/renderer/document_state.cc5
-rw-r--r--content/public/renderer/document_state.h2
-rw-r--r--content/renderer/render_view_impl.cc7
-rw-r--r--tools/valgrind/memcheck/suppressions.txt19
-rw-r--r--webkit/forms/password_form_dom_manager.cc6
-rw-r--r--webkit/forms/password_form_dom_manager.h3
7 files changed, 15 insertions, 31 deletions
diff --git a/chrome/renderer/autofill/password_generation_manager.cc b/chrome/renderer/autofill/password_generation_manager.cc
index 767e551..ef14059 100644
--- a/chrome/renderer/autofill/password_generation_manager.cc
+++ b/chrome/renderer/autofill/password_generation_manager.cc
@@ -165,10 +165,10 @@ WebKit::WebCString PasswordGenerationManager::imageNameForReadOnlyState() {
void PasswordGenerationManager::handleClick(WebKit::WebInputElement& element) {
gfx::Rect rect(element.decorationElementFor(this).boundsInViewportSpace());
- webkit::forms::PasswordForm* password_form(
+ scoped_ptr<webkit::forms::PasswordForm> password_form(
webkit::forms::PasswordFormDomManager::CreatePasswordForm(
element.form()));
- if (password_form) {
+ if (password_form.get()) {
Send(new AutofillHostMsg_ShowPasswordGenerationPopup(routing_id(),
rect,
element.maxLength(),
diff --git a/content/public/renderer/document_state.cc b/content/public/renderer/document_state.cc
index 9e71d7b..3636a7b 100644
--- a/content/public/renderer/document_state.cc
+++ b/content/public/renderer/document_state.cc
@@ -31,8 +31,9 @@ DocumentState::DocumentState()
DocumentState::~DocumentState() {}
-void DocumentState::set_password_form_data(webkit::forms::PasswordForm* data) {
- password_form_data_.reset(data);
+void DocumentState::set_password_form_data(
+ scoped_ptr<webkit::forms::PasswordForm> data) {
+ password_form_data_.reset(data.release());
}
void DocumentState::set_alt_error_page_fetcher(
diff --git a/content/public/renderer/document_state.h b/content/public/renderer/document_state.h
index 3d8d4f0..d47891c 100644
--- a/content/public/renderer/document_state.h
+++ b/content/public/renderer/document_state.h
@@ -177,7 +177,7 @@ class DocumentState : public WebKit::WebDataSource::ExtraData {
webkit::forms::PasswordForm* password_form_data() const {
return password_form_data_.get();
}
- void set_password_form_data(webkit::forms::PasswordForm* data);
+ void set_password_form_data(scoped_ptr<webkit::forms::PasswordForm> data);
const std::string& security_info() const { return security_info_; }
void set_security_info(const std::string& security_info) {
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 9639d2e..b32cfa0 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -2825,16 +2825,15 @@ void RenderViewImpl::willSubmitForm(WebFrame* frame,
document_state->set_searchable_form_url(web_searchable_form_data.url());
document_state->set_searchable_form_encoding(
web_searchable_form_data.encoding().utf8());
- PasswordForm* password_form_data =
+ scoped_ptr<PasswordForm> password_form_data =
PasswordFormDomManager::CreatePasswordForm(form);
- document_state->set_password_form_data(password_form_data);
// In order to save the password that the user actually typed and not one
// that may have gotten transformed by the site prior to submit, recover it
// from the form contents already stored by |willSendSubmitEvent| into the
// dataSource's NavigationState (as opposed to the provisionalDataSource's,
// which is what we're storing into now.)
- if (password_form_data) {
+ if (password_form_data.get()) {
DocumentState* old_document_state =
DocumentState::FromDataSource(frame->dataSource());
if (old_document_state) {
@@ -2844,6 +2843,8 @@ void RenderViewImpl::willSubmitForm(WebFrame* frame,
}
}
+ document_state->set_password_form_data(password_form_data.Pass());
+
FOR_EACH_OBSERVER(
RenderViewObserver, observers_, WillSubmitForm(frame, form));
}
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index 5bcbc26..9226571 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -5972,25 +5972,6 @@
fun:_ZN2pp25CompletionCallbackFactoryI15TestingInstanceNS_22ThreadSafeThreadTraitsEE12CallbackDataINS3_11Dispatcher0IMS1_FviEEEE5ThunkEPvi
}
{
- bug_145711
- Memcheck:Leak
- fun:_Znw*
- fun:_ZN6webkit5forms22PasswordFormDomManager18CreatePasswordFormERKN6WebKit14WebFormElementE
- fun:_ZN8autofill25PasswordGenerationManager11handleClickERN6WebKit15WebInputElementE
- fun:_ZN6WebKit22TextFieldDecoratorImpl11handleClickEPN7WebCore16HTMLInputElementE
- fun:_ZN7WebCore26TextFieldDecorationElement19defaultEventHandlerEPNS_5EventE
- fun:_ZN7WebCore15EventDispatcher24dispatchEventPostProcessEN3WTF10PassRefPtrINS_5EventEEEPv
- fun:_ZN7WebCore15EventDispatcher13dispatchEventEN3WTF10PassRefPtrINS_5EventEEE
-}
-{
- bug_145712
- Memcheck:Leak
- fun:_Znw*
- fun:_ZN6WebKit25NotificationPresenterImpl17requestPermissionEPN7WebCore22ScriptExecutionContextEN3WTF10PassRefPtrINS1_12VoidCallbackEEE
- fun:_ZN7WebCore18NotificationCenter17requestPermissionEN3WTF10PassRefPtrINS_12VoidCallbackEEE
- fun:_ZN7WebCore20V8NotificationCenter25requestPermissionCallbackERKN2v89ArgumentsE
-}
-{
bug_145723
Memcheck:Leak
fun:_Znw*
diff --git a/webkit/forms/password_form_dom_manager.cc b/webkit/forms/password_form_dom_manager.cc
index 5cf367d..9354598 100644
--- a/webkit/forms/password_form_dom_manager.cc
+++ b/webkit/forms/password_form_dom_manager.cc
@@ -22,12 +22,12 @@ PasswordFormFillData::PasswordFormFillData() : wait_for_username(false) {
PasswordFormFillData::~PasswordFormFillData() {
}
-PasswordForm* PasswordFormDomManager::CreatePasswordForm(
+scoped_ptr<PasswordForm> PasswordFormDomManager::CreatePasswordForm(
const WebFormElement& webform) {
WebPasswordFormData web_password_form(webform);
if (web_password_form.isValid())
- return new PasswordForm(web_password_form);
- return NULL;
+ return scoped_ptr<PasswordForm>(new PasswordForm(web_password_form));
+ return scoped_ptr<PasswordForm>();
}
// static
diff --git a/webkit/forms/password_form_dom_manager.h b/webkit/forms/password_form_dom_manager.h
index 7354ded..30abb74 100644
--- a/webkit/forms/password_form_dom_manager.h
+++ b/webkit/forms/password_form_dom_manager.h
@@ -7,6 +7,7 @@
#include <map>
+#include "base/memory/scoped_ptr.h"
#include "webkit/forms/form_data.h"
#include "webkit/forms/password_form.h"
#include "webkit/forms/webkit_forms_export.h"
@@ -43,7 +44,7 @@ class PasswordFormDomManager {
// custom metadata to DOM nodes, so we have to do this every time an event
// happens with a given form and compare against previously Create'd forms
// to identify..which sucks.
- WEBKIT_FORMS_EXPORT static PasswordForm* CreatePasswordForm(
+ WEBKIT_FORMS_EXPORT static scoped_ptr<PasswordForm> CreatePasswordForm(
const WebKit::WebFormElement& form);
// Create a FillData structure in preparation for autofilling a form,