OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/event_bindings.h" | 5 #include "extensions/renderer/event_bindings.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // This method throws an exception if it returns false. | 208 // This method throws an exception if it returns false. |
209 if (!dispatcher_->CheckContextAccessToExtensionAPI(event_name, context())) | 209 if (!dispatcher_->CheckContextAccessToExtensionAPI(event_name, context())) |
210 return; | 210 return; |
211 | 211 |
212 std::string extension_id = context()->GetExtensionID(); | 212 std::string extension_id = context()->GetExtensionID(); |
213 | 213 |
214 scoped_ptr<base::DictionaryValue> filter; | 214 scoped_ptr<base::DictionaryValue> filter; |
215 scoped_ptr<content::V8ValueConverter> converter( | 215 scoped_ptr<content::V8ValueConverter> converter( |
216 content::V8ValueConverter::create()); | 216 content::V8ValueConverter::create()); |
217 | 217 |
218 base::DictionaryValue* filter_dict = NULL; | 218 base::DictionaryValue* filter_dict = nullptr; |
219 base::Value* filter_value = | 219 base::Value* filter_value = |
220 converter->FromV8Value(args[1]->ToObject(), context()->v8_context()); | 220 converter->FromV8Value(args[1]->ToObject(), context()->v8_context()); |
221 if (!filter_value) { | 221 if (!filter_value) { |
222 args.GetReturnValue().Set(static_cast<int32_t>(-1)); | 222 args.GetReturnValue().Set(static_cast<int32_t>(-1)); |
223 return; | 223 return; |
224 } | 224 } |
225 if (!filter_value->GetAsDictionary(&filter_dict)) { | 225 if (!filter_value->GetAsDictionary(&filter_dict)) { |
226 delete filter_value; | 226 delete filter_value; |
227 args.GetReturnValue().Set(static_cast<int32_t>(-1)); | 227 args.GetReturnValue().Set(static_cast<int32_t>(-1)); |
228 return; | 228 return; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 294 } |
295 | 295 |
296 scoped_ptr<EventMatcher> EventBindings::ParseEventMatcher( | 296 scoped_ptr<EventMatcher> EventBindings::ParseEventMatcher( |
297 base::DictionaryValue* filter_dict) { | 297 base::DictionaryValue* filter_dict) { |
298 return scoped_ptr<EventMatcher>(new EventMatcher( | 298 return scoped_ptr<EventMatcher>(new EventMatcher( |
299 scoped_ptr<base::DictionaryValue>(filter_dict->DeepCopy()), | 299 scoped_ptr<base::DictionaryValue>(filter_dict->DeepCopy()), |
300 context()->GetRenderView()->GetRoutingID())); | 300 context()->GetRenderView()->GetRoutingID())); |
301 } | 301 } |
302 | 302 |
303 } // namespace extensions | 303 } // namespace extensions |
OLD | NEW |