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

Side by Side Diff: google_apis/gcm/engine/connection_factory_impl.h

Issue 1342613002: Revert of Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GOOGLE_APIS_GCM_ENGINE_CONNECTION_FACTORY_IMPL_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_CONNECTION_FACTORY_IMPL_H_
6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_FACTORY_IMPL_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_FACTORY_IMPL_H_
7 7
8 #include "google_apis/gcm/engine/connection_factory.h" 8 #include "google_apis/gcm/engine/connection_factory.h"
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 18 matching lines...) Expand all
29 class GCMStatsRecorder; 29 class GCMStatsRecorder;
30 30
31 class GCM_EXPORT ConnectionFactoryImpl : 31 class GCM_EXPORT ConnectionFactoryImpl :
32 public ConnectionFactory, 32 public ConnectionFactory,
33 public net::NetworkChangeNotifier::NetworkChangeObserver { 33 public net::NetworkChangeNotifier::NetworkChangeObserver {
34 public: 34 public:
35 // |http_network_session| is an optional network session to use as a source 35 // |http_network_session| is an optional network session to use as a source
36 // for proxy auth credentials (via its HttpAuthCache). |gcm_network_session| 36 // for proxy auth credentials (via its HttpAuthCache). |gcm_network_session|
37 // is the network session through which GCM connections should be made, and 37 // is the network session through which GCM connections should be made, and
38 // must not be the same as |http_network_session|. 38 // must not be the same as |http_network_session|.
39 //
40 // The caller is responsible for making sure the ConnectionFactoryImpl is
41 // destroyed before the |gcm_network_session| and |http_network_session|.
42 ConnectionFactoryImpl( 39 ConnectionFactoryImpl(
43 const std::vector<GURL>& mcs_endpoints, 40 const std::vector<GURL>& mcs_endpoints,
44 const net::BackoffEntry::Policy& backoff_policy, 41 const net::BackoffEntry::Policy& backoff_policy,
45 net::HttpNetworkSession* gcm_network_session, 42 const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
46 net::HttpNetworkSession* http_network_session, 43 const scoped_refptr<net::HttpNetworkSession>& http_network_session,
47 net::NetLog* net_log, 44 net::NetLog* net_log,
48 GCMStatsRecorder* recorder); 45 GCMStatsRecorder* recorder);
49 ~ConnectionFactoryImpl() override; 46 ~ConnectionFactoryImpl() override;
50 47
51 // ConnectionFactory implementation. 48 // ConnectionFactory implementation.
52 void Initialize( 49 void Initialize(
53 const BuildLoginRequestCallback& request_builder, 50 const BuildLoginRequestCallback& request_builder,
54 const ConnectionHandler::ProtoReceivedCallback& read_callback, 51 const ConnectionHandler::ProtoReceivedCallback& read_callback,
55 const ConnectionHandler::ProtoSentCallback& write_callback) override; 52 const ConnectionHandler::ProtoSentCallback& write_callback) override;
56 ConnectionHandler* GetConnectionHandler() const override; 53 ConnectionHandler* GetConnectionHandler() const override;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // Index to the endpoint for which a connection should be attempted next. 128 // Index to the endpoint for which a connection should be attempted next.
132 size_t next_endpoint_; 129 size_t next_endpoint_;
133 // Index to the endpoint that was last successfully connected. 130 // Index to the endpoint that was last successfully connected.
134 size_t last_successful_endpoint_; 131 size_t last_successful_endpoint_;
135 132
136 // The backoff policy to use. 133 // The backoff policy to use.
137 const net::BackoffEntry::Policy backoff_policy_; 134 const net::BackoffEntry::Policy backoff_policy_;
138 135
139 // ---- net:: components for establishing connections. ---- 136 // ---- net:: components for establishing connections. ----
140 // Network session for creating new GCM connections. 137 // Network session for creating new GCM connections.
141 net::HttpNetworkSession* gcm_network_session_; 138 const scoped_refptr<net::HttpNetworkSession> gcm_network_session_;
142 // HTTP Network session. If set, is used for extracting proxy auth 139 // HTTP Network session. If set, is used for extracting proxy auth
143 // credentials. If nullptr, is ignored. 140 // credentials. If not set, is ignored.
144 net::HttpNetworkSession* http_network_session_; 141 const scoped_refptr<net::HttpNetworkSession> http_network_session_;
145 // Net log to use in connection attempts. 142 // Net log to use in connection attempts.
146 net::BoundNetLog bound_net_log_; 143 net::BoundNetLog bound_net_log_;
147 // The current PAC request, if one exists. Owned by the proxy service. 144 // The current PAC request, if one exists. Owned by the proxy service.
148 net::ProxyService::PacRequest* pac_request_; 145 net::ProxyService::PacRequest* pac_request_;
149 // The current proxy info. 146 // The current proxy info.
150 net::ProxyInfo proxy_info_; 147 net::ProxyInfo proxy_info_;
151 // The handle to the socket for the current connection, if one exists. 148 // The handle to the socket for the current connection, if one exists.
152 net::ClientSocketHandle socket_handle_; 149 net::ClientSocketHandle socket_handle_;
153 // Current backoff entry. 150 // Current backoff entry.
154 scoped_ptr<net::BackoffEntry> backoff_entry_; 151 scoped_ptr<net::BackoffEntry> backoff_entry_;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 ConnectionListener* listener_; 193 ConnectionListener* listener_;
197 194
198 base::WeakPtrFactory<ConnectionFactoryImpl> weak_ptr_factory_; 195 base::WeakPtrFactory<ConnectionFactoryImpl> weak_ptr_factory_;
199 196
200 DISALLOW_COPY_AND_ASSIGN(ConnectionFactoryImpl); 197 DISALLOW_COPY_AND_ASSIGN(ConnectionFactoryImpl);
201 }; 198 };
202 199
203 } // namespace gcm 200 } // namespace gcm
204 201
205 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_FACTORY_IMPL_H_ 202 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_FACTORY_IMPL_H_
OLDNEW
« no previous file with comments | « content/shell/browser/shell_url_request_context_getter.cc ('k') | google_apis/gcm/engine/connection_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698