OLD | NEW |
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 SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
13 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
14 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
15 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
16 #include "net/url_request/url_fetcher_delegate.h" | 18 #include "net/url_request/url_fetcher_delegate.h" |
17 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" |
18 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
19 #include "sync/base/sync_export.h" | 21 #include "sync/base/sync_export.h" |
20 #include "sync/internal_api/public/base/cancelation_observer.h" | 22 #include "sync/internal_api/public/base/cancelation_observer.h" |
21 #include "sync/internal_api/public/http_post_provider_factory.h" | 23 #include "sync/internal_api/public/http_post_provider_factory.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // GetResponseContentLength() characters when using GetResponseContent. e.g | 71 // GetResponseContentLength() characters when using GetResponseContent. e.g |
70 // string r(b->GetResponseContent(), b->GetResponseContentLength()). | 72 // string r(b->GetResponseContent(), b->GetResponseContentLength()). |
71 int GetResponseContentLength() const override; | 73 int GetResponseContentLength() const override; |
72 const char* GetResponseContent() const override; | 74 const char* GetResponseContent() const override; |
73 const std::string GetResponseHeaderValue( | 75 const std::string GetResponseHeaderValue( |
74 const std::string& name) const override; | 76 const std::string& name) const override; |
75 | 77 |
76 // net::URLFetcherDelegate implementation. | 78 // net::URLFetcherDelegate implementation. |
77 void OnURLFetchComplete(const net::URLFetcher* source) override; | 79 void OnURLFetchComplete(const net::URLFetcher* source) override; |
78 void OnURLFetchDownloadProgress(const net::URLFetcher* source, | 80 void OnURLFetchDownloadProgress(const net::URLFetcher* source, |
79 int64 current, int64 total) override; | 81 int64_t current, |
| 82 int64_t total) override; |
80 void OnURLFetchUploadProgress(const net::URLFetcher* source, | 83 void OnURLFetchUploadProgress(const net::URLFetcher* source, |
81 int64 current, int64 total) override; | 84 int64_t current, |
| 85 int64_t total) override; |
82 | 86 |
83 net::URLRequestContextGetter* GetRequestContextGetterForTest() const; | 87 net::URLRequestContextGetter* GetRequestContextGetterForTest() const; |
84 | 88 |
85 protected: | 89 protected: |
86 ~HttpBridge() override; | 90 ~HttpBridge() override; |
87 | 91 |
88 // Protected virtual so the unit test can override to shunt network requests. | 92 // Protected virtual so the unit test can override to shunt network requests. |
89 virtual void MakeAsynchronousPost(); | 93 virtual void MakeAsynchronousPost(); |
90 | 94 |
91 private: | 95 private: |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // 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 |
223 // service by data_use_measurement component. | 227 // service by data_use_measurement component. |
224 BindToTrackerCallback bind_to_tracker_callback_; | 228 BindToTrackerCallback bind_to_tracker_callback_; |
225 | 229 |
226 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory); | 230 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory); |
227 }; | 231 }; |
228 | 232 |
229 } // namespace syncer | 233 } // namespace syncer |
230 | 234 |
231 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ | 235 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ |
OLD | NEW |