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

Unified Diff: google_apis/gcm/engine/gcm_internals_builder.h

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/engine/gcm_internals_builder.h
diff --git a/google_apis/gcm/engine/gcm_internals_builder.h b/google_apis/gcm/engine/gcm_internals_builder.h
new file mode 100644
index 0000000000000000000000000000000000000000..c5f09e329d6b633bc4ad4c2b6d74422d5e6b5499
--- /dev/null
+++ b/google_apis/gcm/engine/gcm_internals_builder.h
@@ -0,0 +1,64 @@
+// 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 GOOGLE_APIS_GCM_ENGINE_GCM_INTERNALS_BUILDER_H_
+#define GOOGLE_APIS_GCM_ENGINE_GCM_INTERNALS_BUILDER_H_
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "google_apis/gcm/engine/gcm_store.h"
jianli 2014/04/09 23:36:58 Do we need to include this?
+#include "google_apis/gcm/engine/mcs_client.h"
jianli 2014/04/09 23:36:58 ditto
+#include "net/base/backoff_entry.h"
+#include "net/base/net_log.h"
jianli 2014/04/09 23:36:58 ditto
+#include "net/url_request/url_request_context_getter.h"
jianli 2014/04/09 23:36:58 ditto
+
+class GURL;
+
+namespace base {
+class Clock;
+class FilePath;
+} // namespace base
+
+namespace net {
+class HttpNetworkSession;
+} // namespace net
+
+namespace gcm {
+
+class ConnectionFactory;
+
+// Helper class for building GCM internals. Allows tests to inject fake versions
+// as necessary.
+class GCM_EXPORT GCMInternalsBuilder {
+ public:
+ GCMInternalsBuilder();
+ virtual ~GCMInternalsBuilder();
+
+ virtual scoped_ptr<base::Clock> BuildClock();
+ virtual scoped_ptr<GCMStore> BuildGCMStore(
+ const base::FilePath& path,
+ const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner);
jianli 2014/04/09 23:36:58 Do we need forward declaration for SequencedTaskRu
+ virtual scoped_ptr<MCSClient> BuildMCSClient(
+ const std::string& version,
+ base::Clock* clock,
+ ConnectionFactory* connection_factory,
+ GCMStore* gcm_store);
+ virtual scoped_ptr<ConnectionFactory> BuildConnectionFactory(
+ const std::vector<GURL>& endpoints,
+ const net::BackoffEntry::Policy& backoff_policy,
+ scoped_refptr<net::HttpNetworkSession> network_session,
+ net::NetLog* net_log);
+
+ // On a Mac ensures that a mock keychain is used.
+ void SetUpForTesting();
+
+ private:
+ bool testing_;
jianli 2014/04/09 23:36:58 nit: DISALLOW_COPY_AND_ASSIGN
+};
+
+} // namespace gcm
+
+#endif // GOOGLE_APIS_GCM_ENGINE_GCM_INTERNALS_BUILDER_H_
« no previous file with comments | « no previous file | google_apis/gcm/engine/gcm_internals_builder.cc » ('j') | google_apis/gcm/engine/gcm_internals_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698