Skip to content

Commit

Permalink
net: rename BoundNetLog to NetLogWithSource
Browse files Browse the repository at this point in the history
Patch generated by the following command line:

$ g grep -l BoundNetLog | xargs perl -pi -e 's/BoundNetLog/NetLogWithSource/g'

BUG=475260
TEST=net_unittests
R=eroman@chromium.org
TBR=dtrainor,thestig,oshima,sdefresne,avi,rockot,rogerta,sergeyu

Review-Url: https://codereview.chromium.org/2351513002
Cr-Commit-Position: refs/heads/master@{#420320}
  • Loading branch information
tfarina authored and Commit bot committed Sep 22, 2016
1 parent 0fccab7 commit 4283411
Show file tree
Hide file tree
Showing 426 changed files with 3,153 additions and 2,985 deletions.
2 changes: 1 addition & 1 deletion blimp/net/exact_match_cert_verifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int ExactMatchCertVerifier::Verify(const RequestParams& params,
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
std::unique_ptr<Request>* out_req,
const net::BoundNetLog& net_log) {
const net::NetLogWithSource& net_log) {
verify_result->Reset();
verify_result->verified_cert = engine_cert_;

Expand Down
2 changes: 1 addition & 1 deletion blimp/net/exact_match_cert_verifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BLIMP_NET_EXPORT ExactMatchCertVerifier : public net::CertVerifier {
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
std::unique_ptr<Request>* out_req,
const net::BoundNetLog& net_log) override;
const net::NetLogWithSource& net_log) override;

private:
scoped_refptr<net::X509Certificate> engine_cert_;
Expand Down
2 changes: 1 addition & 1 deletion blimp/net/test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class MockStreamSocket : public net::StreamSocket {
MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*));
MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*));
MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&());
MOCK_CONST_METHOD0(NetLog, const net::NetLogWithSource&());
MOCK_METHOD0(SetSubresourceSpeculation, void());
MOCK_METHOD0(SetOmniboxSpeculation, void());
MOCK_CONST_METHOD0(WasEverUsed, bool());
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/policy/policy_cert_verifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int PolicyCertVerifier::Verify(
net::CertVerifyResult* verify_result,
const net::CompletionCallback& completion_callback,
std::unique_ptr<Request>* out_req,
const net::BoundNetLog& net_log) {
const net::NetLogWithSource& net_log) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
DCHECK(delegate_);
net::CompletionCallback wrapped_callback =
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/policy/policy_cert_verifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PolicyCertVerifier : public net::CertVerifier {
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
std::unique_ptr<Request>* out_req,
const net::BoundNetLog& net_log) override;
const net::NetLogWithSource& net_log) override;

bool SupportsOCSPStapling() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PolicyCertVerifierTest : public testing::Test {
std::string(), net::CertificateList()),
nullptr, verify_result,
test_callback.callback(), request,
net::BoundNetLog());
net::NetLogWithSource());
}

bool SupportsAdditionalTrustAnchors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class SocketTunnel : public base::NonThreadSafe {
int result = host_resolver_->Resolve(
request_info, net::DEFAULT_PRIORITY, &address_list_,
base::Bind(&SocketTunnel::OnResolved, base::Unretained(this)),
&request_, net::BoundNetLog());
&request_, net::NetLogWithSource());
if (result != net::ERR_IO_PENDING)
OnResolved(result);
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/devtools/device/tcp_device_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ResolveHostAndOpenSocket final {
request_info, net::DEFAULT_PRIORITY, &address_list_,
base::Bind(&ResolveHostAndOpenSocket::OnResolved,
base::Unretained(this)),
&request_, net::BoundNetLog());
&request_, net::NetLogWithSource());
if (result != net::ERR_IO_PENDING)
OnResolved(result);
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/devtools/device/usb/android_usb_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int AndroidUsbSocket::GetLocalAddress(net::IPEndPoint* address) const {
return net::ERR_NOT_IMPLEMENTED;
}

const net::BoundNetLog& AndroidUsbSocket::NetLog() const {
const net::NetLogWithSource& AndroidUsbSocket::NetLog() const {
return net_log_;
}

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/devtools/device/usb/android_usb_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AndroidUsbSocket : public net::StreamSocket,
bool IsConnectedAndIdle() const override;
int GetPeerAddress(net::IPEndPoint* address) const override;
int GetLocalAddress(net::IPEndPoint* address) const override;
const net::BoundNetLog& NetLog() const override;
const net::NetLogWithSource& NetLog() const override;
void SetSubresourceSpeculation() override;
void SetOmniboxSpeculation() override;
bool WasEverUsed() const override;
Expand All @@ -68,7 +68,7 @@ class AndroidUsbSocket : public net::StreamSocket,
std::string command_;
uint32_t local_id_;
uint32_t remote_id_;
net::BoundNetLog net_log_;
net::NetLogWithSource net_log_;
bool is_connected_;
std::string read_buffer_;
scoped_refptr<net::IOBuffer> read_io_buffer_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class DevToolsNetworkControllerHelper {
request_->upload_data_stream = upload_data_stream_.get();
}

int rv = transaction_->Start(
request_.get(), completion_callback_, net::BoundNetLog());
int rv = transaction_->Start(request_.get(), completion_callback_,
net::NetLogWithSource());
EXPECT_EQ(with_upload, !!transaction_->custom_upload_data_stream_);
return rv;
}
Expand Down Expand Up @@ -127,7 +127,7 @@ class DevToolsNetworkControllerHelper {

int ReadUploadData() {
EXPECT_EQ(net::OK, transaction_->custom_upload_data_stream_->Init(
completion_callback_, net::BoundNetLog()));
completion_callback_, net::NetLogWithSource()));
return transaction_->custom_upload_data_stream_->Read(
buffer_.get(), 64, completion_callback_);
}
Expand Down
7 changes: 3 additions & 4 deletions chrome/browser/devtools/devtools_network_transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ bool DevToolsNetworkTransaction::CheckFailed() {
return false;
}

int DevToolsNetworkTransaction::Start(
const net::HttpRequestInfo* request,
const net::CompletionCallback& callback,
const net::BoundNetLog& net_log) {
int DevToolsNetworkTransaction::Start(const net::HttpRequestInfo* request,
const net::CompletionCallback& callback,
const net::NetLogWithSource& net_log) {
DCHECK(request);
request_ = request;

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/devtools/devtools_network_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class GURL;

namespace net {
class AuthCredentials;
class BoundNetLog;
class NetLogWithSource;
class HttpRequestHeaders;
struct HttpRequestInfo;
class HttpResponseInfo;
Expand Down Expand Up @@ -58,7 +58,7 @@ class DevToolsNetworkTransaction
// HttpTransaction methods:
int Start(const net::HttpRequestInfo* request,
const net::CompletionCallback& callback,
const net::BoundNetLog& net_log) override;
const net::NetLogWithSource& net_log) override;
int RestartIgnoringLastError(
const net::CompletionCallback& callback) override;
int RestartWithCertificate(net::X509Certificate* client_cert,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bool DevToolsNetworkUploadDataStream::IsInMemory() const {
}

int DevToolsNetworkUploadDataStream::InitInternal(
const net::BoundNetLog& net_log) {
const net::NetLogWithSource& net_log) {
throttled_byte_count_ = 0;
int result = upload_data_stream_->Init(
base::Bind(&DevToolsNetworkUploadDataStream::StreamInitCallback,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DevToolsNetworkUploadDataStream : public net::UploadDataStream {
private:
// net::UploadDataStream implementation.
bool IsInMemory() const override;
int InitInternal(const net::BoundNetLog& net_log) override;
int InitInternal(const net::NetLogWithSource& net_log) override;
int ReadInternal(net::IOBuffer* buf, int buf_len) override;
void ResetInternal() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PrivetV3ContextGetter::CertVerifier : public net::CertVerifier {
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
std::unique_ptr<Request>* out_req,
const net::BoundNetLog& net_log) override {
const net::NetLogWithSource& net_log) override {
verify_result->Reset();
verify_result->verified_cert = params.certificate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void VerifyTrustAPI::IOPart::Verify(std::unique_ptr<Params> params,

std::unique_ptr<net::CertVerifyResult> verify_result(
new net::CertVerifyResult);
std::unique_ptr<net::BoundNetLog> net_log(new net::BoundNetLog);
std::unique_ptr<net::NetLogWithSource> net_log(new net::NetLogWithSource);
const int flags = 0;

std::string ocsp_response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MockTCPClientSocket : public net::TCPClientSocket {
MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*));
MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*));
MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&());
MOCK_CONST_METHOD0(NetLog, const net::NetLogWithSource&());
MOCK_METHOD0(SetSubresourceSpeculation, void());
MOCK_METHOD0(SetOmniboxSpeculation, void());
MOCK_CONST_METHOD0(WasEverUsed, bool());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MockSSLClientSocket : public net::SSLClientSocket {
MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*));
MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*));
MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&());
MOCK_CONST_METHOD0(NetLog, const net::NetLogWithSource&());
MOCK_METHOD0(SetSubresourceSpeculation, void());
MOCK_METHOD0(SetOmniboxSpeculation, void());
MOCK_CONST_METHOD0(WasEverUsed, bool());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ TEST(ExtensionWebRequestHelpersTest, TestCalculateOnAuthRequiredDelta) {
TEST(ExtensionWebRequestHelpersTest, TestMergeCancelOfResponses) {
EventResponseDeltas deltas;
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
bool canceled = false;

// Single event that does not cancel.
Expand All @@ -1573,7 +1573,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeCancelOfResponses) {
TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
EventResponseDeltas deltas;
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
GURL effective_new_url;

Expand Down Expand Up @@ -1654,7 +1654,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
EventResponseDeltas deltas;
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
GURL effective_new_url;

Expand Down Expand Up @@ -1723,7 +1723,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses3) {
EventResponseDeltas deltas;
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
GURL effective_new_url;

Expand Down Expand Up @@ -1759,7 +1759,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
base_headers.SetHeader("key1", "value 1");
base_headers.SetHeader("key2", "value 2");
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
std::string header_value;
EventResponseDeltas deltas;
Expand Down Expand Up @@ -1855,7 +1855,7 @@ TEST(ExtensionWebRequestHelpersTest,
base_headers.AddHeaderFromString(
"Cookie: name=value; name2=value2; name3=\"value3\"");
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
std::string header_value;
EventResponseDeltas deltas;
Expand Down Expand Up @@ -1939,7 +1939,7 @@ std::string GetCookieExpirationDate(int delta_secs) {
TEST(ExtensionWebRequestHelpersTest,
TestMergeCookiesInOnHeadersReceivedResponses) {
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
std::string header_value;
EventResponseDeltas deltas;
Expand Down Expand Up @@ -2174,7 +2174,7 @@ TEST(ExtensionWebRequestHelpersTest,

TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
std::string header_value;
EventResponseDeltas deltas;
Expand Down Expand Up @@ -2274,7 +2274,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
TEST(ExtensionWebRequestHelpersTest,
TestMergeOnHeadersReceivedResponsesDeletion) {
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
std::string header_value;
EventResponseDeltas deltas;
Expand Down Expand Up @@ -2328,7 +2328,7 @@ TEST(ExtensionWebRequestHelpersTest,
TestMergeOnHeadersReceivedResponsesRedirect) {
EventResponseDeltas deltas;
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;

char base_headers_string[] =
Expand Down Expand Up @@ -2381,7 +2381,7 @@ TEST(ExtensionWebRequestHelpersTest,

TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) {
net::BoundTestNetLog capturing_net_log;
net::BoundNetLog net_log = capturing_net_log.bound();
net::NetLogWithSource net_log = capturing_net_log.bound();
WarningSet warning_set;
EventResponseDeltas deltas;
base::string16 username = base::ASCIIToUTF16("foo");
Expand Down
13 changes: 7 additions & 6 deletions chrome/browser/loader/safe_browsing_resource_throttle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ SafeBrowsingResourceThrottle::SafeBrowsingResourceThrottle(
ui_manager_(sb_service->ui_manager()),
request_(request),
resource_type_(resource_type),
bound_net_log_(net::BoundNetLog::Make(request->net_log().net_log(),
NetLogSourceType::SAFE_BROWSING)) {}
net_log_with_source_(
net::NetLogWithSource::Make(request->net_log().net_log(),
NetLogSourceType::SAFE_BROWSING)) {}

SafeBrowsingResourceThrottle::~SafeBrowsingResourceThrottle() {
if (defer_state_ != DEFERRED_NONE) {
Expand All @@ -116,19 +117,19 @@ void SafeBrowsingResourceThrottle::BeginNetLogEvent(NetLogEventType type,
const GURL& url,
const char* name,
const char* value) {
bound_net_log_.BeginEvent(
net_log_with_source_.BeginEvent(
type, base::Bind(&NetLogUrlCallback, request_, url, name, value));
request_->net_log().AddEvent(
type, bound_net_log_.source().ToEventParametersCallback());
type, net_log_with_source_.source().ToEventParametersCallback());
}

void SafeBrowsingResourceThrottle::EndNetLogEvent(NetLogEventType type,
const char* name,
const char* value) {
bound_net_log_.EndEvent(
net_log_with_source_.EndEvent(
type, base::Bind(&NetLogStringCallback, name, value));
request_->net_log().AddEvent(
type, bound_net_log_.source().ToEventParametersCallback());
type, net_log_with_source_.source().ToEventParametersCallback());
}

void SafeBrowsingResourceThrottle::WillStartRequest(bool* defer) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/loader/safe_browsing_resource_throttle.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class SafeBrowsingResourceThrottle
scoped_refptr<safe_browsing::SafeBrowsingUIManager> ui_manager_;
const net::URLRequest* request_;
const content::ResourceType resource_type_;
net::BoundNetLog bound_net_log_;
net::NetLogWithSource net_log_with_source_;

DISALLOW_COPY_AND_ASSIGN(SafeBrowsingResourceThrottle);
};
Expand Down
7 changes: 3 additions & 4 deletions chrome/browser/net/dns_probe_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
using base::TimeDelta;
using content::BrowserThread;
using net::AddressList;
using net::BoundNetLog;
using net::DnsClient;
using net::DnsResponse;
using net::DnsTransaction;
using net::DnsTransactionFactory;
using net::IPEndPoint;
using net::NetLog;
using net::NetLogWithSource;
using net::NetworkChangeNotifier;

namespace chrome_browser_net {
Expand Down Expand Up @@ -107,11 +107,10 @@ void DnsProbeRunner::RunProbe(const base::Closure& callback) {
}

transaction_ = factory->CreateTransaction(
kKnownGoodHostname,
net::dns_protocol::kTypeA,
kKnownGoodHostname, net::dns_protocol::kTypeA,
base::Bind(&DnsProbeRunner::OnTransactionComplete,
weak_factory_.GetWeakPtr()),
BoundNetLog());
NetLogWithSource());

transaction_->Start();
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/net/predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ bool Predictor::WouldLikelyProxyURL(const GURL& url) {

net::ProxyInfo info;
bool synchronous_success = proxy_service_->TryResolveProxySynchronously(
url, std::string(), &info, nullptr, net::BoundNetLog());
url, std::string(), &info, nullptr, net::NetLogWithSource());

return synchronous_success && !info.is_direct();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ void NetInternalsTest::MessageHandler::GetNetLogFileContents(
nullptr);
g_browser_process->net_log()->AddGlobalEntry(
net::NetLogEventType::NETWORK_IP_ADDRESSES_CHANGED);
net::BoundNetLog bound_net_log = net::BoundNetLog::Make(
net::NetLogWithSource net_log_with_source = net::NetLogWithSource::Make(
g_browser_process->net_log(), net::NetLogSourceType::URL_REQUEST);
bound_net_log.BeginEvent(net::NetLogEventType::REQUEST_ALIVE);
net_log_with_source.BeginEvent(net::NetLogEventType::REQUEST_ALIVE);
net_log_logger->StopObserving(nullptr);
net_log_logger.reset();

Expand Down
Loading

0 comments on commit 4283411

Please sign in to comment.