Commit 4f6bb368 authored by mlamouri's avatar mlamouri Committed by Commit bot

Revert of Net-related fixups for scoped_refptr conversion operator cleanup....

Revert of Net-related fixups for scoped_refptr conversion operator cleanup. (patchset #2 of https://codereview.chromium.org/511163002/)

Reason for revert:
It seems to be breaking GPU Mac Builder (Blink):
http://build.chromium.org/p/chromium.webkit/builders/GPU%20Mac%20Builder/builds/19306/steps/compile/logs/stdio

Original issue's description:
> Net-related fixups for scoped_refptr conversion operator cleanup.
>
> BUG=110610
> TBR=pkasting@chromium.org
>
> Committed: https://chromium.googlesource.com/chromium/src/+/aa3dd9e5a2d3215f9c756ddcbb11268569cbe473

TBR=mmenke@chromium.org,rsleevi@chromium.org,pkasting@chromium.org,dcheng@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=110610

Review URL: https://codereview.chromium.org/517873003

Cr-Commit-Position: refs/heads/master@{#292606}
parent f86e51b5
...@@ -20,7 +20,7 @@ typedef std::pair<net::SSLCertRequestInfo*, net::X509Certificate*> CertDetails; ...@@ -20,7 +20,7 @@ typedef std::pair<net::SSLCertRequestInfo*, net::X509Certificate*> CertDetails;
SSLClientAuthObserver::SSLClientAuthObserver( SSLClientAuthObserver::SSLClientAuthObserver(
const net::HttpNetworkSession* network_session, const net::HttpNetworkSession* network_session,
const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, net::SSLCertRequestInfo* cert_request_info,
const base::Callback<void(net::X509Certificate*)>& callback) const base::Callback<void(net::X509Certificate*)>& callback)
: network_session_(network_session), : network_session_(network_session),
cert_request_info_(cert_request_info), cert_request_info_(cert_request_info),
......
...@@ -20,7 +20,7 @@ class SSLClientAuthObserver : public content::NotificationObserver { ...@@ -20,7 +20,7 @@ class SSLClientAuthObserver : public content::NotificationObserver {
public: public:
SSLClientAuthObserver( SSLClientAuthObserver(
const net::HttpNetworkSession* network_session, const net::HttpNetworkSession* network_session,
const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, net::SSLCertRequestInfo* cert_request_info,
const base::Callback<void(net::X509Certificate*)>& callback); const base::Callback<void(net::X509Certificate*)>& callback);
virtual ~SSLClientAuthObserver(); virtual ~SSLClientAuthObserver();
......
...@@ -5,17 +5,15 @@ ...@@ -5,17 +5,15 @@
#include "chrome/browser/ssl/ssl_client_auth_requestor_mock.h" #include "chrome/browser/ssl/ssl_client_auth_requestor_mock.h"
#include "net/http/http_transaction_factory.h" #include "net/http/http_transaction_factory.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
SSLClientAuthRequestorMock::SSLClientAuthRequestorMock( SSLClientAuthRequestorMock::SSLClientAuthRequestorMock(
net::URLRequest* request, net::URLRequest* request,
const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info) net::SSLCertRequestInfo* cert_request_info)
: cert_request_info_(cert_request_info), : cert_request_info_(cert_request_info),
http_network_session_(request->context() http_network_session_(
->http_transaction_factory() request->context()->http_transaction_factory()->GetSession()) {
->GetSession()) {
} }
SSLClientAuthRequestorMock::~SSLClientAuthRequestorMock() {} SSLClientAuthRequestorMock::~SSLClientAuthRequestorMock() {}
...@@ -20,11 +20,11 @@ class SSLClientAuthRequestorMock ...@@ -20,11 +20,11 @@ class SSLClientAuthRequestorMock
public: public:
SSLClientAuthRequestorMock( SSLClientAuthRequestorMock(
net::URLRequest* request, net::URLRequest* request,
const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info); net::SSLCertRequestInfo* cert_request_info);
MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert)); MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert));
scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; net::SSLCertRequestInfo* cert_request_info_;
net::HttpNetworkSession* http_network_session_; net::HttpNetworkSession* http_network_session_;
protected: protected:
......
...@@ -83,10 +83,10 @@ void CertificateSelectorTableModel::SetObserver( ...@@ -83,10 +83,10 @@ void CertificateSelectorTableModel::SetObserver(
SSLClientCertificateSelector::SSLClientCertificateSelector( SSLClientCertificateSelector::SSLClientCertificateSelector(
content::WebContents* web_contents, content::WebContents* web_contents,
const net::HttpNetworkSession* network_session, const net::HttpNetworkSession* network_session,
const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, net::SSLCertRequestInfo* cert_request_info,
const chrome::SelectCertificateCallback& callback) const chrome::SelectCertificateCallback& callback)
: SSLClientAuthObserver(network_session, cert_request_info, callback), : SSLClientAuthObserver(network_session, cert_request_info, callback),
model_(new CertificateSelectorTableModel(cert_request_info.get())), model_(new CertificateSelectorTableModel(cert_request_info)),
web_contents_(web_contents), web_contents_(web_contents),
table_(NULL), table_(NULL),
view_cert_button_(NULL) { view_cert_button_(NULL) {
......
...@@ -41,7 +41,7 @@ class SSLClientCertificateSelector : public SSLClientAuthObserver, ...@@ -41,7 +41,7 @@ class SSLClientCertificateSelector : public SSLClientAuthObserver,
SSLClientCertificateSelector( SSLClientCertificateSelector(
content::WebContents* web_contents, content::WebContents* web_contents,
const net::HttpNetworkSession* network_session, const net::HttpNetworkSession* network_session,
const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, net::SSLCertRequestInfo* cert_request_info,
const chrome::SelectCertificateCallback& callback); const chrome::SelectCertificateCallback& callback);
virtual ~SSLClientCertificateSelector(); virtual ~SSLClientCertificateSelector();
......
...@@ -656,7 +656,7 @@ void SimpleBackendImpl::GetNextEntryInIterator( ...@@ -656,7 +656,7 @@ void SimpleBackendImpl::GetNextEntryInIterator(
void SimpleBackendImpl::OnEntryOpenedFromHash( void SimpleBackendImpl::OnEntryOpenedFromHash(
uint64 hash, uint64 hash,
Entry** entry, Entry** entry,
const scoped_refptr<SimpleEntryImpl>& simple_entry, scoped_refptr<SimpleEntryImpl> simple_entry,
const CompletionCallback& callback, const CompletionCallback& callback,
int error_code) { int error_code) {
if (error_code != net::OK) { if (error_code != net::OK) {
...@@ -665,7 +665,7 @@ void SimpleBackendImpl::OnEntryOpenedFromHash( ...@@ -665,7 +665,7 @@ void SimpleBackendImpl::OnEntryOpenedFromHash(
} }
DCHECK(*entry); DCHECK(*entry);
std::pair<EntryMap::iterator, bool> insert_result = std::pair<EntryMap::iterator, bool> insert_result =
active_entries_.insert(EntryMap::value_type(hash, simple_entry.get())); active_entries_.insert(EntryMap::value_type(hash, simple_entry));
EntryMap::iterator& it = insert_result.first; EntryMap::iterator& it = insert_result.first;
const bool did_insert = insert_result.second; const bool did_insert = insert_result.second;
if (did_insert) { if (did_insert) {
...@@ -686,7 +686,7 @@ void SimpleBackendImpl::OnEntryOpenedFromHash( ...@@ -686,7 +686,7 @@ void SimpleBackendImpl::OnEntryOpenedFromHash(
void SimpleBackendImpl::OnEntryOpenedFromKey( void SimpleBackendImpl::OnEntryOpenedFromKey(
const std::string key, const std::string key,
Entry** entry, Entry** entry,
const scoped_refptr<SimpleEntryImpl>& simple_entry, scoped_refptr<SimpleEntryImpl> simple_entry,
const CompletionCallback& callback, const CompletionCallback& callback,
int error_code) { int error_code) {
int final_code = error_code; int final_code = error_code;
......
...@@ -169,7 +169,7 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend, ...@@ -169,7 +169,7 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend,
// using a key in the meantime. // using a key in the meantime.
void OnEntryOpenedFromHash(uint64 hash, void OnEntryOpenedFromHash(uint64 hash,
Entry** entry, Entry** entry,
const scoped_refptr<SimpleEntryImpl>& simple_entry, scoped_refptr<SimpleEntryImpl> simple_entry,
const CompletionCallback& callback, const CompletionCallback& callback,
int error_code); int error_code);
...@@ -177,7 +177,7 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend, ...@@ -177,7 +177,7 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend,
// opened, a check for key mismatch is performed. // opened, a check for key mismatch is performed.
void OnEntryOpenedFromKey(const std::string key, void OnEntryOpenedFromKey(const std::string key,
Entry** entry, Entry** entry,
const scoped_refptr<SimpleEntryImpl>& simple_entry, scoped_refptr<SimpleEntryImpl> simple_entry,
const CompletionCallback& callback, const CompletionCallback& callback,
int error_code); int error_code);
......
...@@ -135,11 +135,10 @@ bool EntryMetadata::Deserialize(PickleIterator* it) { ...@@ -135,11 +135,10 @@ bool EntryMetadata::Deserialize(PickleIterator* it) {
return true; return true;
} }
SimpleIndex::SimpleIndex( SimpleIndex::SimpleIndex(base::SingleThreadTaskRunner* io_thread,
const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, SimpleIndexDelegate* delegate,
SimpleIndexDelegate* delegate, net::CacheType cache_type,
net::CacheType cache_type, scoped_ptr<SimpleIndexFile> index_file)
scoped_ptr<SimpleIndexFile> index_file)
: delegate_(delegate), : delegate_(delegate),
cache_type_(cache_type), cache_type_(cache_type),
cache_size_(0), cache_size_(0),
...@@ -153,8 +152,7 @@ SimpleIndex::SimpleIndex( ...@@ -153,8 +152,7 @@ SimpleIndex::SimpleIndex(
// Creating the callback once so it is reused every time // Creating the callback once so it is reused every time
// write_to_disk_timer_.Start() is called. // write_to_disk_timer_.Start() is called.
write_to_disk_cb_(base::Bind(&SimpleIndex::WriteToDisk, AsWeakPtr())), write_to_disk_cb_(base::Bind(&SimpleIndex::WriteToDisk, AsWeakPtr())),
app_on_background_(false) { app_on_background_(false) {}
}
SimpleIndex::~SimpleIndex() { SimpleIndex::~SimpleIndex() {
DCHECK(io_thread_checker_.CalledOnValidThread()); DCHECK(io_thread_checker_.CalledOnValidThread());
......
...@@ -77,7 +77,7 @@ class NET_EXPORT_PRIVATE SimpleIndex ...@@ -77,7 +77,7 @@ class NET_EXPORT_PRIVATE SimpleIndex
public: public:
typedef std::vector<uint64> HashList; typedef std::vector<uint64> HashList;
SimpleIndex(const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, SimpleIndex(base::SingleThreadTaskRunner* io_thread,
SimpleIndexDelegate* delegate, SimpleIndexDelegate* delegate,
net::CacheType cache_type, net::CacheType cache_type,
scoped_ptr<SimpleIndexFile> simple_index_file); scoped_ptr<SimpleIndexFile> simple_index_file);
......
...@@ -97,7 +97,7 @@ namespace net { ...@@ -97,7 +97,7 @@ namespace net {
TransportSecurityPersister::TransportSecurityPersister( TransportSecurityPersister::TransportSecurityPersister(
TransportSecurityState* state, TransportSecurityState* state,
const base::FilePath& profile_path, const base::FilePath& profile_path,
const scoped_refptr<base::SequencedTaskRunner>& background_runner, base::SequencedTaskRunner* background_runner,
bool readonly) bool readonly)
: transport_security_state_(state), : transport_security_state_(state),
writer_(profile_path.AppendASCII("TransportSecurity"), background_runner), writer_(profile_path.AppendASCII("TransportSecurity"), background_runner),
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// This means that it's possible for pages opened very quickly not to get the // This means that it's possible for pages opened very quickly not to get the
// correct transport security information. // correct transport security information.
// //
// To load the state, we schedule a Task on background_runner, which // To load the state, we schedule a Task on file_task_runner, which
// deserializes and configures the TransportSecurityState. // deserializes and configures the TransportSecurityState.
// //
// The TransportSecurityState object supports running a callback function // The TransportSecurityState object supports running a callback function
...@@ -51,17 +51,16 @@ namespace net { ...@@ -51,17 +51,16 @@ namespace net {
// Reads and updates on-disk TransportSecurity state. Clients of this class // Reads and updates on-disk TransportSecurity state. Clients of this class
// should create, destroy, and call into it from one thread. // should create, destroy, and call into it from one thread.
// //
// background_runner is the task runner this class should use internally to // file_task_runner is the task runner this class should use internally to
// perform file IO, and can optionally be associated with a different thread. // perform file IO, and can optionally be associated with a different thread.
class NET_EXPORT TransportSecurityPersister class NET_EXPORT TransportSecurityPersister
: public TransportSecurityState::Delegate, : public TransportSecurityState::Delegate,
public base::ImportantFileWriter::DataSerializer { public base::ImportantFileWriter::DataSerializer {
public: public:
TransportSecurityPersister( TransportSecurityPersister(TransportSecurityState* state,
TransportSecurityState* state, const base::FilePath& profile_path,
const base::FilePath& profile_path, base::SequencedTaskRunner* file_task_runner,
const scoped_refptr<base::SequencedTaskRunner>& background_runner, bool readonly);
bool readonly);
virtual ~TransportSecurityPersister(); virtual ~TransportSecurityPersister();
// Called by the TransportSecurityState when it changes its state. // Called by the TransportSecurityState when it changes its state.
......
...@@ -1527,7 +1527,7 @@ int SSLClientSocketOpenSSL::CertVerifyCallback(X509_STORE_CTX* store_ctx) { ...@@ -1527,7 +1527,7 @@ int SSLClientSocketOpenSSL::CertVerifyCallback(X509_STORE_CTX* store_ctx) {
CHECK(server_cert_.get()); CHECK(server_cert_.get());
PeerCertificateChain chain(store_ctx->untrusted); PeerCertificateChain chain(store_ctx->untrusted);
if (chain.IsValid() && server_cert_->Equals(chain.AsOSChain().get())) if (chain.IsValid() && server_cert_->Equals(chain.AsOSChain()))
return 1; return 1;
if (!chain.IsValid()) if (!chain.IsValid())
......
...@@ -46,15 +46,15 @@ SSLSocketParams::SSLSocketParams( ...@@ -46,15 +46,15 @@ SSLSocketParams::SSLSocketParams(
force_spdy_over_ssl_(force_spdy_over_ssl), force_spdy_over_ssl_(force_spdy_over_ssl),
want_spdy_over_npn_(want_spdy_over_npn), want_spdy_over_npn_(want_spdy_over_npn),
ignore_limits_(false) { ignore_limits_(false) {
if (direct_params_.get()) { if (direct_params_) {
DCHECK(!socks_proxy_params_.get()); DCHECK(!socks_proxy_params_);
DCHECK(!http_proxy_params_.get()); DCHECK(!http_proxy_params_);
ignore_limits_ = direct_params_->ignore_limits(); ignore_limits_ = direct_params_->ignore_limits();
} else if (socks_proxy_params_.get()) { } else if (socks_proxy_params_) {
DCHECK(!http_proxy_params_.get()); DCHECK(!http_proxy_params_);
ignore_limits_ = socks_proxy_params_->ignore_limits(); ignore_limits_ = socks_proxy_params_->ignore_limits();
} else { } else {
DCHECK(http_proxy_params_.get()); DCHECK(http_proxy_params_);
ignore_limits_ = http_proxy_params_->ignore_limits(); ignore_limits_ = http_proxy_params_->ignore_limits();
} }
} }
...@@ -62,18 +62,18 @@ SSLSocketParams::SSLSocketParams( ...@@ -62,18 +62,18 @@ SSLSocketParams::SSLSocketParams(
SSLSocketParams::~SSLSocketParams() {} SSLSocketParams::~SSLSocketParams() {}
SSLSocketParams::ConnectionType SSLSocketParams::GetConnectionType() const { SSLSocketParams::ConnectionType SSLSocketParams::GetConnectionType() const {
if (direct_params_.get()) { if (direct_params_) {
DCHECK(!socks_proxy_params_.get()); DCHECK(!socks_proxy_params_);
DCHECK(!http_proxy_params_.get()); DCHECK(!http_proxy_params_);
return DIRECT; return DIRECT;
} }
if (socks_proxy_params_.get()) { if (socks_proxy_params_) {
DCHECK(!http_proxy_params_.get()); DCHECK(!http_proxy_params_);
return SOCKS_PROXY; return SOCKS_PROXY;
} }
DCHECK(http_proxy_params_.get()); DCHECK(http_proxy_params_);
return HTTP_PROXY; return HTTP_PROXY;
} }
......
...@@ -93,7 +93,7 @@ TEST(WebSocketInflaterTest, ChokedInvalidData) { ...@@ -93,7 +93,7 @@ TEST(WebSocketInflaterTest, ChokedInvalidData) {
EXPECT_TRUE(inflater.AddBytes("\xf2\x48\xcd\xc9INVALID DATA", 16)); EXPECT_TRUE(inflater.AddBytes("\xf2\x48\xcd\xc9INVALID DATA", 16));
EXPECT_TRUE(inflater.Finish()); EXPECT_TRUE(inflater.Finish());
EXPECT_EQ(1u, inflater.CurrentOutputSize()); EXPECT_EQ(1u, inflater.CurrentOutputSize());
EXPECT_FALSE(inflater.GetOutput(1024).get()); EXPECT_FALSE(inflater.GetOutput(1024));
} }
TEST(WebSocketInflaterTest, MultipleAddBytesCalls) { TEST(WebSocketInflaterTest, MultipleAddBytesCalls) {
......
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