Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "extensions/common/event_filtering_info.h" | 5 #include "extensions/common/event_filtering_info.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 | 9 |
| 10 namespace extensions { | 10 namespace extensions { |
| 11 | 11 |
| 12 EventFilteringInfo::EventFilteringInfo() | 12 EventFilteringInfo::EventFilteringInfo() |
| 13 : has_url_(false), | 13 : has_url_(false), |
|
not at google - send to devlin
2014/01/16 23:58:59
having both a url_ and a has_url_ seems redundant.
lazyboy
2014/01/17 01:08:47
Seems this was checked in from the initial revisio
| |
| 14 has_instance_id_(false), | 14 has_instance_id_(false), |
| 15 instance_id_(0) { | 15 instance_id_(0) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 EventFilteringInfo::~EventFilteringInfo() { | 18 EventFilteringInfo::~EventFilteringInfo() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 void EventFilteringInfo::SetURL(const GURL& url) { | 21 void EventFilteringInfo::SetURL(const GURL& url) { |
| 22 url_ = url; | 22 url_ = url; |
| 23 has_url_ = true; | 23 has_url_ = true; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 39 if (has_instance_id_) | 39 if (has_instance_id_) |
| 40 result->SetInteger("instanceId", instance_id_); | 40 result->SetInteger("instanceId", instance_id_); |
| 41 | 41 |
| 42 if (!service_type_.empty()) | 42 if (!service_type_.empty()) |
| 43 result->SetString("serviceType", service_type_); | 43 result->SetString("serviceType", service_type_); |
| 44 | 44 |
| 45 return result.PassAs<base::Value>(); | 45 return result.PassAs<base::Value>(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool EventFilteringInfo::IsEmpty() const { | 48 bool EventFilteringInfo::IsEmpty() const { |
| 49 return !has_url_ && service_type_.empty(); | 49 return !has_url_ && service_type_.empty() && !has_instance_id_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace extensions | 52 } // namespace extensions |
| OLD | NEW |