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

Side by Side Diff: extensions/browser/api/socket/socket_api.cc

Issue 394103004: Move DnsApiTest.DnsResolveIPLiteral and DnsApiTest.DnsResolveHostname to app_shell_browsertests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: correcter gyp Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/api/socket/socket_api.h" 5 #include "extensions/browser/api/socket/socket_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool SocketExtensionWithDnsLookupFunction::PrePrepare() { 89 bool SocketExtensionWithDnsLookupFunction::PrePrepare() {
90 if (!SocketAsyncApiFunction::PrePrepare()) 90 if (!SocketAsyncApiFunction::PrePrepare())
91 return false; 91 return false;
92 resource_context_ = browser_context()->GetResourceContext(); 92 resource_context_ = browser_context()->GetResourceContext();
93 return resource_context_ != NULL; 93 return resource_context_ != NULL;
94 } 94 }
95 95
96 void SocketExtensionWithDnsLookupFunction::StartDnsLookup( 96 void SocketExtensionWithDnsLookupFunction::StartDnsLookup(
97 const std::string& hostname) { 97 const std::string& hostname) {
98 net::HostResolver* host_resolver = 98 net::HostResolver* host_resolver =
99 extensions::HostResolverWrapper::GetInstance()->GetHostResolver( 99 HostResolverWrapper::GetInstance()->GetHostResolver(resource_context_);
100 resource_context_->GetHostResolver());
101 DCHECK(host_resolver); 100 DCHECK(host_resolver);
102 101
103 // Yes, we are passing zero as the port. There are some interesting but not 102 // Yes, we are passing zero as the port. There are some interesting but not
104 // presently relevant reasons why HostResolver asks for the port of the 103 // presently relevant reasons why HostResolver asks for the port of the
105 // hostname you'd like to resolve, even though it doesn't use that value in 104 // hostname you'd like to resolve, even though it doesn't use that value in
106 // determining its answer. 105 // determining its answer.
107 net::HostPortPair host_port_pair(hostname, 0); 106 net::HostPortPair host_port_pair(hostname, 0);
108 107
109 net::HostResolver::RequestInfo request_info(host_port_pair); 108 net::HostResolver::RequestInfo request_info(host_port_pair);
110 int resolve_result = host_resolver->Resolve( 109 int resolve_result = host_resolver->Resolve(
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 return; 881 return;
883 } 882 }
884 883
885 base::ListValue* values = new base::ListValue(); 884 base::ListValue* values = new base::ListValue();
886 values->AppendStrings((std::vector<std::string>&)static_cast<UDPSocket*>( 885 values->AppendStrings((std::vector<std::string>&)static_cast<UDPSocket*>(
887 socket)->GetJoinedGroups()); 886 socket)->GetJoinedGroups());
888 SetResult(values); 887 SetResult(values);
889 } 888 }
890 889
891 } // namespace extensions 890 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/dns/mock_host_resolver_creator.cc ('k') | extensions/browser/api_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698