| Index: extensions/common/event_filtering_info.cc
|
| diff --git a/extensions/common/event_filtering_info.cc b/extensions/common/event_filtering_info.cc
|
| index 0f2c7230a2f07618d228104c2d69f1ca1ed0d487..4770d9e95227a951ef3ef9b0de41926115a5b69c 100644
|
| --- a/extensions/common/event_filtering_info.cc
|
| +++ b/extensions/common/event_filtering_info.cc
|
| @@ -7,6 +7,7 @@
|
| #include <utility>
|
|
|
| #include "base/json/json_writer.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/values.h"
|
|
|
| namespace extensions {
|
| @@ -44,11 +45,8 @@ void EventFilteringInfo::SetInstanceID(int instance_id) {
|
| has_instance_id_ = true;
|
| }
|
|
|
| -std::unique_ptr<base::Value> EventFilteringInfo::AsValue() const {
|
| - if (IsEmpty())
|
| - return base::Value::CreateNullValue();
|
| -
|
| - std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue);
|
| +std::unique_ptr<base::DictionaryValue> EventFilteringInfo::AsValue() const {
|
| + auto result = base::MakeUnique<base::DictionaryValue>();
|
| if (has_url_)
|
| result->SetString("url", url_.spec());
|
|
|
| @@ -64,12 +62,7 @@ std::unique_ptr<base::Value> EventFilteringInfo::AsValue() const {
|
| if (has_window_exposed_by_default_)
|
| result->SetBoolean("windowExposedByDefault", window_exposed_by_default_);
|
|
|
| - return std::move(result);
|
| -}
|
| -
|
| -bool EventFilteringInfo::IsEmpty() const {
|
| - return !has_window_type_ && !has_url_ && service_type_.empty() &&
|
| - !has_instance_id_ && !has_window_exposed_by_default_;
|
| + return result;
|
| }
|
|
|
| } // namespace extensions
|
|
|