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

Side by Side Diff: components/sync/engine/net/http_bridge.h

Issue 2380143002: [Sync] Enable Compression from Client to Server by experiment (Closed)
Patch Set: rebase Created 4 years, 2 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 COMPONENTS_SYNC_ENGINE_NET_HTTP_BRIDGE_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_NET_HTTP_BRIDGE_H_
6 #define COMPONENTS_SYNC_ENGINE_NET_HTTP_BRIDGE_H_ 6 #define COMPONENTS_SYNC_ENGINE_NET_HTTP_BRIDGE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/feature_list.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/synchronization/lock.h" 17 #include "base/synchronization/lock.h"
17 #include "base/synchronization/waitable_event.h" 18 #include "base/synchronization/waitable_event.h"
18 #include "base/threading/thread_checker.h" 19 #include "base/threading/thread_checker.h"
19 #include "base/timer/timer.h" 20 #include "base/timer/timer.h"
20 #include "components/sync/base/cancelation_observer.h" 21 #include "components/sync/base/cancelation_observer.h"
21 #include "components/sync/engine/net/http_post_provider_factory.h" 22 #include "components/sync/engine/net/http_post_provider_factory.h"
22 #include "components/sync/engine/net/http_post_provider_interface.h" 23 #include "components/sync/engine/net/http_post_provider_interface.h"
23 #include "components/sync/engine/net/network_time_update_callback.h" 24 #include "components/sync/engine/net/network_time_update_callback.h"
24 #include "net/url_request/url_fetcher_delegate.h" 25 #include "net/url_request/url_fetcher_delegate.h"
25 #include "net/url_request/url_request_context.h" 26 #include "net/url_request/url_request_context.h"
26 #include "net/url_request/url_request_context_getter.h" 27 #include "net/url_request/url_request_context_getter.h"
27 #include "url/gurl.h" 28 #include "url/gurl.h"
28 29
29 class HttpBridgeTest; 30 class HttpBridgeTest;
30 31
31 namespace net { 32 namespace net {
32 class HttpResponseHeaders; 33 class HttpResponseHeaders;
33 class HttpUserAgentSettings; 34 class HttpUserAgentSettings;
34 class URLFetcher; 35 class URLFetcher;
35 class URLRequestJobFactory; 36 class URLRequestJobFactory;
36 } 37 }
37 38
38 namespace syncer { 39 namespace syncer {
39 40
40 class CancelationSignal; 41 class CancelationSignal;
42 extern const base::Feature kSyncClientToServerCompression;
41 43
42 // A bridge between the syncer and Chromium HTTP layers. 44 // A bridge between the syncer and Chromium HTTP layers.
43 // Provides a way for the sync backend to use Chromium directly for HTTP 45 // Provides a way for the sync backend to use Chromium directly for HTTP
44 // requests rather than depending on a third party provider (e.g libcurl). 46 // requests rather than depending on a third party provider (e.g libcurl).
45 // This is a one-time use bridge. Create one for each request you want to make. 47 // This is a one-time use bridge. Create one for each request you want to make.
46 // It is RefCountedThreadSafe because it can PostTask to the io loop, and thus 48 // It is RefCountedThreadSafe because it can PostTask to the io loop, and thus
47 // needs to stick around across context switches, etc. 49 // needs to stick around across context switches, etc.
48 class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, 50 class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>,
49 public HttpPostProviderInterface, 51 public HttpPostProviderInterface,
50 public net::URLFetcherDelegate { 52 public net::URLFetcherDelegate {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // A callback to tag Sync request to be able to record data use of this 226 // A callback to tag Sync request to be able to record data use of this
225 // service by data_use_measurement component. 227 // service by data_use_measurement component.
226 BindToTrackerCallback bind_to_tracker_callback_; 228 BindToTrackerCallback bind_to_tracker_callback_;
227 229
228 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory); 230 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory);
229 }; 231 };
230 232
231 } // namespace syncer 233 } // namespace syncer
232 234
233 #endif // COMPONENTS_SYNC_ENGINE_NET_HTTP_BRIDGE_H_ 235 #endif // COMPONENTS_SYNC_ENGINE_NET_HTTP_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698