| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <queue> | 5 #include <queue> |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 Save(value); | 405 Save(value); |
| 406 } | 406 } |
| 407 | 407 |
| 408 void Save(const RecordParsed* value) { | 408 void Save(const RecordParsed* value) { |
| 409 set_ = true; | 409 set_ = true; |
| 410 name_ = value->name(); | 410 name_ = value->name(); |
| 411 ptrdomain_ = value->rdata<PtrRecordRdata>()->ptrdomain(); | 411 ptrdomain_ = value->rdata<PtrRecordRdata>()->ptrdomain(); |
| 412 ttl_ = value->ttl(); | 412 ttl_ = value->ttl(); |
| 413 } | 413 } |
| 414 | 414 |
| 415 bool IsRecordWith(std::string name, std::string ptrdomain) { | 415 bool IsRecordWith(const std::string& name, const std::string& ptrdomain) { |
| 416 return set_ && name_ == name && ptrdomain_ == ptrdomain; | 416 return set_ && name_ == name && ptrdomain_ == ptrdomain; |
| 417 } | 417 } |
| 418 | 418 |
| 419 const std::string& name() { return name_; } | 419 const std::string& name() { return name_; } |
| 420 const std::string& ptrdomain() { return ptrdomain_; } | 420 const std::string& ptrdomain() { return ptrdomain_; } |
| 421 int ttl() { return ttl_; } | 421 int ttl() { return ttl_; } |
| 422 | 422 |
| 423 private: | 423 private: |
| 424 bool set_; | 424 bool set_; |
| 425 std::string name_; | 425 std::string name_; |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 SendToInternal(sample_packet_, "224.0.0.251:5353", _)) | 1314 SendToInternal(sample_packet_, "224.0.0.251:5353", _)) |
| 1315 .Times(0); | 1315 .Times(0); |
| 1316 // Expect call for the second IPv6 packed. | 1316 // Expect call for the second IPv6 packed. |
| 1317 EXPECT_CALL(*socket_ipv6_, | 1317 EXPECT_CALL(*socket_ipv6_, |
| 1318 SendToInternal(sample_packet_, "[ff02::fb]:5353", _)) | 1318 SendToInternal(sample_packet_, "[ff02::fb]:5353", _)) |
| 1319 .WillOnce(Return(OK)); | 1319 .WillOnce(Return(OK)); |
| 1320 callback.Run(OK); | 1320 callback.Run(OK); |
| 1321 } | 1321 } |
| 1322 | 1322 |
| 1323 } // namespace net | 1323 } // namespace net |
| OLD | NEW |