diff options
author | craigdh@chromium.org <craigdh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 18:45:10 +0000 |
---|---|---|
committer | craigdh@chromium.org <craigdh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 18:45:10 +0000 |
commit | 5522508c77da1a7e5063dbfb2105fbe5882b1827 (patch) | |
tree | b408f63eabde78061a1514975ea3a03eac6174b6 /chrome/browser/automation/automation_event_queue.cc | |
parent | 817ecd183fc100cc16931725ee7bfab0aeb792f3 (diff) | |
download | chromium_src-5522508c77da1a7e5063dbfb2105fbe5882b1827.zip chromium_src-5522508c77da1a7e5063dbfb2105fbe5882b1827.tar.gz chromium_src-5522508c77da1a7e5063dbfb2105fbe5882b1827.tar.bz2 |
Fixed a possible memory leak and support null pointers in AutomationEventObservers' NotifyEvent.
BUG=None
TEST=functional/apptest.py
Review URL: https://chromiumcodereview.appspot.com/10386144
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_event_queue.cc')
-rw-r--r-- | chrome/browser/automation/automation_event_queue.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_event_queue.cc b/chrome/browser/automation/automation_event_queue.cc index 469887e..411a969 100644 --- a/chrome/browser/automation/automation_event_queue.cc +++ b/chrome/browser/automation/automation_event_queue.cc @@ -4,6 +4,7 @@ #include <algorithm> +#include "base/logging.h" #include "chrome/browser/automation/automation_event_observers.h" #include "chrome/browser/automation/automation_event_queue.h" #include "chrome/browser/automation/automation_provider_json.h" @@ -74,6 +75,8 @@ AutomationEventQueue::AutomationEvent* AutomationEventQueue::PopEvent( void AutomationEventQueue::NotifyEvent( AutomationEventQueue::AutomationEvent* event) { + DCHECK(event); + VLOG(2) << "AutomationEventQueue::NotifyEvent id=" << event->GetId(); event_queue_.push_front(event); CheckReturnEvent(); } @@ -87,6 +90,7 @@ int AutomationEventQueue::AddObserver(AutomationEventObserver* observer) { bool AutomationEventQueue::RemoveObserver(int observer_id) { if (observers_.find(observer_id) != observers_.end()) { + VLOG(2) << "AutomationEventQueue::RemoveObserver id=" << observer_id; delete observers_[observer_id]; observers_.erase(observer_id); return true; |