Commit e46b5443 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

Change DriveServiceInterface to use CoreAccountId as account_id

DriveServiceInterface and its subclasses should use CoreAccountId
instead of std::string to denote account_id because they get this
account_id from identity_manager. This should not be a std::string as
that could lead to confusion in using this as gaia_id or email.

Bug: 959157
Change-Id: I6cb20917504f4aeca6fae095df1f018811b17e09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1736668Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689439}
parent 1a3577f7
......@@ -263,7 +263,7 @@ bool DriveServiceOnWorker::HasRefreshToken() const {
return false;
}
void DriveServiceOnWorker::Initialize(const std::string& account_id) {
void DriveServiceOnWorker::Initialize(const CoreAccountId& account_id) {
NOTREACHED();
}
......
......@@ -107,7 +107,7 @@ class DriveServiceOnWorker : public drive::DriveServiceInterface {
bool HasRefreshToken() const override;
// Following virtual methods are expected not to be accessed at all.
void Initialize(const std::string& account_id) override;
void Initialize(const CoreAccountId& account_id) override;
void AddObserver(drive::DriveServiceObserver* observer) override;
void RemoveObserver(drive::DriveServiceObserver* observer) override;
bool CanSendRequest() const override;
......
......@@ -305,7 +305,7 @@ void SyncEngine::InitializeInternal(
drive_service_ = std::move(drive_service);
drive_service_wrapper_.reset(new DriveServiceWrapper(drive_service_.get()));
std::string account_id;
CoreAccountId account_id;
if (identity_manager_)
account_id = identity_manager_->GetPrimaryAccountId();
......
......@@ -243,7 +243,7 @@ DriveAPIService::~DriveAPIService() {
sender_->auth_service()->RemoveObserver(this);
}
void DriveAPIService::Initialize(const std::string& account_id) {
void DriveAPIService::Initialize(const CoreAccountId& account_id) {
DCHECK(thread_checker_.CalledOnValidThread());
std::vector<std::string> scopes;
......
......@@ -119,7 +119,7 @@ class DriveAPIService : public DriveServiceInterface,
~DriveAPIService() override;
// DriveServiceInterface Overrides
void Initialize(const std::string& account_id) override;
void Initialize(const CoreAccountId& account_id) override;
void AddObserver(DriveServiceObserver* observer) override;
void RemoveObserver(DriveServiceObserver* observer) override;
bool CanSendRequest() const override;
......
......@@ -15,6 +15,7 @@
#include "google_apis/drive/base_requests.h"
#include "google_apis/drive/drive_api_requests.h"
#include "google_apis/drive/drive_common_callbacks.h"
#include "google_apis/gaia/core_account_id.h"
namespace base {
class Time;
......@@ -163,7 +164,7 @@ class DriveServiceInterface : public DriveServiceBatchOperationsInterface {
// Common service:
// Initializes the documents service with |account_id|.
virtual void Initialize(const std::string& account_id) = 0;
virtual void Initialize(const CoreAccountId& account_id) = 0;
// Adds an observer.
virtual void AddObserver(DriveServiceObserver* observer) = 0;
......
......@@ -28,7 +28,7 @@ DummyDriveService::DummyDriveService() = default;
DummyDriveService::~DummyDriveService() = default;
void DummyDriveService::Initialize(const std::string& account_id) {}
void DummyDriveService::Initialize(const CoreAccountId& account_id) {}
void DummyDriveService::AddObserver(DriveServiceObserver* observer) {}
......
......@@ -23,7 +23,7 @@ class DummyDriveService : public DriveServiceInterface {
~DummyDriveService() override;
// DriveServiceInterface Overrides
void Initialize(const std::string& account_id) override;
void Initialize(const CoreAccountId& account_id) override;
void AddObserver(DriveServiceObserver* observer) override;
void RemoveObserver(DriveServiceObserver* observer) override;
bool CanSendRequest() const override;
......
......@@ -304,7 +304,7 @@ void FakeDriveService::SetQuotaValue(int64_t used, int64_t total) {
about_resource_->set_quota_bytes_total(total);
}
void FakeDriveService::Initialize(const std::string& account_id) {
void FakeDriveService::Initialize(const CoreAccountId& account_id) {
DCHECK(thread_checker_.CalledOnValidThread());
}
......
......@@ -123,7 +123,7 @@ class FakeDriveService : public DriveServiceInterface {
}
// DriveServiceInterface Overrides
void Initialize(const std::string& account_id) override;
void Initialize(const CoreAccountId& account_id) override;
void AddObserver(DriveServiceObserver* observer) override;
void RemoveObserver(DriveServiceObserver* observer) override;
bool CanSendRequest() const override;
......
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