| Index: components/sync/core/http_bridge.cc
|
| diff --git a/sync/internal_api/http_bridge.cc b/components/sync/core/http_bridge.cc
|
| similarity index 95%
|
| rename from sync/internal_api/http_bridge.cc
|
| rename to components/sync/core/http_bridge.cc
|
| index 87884c55373f015673415d68cbe0c7587bbecbfa..2434e5083dbbac1f14f86224ae9a2b80d54f3b11 100644
|
| --- a/sync/internal_api/http_bridge.cc
|
| +++ b/components/sync/core/http_bridge.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "sync/internal_api/public/http_bridge.h"
|
| +#include "components/sync/core/http_bridge.h"
|
|
|
| #include <stddef.h>
|
| #include <stdint.h>
|
| @@ -17,6 +17,7 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| +#include "components/sync/base/cancelation_signal.h"
|
| #include "net/base/load_flags.h"
|
| #include "net/base/net_errors.h"
|
| #include "net/http/http_cache.h"
|
| @@ -28,7 +29,6 @@
|
| #include "net/url_request/url_request_context.h"
|
| #include "net/url_request/url_request_job_factory_impl.h"
|
| #include "net/url_request/url_request_status.h"
|
| -#include "sync/internal_api/public/base/cancelation_signal.h"
|
|
|
| namespace syncer {
|
|
|
| @@ -121,8 +121,7 @@ HttpBridge::URLFetchState::URLFetchState()
|
| request_completed(false),
|
| request_succeeded(false),
|
| http_response_code(-1),
|
| - error_code(-1) {
|
| -}
|
| + error_code(-1) {}
|
| HttpBridge::URLFetchState::~URLFetchState() {}
|
|
|
| HttpBridge::HttpBridge(
|
| @@ -138,10 +137,9 @@ HttpBridge::HttpBridge(
|
| network_time_update_callback_(network_time_update_callback),
|
| bind_to_tracker_callback_(bind_to_tracker_callback) {}
|
|
|
| -HttpBridge::~HttpBridge() {
|
| -}
|
| +HttpBridge::~HttpBridge() {}
|
|
|
| -void HttpBridge::SetExtraRequestHeaders(const char * headers) {
|
| +void HttpBridge::SetExtraRequestHeaders(const char* headers) {
|
| DCHECK(extra_headers_.empty())
|
| << "HttpBridge::SetExtraRequestHeaders called twice.";
|
| extra_headers_.assign(headers);
|
| @@ -199,8 +197,7 @@ bool HttpBridge::MakeSynchronousPost(int* error_code, int* response_code) {
|
| #endif
|
|
|
| if (!network_task_runner_->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&HttpBridge::CallMakeAsynchronousPost, this))) {
|
| + FROM_HERE, base::Bind(&HttpBridge::CallMakeAsynchronousPost, this))) {
|
| // This usually happens when we're in a unit test.
|
| LOG(WARNING) << "Could not post CallMakeAsynchronousPost task";
|
| return false;
|
| @@ -249,10 +246,9 @@ void HttpBridge::MakeAsynchronousPost() {
|
|
|
| fetch_state_.url_poster->AddExtraRequestHeader(base::StringPrintf(
|
| "%s: %s", net::HttpRequestHeaders::kUserAgent, user_agent_.c_str()));
|
| - fetch_state_.url_poster->SetLoadFlags(net::LOAD_BYPASS_CACHE |
|
| - net::LOAD_DISABLE_CACHE |
|
| - net::LOAD_DO_NOT_SAVE_COOKIES |
|
| - net::LOAD_DO_NOT_SEND_COOKIES);
|
| + fetch_state_.url_poster->SetLoadFlags(
|
| + net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE |
|
| + net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES);
|
|
|
| fetch_state_.url_poster->Start();
|
| }
|
| @@ -308,9 +304,8 @@ void HttpBridge::Abort() {
|
| http_post_completed_.Signal();
|
| }
|
|
|
| -void HttpBridge::DestroyURLFetcherOnIOThread(
|
| - net::URLFetcher* fetcher,
|
| - base::Timer* fetch_timer) {
|
| +void HttpBridge::DestroyURLFetcherOnIOThread(net::URLFetcher* fetcher,
|
| + base::Timer* fetch_timer) {
|
| DCHECK(network_task_runner_->BelongsToCurrentThread());
|
| if (fetch_timer)
|
| delete fetch_timer;
|
|
|