Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Side by Side Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review comments. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 AutomationProvider* provider, 1546 AutomationProvider* provider,
1547 IPC::Message* reply_message) 1547 IPC::Message* reply_message)
1548 : provider_(provider->AsWeakPtr()), 1548 : provider_(provider->AsWeakPtr()),
1549 reply_message_(reply_message) { 1549 reply_message_(reply_message) {
1550 } 1550 }
1551 1551
1552 AutomationProviderGetPasswordsObserver:: 1552 AutomationProviderGetPasswordsObserver::
1553 ~AutomationProviderGetPasswordsObserver() {} 1553 ~AutomationProviderGetPasswordsObserver() {}
1554 1554
1555 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( 1555 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone(
1556 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { 1556 PasswordStore::Handle handle,
1557 const std::vector<webkit_glue::PasswordForm*>& result) {
1557 if (!provider_) { 1558 if (!provider_) {
1558 delete this; 1559 delete this;
1559 return; 1560 return;
1560 } 1561 }
1561 1562
1562 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 1563 scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
1563 1564
1564 ListValue* passwords = new ListValue; 1565 ListValue* passwords = new ListValue;
1565 for (std::vector<webkit_glue::PasswordForm*>::const_iterator it = 1566 for (std::vector<webkit_glue::PasswordForm*>::const_iterator it =
1566 result.begin(); it != result.end(); ++it) { 1567 result.begin(); it != result.end(); ++it) {
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 this, 2141 this,
2141 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); 2142 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread));
2142 } 2143 }
2143 2144
2144 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { 2145 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() {
2145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 2146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2146 if (automation_) 2147 if (automation_)
2147 automation_->Send(reply_message_.release()); 2148 automation_->Send(reply_message_.release());
2148 Release(); 2149 Release();
2149 } 2150 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698