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

Side by Side Diff: extensions/common/event_filtering_info.cc

Issue 140633003: Make EventFilteringInfo::IsEmpty() take has_instance_id_ into account. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698