From 926338d9adf9c58641491fb24ef876f9b7bfb752 Mon Sep 17 00:00:00 2001 From: xunjieli Date: Wed, 15 Oct 2014 08:38:40 -0700 Subject: [PATCH] Fix some lint errors in url_request_context_adapter BUG= Review URL: https://codereview.chromium.org/656963004 Cr-Commit-Position: refs/heads/master@{#299690} --- .../cronet/android/url_request_context_adapter.cc | 58 +++++++++++----------- .../cronet/android/url_request_context_adapter.h | 10 ++-- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/components/cronet/android/url_request_context_adapter.cc b/components/cronet/android/url_request_context_adapter.cc index 026e39d0b152..ffd934459d40 100644 --- a/components/cronet/android/url_request_context_adapter.cc +++ b/components/cronet/android/url_request_context_adapter.cc @@ -4,6 +4,8 @@ #include "components/cronet/android/url_request_context_adapter.h" +#include + #include "base/bind.h" #include "base/files/file_util.h" #include "base/single_thread_task_runner.h" @@ -31,22 +33,22 @@ class BasicNetworkDelegate : public net::NetworkDelegate { private: // net::NetworkDelegate implementation. - virtual int OnBeforeURLRequest(net::URLRequest* request, - const net::CompletionCallback& callback, - GURL* new_url) override { + int OnBeforeURLRequest(net::URLRequest* request, + const net::CompletionCallback& callback, + GURL* new_url) override { return net::OK; } - virtual int OnBeforeSendHeaders(net::URLRequest* request, - const net::CompletionCallback& callback, - net::HttpRequestHeaders* headers) override { + int OnBeforeSendHeaders(net::URLRequest* request, + const net::CompletionCallback& callback, + net::HttpRequestHeaders* headers) override { return net::OK; } - virtual void OnSendHeaders(net::URLRequest* request, - const net::HttpRequestHeaders& headers) override {} + void OnSendHeaders(net::URLRequest* request, + const net::HttpRequestHeaders& headers) override {} - virtual int OnHeadersReceived( + int OnHeadersReceived( net::URLRequest* request, const net::CompletionCallback& callback, const net::HttpResponseHeaders* original_response_headers, @@ -55,22 +57,22 @@ class BasicNetworkDelegate : public net::NetworkDelegate { return net::OK; } - virtual void OnBeforeRedirect(net::URLRequest* request, - const GURL& new_location) override {} + void OnBeforeRedirect(net::URLRequest* request, + const GURL& new_location) override {} - virtual void OnResponseStarted(net::URLRequest* request) override {} + void OnResponseStarted(net::URLRequest* request) override {} - virtual void OnRawBytesRead(const net::URLRequest& request, - int bytes_read) override {} + void OnRawBytesRead(const net::URLRequest& request, + int bytes_read) override {} - virtual void OnCompleted(net::URLRequest* request, bool started) override {} + void OnCompleted(net::URLRequest* request, bool started) override {} - virtual void OnURLRequestDestroyed(net::URLRequest* request) override {} + void OnURLRequestDestroyed(net::URLRequest* request) override {} - virtual void OnPACScriptError(int line_number, - const base::string16& error) override {} + void OnPACScriptError(int line_number, + const base::string16& error) override {} - virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired( + NetworkDelegate::AuthRequiredResponse OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, const AuthCallback& callback, @@ -78,28 +80,28 @@ class BasicNetworkDelegate : public net::NetworkDelegate { return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; } - virtual bool OnCanGetCookies(const net::URLRequest& request, - const net::CookieList& cookie_list) override { + bool OnCanGetCookies(const net::URLRequest& request, + const net::CookieList& cookie_list) override { return false; } - virtual bool OnCanSetCookie(const net::URLRequest& request, - const std::string& cookie_line, - net::CookieOptions* options) override { + bool OnCanSetCookie(const net::URLRequest& request, + const std::string& cookie_line, + net::CookieOptions* options) override { return false; } - virtual bool OnCanAccessFile(const net::URLRequest& request, - const base::FilePath& path) const override { + bool OnCanAccessFile(const net::URLRequest& request, + const base::FilePath& path) const override { return false; } - virtual bool OnCanThrottleRequest( + bool OnCanThrottleRequest( const net::URLRequest& request) const override { return false; } - virtual int OnBeforeSocketStreamConnect( + int OnBeforeSocketStreamConnect( net::SocketStream* stream, const net::CompletionCallback& callback) override { return net::OK; diff --git a/components/cronet/android/url_request_context_adapter.h b/components/cronet/android/url_request_context_adapter.h index b84e036f3cb4..3bc95db50afd 100644 --- a/components/cronet/android/url_request_context_adapter.h +++ b/components/cronet/android/url_request_context_adapter.h @@ -21,7 +21,9 @@ #include "net/url_request/url_request_context_getter.h" namespace net { + class NetLogLogger; + } // namespace net namespace cronet { @@ -32,11 +34,11 @@ typedef base::Callback RunAfterContextInitTask; // Implementation of the Chromium NetLog observer interface. class NetLogObserver : public net::NetLog::ThreadSafeObserver { public: - explicit NetLogObserver() {} + virtual NetLogObserver() {} virtual ~NetLogObserver() {} - virtual void OnAddEntry(const net::NetLog::Entry& entry) override; + void OnAddEntry(const net::NetLog::Entry& entry) override; private: DISALLOW_COPY_AND_ASSIGN(NetLogObserver); @@ -73,8 +75,8 @@ class URLRequestContextAdapter : public net::URLRequestContextGetter { const std::string& GetUserAgent(const GURL& url) const; // net::URLRequestContextGetter implementation: - virtual net::URLRequestContext* GetURLRequestContext() override; - virtual scoped_refptr GetNetworkTaskRunner() + net::URLRequestContext* GetURLRequestContext() override; + scoped_refptr GetNetworkTaskRunner() const override; void StartNetLogToFile(const std::string& file_name); -- 2.11.4.GIT