Commit 28fa7ca6 authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in components/policy/

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

BUG=110610

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

Cr-Commit-Position: refs/heads/master@{#291928}
parent d40ebfeb
......@@ -469,7 +469,7 @@ void URLBlacklistManager::UpdateOnIO(scoped_ptr<base::ListValue> block,
// The URLBlacklist is built on a worker thread. Once it's ready, it is passed
// to the URLBlacklistManager on IO.
base::PostTaskAndReplyWithResult(
background_task_runner_,
background_task_runner_.get(),
FROM_HERE,
base::Bind(&BuildBlacklist,
base::Passed(&block),
......
......@@ -155,7 +155,7 @@ CloudPolicyClientRegistrationHelper::CloudPolicyClientRegistrationHelper(
: context_(client->GetRequestContext()),
client_(client),
registration_type_(registration_type) {
DCHECK(context_);
DCHECK(context_.get());
DCHECK(client_);
}
......@@ -197,7 +197,7 @@ void CloudPolicyClientRegistrationHelper::StartRegistrationWithLoginToken(
new CloudPolicyClientRegistrationHelper::LoginTokenHelper());
login_token_helper_->FetchAccessToken(
login_refresh_token,
context_,
context_.get(),
base::Bind(&CloudPolicyClientRegistrationHelper::OnTokenFetched,
base::Unretained(this)));
}
......@@ -240,7 +240,7 @@ void CloudPolicyClientRegistrationHelper::OnTokenFetched(
DVLOG(1) << "Fetched new scoped OAuth token:" << oauth_access_token_;
// Now we've gotten our access token - contact GAIA to see if this is a
// hosted domain.
user_info_fetcher_.reset(new UserInfoFetcher(this, context_));
user_info_fetcher_.reset(new UserInfoFetcher(this, context_.get()));
user_info_fetcher_->Start(oauth_access_token_);
}
......
......@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/user_info_fetcher.h"
......@@ -107,7 +108,7 @@ class POLICY_EXPORT CloudPolicyClientRegistrationHelper
// GAIA to get information about the signed in user.
std::string oauth_access_token_;
net::URLRequestContextGetter* context_;
scoped_refptr<net::URLRequestContextGetter> context_;
CloudPolicyClient* client_;
enterprise_management::DeviceRegisterRequest::Type registration_type_;
base::Closure callback_;
......
......@@ -77,9 +77,8 @@ class DeviceManagementServiceTestBase : public testing::Test {
}
DeviceManagementRequestJob* StartRegistrationJob() {
DeviceManagementRequestJob* job =
service_->CreateJob(DeviceManagementRequestJob::TYPE_REGISTRATION,
request_context_);
DeviceManagementRequestJob* job = service_->CreateJob(
DeviceManagementRequestJob::TYPE_REGISTRATION, request_context_.get());
job->SetGaiaToken(kGaiaAuthToken);
job->SetOAuthToken(kOAuthToken);
job->SetClientID(kClientID);
......@@ -94,7 +93,7 @@ class DeviceManagementServiceTestBase : public testing::Test {
DeviceManagementRequestJob* StartApiAuthCodeFetchJob() {
DeviceManagementRequestJob* job = service_->CreateJob(
DeviceManagementRequestJob::TYPE_API_AUTH_CODE_FETCH,
request_context_);
request_context_.get());
job->SetGaiaToken(kGaiaAuthToken);
job->SetOAuthToken(kOAuthToken);
job->SetClientID(kClientID);
......@@ -109,7 +108,7 @@ class DeviceManagementServiceTestBase : public testing::Test {
DeviceManagementRequestJob* StartUnregistrationJob() {
DeviceManagementRequestJob* job =
service_->CreateJob(DeviceManagementRequestJob::TYPE_UNREGISTRATION,
request_context_);
request_context_.get());
job->SetDMToken(kDMToken);
job->SetClientID(kClientID);
job->GetRequest()->mutable_unregister_request();
......@@ -121,9 +120,8 @@ class DeviceManagementServiceTestBase : public testing::Test {
}
DeviceManagementRequestJob* StartPolicyFetchJob() {
DeviceManagementRequestJob* job =
service_->CreateJob(DeviceManagementRequestJob::TYPE_POLICY_FETCH,
request_context_);
DeviceManagementRequestJob* job = service_->CreateJob(
DeviceManagementRequestJob::TYPE_POLICY_FETCH, request_context_.get());
job->SetGaiaToken(kGaiaAuthToken);
job->SetOAuthToken(kOAuthToken);
job->SetClientID(kClientID);
......@@ -140,7 +138,7 @@ class DeviceManagementServiceTestBase : public testing::Test {
DeviceManagementRequestJob* StartAutoEnrollmentJob() {
DeviceManagementRequestJob* job =
service_->CreateJob(DeviceManagementRequestJob::TYPE_AUTO_ENROLLMENT,
request_context_);
request_context_.get());
job->SetClientID(kClientID);
em::DeviceAutoEnrollmentRequest* request =
job->GetRequest()->mutable_auto_enrollment_request();
......
......@@ -17,7 +17,7 @@ SystemPolicyRequestContext::SystemPolicyRequestContext(
const std::string& user_agent)
: system_context_getter_(system_context_getter),
http_user_agent_settings_("*", user_agent) {
DCHECK(system_context_getter);
DCHECK(system_context_getter.get());
}
SystemPolicyRequestContext::~SystemPolicyRequestContext() {
......
......@@ -19,7 +19,7 @@ UserPolicyRequestContext::UserPolicyRequestContext(
: user_context_getter_(user_context_getter),
system_context_getter_(system_context_getter),
http_user_agent_settings_("*", user_agent) {
DCHECK(user_context_getter_);
DCHECK(user_context_getter_.get());
}
UserPolicyRequestContext::~UserPolicyRequestContext() {
......
......@@ -975,7 +975,7 @@ Schema Schema::Parse(const std::string& content, std::string* error) {
scoped_refptr<const InternalStorage> storage =
InternalStorage::ParseSchema(*dict, error);
if (!storage)
if (!storage.get())
return Schema();
return Schema(storage, storage->root_node());
}
......
......@@ -105,7 +105,7 @@ bool SchemaMap::HasComponents() const {
void SchemaMap::GetChanges(const scoped_refptr<SchemaMap>& older,
PolicyNamespaceList* removed,
PolicyNamespaceList* added) const {
GetNamespacesNotInOther(older, added);
GetNamespacesNotInOther(older.get(), added);
older->GetNamespacesNotInOther(this, removed);
}
......
......@@ -96,7 +96,7 @@ TEST_F(SchemaMapTest, HasComponents) {
TEST_F(SchemaMapTest, Lookups) {
scoped_refptr<SchemaMap> map = CreateTestMap();
ASSERT_TRUE(map);
ASSERT_TRUE(map.get());
EXPECT_TRUE(map->HasComponents());
EXPECT_FALSE(map->GetSchema(
......
......@@ -68,7 +68,7 @@ TEST(SchemaRegistryTest, Notifications) {
SchemaRegistry registry;
registry.AddObserver(&observer);
ASSERT_TRUE(registry.schema_map());
ASSERT_TRUE(registry.schema_map().get());
EXPECT_FALSE(registry.schema_map()->GetSchema(
PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "abc")));
......
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