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

Unified Diff: extensions/common/event_filtering_info.cc

Issue 2495213007: [Extensions] Use a separate IPC message for extension events (Closed)
Patch Set: lazyboys Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/event_filtering_info.h ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « extensions/common/event_filtering_info.h ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698