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

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: use non-zero tests until http://crbug.com/77650 is addressed. 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 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 AutomationProvider* provider, 1457 AutomationProvider* provider,
1458 IPC::Message* reply_message) 1458 IPC::Message* reply_message)
1459 : provider_(provider->AsWeakPtr()), 1459 : provider_(provider->AsWeakPtr()),
1460 reply_message_(reply_message) { 1460 reply_message_(reply_message) {
1461 } 1461 }
1462 1462
1463 AutomationProviderGetPasswordsObserver:: 1463 AutomationProviderGetPasswordsObserver::
1464 ~AutomationProviderGetPasswordsObserver() {} 1464 ~AutomationProviderGetPasswordsObserver() {}
1465 1465
1466 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( 1466 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone(
1467 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { 1467 CancelableRequestProvider::Handle handle,
1468 const std::vector<webkit_glue::PasswordForm*>& result) {
1468 if (!provider_) { 1469 if (!provider_) {
1469 delete this; 1470 delete this;
1470 return; 1471 return;
1471 } 1472 }
1472 1473
1473 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 1474 scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
1474 1475
1475 ListValue* passwords = new ListValue; 1476 ListValue* passwords = new ListValue;
1476 for (std::vector<webkit_glue::PasswordForm*>::const_iterator it = 1477 for (std::vector<webkit_glue::PasswordForm*>::const_iterator it =
1477 result.begin(); it != result.end(); ++it) { 1478 result.begin(); it != result.end(); ++it) {
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 this, 2052 this,
2052 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); 2053 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread));
2053 } 2054 }
2054 2055
2055 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { 2056 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() {
2056 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 2057 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2057 if (automation_) 2058 if (automation_)
2058 automation_->Send(reply_message_.release()); 2059 automation_->Send(reply_message_.release());
2059 Release(); 2060 Release();
2060 } 2061 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.h ('k') | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698