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

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

Issue 10386144: Fixed a possible memory leak and support null pointers in AutomationEventObservers' NotifyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_event_observers.h" 5 #include "chrome/browser/automation/automation_event_observers.h"
6 #include "chrome/browser/chromeos/login/existing_user_controller.h" 6 #include "chrome/browser/chromeos/login/existing_user_controller.h"
7 7
8 LoginEventObserver::LoginEventObserver( 8 LoginEventObserver::LoginEventObserver(
9 AutomationEventQueue* event_queue, 9 AutomationEventQueue* event_queue,
10 chromeos::ExistingUserController* controller) 10 chromeos::ExistingUserController* controller)
(...skipping 11 matching lines...) Expand all
22 void LoginEventObserver::OnLoginSuccess(const std::string& username, 22 void LoginEventObserver::OnLoginSuccess(const std::string& username,
23 const std::string& password, 23 const std::string& password,
24 bool pending_requests, 24 bool pending_requests,
25 bool using_oauth) { 25 bool using_oauth) {
26 _NotifyLoginEvent(std::string()); 26 _NotifyLoginEvent(std::string());
27 } 27 }
28 28
29 void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) { 29 void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) {
30 DictionaryValue* dict = new DictionaryValue; 30 DictionaryValue* dict = new DictionaryValue;
31 dict->SetString("type", "login_event"); 31 dict->SetString("type", "login_event");
32 dict->SetInteger("observer_id", GetId());
33 if (error_string.length()) 32 if (error_string.length())
34 dict->SetString("error_string", error_string); 33 dict->SetString("error_string", error_string);
35 NotifyEvent(dict); 34 NotifyEvent(dict);
36 controller_->set_login_status_consumer(NULL); 35 controller_->set_login_status_consumer(NULL);
37 RemoveIfDone(); 36 RemoveIfDone();
38 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698