Chromium Code Reviews| 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_ |