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

Side by Side Diff: chrome/browser/extensions/event_router.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 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/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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/storage/syncable_settings_storage.cc ('k') | chrome/browser/plugins/plugin_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698