Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: google_apis/gcm/gcm_client_impl.cc

Issue 221453003: Removing the mock-keychain related bool from GCMStore constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving all of the encryptor calls from tests to chrome binary Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: google_apis/gcm/gcm_client_impl.cc
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc
index 9aaa043285e8774c24159866596b7134fad6274b..ae7d01547d42aa8b8c9f6a21b7ba57370cc75d5f 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -11,12 +11,11 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/sequenced_task_runner.h"
-#include "base/time/default_clock.h"
+#include "base/time/clock.h"
#include "google_apis/gcm/base/mcs_message.h"
#include "google_apis/gcm/base/mcs_util.h"
#include "google_apis/gcm/engine/checkin_request.h"
-#include "google_apis/gcm/engine/connection_factory_impl.h"
-#include "google_apis/gcm/engine/gcm_store_impl.h"
+#include "google_apis/gcm/engine/connection_factory.h"
#include "google_apis/gcm/engine/mcs_client.h"
#include "google_apis/gcm/protocol/mcs.pb.h"
#include "net/http/http_network_session.h"
@@ -118,37 +117,6 @@ MessageType DecodeMessageType(const std::string& value) {
} // namespace
-GCMInternalsBuilder::GCMInternalsBuilder() {}
-GCMInternalsBuilder::~GCMInternalsBuilder() {}
-
-scoped_ptr<base::Clock> GCMInternalsBuilder::BuildClock() {
- return make_scoped_ptr<base::Clock>(new base::DefaultClock());
-}
-
-scoped_ptr<MCSClient> GCMInternalsBuilder::BuildMCSClient(
- const std::string& version,
- base::Clock* clock,
- ConnectionFactory* connection_factory,
- GCMStore* gcm_store) {
- return make_scoped_ptr<MCSClient>(
- new MCSClient(version,
- clock,
- connection_factory,
- gcm_store));
-}
-
-scoped_ptr<ConnectionFactory> GCMInternalsBuilder::BuildConnectionFactory(
- const std::vector<GURL>& endpoints,
- const net::BackoffEntry::Policy& backoff_policy,
- scoped_refptr<net::HttpNetworkSession> network_session,
- net::NetLog* net_log) {
- return make_scoped_ptr<ConnectionFactory>(
- new ConnectionFactoryImpl(endpoints,
- backoff_policy,
- network_session,
- net_log));
-}
-
GCMClientImpl::GCMClientImpl(scoped_ptr<GCMInternalsBuilder> internals_builder)
: internals_builder_(internals_builder.Pass()),
state_(UNINITIALIZED),
@@ -185,7 +153,8 @@ void GCMClientImpl::Initialize(
chrome_build_proto_.CopyFrom(chrome_build_proto);
account_ids_ = account_ids;
- gcm_store_.reset(new GCMStoreImpl(false, path, blocking_task_runner));
+ gcm_store_ =
+ internals_builder_->BuildGCMStore(path, blocking_task_runner).Pass();
delegate_ = delegate;

Powered by Google App Engine
This is Rietveld 408576698