Commit 8ad80515 authored by jianli@chromium.org's avatar jianli@chromium.org

Retrieve chrome build info in GCMProfileService, instead of GCMDriver

Since GCMDriver is going to be moved into component, it cannot access
chrome build info. So we now let GCMProfileService retrieve and pass
it.

Also change to define build info in GCMClient, instead of relying on
the one defined in proto buffer generated file.

BUG=356716
TEST=existing tests

Patch

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272453 0039d316-1c4b-4281-b951-d872f2087c98
parent 46d78188
...@@ -30,7 +30,7 @@ FakeGCMClient::~FakeGCMClient() { ...@@ -30,7 +30,7 @@ FakeGCMClient::~FakeGCMClient() {
} }
void FakeGCMClient::Initialize( void FakeGCMClient::Initialize(
const checkin_proto::ChromeBuildProto& chrome_build_proto, const ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const std::vector<std::string>& account_ids, const std::vector<std::string>& account_ids,
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
......
...@@ -37,7 +37,7 @@ class FakeGCMClient : public GCMClient { ...@@ -37,7 +37,7 @@ class FakeGCMClient : public GCMClient {
// Overridden from GCMClient: // Overridden from GCMClient:
// Called on IO thread. // Called on IO thread.
virtual void Initialize( virtual void Initialize(
const checkin_proto::ChromeBuildProto& chrome_build_proto, const ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const std::vector<std::string>& account_ids, const std::vector<std::string>& account_ids,
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
......
...@@ -18,56 +18,10 @@ ...@@ -18,56 +18,10 @@
#include "components/gcm_driver/gcm_client_factory.h" #include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/system_encryptor.h" #include "components/gcm_driver/system_encryptor.h"
#include "google_apis/gaia/oauth2_token_service.h" #include "google_apis/gaia/oauth2_token_service.h"
#include "google_apis/gcm/protocol/android_checkin.pb.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
namespace gcm { namespace gcm {
namespace {
checkin_proto::ChromeBuildProto_Platform GetPlatform() {
#if defined(OS_WIN)
return checkin_proto::ChromeBuildProto_Platform_PLATFORM_WIN;
#elif defined(OS_MACOSX)
return checkin_proto::ChromeBuildProto_Platform_PLATFORM_MAC;
#elif defined(OS_IOS)
return checkin_proto::ChromeBuildProto_Platform_PLATFORM_IOS;
#elif defined(OS_CHROMEOS)
return checkin_proto::ChromeBuildProto_Platform_PLATFORM_CROS;
#elif defined(OS_LINUX)
return checkin_proto::ChromeBuildProto_Platform_PLATFORM_LINUX;
#else
// For all other platforms, return as LINUX.
return checkin_proto::ChromeBuildProto_Platform_PLATFORM_LINUX;
#endif
}
std::string GetVersion() {
chrome::VersionInfo version_info;
return version_info.Version();
}
checkin_proto::ChromeBuildProto_Channel GetChannel() {
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
switch (channel) {
case chrome::VersionInfo::CHANNEL_UNKNOWN:
return checkin_proto::ChromeBuildProto_Channel_CHANNEL_UNKNOWN;
case chrome::VersionInfo::CHANNEL_CANARY:
return checkin_proto::ChromeBuildProto_Channel_CHANNEL_CANARY;
case chrome::VersionInfo::CHANNEL_DEV:
return checkin_proto::ChromeBuildProto_Channel_CHANNEL_DEV;
case chrome::VersionInfo::CHANNEL_BETA:
return checkin_proto::ChromeBuildProto_Channel_CHANNEL_BETA;
case chrome::VersionInfo::CHANNEL_STABLE:
return checkin_proto::ChromeBuildProto_Channel_CHANNEL_STABLE;
default:
NOTREACHED();
return checkin_proto::ChromeBuildProto_Channel_CHANNEL_UNKNOWN;
}
}
} // namespace
// Helper class to save tasks to run until we're ready to execute them. // Helper class to save tasks to run until we're ready to execute them.
class GCMDriver::DelayedTaskController { class GCMDriver::DelayedTaskController {
public: public:
...@@ -152,6 +106,7 @@ class GCMDriver::IOWorker : public GCMClient::Delegate { ...@@ -152,6 +106,7 @@ class GCMDriver::IOWorker : public GCMClient::Delegate {
// Called on IO thread. // Called on IO thread.
void Initialize( void Initialize(
scoped_ptr<GCMClientFactory> gcm_client_factory, scoped_ptr<GCMClientFactory> gcm_client_factory,
const GCMClient::ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const std::vector<std::string>& account_ids, const std::vector<std::string>& account_ids,
const scoped_refptr<net::URLRequestContextGetter>& request_context, const scoped_refptr<net::URLRequestContextGetter>& request_context,
...@@ -196,6 +151,7 @@ GCMDriver::IOWorker::~IOWorker() { ...@@ -196,6 +151,7 @@ GCMDriver::IOWorker::~IOWorker() {
void GCMDriver::IOWorker::Initialize( void GCMDriver::IOWorker::Initialize(
scoped_ptr<GCMClientFactory> gcm_client_factory, scoped_ptr<GCMClientFactory> gcm_client_factory,
const GCMClient::ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const std::vector<std::string>& account_ids, const std::vector<std::string>& account_ids,
const scoped_refptr<net::URLRequestContextGetter>& request_context, const scoped_refptr<net::URLRequestContextGetter>& request_context,
...@@ -204,12 +160,7 @@ void GCMDriver::IOWorker::Initialize( ...@@ -204,12 +160,7 @@ void GCMDriver::IOWorker::Initialize(
gcm_client_ = gcm_client_factory->BuildInstance(); gcm_client_ = gcm_client_factory->BuildInstance();
checkin_proto::ChromeBuildProto chrome_build_proto; gcm_client_->Initialize(chrome_build_info,
chrome_build_proto.set_platform(GetPlatform());
chrome_build_proto.set_chrome_version(GetVersion());
chrome_build_proto.set_channel(GetChannel());
gcm_client_->Initialize(chrome_build_proto,
store_path, store_path,
account_ids, account_ids,
blocking_task_runner, blocking_task_runner,
...@@ -369,6 +320,7 @@ void GCMDriver::IOWorker::SetGCMRecording(bool recording) { ...@@ -369,6 +320,7 @@ void GCMDriver::IOWorker::SetGCMRecording(bool recording) {
GCMDriver::GCMDriver( GCMDriver::GCMDriver(
scoped_ptr<GCMClientFactory> gcm_client_factory, scoped_ptr<GCMClientFactory> gcm_client_factory,
scoped_ptr<IdentityProvider> identity_provider, scoped_ptr<IdentityProvider> identity_provider,
const GCMClient::ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const scoped_refptr<net::URLRequestContextGetter>& request_context, const scoped_refptr<net::URLRequestContextGetter>& request_context,
const scoped_refptr<base::SequencedTaskRunner>& ui_thread, const scoped_refptr<base::SequencedTaskRunner>& ui_thread,
...@@ -394,6 +346,7 @@ GCMDriver::GCMDriver( ...@@ -394,6 +346,7 @@ GCMDriver::GCMDriver(
base::Bind(&GCMDriver::IOWorker::Initialize, base::Bind(&GCMDriver::IOWorker::Initialize,
base::Unretained(io_worker_.get()), base::Unretained(io_worker_.get()),
base::Passed(&gcm_client_factory), base::Passed(&gcm_client_factory),
chrome_build_info,
store_path, store_path,
account_ids, account_ids,
request_context, request_context,
......
...@@ -52,6 +52,7 @@ class GCMDriver : public IdentityProvider::Observer { ...@@ -52,6 +52,7 @@ class GCMDriver : public IdentityProvider::Observer {
GCMDriver( GCMDriver(
scoped_ptr<GCMClientFactory> gcm_client_factory, scoped_ptr<GCMClientFactory> gcm_client_factory,
scoped_ptr<IdentityProvider> identity_provider, scoped_ptr<IdentityProvider> identity_provider,
const GCMClient::ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const scoped_refptr<net::URLRequestContextGetter>& request_context, const scoped_refptr<net::URLRequestContextGetter>& request_context,
const scoped_refptr<base::SequencedTaskRunner>& ui_thread, const scoped_refptr<base::SequencedTaskRunner>& ui_thread,
......
...@@ -197,6 +197,7 @@ void GCMDriverTest::CreateDriver( ...@@ -197,6 +197,7 @@ void GCMDriverTest::CreateDriver(
base::MessageLoopProxy::current(), base::MessageLoopProxy::current(),
io_thread_.message_loop_proxy())).Pass(), io_thread_.message_loop_proxy())).Pass(),
identity_provider_owner_.PassAs<IdentityProvider>(), identity_provider_owner_.PassAs<IdentityProvider>(),
GCMClient::ChromeBuildInfo(),
temp_dir_.path(), temp_dir_.path(),
request_context, request_context,
base::MessageLoopProxy::current(), base::MessageLoopProxy::current(),
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/services/gcm/gcm_driver.h" #include "chrome/browser/services/gcm/gcm_driver.h"
#include "chrome/browser/services/gcm/gcm_utils.h"
#include "chrome/browser/signin/profile_identity_provider.h" #include "chrome/browser/signin/profile_identity_provider.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/signin_manager_factory.h"
...@@ -101,6 +102,7 @@ GCMProfileService::GCMProfileService( ...@@ -101,6 +102,7 @@ GCMProfileService::GCMProfileService(
SigninManagerFactory::GetForProfile(profile_), SigninManagerFactory::GetForProfile(profile_),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_), ProfileOAuth2TokenServiceFactory::GetForProfile(profile_),
login_ui_service)), login_ui_service)),
GetChromeBuildInfo(),
profile_->GetPath().Append(chrome::kGCMStoreDirname), profile_->GetPath().Append(chrome::kGCMStoreDirname),
profile_->GetRequestContext(), profile_->GetRequestContext(),
content::BrowserThread::GetMessageLoopProxyForThread( content::BrowserThread::GetMessageLoopProxyForThread(
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/services/gcm/gcm_utils.h"
#include "base/logging.h"
#include "chrome/common/chrome_version_info.h"
namespace gcm {
namespace {
GCMClient::ChromePlatform GetPlatform() {
#if defined(OS_WIN)
return GCMClient::PLATFORM_WIN;
#elif defined(OS_MACOSX)
return GCMClient::PLATFORM_MAC;
#elif defined(OS_IOS)
return GCMClient::PLATFORM_IOS;
#elif defined(OS_ANDROID)
return GCMClient::PLATFORM_ANDROID;
#elif defined(OS_CHROMEOS)
return GCMClient::PLATFORM_CROS;
#elif defined(OS_LINUX)
return GCMClient::PLATFORM_LINUX;
#else
// For all other platforms, return as LINUX.
return GCMClient::PLATFORM_LINUX;
#endif
}
GCMClient::ChromeChannel GetChannel() {
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
switch (channel) {
case chrome::VersionInfo::CHANNEL_UNKNOWN:
return GCMClient::CHANNEL_UNKNOWN;
case chrome::VersionInfo::CHANNEL_CANARY:
return GCMClient::CHANNEL_CANARY;
case chrome::VersionInfo::CHANNEL_DEV:
return GCMClient::CHANNEL_DEV;
case chrome::VersionInfo::CHANNEL_BETA:
return GCMClient::CHANNEL_BETA;
case chrome::VersionInfo::CHANNEL_STABLE:
return GCMClient::CHANNEL_STABLE;
default:
NOTREACHED();
return GCMClient::CHANNEL_UNKNOWN;
}
}
std::string GetVersion() {
chrome::VersionInfo version_info;
return version_info.Version();
}
} // namespace
GCMClient::ChromeBuildInfo GetChromeBuildInfo() {
GCMClient::ChromeBuildInfo chrome_build_info;
chrome_build_info.platform = GetPlatform();
chrome_build_info.channel = GetChannel();
chrome_build_info.version = GetVersion();
return chrome_build_info;
}
} // namespace gcm
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SERVICES_GCM_GCM_UTILS_H_
#define CHROME_BROWSER_SERVICES_GCM_GCM_UTILS_H_
#include "google_apis/gcm/gcm_client.h"
namespace gcm {
// Returns the chrome build info that is passed to GCM.
GCMClient::ChromeBuildInfo GetChromeBuildInfo();
} // namespace gcm
#endif // CHROME_BROWSER_SERVICES_GCM_GCM_UTILS_H_
...@@ -2004,6 +2004,8 @@ ...@@ -2004,6 +2004,8 @@
'browser/services/gcm/gcm_profile_service.h', 'browser/services/gcm/gcm_profile_service.h',
'browser/services/gcm/gcm_profile_service_factory.cc', 'browser/services/gcm/gcm_profile_service_factory.cc',
'browser/services/gcm/gcm_profile_service_factory.h', 'browser/services/gcm/gcm_profile_service_factory.h',
'browser/services/gcm/gcm_utils.cc',
'browser/services/gcm/gcm_utils.h',
'browser/service_process/service_process_control.cc', 'browser/service_process/service_process_control.cc',
'browser/service_process/service_process_control_mac.mm', 'browser/service_process/service_process_control_mac.mm',
'browser/service_process/service_process_control.h', 'browser/service_process/service_process_control.h',
......
...@@ -6,6 +6,14 @@ ...@@ -6,6 +6,14 @@
namespace gcm { namespace gcm {
GCMClient::ChromeBuildInfo::ChromeBuildInfo()
: platform(PLATFORM_UNKNOWN),
channel(CHANNEL_UNKNOWN) {
}
GCMClient::ChromeBuildInfo::~ChromeBuildInfo() {
}
GCMClient::OutgoingMessage::OutgoingMessage() GCMClient::OutgoingMessage::OutgoingMessage()
: time_to_live(kMaximumTTL) { : time_to_live(kMaximumTTL) {
} }
......
...@@ -20,10 +20,6 @@ class FilePath; ...@@ -20,10 +20,6 @@ class FilePath;
class SequencedTaskRunner; class SequencedTaskRunner;
} }
namespace checkin_proto {
class ChromeBuildProto;
}
namespace net { namespace net {
class URLRequestContextGetter; class URLRequestContextGetter;
} }
...@@ -58,6 +54,33 @@ class GCM_EXPORT GCMClient { ...@@ -58,6 +54,33 @@ class GCM_EXPORT GCMClient {
UNKNOWN_ERROR UNKNOWN_ERROR
}; };
enum ChromePlatform {
PLATFORM_WIN,
PLATFORM_MAC,
PLATFORM_LINUX,
PLATFORM_CROS,
PLATFORM_IOS,
PLATFORM_ANDROID,
PLATFORM_UNKNOWN
};
enum ChromeChannel {
CHANNEL_STABLE,
CHANNEL_BETA,
CHANNEL_DEV,
CHANNEL_CANARY,
CHANNEL_UNKNOWN
};
struct GCM_EXPORT ChromeBuildInfo {
ChromeBuildInfo();
~ChromeBuildInfo();
ChromePlatform platform;
ChromeChannel channel;
std::string version;
};
// Message data consisting of key-value pairs. // Message data consisting of key-value pairs.
typedef std::map<std::string, std::string> MessageData; typedef std::map<std::string, std::string> MessageData;
...@@ -173,7 +196,7 @@ class GCM_EXPORT GCMClient { ...@@ -173,7 +196,7 @@ class GCM_EXPORT GCMClient {
// Begins initialization of the GCM Client. This will not trigger a // Begins initialization of the GCM Client. This will not trigger a
// connection. // connection.
// |chrome_build_proto|: chrome info, i.e., version, channel and etc. // |chrome_build_info|: chrome info, i.e., version, channel and etc.
// |store_path|: path to the GCM store. // |store_path|: path to the GCM store.
// |account_ids|: account IDs to be related to the device when checking in. // |account_ids|: account IDs to be related to the device when checking in.
// |blocking_task_runner|: for running blocking file tasks. // |blocking_task_runner|: for running blocking file tasks.
...@@ -181,7 +204,7 @@ class GCM_EXPORT GCMClient { ...@@ -181,7 +204,7 @@ class GCM_EXPORT GCMClient {
// |delegate|: the delegate whose methods will be called asynchronously in // |delegate|: the delegate whose methods will be called asynchronously in
// response to events and messages. // response to events and messages.
virtual void Initialize( virtual void Initialize(
const checkin_proto::ChromeBuildProto& chrome_build_proto, const ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const std::vector<std::string>& account_ids, const std::vector<std::string>& account_ids,
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "google_apis/gcm/engine/connection_factory_impl.h" #include "google_apis/gcm/engine/connection_factory_impl.h"
#include "google_apis/gcm/engine/gcm_store_impl.h" #include "google_apis/gcm/engine/gcm_store_impl.h"
#include "google_apis/gcm/monitoring/gcm_stats_recorder.h" #include "google_apis/gcm/monitoring/gcm_stats_recorder.h"
#include "google_apis/gcm/protocol/checkin.pb.h"
#include "google_apis/gcm/protocol/mcs.pb.h" #include "google_apis/gcm/protocol/mcs.pb.h"
#include "net/http/http_network_session.h" #include "net/http/http_network_session.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
...@@ -115,6 +116,67 @@ GCMClient::Result ToGCMClientResult(MCSClient::MessageSendStatus status) { ...@@ -115,6 +116,67 @@ GCMClient::Result ToGCMClientResult(MCSClient::MessageSendStatus status) {
return GCMClientImpl::UNKNOWN_ERROR; return GCMClientImpl::UNKNOWN_ERROR;
} }
void ToCheckinProtoVersion(
const GCMClient::ChromeBuildInfo& chrome_build_info,
checkin_proto::ChromeBuildProto* android_build_info) {
checkin_proto::ChromeBuildProto_Platform platform;
switch (chrome_build_info.platform) {
case GCMClient::PLATFORM_WIN:
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_WIN;
break;
case GCMClient::PLATFORM_MAC:
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_MAC;
break;
case GCMClient::PLATFORM_LINUX:
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_LINUX;
break;
case GCMClient::PLATFORM_IOS:
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_IOS;
break;
case GCMClient::PLATFORM_ANDROID:
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_ANDROID;
break;
case GCMClient::PLATFORM_CROS:
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_CROS;
break;
case GCMClient::PLATFORM_UNKNOWN:
// For unknown platform, return as LINUX.
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_LINUX;
break;
default:
NOTREACHED();
platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_LINUX;
break;
}
android_build_info->set_platform(platform);
checkin_proto::ChromeBuildProto_Channel channel;
switch (chrome_build_info.channel) {
case GCMClient::CHANNEL_STABLE:
channel = checkin_proto::ChromeBuildProto_Channel_CHANNEL_STABLE;
break;
case GCMClient::CHANNEL_BETA:
channel = checkin_proto::ChromeBuildProto_Channel_CHANNEL_BETA;
break;
case GCMClient::CHANNEL_DEV:
channel = checkin_proto::ChromeBuildProto_Channel_CHANNEL_DEV;
break;
case GCMClient::CHANNEL_CANARY:
channel = checkin_proto::ChromeBuildProto_Channel_CHANNEL_CANARY;
break;
case GCMClient::CHANNEL_UNKNOWN:
channel = checkin_proto::ChromeBuildProto_Channel_CHANNEL_UNKNOWN;
break;
default:
NOTREACHED();
channel = checkin_proto::ChromeBuildProto_Channel_CHANNEL_UNKNOWN;
break;
}
android_build_info->set_channel(channel);
android_build_info->set_chrome_version(chrome_build_info.version);
}
MessageType DecodeMessageType(const std::string& value) { MessageType DecodeMessageType(const std::string& value) {
if (kMessageTypeDeletedMessagesKey == value) if (kMessageTypeDeletedMessagesKey == value)
return DELETED_MESSAGES; return DELETED_MESSAGES;
...@@ -201,7 +263,7 @@ GCMClientImpl::~GCMClientImpl() { ...@@ -201,7 +263,7 @@ GCMClientImpl::~GCMClientImpl() {
} }
void GCMClientImpl::Initialize( void GCMClientImpl::Initialize(
const checkin_proto::ChromeBuildProto& chrome_build_proto, const ChromeBuildInfo& chrome_build_info,
const base::FilePath& path, const base::FilePath& path,
const std::vector<std::string>& account_ids, const std::vector<std::string>& account_ids,
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
...@@ -220,7 +282,7 @@ void GCMClientImpl::Initialize( ...@@ -220,7 +282,7 @@ void GCMClientImpl::Initialize(
DCHECK(network_session_params); DCHECK(network_session_params);
network_session_ = new net::HttpNetworkSession(*network_session_params); network_session_ = new net::HttpNetworkSession(*network_session_params);
chrome_build_proto_.CopyFrom(chrome_build_proto); chrome_build_info_ = chrome_build_info;
account_ids_ = account_ids; account_ids_ = account_ids;
gcm_store_.reset( gcm_store_.reset(
...@@ -280,7 +342,7 @@ void GCMClientImpl::InitializeMCSClient( ...@@ -280,7 +342,7 @@ void GCMClientImpl::InitializeMCSClient(
net_log_.net_log(), net_log_.net_log(),
&recorder_); &recorder_);
mcs_client_ = internals_builder_->BuildMCSClient( mcs_client_ = internals_builder_->BuildMCSClient(
chrome_build_proto_.chrome_version(), chrome_build_info_.version,
clock_.get(), clock_.get(),
connection_factory_.get(), connection_factory_.get(),
gcm_store_.get(), gcm_store_.get(),
...@@ -333,11 +395,13 @@ void GCMClientImpl::StartCheckin() { ...@@ -333,11 +395,13 @@ void GCMClientImpl::StartCheckin() {
if (checkin_request_.get()) if (checkin_request_.get())
return; return;
checkin_proto::ChromeBuildProto chrome_build_proto;
ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id, CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id,
device_checkin_info_.secret, device_checkin_info_.secret,
gservices_settings_.digest(), gservices_settings_.digest(),
account_ids_, account_ids_,
chrome_build_proto_); chrome_build_proto);
checkin_request_.reset( checkin_request_.reset(
new CheckinRequest(gservices_settings_.GetCheckinURL(), new CheckinRequest(gservices_settings_.GetCheckinURL(),
request_info, request_info,
......
...@@ -81,7 +81,7 @@ class GCM_EXPORT GCMClientImpl ...@@ -81,7 +81,7 @@ class GCM_EXPORT GCMClientImpl
// Overridden from GCMClient: // Overridden from GCMClient:
virtual void Initialize( virtual void Initialize(
const checkin_proto::ChromeBuildProto& chrome_build_proto, const ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path, const base::FilePath& store_path,
const std::vector<std::string>& account_ids, const std::vector<std::string>& account_ids,
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
...@@ -249,7 +249,7 @@ class GCM_EXPORT GCMClientImpl ...@@ -249,7 +249,7 @@ class GCM_EXPORT GCMClientImpl
// Information about the chrome build. // Information about the chrome build.
// TODO(fgorski): Check if it can be passed in constructor and made const. // TODO(fgorski): Check if it can be passed in constructor and made const.
checkin_proto::ChromeBuildProto chrome_build_proto_; ChromeBuildInfo chrome_build_info_;
// Persistent data store for keeping device credentials, messages and user to // Persistent data store for keeping device credentials, messages and user to
// serial number mappings. // serial number mappings.
......
...@@ -444,8 +444,8 @@ void GCMClientImplTest::InitializeGCMClient() { ...@@ -444,8 +444,8 @@ void GCMClientImplTest::InitializeGCMClient() {
clock()->Advance(base::TimeDelta::FromMilliseconds(1)); clock()->Advance(base::TimeDelta::FromMilliseconds(1));
// Actual initialization. // Actual initialization.
checkin_proto::ChromeBuildProto chrome_build_proto; GCMClient::ChromeBuildInfo chrome_build_info;
gcm_client_->Initialize(chrome_build_proto, gcm_client_->Initialize(chrome_build_info,
temp_directory_.path(), temp_directory_.path(),
std::vector<std::string>(), std::vector<std::string>(),
message_loop_.message_loop_proxy(), message_loop_.message_loop_proxy(),
......
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