Update ASan/Android runtime and setup script to LLVM r200682.
[chromium-blink-merge.git] / google_apis / gcm / engine / fake_connection_factory.h
blobbd29310603101726f821f8d77e9e3253c2ef193d
1 // Copyright 2013 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.
5 #ifndef GOOGLE_APIS_GCM_ENGINE_FAKE_CONNECTION_FACTORY_H_
6 #define GOOGLE_APIS_GCM_ENGINE_FAKE_CONNECTION_FACTORY_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "google_apis/gcm/engine/connection_factory.h"
11 namespace gcm {
13 class FakeConnectionHandler;
15 // A connection factory that mocks out real connections, using a fake connection
16 // handler instead.
17 class FakeConnectionFactory : public ConnectionFactory {
18 public:
19 FakeConnectionFactory();
20 virtual ~FakeConnectionFactory();
22 // ConnectionFactory implementation.
23 virtual void Initialize(
24 const BuildLoginRequestCallback& request_builder,
25 const ConnectionHandler::ProtoReceivedCallback& read_callback,
26 const ConnectionHandler::ProtoSentCallback& write_callback) OVERRIDE;
27 virtual ConnectionHandler* GetConnectionHandler() const OVERRIDE;
28 virtual void Connect() OVERRIDE;
29 virtual bool IsEndpointReachable() const OVERRIDE;
30 virtual base::TimeTicks NextRetryAttempt() const OVERRIDE;
31 virtual void SignalConnectionReset() OVERRIDE;
33 private:
34 scoped_ptr<FakeConnectionHandler> connection_handler_;
36 BuildLoginRequestCallback request_builder_;
38 DISALLOW_COPY_AND_ASSIGN(FakeConnectionFactory);
41 } // namespace gcm
43 #endif // GOOGLE_APIS_GCM_ENGINE_FAKE_CONNECTION_FACTORY_H_