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

Side by Side Diff: net/dns/record_parsed.cc

Issue 15733008: Multicast DNS implementation (initial) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mdns_implementation2
Patch Set: Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/dns/record_parsed.h" 5 #include "net/dns/record_parsed.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/dns/dns_response.h" 8 #include "net/dns/dns_response.h"
9 #include "net/dns/record_rdata.h" 9 #include "net/dns/record_rdata.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 RecordParsed::RecordParsed(const std::string& name, uint16 type, uint16 klass, 13 RecordParsed::RecordParsed(const std::string& name, uint16 type, uint16 klass,
14 uint32 ttl, scoped_ptr<const RecordRdata> rdata, 14 uint32 ttl, scoped_ptr<const RecordRdata> rdata,
15 base::Time time_created) 15 base::Time time_created)
16 : name_(name), type_(type), klass_(klass), ttl_(ttl), rdata_(rdata.Pass()), 16 : name_(name), type_(type), klass_(klass), ttl_(ttl), rdata_(rdata.Pass()),
17 time_created_(time_created) { 17 time_created_(time_created) {
18 } 18 }
19 19
20 scoped_ptr<const RecordParsed> RecordParsed::Clone() const {
21 return scoped_ptr<const RecordParsed>(new RecordParsed(
22 name_, type_, klass_, ttl_, rdata_->Clone(), time_created_));
23 }
24
20 RecordParsed::~RecordParsed() { 25 RecordParsed::~RecordParsed() {
21 } 26 }
22 27
23 // static 28 // static
24 scoped_ptr<const RecordParsed> RecordParsed::CreateFrom( 29 scoped_ptr<const RecordParsed> RecordParsed::CreateFrom(
25 DnsRecordParser* parser, 30 DnsRecordParser* parser,
26 base::Time time_created) { 31 base::Time time_created) {
27 DnsResourceRecord record; 32 DnsResourceRecord record;
28 scoped_ptr<const RecordRdata> rdata; 33 scoped_ptr<const RecordRdata> rdata;
29 34
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 klass &= dns_protocol::kMDnsClassMask; 79 klass &= dns_protocol::kMDnsClassMask;
75 other_klass &= dns_protocol::kMDnsClassMask; 80 other_klass &= dns_protocol::kMDnsClassMask;
76 } 81 }
77 82
78 return name_ == other->name_ && 83 return name_ == other->name_ &&
79 klass == other_klass && 84 klass == other_klass &&
80 type_ == other->type_ && 85 type_ == other->type_ &&
81 rdata_->IsEqual(other->rdata_.get()); 86 rdata_->IsEqual(other->rdata_.get());
82 } 87 }
83 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698