OLD | NEW |
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/extensions/event_router.h" | 5 #include "chrome/browser/extensions/event_router.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ipc_sender->Send(new ExtensionMsg_MessageInvoke( | 136 ipc_sender->Send(new ExtensionMsg_MessageInvoke( |
137 MSG_ROUTING_CONTROL, | 137 MSG_ROUTING_CONTROL, |
138 extension_id, | 138 extension_id, |
139 "event_bindings", | 139 "event_bindings", |
140 "dispatchEvent", | 140 "dispatchEvent", |
141 args, | 141 args, |
142 user_gesture == USER_GESTURE_ENABLED)); | 142 user_gesture == USER_GESTURE_ENABLED)); |
143 | 143 |
144 // DispatchExtensionMessage does _not_ take ownership of event_args, so we | 144 // DispatchExtensionMessage does _not_ take ownership of event_args, so we |
145 // must ensure that the destruction of args does not attempt to free it. | 145 // must ensure that the destruction of args does not attempt to free it. |
146 Value* removed_event_args = NULL; | 146 scoped_ptr<Value> removed_event_args; |
147 args.Remove(1, &removed_event_args); | 147 args.Remove(1, &removed_event_args); |
| 148 ignore_result(removed_event_args.release()); |
148 } | 149 } |
149 | 150 |
150 // static | 151 // static |
151 void EventRouter::DispatchEvent(IPC::Sender* ipc_sender, | 152 void EventRouter::DispatchEvent(IPC::Sender* ipc_sender, |
152 void* profile_id, | 153 void* profile_id, |
153 const std::string& extension_id, | 154 const std::string& extension_id, |
154 const std::string& event_name, | 155 const std::string& event_name, |
155 scoped_ptr<ListValue> event_args, | 156 scoped_ptr<ListValue> event_args, |
156 UserGestureState user_gesture, | 157 UserGestureState user_gesture, |
157 const EventFilteringInfo& info) { | 158 const EventFilteringInfo& info) { |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 copy->will_dispatch_callback = will_dispatch_callback; | 861 copy->will_dispatch_callback = will_dispatch_callback; |
861 return copy; | 862 return copy; |
862 } | 863 } |
863 | 864 |
864 EventListenerInfo::EventListenerInfo(const std::string& event_name, | 865 EventListenerInfo::EventListenerInfo(const std::string& event_name, |
865 const std::string& extension_id) | 866 const std::string& extension_id) |
866 : event_name(event_name), | 867 : event_name(event_name), |
867 extension_id(extension_id) {} | 868 extension_id(extension_id) {} |
868 | 869 |
869 } // namespace extensions | 870 } // namespace extensions |
OLD | NEW |