Commit eff8449a authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in c/b/chromeos/policy

This patch was generated by running the rewrite_scoped_refptr clang tool
on a ChromeOS build.

BUG=110610

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

Cr-Commit-Position: refs/heads/master@{#294526}
parent 73c263ec
...@@ -199,9 +199,9 @@ void BrowserPolicyConnectorChromeOS::Init( ...@@ -199,9 +199,9 @@ void BrowserPolicyConnectorChromeOS::Init(
device_cloud_policy_invalidator_.reset(new DeviceCloudPolicyInvalidator); device_cloud_policy_invalidator_.reset(new DeviceCloudPolicyInvalidator);
// request_context is NULL in unit tests. // request_context is NULL in unit tests.
if (request_context && install_attributes_) { if (request_context.get() && install_attributes_) {
app_pack_updater_.reset( app_pack_updater_.reset(
new AppPackUpdater(request_context, install_attributes_.get())); new AppPackUpdater(request_context.get(), install_attributes_.get()));
} }
SetTimezoneIfPolicyAvailable(); SetTimezoneIfPolicyAvailable();
......
...@@ -73,7 +73,7 @@ scoped_refptr<DeviceLocalAccountExternalDataManager> ...@@ -73,7 +73,7 @@ scoped_refptr<DeviceLocalAccountExternalDataManager>
CloudPolicyStore* policy_store) { CloudPolicyStore* policy_store) {
scoped_refptr<DeviceLocalAccountExternalDataManager>& external_data_manager = scoped_refptr<DeviceLocalAccountExternalDataManager>& external_data_manager =
external_data_managers_[account_id]; external_data_managers_[account_id];
if (!external_data_manager) { if (!external_data_manager.get()) {
external_data_manager = new DeviceLocalAccountExternalDataManager( external_data_manager = new DeviceLocalAccountExternalDataManager(
account_id, account_id,
base::Bind(&GetChromePolicyDetails), base::Bind(&GetChromePolicyDetails),
......
...@@ -274,7 +274,7 @@ DeviceLocalAccountPolicyService::DeviceLocalAccountPolicyService( ...@@ -274,7 +274,7 @@ DeviceLocalAccountPolicyService::DeviceLocalAccountPolicyService(
} }
DeviceLocalAccountPolicyService::~DeviceLocalAccountPolicyService() { DeviceLocalAccountPolicyService::~DeviceLocalAccountPolicyService() {
DCHECK(!request_context_); DCHECK(!request_context_.get());
DCHECK(policy_brokers_.empty()); DCHECK(policy_brokers_.empty());
} }
......
...@@ -141,7 +141,7 @@ void DeviceLocalAccountPolicyStore::Validate( ...@@ -141,7 +141,7 @@ void DeviceLocalAccountPolicyStore::Validate(
device_settings_service_->policy_data(); device_settings_service_->policy_data();
scoped_refptr<ownership::PublicKey> key = scoped_refptr<ownership::PublicKey> key =
device_settings_service_->GetPublicKey(); device_settings_service_->GetPublicKey();
if (!key || !key->is_loaded() || !device_policy_data) { if (!key.get() || !key->is_loaded() || !device_policy_data) {
status_ = CloudPolicyStore::STATUS_BAD_STATE; status_ = CloudPolicyStore::STATUS_BAD_STATE;
NotifyStoreLoaded(); NotifyStoreLoaded();
return; return;
......
...@@ -57,7 +57,7 @@ void PolicyCertVerifier::InitializeOnIOThread( ...@@ -57,7 +57,7 @@ void PolicyCertVerifier::InitializeOnIOThread(
<< "Additional trust anchors not supported on the current platform!"; << "Additional trust anchors not supported on the current platform!";
} }
net::MultiThreadedCertVerifier* verifier = net::MultiThreadedCertVerifier* verifier =
new net::MultiThreadedCertVerifier(verify_proc); new net::MultiThreadedCertVerifier(verify_proc.get());
verifier->SetCertTrustAnchorProvider(this); verifier->SetCertTrustAnchorProvider(this);
delegate_.reset(verifier); delegate_.reset(verifier);
} }
......
...@@ -51,9 +51,9 @@ class PolicyCertVerifierTest : public testing::Test { ...@@ -51,9 +51,9 @@ class PolicyCertVerifierTest : public testing::Test {
crypto::GetPublicSlotForChromeOSUser(test_nss_user_.username_hash()))); crypto::GetPublicSlotForChromeOSUser(test_nss_user_.username_hash())));
test_ca_cert_ = LoadCertificate("root_ca_cert.pem", net::CA_CERT); test_ca_cert_ = LoadCertificate("root_ca_cert.pem", net::CA_CERT);
ASSERT_TRUE(test_ca_cert_); ASSERT_TRUE(test_ca_cert_.get());
test_server_cert_ = LoadCertificate("ok_cert.pem", net::SERVER_CERT); test_server_cert_ = LoadCertificate("ok_cert.pem", net::SERVER_CERT);
ASSERT_TRUE(test_server_cert_); ASSERT_TRUE(test_server_cert_.get());
test_ca_cert_list_.push_back(test_ca_cert_); test_ca_cert_list_.push_back(test_ca_cert_);
} }
......
...@@ -112,7 +112,7 @@ void UserCloudPolicyManagerChromeOS::Connect( ...@@ -112,7 +112,7 @@ void UserCloudPolicyManagerChromeOS::Connect(
DCHECK(local_state); DCHECK(local_state);
local_state_ = local_state; local_state_ = local_state;
scoped_refptr<net::URLRequestContextGetter> request_context; scoped_refptr<net::URLRequestContextGetter> request_context;
if (system_request_context) { if (system_request_context.get()) {
// |system_request_context| can be null for tests. // |system_request_context| can be null for tests.
// Use the system request context here instead of a context derived // Use the system request context here instead of a context derived
// from the Profile because Connect() is called before the profile is // from the Profile because Connect() is called before the profile is
......
...@@ -44,7 +44,7 @@ void WildcardLoginChecker::Start( ...@@ -44,7 +44,7 @@ void WildcardLoginChecker::Start(
callback_ = callback; callback_ = callback;
token_fetcher_.reset(new PolicyOAuth2TokenFetcher( token_fetcher_.reset(new PolicyOAuth2TokenFetcher(
signin_context, signin_context.get(),
g_browser_process->system_request_context(), g_browser_process->system_request_context(),
base::Bind(&WildcardLoginChecker::OnPolicyTokenFetched, base::Bind(&WildcardLoginChecker::OnPolicyTokenFetched,
base::Unretained(this)))); base::Unretained(this))));
......
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