Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GCM_INTERNALS_BUILDER_H_ | |
| 6 #define GOOGLE_APIS_GCM_ENGINE_GCM_INTERNALS_BUILDER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "google_apis/gcm/engine/gcm_store.h" | |
|
jianli
2014/04/09 23:36:58
Do we need to include this?
| |
| 13 #include "google_apis/gcm/engine/mcs_client.h" | |
|
jianli
2014/04/09 23:36:58
ditto
| |
| 14 #include "net/base/backoff_entry.h" | |
| 15 #include "net/base/net_log.h" | |
|
jianli
2014/04/09 23:36:58
ditto
| |
| 16 #include "net/url_request/url_request_context_getter.h" | |
|
jianli
2014/04/09 23:36:58
ditto
| |
| 17 | |
| 18 class GURL; | |
| 19 | |
| 20 namespace base { | |
| 21 class Clock; | |
| 22 class FilePath; | |
| 23 } // namespace base | |
| 24 | |
| 25 namespace net { | |
| 26 class HttpNetworkSession; | |
| 27 } // namespace net | |
| 28 | |
| 29 namespace gcm { | |
| 30 | |
| 31 class ConnectionFactory; | |
| 32 | |
| 33 // Helper class for building GCM internals. Allows tests to inject fake versions | |
| 34 // as necessary. | |
| 35 class GCM_EXPORT GCMInternalsBuilder { | |
| 36 public: | |
| 37 GCMInternalsBuilder(); | |
| 38 virtual ~GCMInternalsBuilder(); | |
| 39 | |
| 40 virtual scoped_ptr<base::Clock> BuildClock(); | |
| 41 virtual scoped_ptr<GCMStore> BuildGCMStore( | |
| 42 const base::FilePath& path, | |
| 43 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); | |
|
jianli
2014/04/09 23:36:58
Do we need forward declaration for SequencedTaskRu
| |
| 44 virtual scoped_ptr<MCSClient> BuildMCSClient( | |
| 45 const std::string& version, | |
| 46 base::Clock* clock, | |
| 47 ConnectionFactory* connection_factory, | |
| 48 GCMStore* gcm_store); | |
| 49 virtual scoped_ptr<ConnectionFactory> BuildConnectionFactory( | |
| 50 const std::vector<GURL>& endpoints, | |
| 51 const net::BackoffEntry::Policy& backoff_policy, | |
| 52 scoped_refptr<net::HttpNetworkSession> network_session, | |
| 53 net::NetLog* net_log); | |
| 54 | |
| 55 // On a Mac ensures that a mock keychain is used. | |
| 56 void SetUpForTesting(); | |
| 57 | |
| 58 private: | |
| 59 bool testing_; | |
|
jianli
2014/04/09 23:36:58
nit: DISALLOW_COPY_AND_ASSIGN
| |
| 60 }; | |
| 61 | |
| 62 } // namespace gcm | |
| 63 | |
| 64 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_INTERNALS_BUILDER_H_ | |
| OLD | NEW |