| Index: components/cronet/android/url_request_context_adapter.cc
|
| diff --git a/components/cronet/android/url_request_context_peer.cc b/components/cronet/android/url_request_context_adapter.cc
|
| similarity index 86%
|
| rename from components/cronet/android/url_request_context_peer.cc
|
| rename to components/cronet/android/url_request_context_adapter.cc
|
| index 84b369e4b401a23ad68350050acebcf482a9f27e..0feb0f13e4ad825768ca041f4665061cfcafeba8 100644
|
| --- a/components/cronet/android/url_request_context_peer.cc
|
| +++ b/components/cronet/android/url_request_context_adapter.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "components/cronet/android/url_request_context_peer.h"
|
| +#include "components/cronet/android/url_request_context_adapter.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/file_util.h"
|
| @@ -94,8 +94,8 @@ class BasicNetworkDelegate : public net::NetworkDelegate {
|
| return false;
|
| }
|
|
|
| - virtual bool OnCanThrottleRequest(const net::URLRequest& request)
|
| - const OVERRIDE {
|
| + virtual bool OnCanThrottleRequest(
|
| + const net::URLRequest& request) const OVERRIDE {
|
| return false;
|
| }
|
|
|
| @@ -112,14 +112,14 @@ class BasicNetworkDelegate : public net::NetworkDelegate {
|
|
|
| namespace cronet {
|
|
|
| -URLRequestContextPeer::URLRequestContextPeer(
|
| - URLRequestContextPeerDelegate* delegate,
|
| +URLRequestContextAdapter::URLRequestContextAdapter(
|
| + URLRequestContextAdapterDelegate* delegate,
|
| std::string user_agent) {
|
| delegate_ = delegate;
|
| user_agent_ = user_agent;
|
| }
|
|
|
| -void URLRequestContextPeer::Initialize(
|
| +void URLRequestContextAdapter::Initialize(
|
| scoped_ptr<URLRequestContextConfig> config) {
|
| network_thread_ = new base::Thread("network");
|
| base::Thread::Options options;
|
| @@ -128,12 +128,12 @@ void URLRequestContextPeer::Initialize(
|
|
|
| GetNetworkTaskRunner()->PostTask(
|
| FROM_HERE,
|
| - base::Bind(&URLRequestContextPeer::InitializeURLRequestContext,
|
| + base::Bind(&URLRequestContextAdapter::InitializeURLRequestContext,
|
| this,
|
| Passed(&config)));
|
| }
|
|
|
| -void URLRequestContextPeer::InitializeURLRequestContext(
|
| +void URLRequestContextAdapter::InitializeURLRequestContext(
|
| scoped_ptr<URLRequestContextConfig> config) {
|
| // TODO(mmenke): Add method to have the builder enable SPDY.
|
| net::URLRequestContextBuilder context_builder;
|
| @@ -153,7 +153,7 @@ void URLRequestContextPeer::InitializeURLRequestContext(
|
| delegate_->OnContextInitialized(this);
|
| }
|
|
|
| -URLRequestContextPeer::~URLRequestContextPeer() {
|
| +URLRequestContextAdapter::~URLRequestContextAdapter() {
|
| if (net_log_observer_) {
|
| context_->net_log()->RemoveThreadSafeObserver(net_log_observer_.get());
|
| net_log_observer_.reset();
|
| @@ -162,11 +162,12 @@ URLRequestContextPeer::~URLRequestContextPeer() {
|
| // TODO(mef): Ensure that |network_thread_| is destroyed properly.
|
| }
|
|
|
| -const std::string& URLRequestContextPeer::GetUserAgent(const GURL& url) const {
|
| +const std::string& URLRequestContextAdapter::GetUserAgent(
|
| + const GURL& url) const {
|
| return user_agent_;
|
| }
|
|
|
| -net::URLRequestContext* URLRequestContextPeer::GetURLRequestContext() {
|
| +net::URLRequestContext* URLRequestContextAdapter::GetURLRequestContext() {
|
| if (!context_) {
|
| LOG(ERROR) << "URLRequestContext is not set up";
|
| }
|
| @@ -174,11 +175,11 @@ net::URLRequestContext* URLRequestContextPeer::GetURLRequestContext() {
|
| }
|
|
|
| scoped_refptr<base::SingleThreadTaskRunner>
|
| -URLRequestContextPeer::GetNetworkTaskRunner() const {
|
| +URLRequestContextAdapter::GetNetworkTaskRunner() const {
|
| return network_thread_->message_loop_proxy();
|
| }
|
|
|
| -void URLRequestContextPeer::StartNetLogToFile(const std::string& file_name) {
|
| +void URLRequestContextAdapter::StartNetLogToFile(const std::string& file_name) {
|
| // Do nothing if already logging to a file.
|
| if (net_log_logger_)
|
| return;
|
| @@ -193,7 +194,7 @@ void URLRequestContextPeer::StartNetLogToFile(const std::string& file_name) {
|
| net_log_logger_->StartObserving(context_->net_log());
|
| }
|
|
|
| -void URLRequestContextPeer::StopNetLog() {
|
| +void URLRequestContextAdapter::StopNetLog() {
|
| if (net_log_logger_) {
|
| net_log_logger_->StopObserving();
|
| net_log_logger_.reset();
|
| @@ -202,8 +203,7 @@ void URLRequestContextPeer::StopNetLog() {
|
|
|
| void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) {
|
| VLOG(2) << "Net log entry: type=" << entry.type()
|
| - << ", source=" << entry.source().type
|
| - << ", phase=" << entry.phase();
|
| + << ", source=" << entry.source().type << ", phase=" << entry.phase();
|
| }
|
|
|
| } // namespace cronet
|
|
|