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

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

Issue 1059843002: Refactor NetLog::LogLevel --> NetLogCaptureMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again to fix a merge conflict Created 5 years, 8 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 | « net/disk_cache/simple/simple_net_log_parameters.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | 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 "net/dns/dns_transaction.h" 5 #include "net/dns/dns_transaction.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 ++count; 52 ++count;
53 return count; 53 return count;
54 } 54 }
55 55
56 bool IsIPLiteral(const std::string& hostname) { 56 bool IsIPLiteral(const std::string& hostname) {
57 IPAddressNumber ip; 57 IPAddressNumber ip;
58 return ParseIPLiteralToNumber(hostname, &ip); 58 return ParseIPLiteralToNumber(hostname, &ip);
59 } 59 }
60 60
61 base::Value* NetLogStartCallback(const std::string* hostname, 61 base::Value* NetLogStartCallback(const std::string* hostname,
62 uint16 qtype, 62 uint16 qtype,
63 NetLog::LogLevel /* log_level */) { 63 NetLogCaptureMode /* capture_mode */) {
64 base::DictionaryValue* dict = new base::DictionaryValue(); 64 base::DictionaryValue* dict = new base::DictionaryValue();
65 dict->SetString("hostname", *hostname); 65 dict->SetString("hostname", *hostname);
66 dict->SetInteger("query_type", qtype); 66 dict->SetInteger("query_type", qtype);
67 return dict; 67 return dict;
68 }; 68 };
69 69
70 // ---------------------------------------------------------------------------- 70 // ----------------------------------------------------------------------------
71 71
72 // A single asynchronous DNS exchange, which consists of sending out a 72 // A single asynchronous DNS exchange, which consists of sending out a
73 // DNS query, waiting for a response, and returning the response that it 73 // DNS query, waiting for a response, and returning the response that it
(...skipping 17 matching lines...) Expand all
91 91
92 // Returns the net log bound to the source of the socket. 92 // Returns the net log bound to the source of the socket.
93 virtual const BoundNetLog& GetSocketNetLog() const = 0; 93 virtual const BoundNetLog& GetSocketNetLog() const = 0;
94 94
95 // Returns the index of the destination server within DnsConfig::nameservers. 95 // Returns the index of the destination server within DnsConfig::nameservers.
96 unsigned server_index() const { return server_index_; } 96 unsigned server_index() const { return server_index_; }
97 97
98 // Returns a Value representing the received response, along with a reference 98 // Returns a Value representing the received response, along with a reference
99 // to the NetLog source source of the UDP socket used. The request must have 99 // to the NetLog source source of the UDP socket used. The request must have
100 // completed before this is called. 100 // completed before this is called.
101 base::Value* NetLogResponseCallback(NetLog::LogLevel log_level) const { 101 base::Value* NetLogResponseCallback(NetLogCaptureMode capture_mode) const {
102 DCHECK(GetResponse()->IsValid()); 102 DCHECK(GetResponse()->IsValid());
103 103
104 base::DictionaryValue* dict = new base::DictionaryValue(); 104 base::DictionaryValue* dict = new base::DictionaryValue();
105 dict->SetInteger("rcode", GetResponse()->rcode()); 105 dict->SetInteger("rcode", GetResponse()->rcode());
106 dict->SetInteger("answer_count", GetResponse()->answer_count()); 106 dict->SetInteger("answer_count", GetResponse()->answer_count());
107 GetSocketNetLog().source().AddToEventParameters(dict); 107 GetSocketNetLog().source().AddToEventParameters(dict);
108 return dict; 108 return dict;
109 } 109 }
110 110
111 void set_result(int result) { 111 void set_result(int result) {
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 } // namespace 988 } // namespace
989 989
990 // static 990 // static
991 scoped_ptr<DnsTransactionFactory> DnsTransactionFactory::CreateFactory( 991 scoped_ptr<DnsTransactionFactory> DnsTransactionFactory::CreateFactory(
992 DnsSession* session) { 992 DnsSession* session) {
993 return scoped_ptr<DnsTransactionFactory>( 993 return scoped_ptr<DnsTransactionFactory>(
994 new DnsTransactionFactoryImpl(session)); 994 new DnsTransactionFactoryImpl(session));
995 } 995 }
996 996
997 } // namespace net 997 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_net_log_parameters.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698