Commit b9454e04 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Make HttpPostProviderInterface refcounted

This allows the corresponding factory to return refptrs instead of raw
pointers, and lets remove the explicit Destroy() method.
One downside is that now all implementations have to be refcounted, but
this only affects some test implementations.

One particular test implementation, TestHttpBridge[Factory], was unused
and is deleted.

Bug: 951350
Change-Id: I8c581136389e2ce470786dffefa3145e88c5d19c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466237
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarVictor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#816494}
parent 9cc4c7f6
...@@ -6485,7 +6485,6 @@ static_library("test_support") { ...@@ -6485,7 +6485,6 @@ static_library("test_support") {
"//chrome/browser/subresource_filter:test_support", "//chrome/browser/subresource_filter:test_support",
"//chrome/common", "//chrome/common",
"//chrome/common/safe_browsing:proto", "//chrome/common/safe_browsing:proto",
"//components/browser_sync:test_support",
"//components/consent_auditor:test_support", "//components/consent_auditor:test_support",
"//components/invalidation/impl", "//components/invalidation/impl",
"//components/invalidation/impl:test_support", "//components/invalidation/impl:test_support",
......
...@@ -4091,7 +4091,6 @@ test("unit_tests") { ...@@ -4091,7 +4091,6 @@ test("unit_tests") {
"//chrome/services/machine_learning/public/cpp:test_support", "//chrome/services/machine_learning/public/cpp:test_support",
"//components/account_id", "//components/account_id",
"//components/autofill/content/renderer:test_support", "//components/autofill/content/renderer:test_support",
"//components/browser_sync:test_support",
"//components/browsing_data/content:test_support", "//components/browsing_data/content:test_support",
"//components/captive_portal/core:buildflags", "//components/captive_portal/core:buildflags",
"//components/component_updater:test_support", "//components/component_updater:test_support",
......
...@@ -47,7 +47,6 @@ source_set("unit_tests") { ...@@ -47,7 +47,6 @@ source_set("unit_tests") {
deps = [ deps = [
":browser_sync", ":browser_sync",
":test_support",
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//components/autofill/core/browser:test_support", "//components/autofill/core/browser:test_support",
...@@ -73,24 +72,3 @@ source_set("unit_tests") { ...@@ -73,24 +72,3 @@ source_set("unit_tests") {
"//testing/gtest", "//testing/gtest",
] ]
} }
static_library("test_support") {
testonly = true
sources = [
"test_http_bridge_factory.cc",
"test_http_bridge_factory.h",
]
deps = [
":browser_sync",
"//base",
"//base/test:test_support",
"//components/bookmarks/browser",
"//components/history/core/browser",
"//components/sync",
"//components/sync:test_support",
"//components/sync_preferences:test_support",
"//components/sync_sessions:test_support",
"//services/network:test_support",
]
}
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/browser_sync/test_http_bridge_factory.h"
namespace browser_sync {
bool TestHttpBridge::MakeSynchronousPost(int* net_error_code,
int* http_status_code) {
return false;
}
int TestHttpBridge::GetResponseContentLength() const {
return 0;
}
const char* TestHttpBridge::GetResponseContent() const {
return nullptr;
}
const std::string TestHttpBridge::GetResponseHeaderValue(
const std::string&) const {
return std::string();
}
void TestHttpBridge::Abort() {}
TestHttpBridgeFactory::TestHttpBridgeFactory() {}
TestHttpBridgeFactory::~TestHttpBridgeFactory() {}
syncer::HttpPostProviderInterface* TestHttpBridgeFactory::Create() {
return new TestHttpBridge();
}
void TestHttpBridgeFactory::Destroy(syncer::HttpPostProviderInterface* http) {
delete static_cast<TestHttpBridge*>(http);
}
} // namespace browser_sync
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_BROWSER_SYNC_TEST_HTTP_BRIDGE_FACTORY_H_
#define COMPONENTS_BROWSER_SYNC_TEST_HTTP_BRIDGE_FACTORY_H_
#include <string>
#include "base/compiler_specific.h"
#include "components/sync/engine/net/http_post_provider_factory.h"
#include "components/sync/engine/net/http_post_provider_interface.h"
namespace browser_sync {
class TestHttpBridge : public syncer::HttpPostProviderInterface {
public:
// Begin syncer::HttpPostProviderInterface implementation:
void SetExtraRequestHeaders(const char* headers) override {}
void SetURL(const char* url, int port) override {}
void SetPostPayload(const char* content_type,
int content_length,
const char* content) override {}
bool MakeSynchronousPost(int* net_error_code, int* http_status_code) override;
int GetResponseContentLength() const override;
const char* GetResponseContent() const override;
const std::string GetResponseHeaderValue(const std::string&) const override;
void Abort() override;
// End syncer::HttpPostProviderInterface implementation.
};
class TestHttpBridgeFactory : public syncer::HttpPostProviderFactory {
public:
TestHttpBridgeFactory();
~TestHttpBridgeFactory() override;
// syncer::HttpPostProviderFactory:
syncer::HttpPostProviderInterface* Create() override;
void Destroy(syncer::HttpPostProviderInterface* http) override;
};
} // namespace browser_sync
#endif // COMPONENTS_BROWSER_SYNC_TEST_HTTP_BRIDGE_FACTORY_H_
...@@ -67,17 +67,12 @@ HttpBridgeFactory::HttpBridgeFactory( ...@@ -67,17 +67,12 @@ HttpBridgeFactory::HttpBridgeFactory(
HttpBridgeFactory::~HttpBridgeFactory() = default; HttpBridgeFactory::~HttpBridgeFactory() = default;
HttpPostProviderInterface* HttpBridgeFactory::Create() { scoped_refptr<HttpPostProviderInterface> HttpBridgeFactory::Create() {
DCHECK(url_loader_factory_); DCHECK(url_loader_factory_);
scoped_refptr<HttpBridge> http = new HttpBridge( scoped_refptr<HttpPostProviderInterface> http = new HttpBridge(
user_agent_, url_loader_factory_->Clone(), network_time_update_callback_); user_agent_, url_loader_factory_->Clone(), network_time_update_callback_);
http->AddRef(); return http;
return http.get();
}
void HttpBridgeFactory::Destroy(HttpPostProviderInterface* http) {
static_cast<HttpBridge*>(http)->Release();
} }
HttpBridge::URLFetchState::URLFetchState() HttpBridge::URLFetchState::URLFetchState()
...@@ -103,7 +98,7 @@ HttpBridge::HttpBridge( ...@@ -103,7 +98,7 @@ HttpBridge::HttpBridge(
{base::MayBlock()})), {base::MayBlock()})),
network_time_update_callback_(network_time_update_callback) {} network_time_update_callback_(network_time_update_callback) {}
HttpBridge::~HttpBridge() {} HttpBridge::~HttpBridge() = default;
void HttpBridge::SetExtraRequestHeaders(const char* headers) { void HttpBridge::SetExtraRequestHeaders(const char* headers) {
DCHECK(extra_headers_.empty()) DCHECK(extra_headers_.empty())
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
...@@ -39,10 +39,7 @@ namespace syncer { ...@@ -39,10 +39,7 @@ namespace syncer {
// Provides a way for the sync backend to use Chromium directly for HTTP // Provides a way for the sync backend to use Chromium directly for HTTP
// requests rather than depending on a third party provider (e.g libcurl). // requests rather than depending on a third party provider (e.g libcurl).
// This is a one-time use bridge. Create one for each request you want to make. // This is a one-time use bridge. Create one for each request you want to make.
// It is RefCountedThreadSafe because it can PostTask to the io loop, and thus class HttpBridge : public HttpPostProviderInterface {
// needs to stick around across context switches, etc.
class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>,
public HttpPostProviderInterface {
public: public:
HttpBridge(const std::string& user_agent, HttpBridge(const std::string& user_agent,
std::unique_ptr<network::PendingSharedURLLoaderFactory> std::unique_ptr<network::PendingSharedURLLoaderFactory>
...@@ -85,7 +82,6 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, ...@@ -85,7 +82,6 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>,
} }
private: private:
friend class base::RefCountedThreadSafe<HttpBridge>;
FRIEND_TEST_ALL_PREFIXES(SyncHttpBridgeTest, FRIEND_TEST_ALL_PREFIXES(SyncHttpBridgeTest,
AbortAndReleaseBeforeFetchComplete); AbortAndReleaseBeforeFetchComplete);
// Test is disabled on Android. // Test is disabled on Android.
...@@ -204,8 +200,7 @@ class HttpBridgeFactory : public HttpPostProviderFactory { ...@@ -204,8 +200,7 @@ class HttpBridgeFactory : public HttpPostProviderFactory {
~HttpBridgeFactory() override; ~HttpBridgeFactory() override;
// HttpPostProviderFactory: // HttpPostProviderFactory:
HttpPostProviderInterface* Create() override; scoped_refptr<HttpPostProviderInterface> Create() override;
void Destroy(HttpPostProviderInterface* http) override;
private: private:
// The user agent to use in all requests. // The user agent to use in all requests.
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <string> #include <string>
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/scoped_refptr.h"
#include "components/sync/engine/net/network_time_update_callback.h" #include "components/sync/engine/net/network_time_update_callback.h"
namespace network { namespace network {
...@@ -25,19 +26,10 @@ class HttpPostProviderInterface; ...@@ -25,19 +26,10 @@ class HttpPostProviderInterface;
// HttpPostProviders. // HttpPostProviders.
class HttpPostProviderFactory { class HttpPostProviderFactory {
public: public:
virtual ~HttpPostProviderFactory() {} virtual ~HttpPostProviderFactory() = default;
// Obtain a new HttpPostProviderInterface instance, owned by caller. // Obtain a new HttpPostProviderInterface instance, owned by caller.
virtual HttpPostProviderInterface* Create() = 0; virtual scoped_refptr<HttpPostProviderInterface> Create() = 0;
// When the provider is no longer needed (ready to be cleaned up), clients
// must call Destroy().
// This allows actual HttpPostProvider subclass implementations to be
// reference counted, which is useful if a particular implementation uses
// multiple threads to serve network requests.
// TODO(crbug.com/951350): Either pass out unique_ptrs to providers, or make
// the provider interface refcounted, to avoid this manual destruction.
virtual void Destroy(HttpPostProviderInterface* http) = 0;
}; };
using CreateHttpPostProviderFactory = using CreateHttpPostProviderFactory =
......
...@@ -7,13 +7,19 @@ ...@@ -7,13 +7,19 @@
#include <string> #include <string>
#include "base/memory/ref_counted.h"
namespace syncer { namespace syncer {
// An interface the embedding application (e.g. Chromium) implements to provide // An interface the embedding application (e.g. Chromium) implements to provide
// required HTTP POST functionality to the syncer backend. This interface is // required HTTP POST functionality to the syncer backend. This interface is
// designed for one-time use. You create one, use it, and create another if you // designed for one-time use. You create one, use it, and create another if you
// want to make a subsequent POST. // want to make a subsequent POST.
class HttpPostProviderInterface { // It is RefCountedThreadSafe because its implementations may PostTask to
// background task runners, and thus need to stick around across context
// switches, etc.
class HttpPostProviderInterface
: public base::RefCountedThreadSafe<HttpPostProviderInterface> {
public: public:
// Add additional headers to the request. // Add additional headers to the request.
virtual void SetExtraRequestHeaders(const char* headers) = 0; virtual void SetExtraRequestHeaders(const char* headers) = 0;
...@@ -55,7 +61,8 @@ class HttpPostProviderInterface { ...@@ -55,7 +61,8 @@ class HttpPostProviderInterface {
virtual void Abort() = 0; virtual void Abort() = 0;
protected: protected:
virtual ~HttpPostProviderInterface() {} friend class base::RefCountedThreadSafe<HttpPostProviderInterface>;
virtual ~HttpPostProviderInterface() = default;
}; };
} // namespace syncer } // namespace syncer
......
...@@ -76,7 +76,7 @@ class Connection : public CancelationObserver { ...@@ -76,7 +76,7 @@ class Connection : public CancelationObserver {
// operation should be aborted. // operation should be aborted.
CancelationSignal* const cancelation_signal_; CancelationSignal* const cancelation_signal_;
HttpPostProviderInterface* const post_provider_; scoped_refptr<HttpPostProviderInterface> const post_provider_;
std::string buffer_; std::string buffer_;
...@@ -93,29 +93,24 @@ Connection::Connection(HttpPostProviderFactory* factory, ...@@ -93,29 +93,24 @@ Connection::Connection(HttpPostProviderFactory* factory,
DCHECK(post_provider_); DCHECK(post_provider_);
} }
Connection::~Connection() { Connection::~Connection() = default;
factory_->Destroy(post_provider_);
}
bool Connection::Init(const std::string& connection_url, bool Connection::Init(const std::string& connection_url,
int sync_server_port, int sync_server_port,
const std::string& access_token, const std::string& access_token,
const std::string& payload, const std::string& payload,
HttpResponse* response) { HttpResponse* response) {
std::string sync_server; post_provider_->SetURL(connection_url.c_str(), sync_server_port);
HttpPostProviderInterface* http = post_provider_;
http->SetURL(connection_url.c_str(), sync_server_port);
if (!access_token.empty()) { if (!access_token.empty()) {
std::string headers; std::string headers;
headers = "Authorization: Bearer " + access_token; headers = "Authorization: Bearer " + access_token;
http->SetExtraRequestHeaders(headers.c_str()); post_provider_->SetExtraRequestHeaders(headers.c_str());
} }
// Must be octet-stream, or the payload may be parsed for a cookie. // Must be octet-stream, or the payload may be parsed for a cookie.
http->SetPostPayload("application/octet-stream", payload.length(), post_provider_->SetPostPayload("application/octet-stream", payload.length(),
payload.data()); payload.data());
// Issue the POST, blocking until it finishes. // Issue the POST, blocking until it finishes.
int net_error_code = 0; int net_error_code = 0;
...@@ -130,7 +125,8 @@ bool Connection::Init(const std::string& connection_url, ...@@ -130,7 +125,8 @@ bool Connection::Init(const std::string& connection_url,
&CancelationSignal::UnregisterHandler, &CancelationSignal::UnregisterHandler,
base::Unretained(cancelation_signal_), base::Unretained(this))); base::Unretained(cancelation_signal_), base::Unretained(this)));
if (!http->MakeSynchronousPost(&net_error_code, &http_status_code)) { if (!post_provider_->MakeSynchronousPost(&net_error_code,
&http_status_code)) {
DCHECK_NE(net_error_code, net::OK); DCHECK_NE(net_error_code, net::OK);
DVLOG(1) << "Http POST failed, error returns: " << net_error_code; DVLOG(1) << "Http POST failed, error returns: " << net_error_code;
response->server_status = HttpResponse::CONNECTION_UNAVAILABLE; response->server_status = HttpResponse::CONNECTION_UNAVAILABLE;
...@@ -141,9 +137,9 @@ bool Connection::Init(const std::string& connection_url, ...@@ -141,9 +137,9 @@ bool Connection::Init(const std::string& connection_url,
// We got a server response, copy over response codes and content. // We got a server response, copy over response codes and content.
response->http_status_code = http_status_code; response->http_status_code = http_status_code;
response->content_length = response->content_length =
static_cast<int64_t>(http->GetResponseContentLength()); static_cast<int64_t>(post_provider_->GetResponseContentLength());
response->payload_length = response->payload_length =
static_cast<int64_t>(http->GetResponseContentLength()); static_cast<int64_t>(post_provider_->GetResponseContentLength());
if (response->http_status_code == net::HTTP_OK) if (response->http_status_code == net::HTTP_OK)
response->server_status = HttpResponse::SERVER_CONNECTION_OK; response->server_status = HttpResponse::SERVER_CONNECTION_OK;
else if (response->http_status_code == net::HTTP_UNAUTHORIZED) else if (response->http_status_code == net::HTTP_UNAUTHORIZED)
...@@ -152,7 +148,8 @@ bool Connection::Init(const std::string& connection_url, ...@@ -152,7 +148,8 @@ bool Connection::Init(const std::string& connection_url,
response->server_status = HttpResponse::SYNC_SERVER_ERROR; response->server_status = HttpResponse::SYNC_SERVER_ERROR;
// Write the content into our buffer. // Write the content into our buffer.
buffer_.assign(http->GetResponseContent(), http->GetResponseContentLength()); buffer_.assign(post_provider_->GetResponseContent(),
post_provider_->GetResponseContentLength());
return true; return true;
} }
......
...@@ -27,7 +27,6 @@ class BlockingHttpPost : public HttpPostProviderInterface { ...@@ -27,7 +27,6 @@ class BlockingHttpPost : public HttpPostProviderInterface {
BlockingHttpPost() BlockingHttpPost()
: wait_for_abort_(base::WaitableEvent::ResetPolicy::AUTOMATIC, : wait_for_abort_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED) {} base::WaitableEvent::InitialState::NOT_SIGNALED) {}
~BlockingHttpPost() override {}
void SetExtraRequestHeaders(const char* headers) override {} void SetExtraRequestHeaders(const char* headers) override {}
void SetURL(const char* url, int port) override {} void SetURL(const char* url, int port) override {}
...@@ -49,19 +48,18 @@ class BlockingHttpPost : public HttpPostProviderInterface { ...@@ -49,19 +48,18 @@ class BlockingHttpPost : public HttpPostProviderInterface {
void Abort() override { wait_for_abort_.Signal(); } void Abort() override { wait_for_abort_.Signal(); }
private: private:
~BlockingHttpPost() override = default;
base::WaitableEvent wait_for_abort_; base::WaitableEvent wait_for_abort_;
}; };
class BlockingHttpPostFactory : public HttpPostProviderFactory { class BlockingHttpPostFactory : public HttpPostProviderFactory {
public: public:
~BlockingHttpPostFactory() override {} ~BlockingHttpPostFactory() override = default;
HttpPostProviderInterface* Create() override { scoped_refptr<HttpPostProviderInterface> Create() override {
return new BlockingHttpPost(); return new BlockingHttpPost();
} }
void Destroy(HttpPostProviderInterface* http) override {
delete static_cast<BlockingHttpPost*>(http);
}
}; };
} // namespace } // namespace
...@@ -130,7 +128,6 @@ class FailingHttpPost : public HttpPostProviderInterface { ...@@ -130,7 +128,6 @@ class FailingHttpPost : public HttpPostProviderInterface {
public: public:
explicit FailingHttpPost(int net_error_code) explicit FailingHttpPost(int net_error_code)
: net_error_code_(net_error_code) {} : net_error_code_(net_error_code) {}
~FailingHttpPost() override {}
void SetExtraRequestHeaders(const char* headers) override {} void SetExtraRequestHeaders(const char* headers) override {}
void SetURL(const char* url, int port) override {} void SetURL(const char* url, int port) override {}
...@@ -151,6 +148,8 @@ class FailingHttpPost : public HttpPostProviderInterface { ...@@ -151,6 +148,8 @@ class FailingHttpPost : public HttpPostProviderInterface {
void Abort() override {} void Abort() override {}
private: private:
~FailingHttpPost() override = default;
int net_error_code_; int net_error_code_;
}; };
...@@ -158,14 +157,11 @@ class FailingHttpPostFactory : public HttpPostProviderFactory { ...@@ -158,14 +157,11 @@ class FailingHttpPostFactory : public HttpPostProviderFactory {
public: public:
explicit FailingHttpPostFactory(int net_error_code) explicit FailingHttpPostFactory(int net_error_code)
: net_error_code_(net_error_code) {} : net_error_code_(net_error_code) {}
~FailingHttpPostFactory() override {} ~FailingHttpPostFactory() override = default;
HttpPostProviderInterface* Create() override { scoped_refptr<HttpPostProviderInterface> Create() override {
return new FailingHttpPost(net_error_code_); return new FailingHttpPost(net_error_code_);
} }
void Destroy(HttpPostProviderInterface* http) override {
delete static_cast<FailingHttpPost*>(http);
}
private: private:
int net_error_code_; int net_error_code_;
......
...@@ -69,8 +69,6 @@ namespace { ...@@ -69,8 +69,6 @@ namespace {
class TestHttpPostProviderInterface : public HttpPostProviderInterface { class TestHttpPostProviderInterface : public HttpPostProviderInterface {
public: public:
~TestHttpPostProviderInterface() override {}
void SetExtraRequestHeaders(const char* headers) override {} void SetExtraRequestHeaders(const char* headers) override {}
void SetURL(const char* url, int port) override {} void SetURL(const char* url, int port) override {}
void SetPostPayload(const char* content_type, void SetPostPayload(const char* content_type,
...@@ -87,17 +85,17 @@ class TestHttpPostProviderInterface : public HttpPostProviderInterface { ...@@ -87,17 +85,17 @@ class TestHttpPostProviderInterface : public HttpPostProviderInterface {
return std::string(); return std::string();
} }
void Abort() override {} void Abort() override {}
private:
~TestHttpPostProviderInterface() override = default;
}; };
class TestHttpPostProviderFactory : public HttpPostProviderFactory { class TestHttpPostProviderFactory : public HttpPostProviderFactory {
public: public:
~TestHttpPostProviderFactory() override {} ~TestHttpPostProviderFactory() override = default;
HttpPostProviderInterface* Create() override { scoped_refptr<HttpPostProviderInterface> Create() override {
return new TestHttpPostProviderInterface(); return new TestHttpPostProviderInterface();
} }
void Destroy(HttpPostProviderInterface* http) override {
delete static_cast<TestHttpPostProviderInterface*>(http);
}
}; };
class SyncManagerObserverMock : public SyncManager::Observer { class SyncManagerObserverMock : public SyncManager::Observer {
......
...@@ -24,18 +24,12 @@ FakeServerHttpPostProviderFactory::FakeServerHttpPostProviderFactory( ...@@ -24,18 +24,12 @@ FakeServerHttpPostProviderFactory::FakeServerHttpPostProviderFactory(
: fake_server_(fake_server), : fake_server_(fake_server),
fake_server_task_runner_(fake_server_task_runner) {} fake_server_task_runner_(fake_server_task_runner) {}
FakeServerHttpPostProviderFactory::~FakeServerHttpPostProviderFactory() {} FakeServerHttpPostProviderFactory::~FakeServerHttpPostProviderFactory() =
default;
syncer::HttpPostProviderInterface* FakeServerHttpPostProviderFactory::Create() { scoped_refptr<syncer::HttpPostProviderInterface>
FakeServerHttpPostProvider* http = FakeServerHttpPostProviderFactory::Create() {
new FakeServerHttpPostProvider(fake_server_, fake_server_task_runner_); return new FakeServerHttpPostProvider(fake_server_, fake_server_task_runner_);
http->AddRef();
return http;
}
void FakeServerHttpPostProviderFactory::Destroy(
syncer::HttpPostProviderInterface* http) {
static_cast<FakeServerHttpPostProvider*>(http)->Release();
} }
FakeServerHttpPostProvider::FakeServerHttpPostProvider( FakeServerHttpPostProvider::FakeServerHttpPostProvider(
......
...@@ -22,9 +22,7 @@ namespace fake_server { ...@@ -22,9 +22,7 @@ namespace fake_server {
class FakeServer; class FakeServer;
class FakeServerHttpPostProvider class FakeServerHttpPostProvider : public syncer::HttpPostProviderInterface {
: public syncer::HttpPostProviderInterface,
public base::RefCountedThreadSafe<FakeServerHttpPostProvider> {
public: public:
FakeServerHttpPostProvider( FakeServerHttpPostProvider(
const base::WeakPtr<FakeServer>& fake_server, const base::WeakPtr<FakeServer>& fake_server,
...@@ -90,8 +88,7 @@ class FakeServerHttpPostProviderFactory ...@@ -90,8 +88,7 @@ class FakeServerHttpPostProviderFactory
~FakeServerHttpPostProviderFactory() override; ~FakeServerHttpPostProviderFactory() override;
// HttpPostProviderFactory: // HttpPostProviderFactory:
syncer::HttpPostProviderInterface* Create() override; scoped_refptr<syncer::HttpPostProviderInterface> Create() override;
void Destroy(syncer::HttpPostProviderInterface* http) override;
private: private:
// |fake_server_| should only be dereferenced on the same thread as // |fake_server_| should only be dereferenced on the same thread as
......
...@@ -475,7 +475,6 @@ test("ios_web_view_unittests") { ...@@ -475,7 +475,6 @@ test("ios_web_view_unittests") {
"//components/autofill/core/browser:test_support", "//components/autofill/core/browser:test_support",
"//components/autofill/ios/browser:test_support", "//components/autofill/ios/browser:test_support",
"//components/autofill/ios/form_util:test_support", "//components/autofill/ios/form_util:test_support",
"//components/browser_sync:test_support",
"//components/invalidation/impl:test_support", "//components/invalidation/impl:test_support",
"//components/password_manager/core/browser:test_support", "//components/password_manager/core/browser:test_support",
"//components/prefs:test_support", "//components/prefs:test_support",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment