Index: chrome/browser/automation/automation_event_observers.cc |
diff --git a/chrome/browser/automation/automation_event_observers.cc b/chrome/browser/automation/automation_event_observers.cc |
index a2e05d326f6bb19eba2c0bbc6ab3c3c6d5d14366..8f2f5acd6d5245aed075e2003d0f3668bc13a650 100644 |
--- a/chrome/browser/automation/automation_event_observers.cc |
+++ b/chrome/browser/automation/automation_event_observers.cc |
@@ -29,10 +29,15 @@ AutomationEventObserver::~AutomationEventObserver() {} |
void AutomationEventObserver::NotifyEvent(DictionaryValue* value) { |
if (event_queue_) { |
dennis_jeffrey
2012/05/16 16:55:42
Will "value" get deleted on the "true" branch of t
craigdh
2012/05/16 17:00:55
Yes. On "true" the AutomationEventQueue takes owne
|
+ if (!value) |
+ value = new DictionaryValue; |
dennis_jeffrey
2012/05/16 16:55:42
Is this check needed? It looks like both callers
craigdh
2012/05/16 17:00:55
Right now NULL is not being passed, but is because
|
+ value->SetInteger("observer_id", GetId()); |
event_queue_->NotifyEvent( |
new AutomationEventQueue::AutomationEvent( |
GetId(), value)); |
event_count_++; |
+ } else if (value) { |
+ delete value; |
} |
} |
@@ -92,7 +97,6 @@ void DomEventObserver::Observe( |
DictionaryValue* dict = new DictionaryValue; |
dict->SetString("type", "raised_event"); |
dict->SetString("name", dom_op_details->json); |
- dict->SetInteger("observer_id", GetId()); |
NotifyEvent(dict); |
} |
} |