summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 04:54:46 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 04:54:46 +0000
commit684970b638fbfe1a2137fd162f630c86d2859828 (patch)
treeb74fafda6801aa5c9e8746c230b8a2880a1de585 /net/base
parentc4deb899d3293782beeb8d83eefc226a5fb1813e (diff)
downloadchromium_src-684970b638fbfe1a2137fd162f630c86d2859828.zip
chromium_src-684970b638fbfe1a2137fd162f630c86d2859828.tar.gz
chromium_src-684970b638fbfe1a2137fd162f630c86d2859828.tar.bz2
LoadLog is used as an output parameter, reorder it to the last parameter.
Review URL: http://codereview.chromium.org/164531 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/host_resolver.cc8
-rw-r--r--net/base/host_resolver.h12
-rw-r--r--net/base/host_resolver_impl.cc6
-rw-r--r--net/base/host_resolver_impl.h6
-rw-r--r--net/base/host_resolver_impl_unittest.cc30
-rw-r--r--net/base/mock_host_resolver.cc8
-rw-r--r--net/base/mock_host_resolver.h6
7 files changed, 38 insertions, 38 deletions
diff --git a/net/base/host_resolver.cc b/net/base/host_resolver.cc
index 4208492..b953443 100644
--- a/net/base/host_resolver.cc
+++ b/net/base/host_resolver.cc
@@ -25,10 +25,10 @@ SingleRequestHostResolver::~SingleRequestHostResolver() {
}
}
-int SingleRequestHostResolver::Resolve(LoadLog* load_log,
- const HostResolver::RequestInfo& info,
+int SingleRequestHostResolver::Resolve(const HostResolver::RequestInfo& info,
AddressList* addresses,
- CompletionCallback* callback) {
+ CompletionCallback* callback,
+ LoadLog* load_log) {
DCHECK(!cur_request_ && !cur_request_callback_) << "resolver already in use";
HostResolver::RequestHandle request = NULL;
@@ -38,7 +38,7 @@ int SingleRequestHostResolver::Resolve(LoadLog* load_log,
CompletionCallback* transient_callback = callback ? &callback_ : NULL;
int rv = resolver_->Resolve(
- load_log, info, addresses, transient_callback, &request);
+ info, addresses, transient_callback, &request, load_log);
if (rv == ERR_IO_PENDING) {
// Cleared in OnResolveCompletion().
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h
index b6b4180..bc32c55 100644
--- a/net/base/host_resolver.h
+++ b/net/base/host_resolver.h
@@ -114,11 +114,11 @@ class HostResolver : public base::RefCounted<HostResolver> {
// This handle is not valid after the request has completed.
//
// Profiling information for the request is saved to |load_log| if non-NULL.
- virtual int Resolve(LoadLog* load_log,
- const RequestInfo& info,
+ virtual int Resolve(const RequestInfo& info,
AddressList* addresses,
CompletionCallback* callback,
- RequestHandle* out_req) = 0;
+ RequestHandle* out_req,
+ LoadLog* load_log) = 0;
// Cancels the specified request. |req| is the handle returned by Resolve().
// After a request is cancelled, its completion callback will not be called.
@@ -152,10 +152,10 @@ class SingleRequestHostResolver {
// Resolves the given hostname (or IP address literal), filling out the
// |addresses| object upon success. See HostResolver::Resolve() for details.
- int Resolve(LoadLog* load_log,
- const HostResolver::RequestInfo& info,
+ int Resolve(const HostResolver::RequestInfo& info,
AddressList* addresses,
- CompletionCallback* callback);
+ CompletionCallback* callback,
+ LoadLog* load_log);
private:
// Callback for when the request to |resolver_| completes, so we dispatch
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 20e57e5..eed116a 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -304,11 +304,11 @@ HostResolverImpl::~HostResolverImpl() {
// TODO(eroman): Don't create cache entries for hostnames which are simply IP
// address literals.
-int HostResolverImpl::Resolve(LoadLog* load_log,
- const RequestInfo& info,
+int HostResolverImpl::Resolve(const RequestInfo& info,
AddressList* addresses,
CompletionCallback* callback,
- RequestHandle* out_req) {
+ RequestHandle* out_req,
+ LoadLog* load_log) {
if (shutdown_)
return ERR_UNEXPECTED;
diff --git a/net/base/host_resolver_impl.h b/net/base/host_resolver_impl.h
index ede3d18..45c8841 100644
--- a/net/base/host_resolver_impl.h
+++ b/net/base/host_resolver_impl.h
@@ -57,11 +57,11 @@ class HostResolverImpl : public HostResolver {
virtual ~HostResolverImpl();
// HostResolver methods:
- virtual int Resolve(LoadLog* load_log,
- const RequestInfo& info,
+ virtual int Resolve(const RequestInfo& info,
AddressList* addresses,
CompletionCallback* callback,
- RequestHandle* out_req);
+ RequestHandle* out_req,
+ LoadLog* load_log);
virtual void CancelRequest(RequestHandle req);
virtual void AddObserver(Observer* observer);
virtual void RemoveObserver(Observer* observer);
diff --git a/net/base/host_resolver_impl_unittest.cc b/net/base/host_resolver_impl_unittest.cc
index c59e477..3fbf041 100644
--- a/net/base/host_resolver_impl_unittest.cc
+++ b/net/base/host_resolver_impl_unittest.cc
@@ -93,7 +93,7 @@ class ResolveRequest {
ALLOW_THIS_IN_INITIALIZER_LIST(
callback_(this, &ResolveRequest::OnLookupFinished)) {
// Start the request.
- int err = resolver->Resolve(NULL, info_, &addrlist_, &callback_, &req_);
+ int err = resolver->Resolve(info_, &addrlist_, &callback_, &req_, NULL);
EXPECT_EQ(net::ERR_IO_PENDING, err);
}
@@ -104,7 +104,7 @@ class ResolveRequest {
ALLOW_THIS_IN_INITIALIZER_LIST(
callback_(this, &ResolveRequest::OnLookupFinished)) {
// Start the request.
- int err = resolver->Resolve(NULL, info, &addrlist_, &callback_, &req_);
+ int err = resolver->Resolve(info, &addrlist_, &callback_, &req_, NULL);
EXPECT_EQ(net::ERR_IO_PENDING, err);
}
@@ -190,7 +190,7 @@ TEST_F(HostResolverImplTest, SynchronousLookup) {
net::HostResolver::RequestInfo info("just.testing", kPortnum);
scoped_refptr<LoadLog> log(new LoadLog);
- int err = host_resolver->Resolve(log, info, &adrlist, NULL, NULL);
+ int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, log);
EXPECT_EQ(net::OK, err);
EXPECT_EQ(2u, log->events().size());
@@ -222,7 +222,7 @@ TEST_F(HostResolverImplTest, AsynchronousLookup) {
net::HostResolver::RequestInfo info("just.testing", kPortnum);
scoped_refptr<LoadLog> log(new LoadLog);
- int err = host_resolver->Resolve(log, info, &adrlist, &callback_, NULL);
+ int err = host_resolver->Resolve(info, &adrlist, &callback_, NULL, log);
EXPECT_EQ(net::ERR_IO_PENDING, err);
EXPECT_EQ(1u, log->events().size());
@@ -260,7 +260,7 @@ TEST_F(HostResolverImplTest, CanceledAsynchronousLookup) {
const int kPortnum = 80;
net::HostResolver::RequestInfo info("just.testing", kPortnum);
- int err = host_resolver->Resolve(log, info, &adrlist, &callback_, NULL);
+ int err = host_resolver->Resolve(info, &adrlist, &callback_, NULL, log);
EXPECT_EQ(net::ERR_IO_PENDING, err);
// Make sure we will exit the queue even when callback is not called.
@@ -294,7 +294,7 @@ TEST_F(HostResolverImplTest, NumericIPv4Address) {
net::AddressList adrlist;
const int kPortnum = 5555;
net::HostResolver::RequestInfo info("127.1.2.3", kPortnum);
- int err = host_resolver->Resolve(NULL, info, &adrlist, NULL, NULL);
+ int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL);
EXPECT_EQ(net::OK, err);
const struct addrinfo* ainfo = adrlist.head();
@@ -319,7 +319,7 @@ TEST_F(HostResolverImplTest, NumericIPv6Address) {
net::AddressList adrlist;
const int kPortnum = 5555;
net::HostResolver::RequestInfo info("2001:db8::1", kPortnum);
- int err = host_resolver->Resolve(NULL, info, &adrlist, NULL, NULL);
+ int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL);
// On computers without IPv6 support, getaddrinfo cannot convert IPv6
// address literals to addresses (getaddrinfo returns EAI_NONAME). So this
// test has to allow host_resolver->Resolve to fail.
@@ -359,7 +359,7 @@ TEST_F(HostResolverImplTest, DISABLED_EmptyHost) {
net::AddressList adrlist;
const int kPortnum = 5555;
net::HostResolver::RequestInfo info("", kPortnum);
- int err = host_resolver->Resolve(NULL, info, &adrlist, NULL, NULL);
+ int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, NULL);
EXPECT_EQ(net::ERR_NAME_NOT_RESOLVED, err);
}
@@ -710,7 +710,7 @@ class BypassCacheVerifier : public ResolveRequest::Delegate {
net::AddressList addrlist;
net::HostResolver::RequestInfo info("a", 70);
- int error = resolver->Resolve(NULL, info, &addrlist, junk_callback, NULL);
+ int error = resolver->Resolve(info, &addrlist, junk_callback, NULL, NULL);
EXPECT_EQ(net::OK, error);
// Ok good. Now make sure that if we ask to bypass the cache, it can no
@@ -828,7 +828,7 @@ TEST_F(HostResolverImplTest, Observers) {
// Resolve "host1".
net::HostResolver::RequestInfo info1("host1", 70);
scoped_refptr<LoadLog> log(new LoadLog);
- int rv = host_resolver->Resolve(log, info1, &addrlist, NULL, NULL);
+ int rv = host_resolver->Resolve(info1, &addrlist, NULL, NULL, log);
EXPECT_EQ(net::OK, rv);
EXPECT_EQ(6u, log->events().size());
@@ -856,7 +856,7 @@ TEST_F(HostResolverImplTest, Observers) {
// Resolve "host1" again -- this time it will be served from cache, but it
// should still notify of completion.
TestCompletionCallback callback;
- rv = host_resolver->Resolve(NULL, info1, &addrlist, &callback, NULL);
+ rv = host_resolver->Resolve(info1, &addrlist, &callback, NULL, NULL);
ASSERT_EQ(net::OK, rv); // Should complete synchronously.
EXPECT_EQ(2U, observer.start_log.size());
@@ -870,7 +870,7 @@ TEST_F(HostResolverImplTest, Observers) {
// Resolve "host2", setting referrer to "http://foobar.com"
net::HostResolver::RequestInfo info2("host2", 70);
info2.set_referrer(GURL("http://foobar.com"));
- rv = host_resolver->Resolve(NULL, info2, &addrlist, NULL, NULL);
+ rv = host_resolver->Resolve(info2, &addrlist, NULL, NULL, NULL);
EXPECT_EQ(net::OK, rv);
EXPECT_EQ(3U, observer.start_log.size());
@@ -886,7 +886,7 @@ TEST_F(HostResolverImplTest, Observers) {
// Resolve "host3"
net::HostResolver::RequestInfo info3("host3", 70);
- host_resolver->Resolve(NULL, info3, &addrlist, NULL, NULL);
+ host_resolver->Resolve(info3, &addrlist, NULL, NULL, NULL);
// No effect this time, since observer was removed.
EXPECT_EQ(3U, observer.start_log.size());
@@ -916,7 +916,7 @@ TEST_F(HostResolverImplTest, CancellationObserver) {
net::HostResolver::RequestInfo info1("host1", 70);
net::HostResolver::RequestHandle req = NULL;
net::AddressList addrlist;
- int rv = host_resolver->Resolve(NULL, info1, &addrlist, &callback, &req);
+ int rv = host_resolver->Resolve(info1, &addrlist, &callback, &req, NULL);
EXPECT_EQ(net::ERR_IO_PENDING, rv);
EXPECT_TRUE(NULL != req);
@@ -939,7 +939,7 @@ TEST_F(HostResolverImplTest, CancellationObserver) {
// Start an async request for (host2:60)
net::HostResolver::RequestInfo info2("host2", 60);
- rv = host_resolver->Resolve(NULL, info2, &addrlist, &callback, NULL);
+ rv = host_resolver->Resolve(info2, &addrlist, &callback, NULL, NULL);
EXPECT_EQ(net::ERR_IO_PENDING, rv);
EXPECT_TRUE(NULL != req);
diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc
index eeabb39..3c09e15 100644
--- a/net/base/mock_host_resolver.cc
+++ b/net/base/mock_host_resolver.cc
@@ -42,16 +42,16 @@ MockHostResolverBase::MockHostResolverBase(bool use_caching)
Reset(NULL);
}
-int MockHostResolverBase::Resolve(LoadLog* load_log,
- const RequestInfo& info,
+int MockHostResolverBase::Resolve(const RequestInfo& info,
AddressList* addresses,
CompletionCallback* callback,
- RequestHandle* out_req) {
+ RequestHandle* out_req,
+ LoadLog* load_log) {
if (synchronous_mode_) {
callback = NULL;
out_req = NULL;
}
- return impl_->Resolve(load_log, info, addresses, callback, out_req);
+ return impl_->Resolve(info, addresses, callback, out_req, load_log);
}
void MockHostResolverBase::CancelRequest(RequestHandle req) {
diff --git a/net/base/mock_host_resolver.h b/net/base/mock_host_resolver.h
index 2dd97b9..548cd0a 100644
--- a/net/base/mock_host_resolver.h
+++ b/net/base/mock_host_resolver.h
@@ -41,11 +41,11 @@ class MockHostResolverBase : public HostResolver {
virtual ~MockHostResolverBase() {}
// HostResolver methods:
- virtual int Resolve(LoadLog* load_log,
- const RequestInfo& info,
+ virtual int Resolve(const RequestInfo& info,
AddressList* addresses,
CompletionCallback* callback,
- RequestHandle* out_req);
+ RequestHandle* out_req,
+ LoadLog* load_log);
virtual void CancelRequest(RequestHandle req);
virtual void AddObserver(Observer* observer);
virtual void RemoveObserver(Observer* observer);