Commit f93bb580 authored by dcheng's avatar dcheng Committed by Commit bot

Standardize usage of virtual/override/final in google_apis/

This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree.

BUG=417463
TBR=rogerta@chromium.org

Review URL: https://codereview.chromium.org/649283003

Cr-Commit-Position: refs/heads/master@{#300495}
parent 895619a9
...@@ -41,15 +41,15 @@ class AuthRequest : public OAuth2TokenService::Consumer { ...@@ -41,15 +41,15 @@ class AuthRequest : public OAuth2TokenService::Consumer {
net::URLRequestContextGetter* url_request_context_getter, net::URLRequestContextGetter* url_request_context_getter,
const AuthStatusCallback& callback, const AuthStatusCallback& callback,
const std::vector<std::string>& scopes); const std::vector<std::string>& scopes);
virtual ~AuthRequest(); ~AuthRequest() override;
private: private:
// Overridden from OAuth2TokenService::Consumer: // Overridden from OAuth2TokenService::Consumer:
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token, const std::string& access_token,
const base::Time& expiration_time) override; const base::Time& expiration_time) override;
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
AuthStatusCallback callback_; AuthStatusCallback callback_;
scoped_ptr<OAuth2TokenService::Request> request_; scoped_ptr<OAuth2TokenService::Request> request_;
......
...@@ -37,21 +37,21 @@ class AuthService : public AuthServiceInterface, ...@@ -37,21 +37,21 @@ class AuthService : public AuthServiceInterface,
const std::string& account_id, const std::string& account_id,
net::URLRequestContextGetter* url_request_context_getter, net::URLRequestContextGetter* url_request_context_getter,
const std::vector<std::string>& scopes); const std::vector<std::string>& scopes);
virtual ~AuthService(); ~AuthService() override;
// Overriden from AuthServiceInterface: // Overriden from AuthServiceInterface:
virtual void AddObserver(AuthServiceObserver* observer) override; void AddObserver(AuthServiceObserver* observer) override;
virtual void RemoveObserver(AuthServiceObserver* observer) override; void RemoveObserver(AuthServiceObserver* observer) override;
virtual void StartAuthentication(const AuthStatusCallback& callback) override; void StartAuthentication(const AuthStatusCallback& callback) override;
virtual bool HasAccessToken() const override; bool HasAccessToken() const override;
virtual bool HasRefreshToken() const override; bool HasRefreshToken() const override;
virtual const std::string& access_token() const override; const std::string& access_token() const override;
virtual void ClearAccessToken() override; void ClearAccessToken() override;
virtual void ClearRefreshToken() override; void ClearRefreshToken() override;
// Overridden from OAuth2TokenService::Observer: // Overridden from OAuth2TokenService::Observer:
virtual void OnRefreshTokenAvailable(const std::string& account_id) override; void OnRefreshTokenAvailable(const std::string& account_id) override;
virtual void OnRefreshTokenRevoked(const std::string& account_id) override; void OnRefreshTokenRevoked(const std::string& account_id) override;
private: private:
// Called when the state of the refresh token changes. // Called when the state of the refresh token changes.
......
...@@ -89,7 +89,7 @@ class ResponseWriter : public net::URLFetcherResponseWriter { ...@@ -89,7 +89,7 @@ class ResponseWriter : public net::URLFetcherResponseWriter {
ResponseWriter(base::SequencedTaskRunner* file_task_runner, ResponseWriter(base::SequencedTaskRunner* file_task_runner,
const base::FilePath& file_path, const base::FilePath& file_path,
const GetContentCallback& get_content_callback); const GetContentCallback& get_content_callback);
virtual ~ResponseWriter(); ~ResponseWriter() override;
const std::string& data() const { return data_; } const std::string& data() const { return data_; }
...@@ -97,11 +97,11 @@ class ResponseWriter : public net::URLFetcherResponseWriter { ...@@ -97,11 +97,11 @@ class ResponseWriter : public net::URLFetcherResponseWriter {
void DisownFile(); void DisownFile();
// URLFetcherResponseWriter overrides: // URLFetcherResponseWriter overrides:
virtual int Initialize(const net::CompletionCallback& callback) override; int Initialize(const net::CompletionCallback& callback) override;
virtual int Write(net::IOBuffer* buffer, int Write(net::IOBuffer* buffer,
int num_bytes, int num_bytes,
const net::CompletionCallback& callback) override; const net::CompletionCallback& callback) override;
virtual int Finish(const net::CompletionCallback& callback) override; int Finish(const net::CompletionCallback& callback) override;
private: private:
void DidWrite(scoped_refptr<net::IOBuffer> buffer, void DidWrite(scoped_refptr<net::IOBuffer> buffer,
...@@ -123,15 +123,15 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface, ...@@ -123,15 +123,15 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
public net::URLFetcherDelegate { public net::URLFetcherDelegate {
public: public:
// AuthenticatedRequestInterface overrides. // AuthenticatedRequestInterface overrides.
virtual void Start(const std::string& access_token, void Start(const std::string& access_token,
const std::string& custom_user_agent, const std::string& custom_user_agent,
const ReAuthenticateCallback& callback) override; const ReAuthenticateCallback& callback) override;
virtual base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() override; base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() override;
virtual void Cancel() override; void Cancel() override;
protected: protected:
explicit UrlFetchRequestBase(RequestSender* sender); explicit UrlFetchRequestBase(RequestSender* sender);
virtual ~UrlFetchRequestBase(); ~UrlFetchRequestBase() override;
// Gets URL for the request. // Gets URL for the request.
virtual GURL GetURL() const = 0; virtual GURL GetURL() const = 0;
...@@ -194,10 +194,10 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface, ...@@ -194,10 +194,10 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
private: private:
// URLFetcherDelegate overrides. // URLFetcherDelegate overrides.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
// AuthenticatedRequestInterface overrides. // AuthenticatedRequestInterface overrides.
virtual void OnAuthFailed(GDataErrorCode code) override; void OnAuthFailed(GDataErrorCode code) override;
ReAuthenticateCallback re_authenticate_callback_; ReAuthenticateCallback re_authenticate_callback_;
int re_authenticate_count_; int re_authenticate_count_;
...@@ -228,12 +228,12 @@ class EntryActionRequest : public UrlFetchRequestBase { ...@@ -228,12 +228,12 @@ class EntryActionRequest : public UrlFetchRequestBase {
// failure. It must not be null. // failure. It must not be null.
EntryActionRequest(RequestSender* sender, EntryActionRequest(RequestSender* sender,
const EntryActionCallback& callback); const EntryActionCallback& callback);
virtual ~EntryActionRequest(); ~EntryActionRequest() override;
protected: protected:
// Overridden from UrlFetchRequestBase. // Overridden from UrlFetchRequestBase.
virtual void ProcessURLFetchResults(const net::URLFetcher* source) override; void ProcessURLFetchResults(const net::URLFetcher* source) override;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) override; void RunCallbackOnPrematureFailure(GDataErrorCode code) override;
private: private:
const EntryActionCallback callback_; const EntryActionCallback callback_;
...@@ -268,12 +268,12 @@ class InitiateUploadRequestBase : public UrlFetchRequestBase { ...@@ -268,12 +268,12 @@ class InitiateUploadRequestBase : public UrlFetchRequestBase {
const InitiateUploadCallback& callback, const InitiateUploadCallback& callback,
const std::string& content_type, const std::string& content_type,
int64 content_length); int64 content_length);
virtual ~InitiateUploadRequestBase(); ~InitiateUploadRequestBase() override;
// UrlFetchRequestBase overrides. // UrlFetchRequestBase overrides.
virtual void ProcessURLFetchResults(const net::URLFetcher* source) override; void ProcessURLFetchResults(const net::URLFetcher* source) override;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) override; void RunCallbackOnPrematureFailure(GDataErrorCode code) override;
virtual std::vector<std::string> GetExtraRequestHeaders() const override; std::vector<std::string> GetExtraRequestHeaders() const override;
private: private:
const InitiateUploadCallback callback_; const InitiateUploadCallback callback_;
...@@ -311,13 +311,13 @@ class UploadRangeRequestBase : public UrlFetchRequestBase { ...@@ -311,13 +311,13 @@ class UploadRangeRequestBase : public UrlFetchRequestBase {
protected: protected:
// |upload_url| is the URL of where to upload the file to. // |upload_url| is the URL of where to upload the file to.
UploadRangeRequestBase(RequestSender* sender, const GURL& upload_url); UploadRangeRequestBase(RequestSender* sender, const GURL& upload_url);
virtual ~UploadRangeRequestBase(); ~UploadRangeRequestBase() override;
// UrlFetchRequestBase overrides. // UrlFetchRequestBase overrides.
virtual GURL GetURL() const override; GURL GetURL() const override;
virtual net::URLFetcher::RequestType GetRequestType() const override; net::URLFetcher::RequestType GetRequestType() const override;
virtual void ProcessURLFetchResults(const net::URLFetcher* source) override; void ProcessURLFetchResults(const net::URLFetcher* source) override;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) override; void RunCallbackOnPrematureFailure(GDataErrorCode code) override;
// This method will be called when the request is done, regardless of // This method will be called when the request is done, regardless of
// whether it is succeeded or failed. // whether it is succeeded or failed.
...@@ -378,14 +378,14 @@ class ResumeUploadRequestBase : public UploadRangeRequestBase { ...@@ -378,14 +378,14 @@ class ResumeUploadRequestBase : public UploadRangeRequestBase {
int64 content_length, int64 content_length,
const std::string& content_type, const std::string& content_type,
const base::FilePath& local_file_path); const base::FilePath& local_file_path);
virtual ~ResumeUploadRequestBase(); ~ResumeUploadRequestBase() override;
// UrlFetchRequestBase overrides. // UrlFetchRequestBase overrides.
virtual std::vector<std::string> GetExtraRequestHeaders() const override; std::vector<std::string> GetExtraRequestHeaders() const override;
virtual bool GetContentFile(base::FilePath* local_file_path, bool GetContentFile(base::FilePath* local_file_path,
int64* range_offset, int64* range_offset,
int64* range_length, int64* range_length,
std::string* upload_content_type) override; std::string* upload_content_type) override;
private: private:
// The parameters for the request. See ResumeUploadParams for the details. // The parameters for the request. See ResumeUploadParams for the details.
...@@ -416,11 +416,11 @@ class GetUploadStatusRequestBase : public UploadRangeRequestBase { ...@@ -416,11 +416,11 @@ class GetUploadStatusRequestBase : public UploadRangeRequestBase {
GetUploadStatusRequestBase(RequestSender* sender, GetUploadStatusRequestBase(RequestSender* sender,
const GURL& upload_url, const GURL& upload_url,
int64 content_length); int64 content_length);
virtual ~GetUploadStatusRequestBase(); ~GetUploadStatusRequestBase() override;
protected: protected:
// UrlFetchRequestBase overrides. // UrlFetchRequestBase overrides.
virtual std::vector<std::string> GetExtraRequestHeaders() const override; std::vector<std::string> GetExtraRequestHeaders() const override;
private: private:
const int64 content_length_; const int64 content_length_;
...@@ -462,20 +462,20 @@ class DownloadFileRequestBase : public UrlFetchRequestBase { ...@@ -462,20 +462,20 @@ class DownloadFileRequestBase : public UrlFetchRequestBase {
const ProgressCallback& progress_callback, const ProgressCallback& progress_callback,
const GURL& download_url, const GURL& download_url,
const base::FilePath& output_file_path); const base::FilePath& output_file_path);
virtual ~DownloadFileRequestBase(); ~DownloadFileRequestBase() override;
protected: protected:
// UrlFetchRequestBase overrides. // UrlFetchRequestBase overrides.
virtual GURL GetURL() const override; GURL GetURL() const override;
virtual void GetOutputFilePath( void GetOutputFilePath(base::FilePath* local_file_path,
base::FilePath* local_file_path, GetContentCallback* get_content_callback) override;
GetContentCallback* get_content_callback) override; void ProcessURLFetchResults(const net::URLFetcher* source) override;
virtual void ProcessURLFetchResults(const net::URLFetcher* source) override; void RunCallbackOnPrematureFailure(GDataErrorCode code) override;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) override;
// net::URLFetcherDelegate overrides. // net::URLFetcherDelegate overrides.
virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, void OnURLFetchDownloadProgress(const net::URLFetcher* source,
int64 current, int64 total) override; int64 current,
int64 total) override;
private: private:
const DownloadActionCallback download_action_callback_; const DownloadActionCallback download_action_callback_;
......
...@@ -35,15 +35,14 @@ class FakeUrlFetchRequest : public UrlFetchRequestBase { ...@@ -35,15 +35,14 @@ class FakeUrlFetchRequest : public UrlFetchRequestBase {
url_(url) { url_(url) {
} }
virtual ~FakeUrlFetchRequest() { ~FakeUrlFetchRequest() override {}
}
protected: protected:
virtual GURL GetURL() const override { return url_; } GURL GetURL() const override { return url_; }
virtual void ProcessURLFetchResults(const net::URLFetcher* source) override { void ProcessURLFetchResults(const net::URLFetcher* source) override {
callback_.Run(GetErrorCode()); callback_.Run(GetErrorCode());
} }
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) override { void RunCallbackOnPrematureFailure(GDataErrorCode code) override {
callback_.Run(code); callback_.Run(code);
} }
......
This diff is collapsed.
...@@ -24,14 +24,14 @@ class DummyAuthService : public AuthServiceInterface { ...@@ -24,14 +24,14 @@ class DummyAuthService : public AuthServiceInterface {
const std::string& refresh_token() const { return refresh_token_; } const std::string& refresh_token() const { return refresh_token_; }
// AuthServiceInterface overrides. // AuthServiceInterface overrides.
virtual void AddObserver(AuthServiceObserver* observer) override; void AddObserver(AuthServiceObserver* observer) override;
virtual void RemoveObserver(AuthServiceObserver* observer) override; void RemoveObserver(AuthServiceObserver* observer) override;
virtual void StartAuthentication(const AuthStatusCallback& callback) override; void StartAuthentication(const AuthStatusCallback& callback) override;
virtual bool HasAccessToken() const override; bool HasAccessToken() const override;
virtual bool HasRefreshToken() const override; bool HasRefreshToken() const override;
virtual const std::string& access_token() const override; const std::string& access_token() const override;
virtual void ClearAccessToken() override; void ClearAccessToken() override;
virtual void ClearRefreshToken() override; void ClearRefreshToken() override;
private: private:
std::string access_token_; std::string access_token_;
......
...@@ -317,7 +317,7 @@ class ResourceEntry : public CommonMetadata { ...@@ -317,7 +317,7 @@ class ResourceEntry : public CommonMetadata {
ENTRY_KIND_FILE ENTRY_KIND_FILE
}; };
ResourceEntry(); ResourceEntry();
virtual ~ResourceEntry(); ~ResourceEntry() override;
// Extracts "entry" dictionary from the JSON value, and parse the contents, // Extracts "entry" dictionary from the JSON value, and parse the contents,
// using CreateFrom(). Returns NULL on failure. The input JSON data, coming // using CreateFrom(). Returns NULL on failure. The input JSON data, coming
...@@ -517,7 +517,7 @@ class ResourceEntry : public CommonMetadata { ...@@ -517,7 +517,7 @@ class ResourceEntry : public CommonMetadata {
class ResourceList : public CommonMetadata { class ResourceList : public CommonMetadata {
public: public:
ResourceList(); ResourceList();
virtual ~ResourceList(); ~ResourceList() override;
// Extracts "feed" dictionary from the JSON value, and parse the contents, // Extracts "feed" dictionary from the JSON value, and parse the contents,
// using CreateFrom(). Returns NULL on failure. The input JSON data, coming // using CreateFrom(). Returns NULL on failure. The input JSON data, coming
......
...@@ -28,13 +28,13 @@ class GetResourceEntryRequest : public UrlFetchRequestBase { ...@@ -28,13 +28,13 @@ class GetResourceEntryRequest : public UrlFetchRequestBase {
const std::string& resource_id, const std::string& resource_id,
const GURL& embed_origin, const GURL& embed_origin,
const GetResourceEntryCallback& callback); const GetResourceEntryCallback& callback);
virtual ~GetResourceEntryRequest(); ~GetResourceEntryRequest() override;
protected: protected:
// UrlFetchRequestBase overrides. // UrlFetchRequestBase overrides.
virtual void ProcessURLFetchResults(const net::URLFetcher* source) override; void ProcessURLFetchResults(const net::URLFetcher* source) override;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode error) override; void RunCallbackOnPrematureFailure(GDataErrorCode error) override;
virtual GURL GetURL() const override; GURL GetURL() const override;
private: private:
void OnDataParsed(GDataErrorCode error, scoped_ptr<ResourceEntry> entry); void OnDataParsed(GDataErrorCode error, scoped_ptr<ResourceEntry> entry);
......
...@@ -31,8 +31,7 @@ class TestAuthService : public DummyAuthService { ...@@ -31,8 +31,7 @@ class TestAuthService : public DummyAuthService {
public: public:
TestAuthService() : auth_try_count_(0) {} TestAuthService() : auth_try_count_(0) {}
virtual void StartAuthentication( void StartAuthentication(const AuthStatusCallback& callback) override {
const AuthStatusCallback& callback) override {
// RequestSender should clear the rejected access token before starting // RequestSender should clear the rejected access token before starting
// to request another one. // to request another one.
EXPECT_FALSE(HasAccessToken()); EXPECT_FALSE(HasAccessToken());
...@@ -95,9 +94,9 @@ class TestRequest : public AuthenticatedRequestInterface { ...@@ -95,9 +94,9 @@ class TestRequest : public AuthenticatedRequestInterface {
return passed_reauth_callback_; return passed_reauth_callback_;
} }
virtual void Start(const std::string& access_token, void Start(const std::string& access_token,
const std::string& custom_user_agent, const std::string& custom_user_agent,
const ReAuthenticateCallback& callback) override { const ReAuthenticateCallback& callback) override {
*start_called_ = true; *start_called_ = true;
passed_access_token_ = access_token; passed_access_token_ = access_token;
passed_reauth_callback_ = callback; passed_reauth_callback_ = callback;
...@@ -106,18 +105,18 @@ class TestRequest : public AuthenticatedRequestInterface { ...@@ -106,18 +105,18 @@ class TestRequest : public AuthenticatedRequestInterface {
// Each test case should respond properly by using the above methods. // Each test case should respond properly by using the above methods.
} }
virtual void Cancel() override { void Cancel() override {
EXPECT_TRUE(*start_called_); EXPECT_TRUE(*start_called_);
*finish_reason_ = CANCEL; *finish_reason_ = CANCEL;
sender_->RequestFinished(this); sender_->RequestFinished(this);
} }
virtual void OnAuthFailed(GDataErrorCode code) override { void OnAuthFailed(GDataErrorCode code) override {
*finish_reason_ = AUTH_FAILURE; *finish_reason_ = AUTH_FAILURE;
sender_->RequestFinished(this); sender_->RequestFinished(this);
} }
virtual base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() override { base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() override {
return weak_ptr_factory_.GetWeakPtr(); return weak_ptr_factory_.GetWeakPtr();
} }
......
...@@ -45,7 +45,7 @@ class AccountTracker : public OAuth2TokenService::Observer, ...@@ -45,7 +45,7 @@ class AccountTracker : public OAuth2TokenService::Observer,
public: public:
AccountTracker(IdentityProvider* identity_provider, AccountTracker(IdentityProvider* identity_provider,
net::URLRequestContextGetter* request_context_getter); net::URLRequestContextGetter* request_context_getter);
virtual ~AccountTracker(); ~AccountTracker() override;
class Observer { class Observer {
public: public:
...@@ -67,16 +67,16 @@ class AccountTracker : public OAuth2TokenService::Observer, ...@@ -67,16 +67,16 @@ class AccountTracker : public OAuth2TokenService::Observer,
AccountIds FindAccountIdsByGaiaId(const std::string& gaia_id); AccountIds FindAccountIdsByGaiaId(const std::string& gaia_id);
// OAuth2TokenService::Observer implementation. // OAuth2TokenService::Observer implementation.
virtual void OnRefreshTokenAvailable(const std::string& account_key) override; void OnRefreshTokenAvailable(const std::string& account_key) override;
virtual void OnRefreshTokenRevoked(const std::string& account_key) override; void OnRefreshTokenRevoked(const std::string& account_key) override;
void OnUserInfoFetchSuccess(AccountIdFetcher* fetcher, void OnUserInfoFetchSuccess(AccountIdFetcher* fetcher,
const std::string& gaia_id); const std::string& gaia_id);
void OnUserInfoFetchFailure(AccountIdFetcher* fetcher); void OnUserInfoFetchFailure(AccountIdFetcher* fetcher);
// IdentityProvider::Observer implementation. // IdentityProvider::Observer implementation.
virtual void OnActiveAccountLogin() override; void OnActiveAccountLogin() override;
virtual void OnActiveAccountLogout() override; void OnActiveAccountLogout() override;
// Sets the state of an account. Does not fire notifications. // Sets the state of an account. Does not fire notifications.
void SetAccountStateForTest(AccountIds ids, bool is_signed_in); void SetAccountStateForTest(AccountIds ids, bool is_signed_in);
...@@ -120,23 +120,23 @@ class AccountIdFetcher : public OAuth2TokenService::Consumer, ...@@ -120,23 +120,23 @@ class AccountIdFetcher : public OAuth2TokenService::Consumer,
net::URLRequestContextGetter* request_context_getter, net::URLRequestContextGetter* request_context_getter,
AccountTracker* tracker, AccountTracker* tracker,
const std::string& account_key); const std::string& account_key);
virtual ~AccountIdFetcher(); ~AccountIdFetcher() override;
const std::string& account_key() { return account_key_; } const std::string& account_key() { return account_key_; }
void Start(); void Start();
// OAuth2TokenService::Consumer implementation. // OAuth2TokenService::Consumer implementation.
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token, const std::string& access_token,
const base::Time& expiration_time) override; const base::Time& expiration_time) override;
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
// gaia::GaiaOAuthClient::Delegate implementation. // gaia::GaiaOAuthClient::Delegate implementation.
virtual void OnGetUserIdResponse(const std::string& gaia_id) override; void OnGetUserIdResponse(const std::string& gaia_id) override;
virtual void OnOAuthError() override; void OnOAuthError() override;
virtual void OnNetworkError(int response_code) override; void OnNetworkError(int response_code) override;
private: private:
OAuth2TokenService* token_service_; OAuth2TokenService* token_service_;
......
...@@ -136,10 +136,10 @@ class AccountTrackerObserver : public AccountTracker::Observer { ...@@ -136,10 +136,10 @@ class AccountTrackerObserver : public AccountTracker::Observer {
void SortEventsByUser(); void SortEventsByUser();
// AccountTracker::Observer implementation // AccountTracker::Observer implementation
virtual void OnAccountAdded(const AccountIds& ids) override; void OnAccountAdded(const AccountIds& ids) override;
virtual void OnAccountRemoved(const AccountIds& ids) override; void OnAccountRemoved(const AccountIds& ids) override;
virtual void OnAccountSignInChanged(const AccountIds& ids, bool is_signed_in) void OnAccountSignInChanged(const AccountIds& ids,
override; bool is_signed_in) override;
private: private:
testing::AssertionResult CheckEvents( testing::AssertionResult CheckEvents(
......
...@@ -17,16 +17,16 @@ class OAuth2TokenService; ...@@ -17,16 +17,16 @@ class OAuth2TokenService;
class FakeIdentityProvider : public IdentityProvider { class FakeIdentityProvider : public IdentityProvider {
public: public:
explicit FakeIdentityProvider(OAuth2TokenService* token_service); explicit FakeIdentityProvider(OAuth2TokenService* token_service);
virtual ~FakeIdentityProvider(); ~FakeIdentityProvider() override;
void LogIn(const std::string& account_id); void LogIn(const std::string& account_id);
void LogOut(); void LogOut();
// IdentityProvider: // IdentityProvider:
virtual std::string GetActiveUsername() override; std::string GetActiveUsername() override;
virtual std::string GetActiveAccountId() override; std::string GetActiveAccountId() override;
virtual OAuth2TokenService* GetTokenService() override; OAuth2TokenService* GetTokenService() override;
virtual bool RequestLogin() override; bool RequestLogin() override;
private: private:
std::string account_id_; std::string account_id_;
......
...@@ -20,9 +20,9 @@ class URLRequestContextGetter; ...@@ -20,9 +20,9 @@ class URLRequestContextGetter;
class FakeOAuth2TokenService : public OAuth2TokenService { class FakeOAuth2TokenService : public OAuth2TokenService {
public: public:
FakeOAuth2TokenService(); FakeOAuth2TokenService();
virtual ~FakeOAuth2TokenService(); ~FakeOAuth2TokenService() override;
virtual std::vector<std::string> GetAccounts() override; std::vector<std::string> GetAccounts() override;
void AddAccount(const std::string& account_id); void AddAccount(const std::string& account_id);
void RemoveAccount(const std::string& account_id); void RemoveAccount(const std::string& account_id);
...@@ -42,20 +42,19 @@ class FakeOAuth2TokenService : public OAuth2TokenService { ...@@ -42,20 +42,19 @@ class FakeOAuth2TokenService : public OAuth2TokenService {
protected: protected:
// OAuth2TokenService overrides. // OAuth2TokenService overrides.
virtual void FetchOAuth2Token(RequestImpl* request, void FetchOAuth2Token(RequestImpl* request,
const std::string& account_id, const std::string& account_id,
net::URLRequestContextGetter* getter, net::URLRequestContextGetter* getter,
const std::string& client_id, const std::string& client_id,
const std::string& client_secret, const std::string& client_secret,
const ScopeSet& scopes) override; const ScopeSet& scopes) override;
virtual void InvalidateOAuth2Token(const std::string& account_id, void InvalidateOAuth2Token(const std::string& account_id,
const std::string& client_id, const std::string& client_id,
const ScopeSet& scopes, const ScopeSet& scopes,
const std::string& access_token) override; const std::string& access_token) override;
virtual bool RefreshTokenIsAvailable(const std::string& account_id) const bool RefreshTokenIsAvailable(const std::string& account_id) const override;
override;
private: private:
struct PendingRequest { struct PendingRequest {
...@@ -70,9 +69,9 @@ class FakeOAuth2TokenService : public OAuth2TokenService { ...@@ -70,9 +69,9 @@ class FakeOAuth2TokenService : public OAuth2TokenService {
}; };
// OAuth2TokenService overrides. // OAuth2TokenService overrides.
virtual net::URLRequestContextGetter* GetRequestContext() override; net::URLRequestContextGetter* GetRequestContext() override;
virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher( OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(
const std::string& account_id, const std::string& account_id,
net::URLRequestContextGetter* getter, net::URLRequestContextGetter* getter,
OAuth2AccessTokenConsumer* consumer) override; OAuth2AccessTokenConsumer* consumer) override;
......
...@@ -53,7 +53,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate { ...@@ -53,7 +53,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
GaiaAuthFetcher(GaiaAuthConsumer* consumer, GaiaAuthFetcher(GaiaAuthConsumer* consumer,
const std::string& source, const std::string& source,
net::URLRequestContextGetter* getter); net::URLRequestContextGetter* getter);
virtual ~GaiaAuthFetcher(); ~GaiaAuthFetcher() override;
// Start a request to obtain the SID and LSID cookies for the the account // Start a request to obtain the SID and LSID cookies for the the account
// identified by |username| and |password|. If |service| is not null or // identified by |username| and |password|. If |service| is not null or
...@@ -192,7 +192,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate { ...@@ -192,7 +192,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
void StartGetCheckConnectionInfo(); void StartGetCheckConnectionInfo();
// Implementation of net::URLFetcherDelegate // Implementation of net::URLFetcherDelegate
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
// StartClientLogin been called && results not back yet? // StartClientLogin been called && results not back yet?
bool HasPendingFetch(); bool HasPendingFetch();
......
...@@ -65,7 +65,7 @@ class GaiaOAuthClient::Core ...@@ -65,7 +65,7 @@ class GaiaOAuthClient::Core
Delegate* delegate); Delegate* delegate);
// net::URLFetcherDelegate implementation. // net::URLFetcherDelegate implementation.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
private: private:
friend class base::RefCountedThreadSafe<Core>; friend class base::RefCountedThreadSafe<Core>;
...@@ -80,7 +80,7 @@ class GaiaOAuthClient::Core ...@@ -80,7 +80,7 @@ class GaiaOAuthClient::Core
USER_INFO, USER_INFO,
}; };
virtual ~Core() {} ~Core() override {}
void GetUserInfoImpl(RequestType type, void GetUserInfoImpl(RequestType type,
const std::string& oauth_access_token, const std::string& oauth_access_token,
......
...@@ -48,9 +48,9 @@ class MockOAuthFetcher : public net::TestURLFetcher { ...@@ -48,9 +48,9 @@ class MockOAuthFetcher : public net::TestURLFetcher {
SetResponseString(results); SetResponseString(results);
} }
virtual ~MockOAuthFetcher() { } ~MockOAuthFetcher() override {}
virtual void Start() override { void Start() override {
if ((GetResponseCode() != net::HTTP_OK) && (max_failure_count_ != -1) && if ((GetResponseCode() != net::HTTP_OK) && (max_failure_count_ != -1) &&
(current_failure_count_ == max_failure_count_)) { (current_failure_count_ == max_failure_count_)) {
set_response_code(net::HTTP_OK); set_response_code(net::HTTP_OK);
...@@ -87,12 +87,11 @@ class MockOAuthFetcherFactory : public net::URLFetcherFactory, ...@@ -87,12 +87,11 @@ class MockOAuthFetcherFactory : public net::URLFetcherFactory,
response_code_(net::HTTP_OK), response_code_(net::HTTP_OK),
complete_immediately_(true) { complete_immediately_(true) {
} }
virtual ~MockOAuthFetcherFactory() {} ~MockOAuthFetcherFactory() override {}
virtual net::URLFetcher* CreateURLFetcher( net::URLFetcher* CreateURLFetcher(int id,
int id, const GURL& url,
const GURL& url, net::URLFetcher::RequestType request_type,
net::URLFetcher::RequestType request_type, net::URLFetcherDelegate* d) override {
net::URLFetcherDelegate* d) override {
url_fetcher_ = new MockOAuthFetcher( url_fetcher_ = new MockOAuthFetcher(
response_code_, response_code_,
max_failure_count_, max_failure_count_,
......
...@@ -41,7 +41,7 @@ class IdentityProvider : public OAuth2TokenService::Observer { ...@@ -41,7 +41,7 @@ class IdentityProvider : public OAuth2TokenService::Observer {
virtual ~Observer(); virtual ~Observer();
}; };
virtual ~IdentityProvider(); ~IdentityProvider() override;
// Adds and removes observers that will be notified of changes to the refresh // Adds and removes observers that will be notified of changes to the refresh
// token availability for the active account. // token availability for the active account.
...@@ -69,9 +69,9 @@ class IdentityProvider : public OAuth2TokenService::Observer { ...@@ -69,9 +69,9 @@ class IdentityProvider : public OAuth2TokenService::Observer {
void RemoveObserver(Observer* observer); void RemoveObserver(Observer* observer);
// OAuth2TokenService::Observer: // OAuth2TokenService::Observer:
virtual void OnRefreshTokenAvailable(const std::string& account_id) override; void OnRefreshTokenAvailable(const std::string& account_id) override;
virtual void OnRefreshTokenRevoked(const std::string& account_id) override; void OnRefreshTokenRevoked(const std::string& account_id) override;
virtual void OnRefreshTokensLoaded() override; void OnRefreshTokensLoaded() override;
protected: protected:
IdentityProvider(); IdentityProvider();
......
...@@ -57,7 +57,7 @@ class MergeSessionHelper : public GaiaAuthConsumer, ...@@ -57,7 +57,7 @@ class MergeSessionHelper : public GaiaAuthConsumer,
typedef std::map<std::string, std::string> ResultMap; typedef std::map<std::string, std::string> ResultMap;
ExternalCcResultFetcher(MergeSessionHelper* helper); ExternalCcResultFetcher(MergeSessionHelper* helper);
virtual ~ExternalCcResultFetcher(); ~ExternalCcResultFetcher() override;
// Gets the current value of the external connection check result string. // Gets the current value of the external connection check result string.
std::string GetExternalCcResult(); std::string GetExternalCcResult();
...@@ -79,14 +79,13 @@ class MergeSessionHelper : public GaiaAuthConsumer, ...@@ -79,14 +79,13 @@ class MergeSessionHelper : public GaiaAuthConsumer,
private: private:
// Overridden from GaiaAuthConsumer. // Overridden from GaiaAuthConsumer.
virtual void OnGetCheckConnectionInfoSuccess( void OnGetCheckConnectionInfoSuccess(const std::string& data) override;
const std::string& data) override;
// Creates and initializes a URL fetcher for doing a connection check. // Creates and initializes a URL fetcher for doing a connection check.
net::URLFetcher* CreateFetcher(const GURL& url); net::URLFetcher* CreateFetcher(const GURL& url);
// Overridden from URLFetcherDelgate. // Overridden from URLFetcherDelgate.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
// Any fetches still ongoing after this call are considered timed out. // Any fetches still ongoing after this call are considered timed out.
void Timeout(); void Timeout();
...@@ -106,7 +105,7 @@ class MergeSessionHelper : public GaiaAuthConsumer, ...@@ -106,7 +105,7 @@ class MergeSessionHelper : public GaiaAuthConsumer,
const std::string& source, const std::string& source,
net::URLRequestContextGetter* request_context, net::URLRequestContextGetter* request_context,
Observer* observer); Observer* observer);
virtual ~MergeSessionHelper(); ~MergeSessionHelper() override;
void LogIn(const std::string& account_id); void LogIn(const std::string& account_id);
...@@ -148,13 +147,12 @@ class MergeSessionHelper : public GaiaAuthConsumer, ...@@ -148,13 +147,12 @@ class MergeSessionHelper : public GaiaAuthConsumer,
net::URLRequestContextGetter* request_context() { return request_context_; } net::URLRequestContextGetter* request_context() { return request_context_; }
// Overridden from UbertokenConsumer. // Overridden from UbertokenConsumer.
virtual void OnUbertokenSuccess(const std::string& token) override; void OnUbertokenSuccess(const std::string& token) override;
virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) override; void OnUbertokenFailure(const GoogleServiceAuthError& error) override;
// Overridden from GaiaAuthConsumer. // Overridden from GaiaAuthConsumer.
virtual void OnMergeSessionSuccess(const std::string& data) override; void OnMergeSessionSuccess(const std::string& data) override;
virtual void OnMergeSessionFailure(const GoogleServiceAuthError& error) void OnMergeSessionFailure(const GoogleServiceAuthError& error) override;
override;
void LogOutInternal(const std::string& account_id, void LogOutInternal(const std::string& account_id,
const std::vector<std::string>& accounts); const std::vector<std::string>& accounts);
...@@ -170,7 +168,7 @@ class MergeSessionHelper : public GaiaAuthConsumer, ...@@ -170,7 +168,7 @@ class MergeSessionHelper : public GaiaAuthConsumer,
void HandleNextAccount(); void HandleNextAccount();
// Overridden from URLFetcherDelgate. // Overridden from URLFetcherDelgate.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
OAuth2TokenService* token_service_; OAuth2TokenService* token_service_;
net::URLRequestContextGetter* request_context_; net::URLRequestContextGetter* request_context_;
......
...@@ -31,9 +31,9 @@ class MockFetcher : public net::TestURLFetcher { ...@@ -31,9 +31,9 @@ class MockFetcher : public net::TestURLFetcher {
net::URLFetcher::RequestType request_type, net::URLFetcher::RequestType request_type,
net::URLFetcherDelegate* d); net::URLFetcherDelegate* d);
virtual ~MockFetcher(); ~MockFetcher() override;
virtual void Start() override; void Start() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(MockFetcher); DISALLOW_COPY_AND_ASSIGN(MockFetcher);
......
...@@ -51,17 +51,17 @@ class OAuth2AccessTokenFetcherImpl : public OAuth2AccessTokenFetcher, ...@@ -51,17 +51,17 @@ class OAuth2AccessTokenFetcherImpl : public OAuth2AccessTokenFetcher,
OAuth2AccessTokenFetcherImpl(OAuth2AccessTokenConsumer* consumer, OAuth2AccessTokenFetcherImpl(OAuth2AccessTokenConsumer* consumer,
net::URLRequestContextGetter* getter, net::URLRequestContextGetter* getter,
const std::string& refresh_token); const std::string& refresh_token);
virtual ~OAuth2AccessTokenFetcherImpl(); ~OAuth2AccessTokenFetcherImpl() override;
// Implementation of OAuth2AccessTokenFetcher // Implementation of OAuth2AccessTokenFetcher
virtual void Start(const std::string& client_id, void Start(const std::string& client_id,
const std::string& client_secret, const std::string& client_secret,
const std::vector<std::string>& scopes) override; const std::vector<std::string>& scopes) override;
virtual void CancelRequest() override; void CancelRequest() override;
// Implementation of net::URLFetcherDelegate // Implementation of net::URLFetcherDelegate
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
private: private:
enum State { enum State {
......
...@@ -32,14 +32,14 @@ class OAuth2ApiCallFlow ...@@ -32,14 +32,14 @@ class OAuth2ApiCallFlow
public: public:
OAuth2ApiCallFlow(); OAuth2ApiCallFlow();
virtual ~OAuth2ApiCallFlow(); ~OAuth2ApiCallFlow() override;
// Start the flow. // Start the flow.
virtual void Start(net::URLRequestContextGetter* context, virtual void Start(net::URLRequestContextGetter* context,
const std::string& access_token); const std::string& access_token);
// net::URLFetcherDelegate implementation. // net::URLFetcherDelegate implementation.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
protected: protected:
// Template methods for sub-classes. // Template methods for sub-classes.
......
...@@ -99,17 +99,15 @@ class OAuth2MintTokenFlow : public OAuth2ApiCallFlow { ...@@ -99,17 +99,15 @@ class OAuth2MintTokenFlow : public OAuth2ApiCallFlow {
}; };
OAuth2MintTokenFlow(Delegate* delegate, const Parameters& parameters); OAuth2MintTokenFlow(Delegate* delegate, const Parameters& parameters);
virtual ~OAuth2MintTokenFlow(); ~OAuth2MintTokenFlow() override;
protected: protected:
// Implementation of template methods in OAuth2ApiCallFlow. // Implementation of template methods in OAuth2ApiCallFlow.
virtual GURL CreateApiCallUrl() override; GURL CreateApiCallUrl() override;
virtual std::string CreateApiCallBody() override; std::string CreateApiCallBody() override;
virtual void ProcessApiCallSuccess( void ProcessApiCallSuccess(const net::URLFetcher* source) override;
const net::URLFetcher* source) override; void ProcessApiCallFailure(const net::URLFetcher* source) override;
virtual void ProcessApiCallFailure(
const net::URLFetcher* source) override;
private: private:
friend class OAuth2MintTokenFlowTest; friend class OAuth2MintTokenFlowTest;
......
...@@ -128,7 +128,7 @@ class OAuth2TokenService::Fetcher : public OAuth2AccessTokenConsumer { ...@@ -128,7 +128,7 @@ class OAuth2TokenService::Fetcher : public OAuth2AccessTokenConsumer {
const std::string& client_secret, const std::string& client_secret,
const ScopeSet& scopes, const ScopeSet& scopes,
base::WeakPtr<RequestImpl> waiting_request); base::WeakPtr<RequestImpl> waiting_request);
virtual ~Fetcher(); ~Fetcher() override;
// Add a request that is waiting for the result of this Fetcher. // Add a request that is waiting for the result of this Fetcher.
void AddWaitingRequest(base::WeakPtr<RequestImpl> waiting_request); void AddWaitingRequest(base::WeakPtr<RequestImpl> waiting_request);
...@@ -151,10 +151,9 @@ class OAuth2TokenService::Fetcher : public OAuth2AccessTokenConsumer { ...@@ -151,10 +151,9 @@ class OAuth2TokenService::Fetcher : public OAuth2AccessTokenConsumer {
protected: protected:
// OAuth2AccessTokenConsumer // OAuth2AccessTokenConsumer
virtual void OnGetTokenSuccess(const std::string& access_token, void OnGetTokenSuccess(const std::string& access_token,
const base::Time& expiration_date) override; const base::Time& expiration_date) override;
virtual void OnGetTokenFailure( void OnGetTokenFailure(const GoogleServiceAuthError& error) override;
const GoogleServiceAuthError& error) override;
private: private:
Fetcher(OAuth2TokenService* oauth2_token_service, Fetcher(OAuth2TokenService* oauth2_token_service,
......
...@@ -215,10 +215,10 @@ class OAuth2TokenService : public base::NonThreadSafe { ...@@ -215,10 +215,10 @@ class OAuth2TokenService : public base::NonThreadSafe {
public: public:
// |consumer| is required to outlive this. // |consumer| is required to outlive this.
explicit RequestImpl(const std::string& account_id, Consumer* consumer); explicit RequestImpl(const std::string& account_id, Consumer* consumer);
virtual ~RequestImpl(); ~RequestImpl() override;
// Overridden from Request: // Overridden from Request:
virtual std::string GetAccountId() const override; std::string GetAccountId() const override;
std::string GetConsumerId() const; std::string GetConsumerId() const;
......
...@@ -163,21 +163,21 @@ class RequestCore : public OAuth2TokenServiceRequest::Core, ...@@ -163,21 +163,21 @@ class RequestCore : public OAuth2TokenServiceRequest::Core,
const OAuth2TokenService::ScopeSet& scopes); const OAuth2TokenService::ScopeSet& scopes);
// OAuth2TokenService::Consumer. Must be called on the token service thread. // OAuth2TokenService::Consumer. Must be called on the token service thread.
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token, const std::string& access_token,
const base::Time& expiration_time) override; const base::Time& expiration_time) override;
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
private: private:
friend class base::RefCountedThreadSafe<RequestCore>; friend class base::RefCountedThreadSafe<RequestCore>;
// Must be destroyed on the owner thread. // Must be destroyed on the owner thread.
virtual ~RequestCore(); ~RequestCore() override;
// Core implementation. // Core implementation.
virtual void StartOnTokenServiceThread() override; void StartOnTokenServiceThread() override;
virtual void StopOnTokenServiceThread() override; void StopOnTokenServiceThread() override;
void InformOwnerOnGetTokenSuccess(std::string access_token, void InformOwnerOnGetTokenSuccess(std::string access_token,
base::Time expiration_time); base::Time expiration_time);
...@@ -279,11 +279,11 @@ class InvalidateCore : public OAuth2TokenServiceRequest::Core { ...@@ -279,11 +279,11 @@ class InvalidateCore : public OAuth2TokenServiceRequest::Core {
friend class base::RefCountedThreadSafe<InvalidateCore>; friend class base::RefCountedThreadSafe<InvalidateCore>;
// Must be destroyed on the owner thread. // Must be destroyed on the owner thread.
virtual ~InvalidateCore(); ~InvalidateCore() override;
// Core implementation. // Core implementation.
virtual void StartOnTokenServiceThread() override; void StartOnTokenServiceThread() override;
virtual void StopOnTokenServiceThread() override; void StopOnTokenServiceThread() override;
std::string access_token_; std::string access_token_;
std::string account_id_; std::string account_id_;
......
...@@ -87,10 +87,10 @@ class OAuth2TokenServiceRequest : public OAuth2TokenService::Request, ...@@ -87,10 +87,10 @@ class OAuth2TokenServiceRequest : public OAuth2TokenService::Request,
const OAuth2TokenService::ScopeSet& scopes, const OAuth2TokenService::ScopeSet& scopes,
const std::string& access_token); const std::string& access_token);
virtual ~OAuth2TokenServiceRequest(); ~OAuth2TokenServiceRequest() override;
// OAuth2TokenService::Request. // OAuth2TokenService::Request.
virtual std::string GetAccountId() const override; std::string GetAccountId() const override;
private: private:
OAuth2TokenServiceRequest(const std::string& account_id); OAuth2TokenServiceRequest(const std::string& account_id);
......
...@@ -22,13 +22,13 @@ const char kScope[] = "SCOPE"; ...@@ -22,13 +22,13 @@ const char kScope[] = "SCOPE";
class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer { class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer {
public: public:
TestingOAuth2TokenServiceConsumer(); TestingOAuth2TokenServiceConsumer();
virtual ~TestingOAuth2TokenServiceConsumer(); ~TestingOAuth2TokenServiceConsumer() override;
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token, const std::string& access_token,
const base::Time& expiration_time) override; const base::Time& expiration_time) override;
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
int num_get_token_success_; int num_get_token_success_;
int num_get_token_failure_; int num_get_token_failure_;
...@@ -67,7 +67,7 @@ void TestingOAuth2TokenServiceConsumer::OnGetTokenFailure( ...@@ -67,7 +67,7 @@ void TestingOAuth2TokenServiceConsumer::OnGetTokenFailure(
class MockOAuth2TokenService : public FakeOAuth2TokenService { class MockOAuth2TokenService : public FakeOAuth2TokenService {
public: public:
MockOAuth2TokenService(); MockOAuth2TokenService();
virtual ~MockOAuth2TokenService(); ~MockOAuth2TokenService() override;
void SetResponse(const GoogleServiceAuthError& error, void SetResponse(const GoogleServiceAuthError& error,
const std::string& access_token, const std::string& access_token,
...@@ -80,17 +80,17 @@ class MockOAuth2TokenService : public FakeOAuth2TokenService { ...@@ -80,17 +80,17 @@ class MockOAuth2TokenService : public FakeOAuth2TokenService {
} }
protected: protected:
virtual void FetchOAuth2Token(RequestImpl* request, void FetchOAuth2Token(RequestImpl* request,
const std::string& account_id, const std::string& account_id,
net::URLRequestContextGetter* getter, net::URLRequestContextGetter* getter,
const std::string& client_id, const std::string& client_id,
const std::string& client_secret, const std::string& client_secret,
const ScopeSet& scopes) override; const ScopeSet& scopes) override;
virtual void InvalidateOAuth2Token(const std::string& account_id, void InvalidateOAuth2Token(const std::string& account_id,
const std::string& client_id, const std::string& client_id,
const ScopeSet& scopes, const ScopeSet& scopes,
const std::string& access_token) override; const std::string& access_token) override;
private: private:
GoogleServiceAuthError response_error_; GoogleServiceAuthError response_error_;
...@@ -154,12 +154,12 @@ class OAuth2TokenServiceRequestTest : public testing::Test { ...@@ -154,12 +154,12 @@ class OAuth2TokenServiceRequestTest : public testing::Test {
Provider(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, Provider(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
OAuth2TokenService* token_service); OAuth2TokenService* token_service);
virtual scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner> GetTokenServiceTaskRunner()
GetTokenServiceTaskRunner() override; override;
virtual OAuth2TokenService* GetTokenService() override; OAuth2TokenService* GetTokenService() override;
private: private:
virtual ~Provider(); ~Provider() override;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
OAuth2TokenService* token_service_; OAuth2TokenService* token_service_;
......
...@@ -16,14 +16,14 @@ std::string GetValidTokenResponse(std::string token, int expiration); ...@@ -16,14 +16,14 @@ std::string GetValidTokenResponse(std::string token, int expiration);
class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer { class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer {
public: public:
TestingOAuth2TokenServiceConsumer(); TestingOAuth2TokenServiceConsumer();
virtual ~TestingOAuth2TokenServiceConsumer(); ~TestingOAuth2TokenServiceConsumer() override;
// OAuth2TokenService::Consumer overrides. // OAuth2TokenService::Consumer overrides.
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& token, const std::string& token,
const base::Time& expiration_date) override; const base::Time& expiration_date) override;
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
std::string last_token_; std::string last_token_;
int number_of_successful_tokens_; int number_of_successful_tokens_;
......
...@@ -27,10 +27,10 @@ class RetryingTestingOAuth2TokenServiceConsumer ...@@ -27,10 +27,10 @@ class RetryingTestingOAuth2TokenServiceConsumer
const std::string& account_id) const std::string& account_id)
: oauth2_service_(oauth2_service), : oauth2_service_(oauth2_service),
account_id_(account_id) {} account_id_(account_id) {}
virtual ~RetryingTestingOAuth2TokenServiceConsumer() {} ~RetryingTestingOAuth2TokenServiceConsumer() override {}
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override { const GoogleServiceAuthError& error) override {
TestingOAuth2TokenServiceConsumer::OnGetTokenFailure(request, error); TestingOAuth2TokenServiceConsumer::OnGetTokenFailure(request, error);
request_.reset(oauth2_service_->StartRequest( request_.reset(oauth2_service_->StartRequest(
account_id_, OAuth2TokenService::ScopeSet(), this).release()); account_id_, OAuth2TokenService::ScopeSet(), this).release());
...@@ -62,8 +62,7 @@ class TestOAuth2TokenService : public OAuth2TokenService { ...@@ -62,8 +62,7 @@ class TestOAuth2TokenService : public OAuth2TokenService {
refresh_tokens_[account_id] = refresh_token; refresh_tokens_[account_id] = refresh_token;
} }
virtual bool RefreshTokenIsAvailable(const std::string& account_id) const bool RefreshTokenIsAvailable(const std::string& account_id) const override {
override {
std::map<std::string, std::string>::const_iterator it = std::map<std::string, std::string>::const_iterator it =
refresh_tokens_.find(account_id); refresh_tokens_.find(account_id);
...@@ -72,11 +71,11 @@ class TestOAuth2TokenService : public OAuth2TokenService { ...@@ -72,11 +71,11 @@ class TestOAuth2TokenService : public OAuth2TokenService {
private: private:
// OAuth2TokenService implementation. // OAuth2TokenService implementation.
virtual net::URLRequestContextGetter* GetRequestContext() override { net::URLRequestContextGetter* GetRequestContext() override {
return request_context_getter_.get(); return request_context_getter_.get();
} }
virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher( OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(
const std::string& account_id, const std::string& account_id,
net::URLRequestContextGetter* getter, net::URLRequestContextGetter* getter,
OAuth2AccessTokenConsumer* consumer) override { OAuth2AccessTokenConsumer* consumer) override {
......
...@@ -46,22 +46,21 @@ class UbertokenFetcher : public GaiaAuthConsumer, ...@@ -46,22 +46,21 @@ class UbertokenFetcher : public GaiaAuthConsumer,
UbertokenConsumer* consumer, UbertokenConsumer* consumer,
const std::string& source, const std::string& source,
net::URLRequestContextGetter* request_context); net::URLRequestContextGetter* request_context);
virtual ~UbertokenFetcher(); ~UbertokenFetcher() override;
// Start fetching the token for |account_id|. // Start fetching the token for |account_id|.
virtual void StartFetchingToken(const std::string& account_id); virtual void StartFetchingToken(const std::string& account_id);
// Overriden from GaiaAuthConsumer // Overriden from GaiaAuthConsumer
virtual void OnUberAuthTokenSuccess(const std::string& token) override; void OnUberAuthTokenSuccess(const std::string& token) override;
virtual void OnUberAuthTokenFailure( void OnUberAuthTokenFailure(const GoogleServiceAuthError& error) override;
const GoogleServiceAuthError& error) override;
// Overriden from OAuth2TokenService::Consumer: // Overriden from OAuth2TokenService::Consumer:
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token, const std::string& access_token,
const base::Time& expiration_time) override; const base::Time& expiration_time) override;
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
private: private:
// Request a login-scoped access token from the token service. // Request a login-scoped access token from the token service.
......
...@@ -24,15 +24,14 @@ class MockUbertokenConsumer : public UbertokenConsumer { ...@@ -24,15 +24,14 @@ class MockUbertokenConsumer : public UbertokenConsumer {
last_error_(GoogleServiceAuthError::AuthErrorNone()), last_error_(GoogleServiceAuthError::AuthErrorNone()),
nb_error_(0) { nb_error_(0) {
} }
virtual ~MockUbertokenConsumer() {} ~MockUbertokenConsumer() override {}
virtual void OnUbertokenSuccess(const std::string& token) override { void OnUbertokenSuccess(const std::string& token) override {
last_token_ = token; last_token_ = token;
++ nb_correct_token_; ++ nb_correct_token_;
} }
virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) void OnUbertokenFailure(const GoogleServiceAuthError& error) override {
override {
last_error_ = error; last_error_ = error;
++nb_error_; ++nb_error_;
} }
......
...@@ -14,13 +14,13 @@ namespace gcm { ...@@ -14,13 +14,13 @@ namespace gcm {
// ciphertext. Obviously, this should be used only for testing. // ciphertext. Obviously, this should be used only for testing.
class FakeEncryptor : public Encryptor { class FakeEncryptor : public Encryptor {
public: public:
virtual ~FakeEncryptor(); ~FakeEncryptor() override;
virtual bool EncryptString(const std::string& plaintext, bool EncryptString(const std::string& plaintext,
std::string* ciphertext) override; std::string* ciphertext) override;
virtual bool DecryptString(const std::string& ciphertext, bool DecryptString(const std::string& ciphertext,
std::string* plaintext) override; std::string* plaintext) override;
}; };
} // namespace gcm } // namespace gcm
......
...@@ -63,13 +63,13 @@ class GCM_EXPORT SocketInputStream ...@@ -63,13 +63,13 @@ class GCM_EXPORT SocketInputStream
// |socket| should already be connected. // |socket| should already be connected.
explicit SocketInputStream(net::StreamSocket* socket); explicit SocketInputStream(net::StreamSocket* socket);
virtual ~SocketInputStream(); ~SocketInputStream() override;
// ZeroCopyInputStream implementation. // ZeroCopyInputStream implementation.
virtual bool Next(const void** data, int* size) override; bool Next(const void** data, int* size) override;
virtual void BackUp(int count) override; void BackUp(int count) override;
virtual bool Skip(int count) override; // Not implemented. bool Skip(int count) override; // Not implemented.
virtual int64 ByteCount() const override; int64 ByteCount() const override;
// The remaining amount of valid data available to be read. // The remaining amount of valid data available to be read.
int UnreadByteCount() const; int UnreadByteCount() const;
...@@ -159,12 +159,12 @@ class GCM_EXPORT SocketOutputStream ...@@ -159,12 +159,12 @@ class GCM_EXPORT SocketOutputStream
// |socket| should already be connected. // |socket| should already be connected.
explicit SocketOutputStream(net::StreamSocket* socket); explicit SocketOutputStream(net::StreamSocket* socket);
virtual ~SocketOutputStream(); ~SocketOutputStream() override;
// ZeroCopyOutputStream implementation. // ZeroCopyOutputStream implementation.
virtual bool Next(void** data, int* size) override; bool Next(void** data, int* size) override;
virtual void BackUp(int count) override; void BackUp(int count) override;
virtual int64 ByteCount() const override; int64 ByteCount() const override;
// Writes the buffer into the Socket. // Writes the buffer into the Socket.
net::Error Flush(const base::Closure& callback); net::Error Flush(const base::Closure& callback);
......
...@@ -64,12 +64,12 @@ class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate { ...@@ -64,12 +64,12 @@ class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate {
const CheckinRequestCallback& callback, const CheckinRequestCallback& callback,
net::URLRequestContextGetter* request_context_getter, net::URLRequestContextGetter* request_context_getter,
GCMStatsRecorder* recorder); GCMStatsRecorder* recorder);
virtual ~CheckinRequest(); ~CheckinRequest() override;
void Start(); void Start();
// URLFetcherDelegate implementation. // URLFetcherDelegate implementation.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
private: private:
// Schedules a retry attempt, informs the backoff of a previous request's // Schedules a retry attempt, informs the backoff of a previous request's
......
...@@ -42,23 +42,23 @@ class GCM_EXPORT ConnectionFactoryImpl : ...@@ -42,23 +42,23 @@ class GCM_EXPORT ConnectionFactoryImpl :
const scoped_refptr<net::HttpNetworkSession>& http_network_session, const scoped_refptr<net::HttpNetworkSession>& http_network_session,
net::NetLog* net_log, net::NetLog* net_log,
GCMStatsRecorder* recorder); GCMStatsRecorder* recorder);
virtual ~ConnectionFactoryImpl(); ~ConnectionFactoryImpl() override;
// ConnectionFactory implementation. // ConnectionFactory implementation.
virtual void Initialize( void Initialize(
const BuildLoginRequestCallback& request_builder, const BuildLoginRequestCallback& request_builder,
const ConnectionHandler::ProtoReceivedCallback& read_callback, const ConnectionHandler::ProtoReceivedCallback& read_callback,
const ConnectionHandler::ProtoSentCallback& write_callback) override; const ConnectionHandler::ProtoSentCallback& write_callback) override;
virtual ConnectionHandler* GetConnectionHandler() const override; ConnectionHandler* GetConnectionHandler() const override;
virtual void Connect() override; void Connect() override;
virtual bool IsEndpointReachable() const override; bool IsEndpointReachable() const override;
virtual std::string GetConnectionStateString() const override; std::string GetConnectionStateString() const override;
virtual base::TimeTicks NextRetryAttempt() const override; base::TimeTicks NextRetryAttempt() const override;
virtual void SignalConnectionReset(ConnectionResetReason reason) override; void SignalConnectionReset(ConnectionResetReason reason) override;
virtual void SetConnectionListener(ConnectionListener* listener) override; void SetConnectionListener(ConnectionListener* listener) override;
// NetworkChangeObserver implementation. // NetworkChangeObserver implementation.
virtual void OnNetworkChanged( void OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) override; net::NetworkChangeNotifier::ConnectionType type) override;
// Returns the server to which the factory is currently connected, or if // Returns the server to which the factory is currently connected, or if
......
...@@ -83,9 +83,9 @@ void WriteContinuation() { ...@@ -83,9 +83,9 @@ void WriteContinuation() {
class TestBackoffEntry : public net::BackoffEntry { class TestBackoffEntry : public net::BackoffEntry {
public: public:
explicit TestBackoffEntry(base::SimpleTestTickClock* tick_clock); explicit TestBackoffEntry(base::SimpleTestTickClock* tick_clock);
virtual ~TestBackoffEntry(); ~TestBackoffEntry() override;
virtual base::TimeTicks ImplGetTimeNow() const override; base::TimeTicks ImplGetTimeNow() const override;
private: private:
base::SimpleTestTickClock* tick_clock_; base::SimpleTestTickClock* tick_clock_;
...@@ -107,22 +107,22 @@ base::TimeTicks TestBackoffEntry::ImplGetTimeNow() const { ...@@ -107,22 +107,22 @@ base::TimeTicks TestBackoffEntry::ImplGetTimeNow() const {
class TestConnectionFactoryImpl : public ConnectionFactoryImpl { class TestConnectionFactoryImpl : public ConnectionFactoryImpl {
public: public:
TestConnectionFactoryImpl(const base::Closure& finished_callback); TestConnectionFactoryImpl(const base::Closure& finished_callback);
virtual ~TestConnectionFactoryImpl(); ~TestConnectionFactoryImpl() override;
void InitializeFactory(); void InitializeFactory();
// Overridden stubs. // Overridden stubs.
virtual void ConnectImpl() override; void ConnectImpl() override;
virtual void InitHandler() override; void InitHandler() override;
virtual scoped_ptr<net::BackoffEntry> CreateBackoffEntry( scoped_ptr<net::BackoffEntry> CreateBackoffEntry(
const net::BackoffEntry::Policy* const policy) override; const net::BackoffEntry::Policy* const policy) override;
virtual scoped_ptr<ConnectionHandler> CreateConnectionHandler( scoped_ptr<ConnectionHandler> CreateConnectionHandler(
base::TimeDelta read_timeout, base::TimeDelta read_timeout,
const ConnectionHandler::ProtoReceivedCallback& read_callback, const ConnectionHandler::ProtoReceivedCallback& read_callback,
const ConnectionHandler::ProtoSentCallback& write_callback, const ConnectionHandler::ProtoSentCallback& write_callback,
const ConnectionHandler::ConnectionChangedCallback& connection_callback) const ConnectionHandler::ConnectionChangedCallback& connection_callback)
override; override;
virtual base::TimeTicks NowTicks() override; base::TimeTicks NowTicks() override;
// Helpers for verifying connection attempts are made. Connection results // Helpers for verifying connection attempts are made. Connection results
// must be consumed. // must be consumed.
...@@ -266,9 +266,9 @@ class ConnectionFactoryImplTest ...@@ -266,9 +266,9 @@ class ConnectionFactoryImplTest
void WaitForConnections(); void WaitForConnections();
// ConnectionFactory::ConnectionListener // ConnectionFactory::ConnectionListener
virtual void OnConnected(const GURL& current_server, void OnConnected(const GURL& current_server,
const net::IPEndPoint& ip_endpoint) override; const net::IPEndPoint& ip_endpoint) override;
virtual void OnDisconnected() override; void OnDisconnected() override;
private: private:
void ConnectionsComplete(); void ConnectionsComplete();
......
...@@ -30,15 +30,14 @@ class GCM_EXPORT ConnectionHandlerImpl : public ConnectionHandler { ...@@ -30,15 +30,14 @@ class GCM_EXPORT ConnectionHandlerImpl : public ConnectionHandler {
const ProtoReceivedCallback& read_callback, const ProtoReceivedCallback& read_callback,
const ProtoSentCallback& write_callback, const ProtoSentCallback& write_callback,
const ConnectionChangedCallback& connection_callback); const ConnectionChangedCallback& connection_callback);
virtual ~ConnectionHandlerImpl(); ~ConnectionHandlerImpl() override;
// ConnectionHandler implementation. // ConnectionHandler implementation.
virtual void Init(const mcs_proto::LoginRequest& login_request, void Init(const mcs_proto::LoginRequest& login_request,
net::StreamSocket* socket) override; net::StreamSocket* socket) override;
virtual void Reset() override; void Reset() override;
virtual bool CanSendMessage() const override; bool CanSendMessage() const override;
virtual void SendMessage(const google::protobuf::MessageLite& message) void SendMessage(const google::protobuf::MessageLite& message) override;
override;
private: private:
// State machine for handling incoming data. See WaitForData(..) for usage. // State machine for handling incoming data. See WaitForData(..) for usage.
......
...@@ -17,20 +17,20 @@ class FakeConnectionHandler; ...@@ -17,20 +17,20 @@ class FakeConnectionHandler;
class FakeConnectionFactory : public ConnectionFactory { class FakeConnectionFactory : public ConnectionFactory {
public: public:
FakeConnectionFactory(); FakeConnectionFactory();
virtual ~FakeConnectionFactory(); ~FakeConnectionFactory() override;
// ConnectionFactory implementation. // ConnectionFactory implementation.
virtual void Initialize( void Initialize(
const BuildLoginRequestCallback& request_builder, const BuildLoginRequestCallback& request_builder,
const ConnectionHandler::ProtoReceivedCallback& read_callback, const ConnectionHandler::ProtoReceivedCallback& read_callback,
const ConnectionHandler::ProtoSentCallback& write_callback) override; const ConnectionHandler::ProtoSentCallback& write_callback) override;
virtual ConnectionHandler* GetConnectionHandler() const override; ConnectionHandler* GetConnectionHandler() const override;
virtual void Connect() override; void Connect() override;
virtual bool IsEndpointReachable() const override; bool IsEndpointReachable() const override;
virtual std::string GetConnectionStateString() const override; std::string GetConnectionStateString() const override;
virtual base::TimeTicks NextRetryAttempt() const override; base::TimeTicks NextRetryAttempt() const override;
virtual void SignalConnectionReset(ConnectionResetReason reason) override; void SignalConnectionReset(ConnectionResetReason reason) override;
virtual void SetConnectionListener(ConnectionListener* listener) override; void SetConnectionListener(ConnectionListener* listener) override;
// Whether a connection reset has been triggered and is yet to run. // Whether a connection reset has been triggered and is yet to run.
bool reconnect_pending() const { return reconnect_pending_; } bool reconnect_pending() const { return reconnect_pending_; }
......
...@@ -19,15 +19,14 @@ class FakeConnectionHandler : public ConnectionHandler { ...@@ -19,15 +19,14 @@ class FakeConnectionHandler : public ConnectionHandler {
FakeConnectionHandler( FakeConnectionHandler(
const ConnectionHandler::ProtoReceivedCallback& read_callback, const ConnectionHandler::ProtoReceivedCallback& read_callback,
const ConnectionHandler::ProtoSentCallback& write_callback); const ConnectionHandler::ProtoSentCallback& write_callback);
virtual ~FakeConnectionHandler(); ~FakeConnectionHandler() override;
// ConnectionHandler implementation. // ConnectionHandler implementation.
virtual void Init(const mcs_proto::LoginRequest& login_request, void Init(const mcs_proto::LoginRequest& login_request,
net::StreamSocket* socket) override; net::StreamSocket* socket) override;
virtual void Reset() override; void Reset() override;
virtual bool CanSendMessage() const override; bool CanSendMessage() const override;
virtual void SendMessage(const google::protobuf::MessageLite& message) void SendMessage(const google::protobuf::MessageLite& message) override;
override;
// EXPECT's receipt of |message| via SendMessage(..). // EXPECT's receipt of |message| via SendMessage(..).
void ExpectOutgoingMessage(const MCSMessage& message); void ExpectOutgoingMessage(const MCSMessage& message);
......
...@@ -28,70 +28,68 @@ class GCM_EXPORT GCMStoreImpl : public GCMStore { ...@@ -28,70 +28,68 @@ class GCM_EXPORT GCMStoreImpl : public GCMStore {
GCMStoreImpl(const base::FilePath& path, GCMStoreImpl(const base::FilePath& path,
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner, scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
scoped_ptr<Encryptor> encryptor); scoped_ptr<Encryptor> encryptor);
virtual ~GCMStoreImpl(); ~GCMStoreImpl() override;
// Load the directory and pass the initial state back to caller. // Load the directory and pass the initial state back to caller.
virtual void Load(const LoadCallback& callback) override; void Load(const LoadCallback& callback) override;
// Closes the GCM store. // Closes the GCM store.
virtual void Close() override; void Close() override;
// Clears the GCM store of all data and destroys any LevelDB files associated // Clears the GCM store of all data and destroys any LevelDB files associated
// with this store. // with this store.
// WARNING: this will permanently destroy any pending outgoing messages // WARNING: this will permanently destroy any pending outgoing messages
// and require the device to re-create credentials and serial number mapping // and require the device to re-create credentials and serial number mapping
// tables. // tables.
virtual void Destroy(const UpdateCallback& callback) override; void Destroy(const UpdateCallback& callback) override;
// Sets this device's messaging credentials. // Sets this device's messaging credentials.
virtual void SetDeviceCredentials(uint64 device_android_id, void SetDeviceCredentials(uint64 device_android_id,
uint64 device_security_token, uint64 device_security_token,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
// Registration info. // Registration info.
virtual void AddRegistration(const std::string& app_id, void AddRegistration(const std::string& app_id,
const linked_ptr<RegistrationInfo>& registration, const linked_ptr<RegistrationInfo>& registration,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
virtual void RemoveRegistration(const std::string& app_id, void RemoveRegistration(const std::string& app_id,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
// Unacknowledged incoming message handling. // Unacknowledged incoming message handling.
virtual void AddIncomingMessage(const std::string& persistent_id, void AddIncomingMessage(const std::string& persistent_id,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
virtual void RemoveIncomingMessage(const std::string& persistent_id, void RemoveIncomingMessage(const std::string& persistent_id,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
virtual void RemoveIncomingMessages(const PersistentIdList& persistent_ids, void RemoveIncomingMessages(const PersistentIdList& persistent_ids,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
// Unacknowledged outgoing messages handling. // Unacknowledged outgoing messages handling.
virtual bool AddOutgoingMessage(const std::string& persistent_id, bool AddOutgoingMessage(const std::string& persistent_id,
const MCSMessage& message, const MCSMessage& message,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
virtual void OverwriteOutgoingMessage(const std::string& persistent_id, void OverwriteOutgoingMessage(const std::string& persistent_id,
const MCSMessage& message, const MCSMessage& message,
const UpdateCallback& callback) const UpdateCallback& callback) override;
override; void RemoveOutgoingMessage(const std::string& persistent_id,
virtual void RemoveOutgoingMessage(const std::string& persistent_id, const UpdateCallback& callback) override;
const UpdateCallback& callback) override; void RemoveOutgoingMessages(const PersistentIdList& persistent_ids,
virtual void RemoveOutgoingMessages(const PersistentIdList& persistent_ids, const UpdateCallback& callback) override;
const UpdateCallback& callback) override;
// Sets last device's checkin information. // Sets last device's checkin information.
virtual void SetLastCheckinInfo(const base::Time& time, void SetLastCheckinInfo(const base::Time& time,
const std::set<std::string>& accounts, const std::set<std::string>& accounts,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
// G-service settings handling. // G-service settings handling.
virtual void SetGServicesSettings( void SetGServicesSettings(const std::map<std::string, std::string>& settings,
const std::map<std::string, std::string>& settings, const std::string& settings_digest,
const std::string& settings_digest, const UpdateCallback& callback) override;
const UpdateCallback& callback) override;
// Sets the account information related to device to account mapping. // Sets the account information related to device to account mapping.
virtual void AddAccountMapping(const AccountMapping& account_mapping, void AddAccountMapping(const AccountMapping& account_mapping,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
virtual void RemoveAccountMapping(const std::string& account_id, void RemoveAccountMapping(const std::string& account_id,
const UpdateCallback& callback) override; const UpdateCallback& callback) override;
private: private:
typedef std::map<std::string, int> AppIdToMessageCountMap; typedef std::map<std::string, int> AppIdToMessageCountMap;
......
...@@ -74,7 +74,7 @@ class TestMCSClient : public MCSClient { ...@@ -74,7 +74,7 @@ class TestMCSClient : public MCSClient {
next_id_(0) { next_id_(0) {
} }
virtual std::string GetNextPersistentId() override { std::string GetNextPersistentId() override {
return base::UintToString(++next_id_); return base::UintToString(++next_id_);
} }
......
...@@ -89,12 +89,12 @@ class GCM_EXPORT RegistrationRequest : public net::URLFetcherDelegate { ...@@ -89,12 +89,12 @@ class GCM_EXPORT RegistrationRequest : public net::URLFetcherDelegate {
int max_retry_count, int max_retry_count,
scoped_refptr<net::URLRequestContextGetter> request_context_getter, scoped_refptr<net::URLRequestContextGetter> request_context_getter,
GCMStatsRecorder* recorder); GCMStatsRecorder* recorder);
virtual ~RegistrationRequest(); ~RegistrationRequest() override;
void Start(); void Start();
// URLFetcherDelegate implementation. // URLFetcherDelegate implementation.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
private: private:
// Schedules a retry attempt, informs the backoff of a previous request's // Schedules a retry attempt, informs the backoff of a previous request's
......
...@@ -80,13 +80,13 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate { ...@@ -80,13 +80,13 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate {
const UnregistrationCallback& callback, const UnregistrationCallback& callback,
scoped_refptr<net::URLRequestContextGetter> request_context_getter, scoped_refptr<net::URLRequestContextGetter> request_context_getter,
GCMStatsRecorder* recorder); GCMStatsRecorder* recorder);
virtual ~UnregistrationRequest(); ~UnregistrationRequest() override;
// Starts an unregistration request. // Starts an unregistration request.
void Start(); void Start();
// URLFetcherDelegate implementation. // URLFetcherDelegate implementation.
virtual void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchComplete(const net::URLFetcher* source) override;
private: private:
// Schedules a retry attempt and informs the backoff of previous request's // Schedules a retry attempt and informs the backoff of previous request's
......
...@@ -13,54 +13,51 @@ namespace gcm { ...@@ -13,54 +13,51 @@ namespace gcm {
class FakeGCMStatsRecorder : public GCMStatsRecorder { class FakeGCMStatsRecorder : public GCMStatsRecorder {
public: public:
FakeGCMStatsRecorder(); FakeGCMStatsRecorder();
virtual ~FakeGCMStatsRecorder(); ~FakeGCMStatsRecorder() override;
virtual void RecordCheckinInitiated(uint64 android_id) override; void RecordCheckinInitiated(uint64 android_id) override;
virtual void RecordCheckinDelayedDueToBackoff(int64 delay_msec) override; void RecordCheckinDelayedDueToBackoff(int64 delay_msec) override;
virtual void RecordCheckinSuccess() override; void RecordCheckinSuccess() override;
virtual void RecordCheckinFailure(std::string status, void RecordCheckinFailure(std::string status, bool will_retry) override;
bool will_retry) override; void RecordConnectionInitiated(const std::string& host) override;
virtual void RecordConnectionInitiated(const std::string& host) override; void RecordConnectionDelayedDueToBackoff(int64 delay_msec) override;
virtual void RecordConnectionDelayedDueToBackoff(int64 delay_msec) override; void RecordConnectionSuccess() override;
virtual void RecordConnectionSuccess() override; void RecordConnectionFailure(int network_error) override;
virtual void RecordConnectionFailure(int network_error) override; void RecordConnectionResetSignaled(
virtual void RecordConnectionResetSignaled(
ConnectionFactory::ConnectionResetReason reason) override; ConnectionFactory::ConnectionResetReason reason) override;
virtual void RecordRegistrationSent(const std::string& app_id, void RecordRegistrationSent(const std::string& app_id,
const std::string& sender_ids) override; const std::string& sender_ids) override;
virtual void RecordRegistrationResponse( void RecordRegistrationResponse(const std::string& app_id,
const std::string& app_id, const std::vector<std::string>& sender_ids,
const std::vector<std::string>& sender_ids, RegistrationRequest::Status status) override;
RegistrationRequest::Status status) override; void RecordRegistrationRetryRequested(
virtual void RecordRegistrationRetryRequested(
const std::string& app_id, const std::string& app_id,
const std::vector<std::string>& sender_ids, const std::vector<std::string>& sender_ids,
int retries_left) override; int retries_left) override;
virtual void RecordUnregistrationSent(const std::string& app_id) override; void RecordUnregistrationSent(const std::string& app_id) override;
virtual void RecordUnregistrationResponse( void RecordUnregistrationResponse(
const std::string& app_id, const std::string& app_id,
UnregistrationRequest::Status status) override; UnregistrationRequest::Status status) override;
virtual void RecordUnregistrationRetryDelayed(const std::string& app_id, void RecordUnregistrationRetryDelayed(const std::string& app_id,
int64 delay_msec) override; int64 delay_msec) override;
virtual void RecordDataMessageReceived( void RecordDataMessageReceived(const std::string& app_id,
const std::string& app_id, const std::string& from,
const std::string& from, int message_byte_size,
int message_byte_size, bool to_registered_app,
bool to_registered_app, ReceivedMessageType message_type) override;
ReceivedMessageType message_type) override; void RecordDataSentToWire(const std::string& app_id,
virtual void RecordDataSentToWire(const std::string& app_id, const std::string& receiver_id,
const std::string& receiver_id, const std::string& message_id,
const std::string& message_id, int queued) override;
int queued) override; void RecordNotifySendStatus(const std::string& app_id,
virtual void RecordNotifySendStatus(const std::string& app_id, const std::string& receiver_id,
const std::string& receiver_id, const std::string& message_id,
const std::string& message_id, MCSClient::MessageSendStatus status,
MCSClient::MessageSendStatus status, int byte_size,
int byte_size, int ttl) override;
int ttl) override; void RecordIncomingSendError(const std::string& app_id,
virtual void RecordIncomingSendError(const std::string& app_id, const std::string& receiver_id,
const std::string& receiver_id, const std::string& message_id) override;
const std::string& message_id) override;
private: private:
DISALLOW_COPY_AND_ASSIGN(FakeGCMStatsRecorder); DISALLOW_COPY_AND_ASSIGN(FakeGCMStatsRecorder);
......
...@@ -139,7 +139,7 @@ class MyTestURLRequestContext : public net::TestURLRequestContext { ...@@ -139,7 +139,7 @@ class MyTestURLRequestContext : public net::TestURLRequestContext {
Init(); Init();
} }
virtual ~MyTestURLRequestContext() {} ~MyTestURLRequestContext() override {}
}; };
class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter {
...@@ -148,7 +148,7 @@ class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { ...@@ -148,7 +148,7 @@ class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter {
const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy) const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy)
: TestURLRequestContextGetter(io_message_loop_proxy) {} : TestURLRequestContextGetter(io_message_loop_proxy) {}
virtual net::TestURLRequestContext* GetURLRequestContext() override { net::TestURLRequestContext* GetURLRequestContext() override {
// Construct |context_| lazily so it gets constructed on the right // Construct |context_| lazily so it gets constructed on the right
// thread (the IO thread). // thread (the IO thread).
if (!context_) if (!context_)
...@@ -157,7 +157,7 @@ class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { ...@@ -157,7 +157,7 @@ class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter {
} }
private: private:
virtual ~MyTestURLRequestContextGetter() {} ~MyTestURLRequestContextGetter() override {}
scoped_ptr<MyTestURLRequestContext> context_; scoped_ptr<MyTestURLRequestContext> context_;
}; };
...@@ -166,20 +166,20 @@ class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { ...@@ -166,20 +166,20 @@ class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter {
class MyTestCertVerifier : public net::CertVerifier { class MyTestCertVerifier : public net::CertVerifier {
public: public:
MyTestCertVerifier() {} MyTestCertVerifier() {}
virtual ~MyTestCertVerifier() {} ~MyTestCertVerifier() override {}
virtual int Verify(net::X509Certificate* cert, int Verify(net::X509Certificate* cert,
const std::string& hostname, const std::string& hostname,
int flags, int flags,
net::CRLSet* crl_set, net::CRLSet* crl_set,
net::CertVerifyResult* verify_result, net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback, const net::CompletionCallback& callback,
RequestHandle* out_req, RequestHandle* out_req,
const net::BoundNetLog& net_log) override { const net::BoundNetLog& net_log) override {
return net::OK; return net::OK;
} }
virtual void CancelRequest(RequestHandle req) override { void CancelRequest(RequestHandle req) override {
// Do nothing. // Do nothing.
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment