| Index: chrome/browser/extensions/extension_webrequest_api.cc
|
| diff --git a/chrome/browser/extensions/extension_webrequest_api.cc b/chrome/browser/extensions/extension_webrequest_api.cc
|
| index 481c0152450acd92665141281678e0cd0f137c14..9b619bfbb72c4327f784ddc4054c46b844151d0e 100644
|
| --- a/chrome/browser/extensions/extension_webrequest_api.cc
|
| +++ b/chrome/browser/extensions/extension_webrequest_api.cc
|
| @@ -412,6 +412,9 @@ struct ExtensionWebRequestEventRouter::BlockedRequest {
|
|
|
| bool ExtensionWebRequestEventRouter::RequestFilter::InitFromValue(
|
| const DictionaryValue& value, std::string* error) {
|
| + if (!value.HasKey("urls"))
|
| + return false;
|
| +
|
| for (DictionaryValue::key_iterator key = value.begin_keys();
|
| key != value.end_keys(); ++key) {
|
| if (*key == "urls") {
|
| @@ -1489,16 +1492,14 @@ bool WebRequestAddEventListener::RunImpl() {
|
| // Argument 0 is the callback, which we don't use here.
|
|
|
| ExtensionWebRequestEventRouter::RequestFilter filter;
|
| - if (HasOptionalArgument(1)) {
|
| - DictionaryValue* value = NULL;
|
| - error_.clear();
|
| - EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &value));
|
| - // Failure + an empty error string means a fatal error.
|
| - EXTENSION_FUNCTION_VALIDATE(filter.InitFromValue(*value, &error_) ||
|
| - !error_.empty());
|
| - if (!error_.empty())
|
| - return false;
|
| - }
|
| + DictionaryValue* value = NULL;
|
| + error_.clear();
|
| + EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &value));
|
| + // Failure + an empty error string means a fatal error.
|
| + EXTENSION_FUNCTION_VALIDATE(filter.InitFromValue(*value, &error_) ||
|
| + !error_.empty());
|
| + if (!error_.empty())
|
| + return false;
|
|
|
| int extra_info_spec = 0;
|
| if (HasOptionalArgument(2)) {
|
|
|