Commit 62c7cf84 authored by dcheng's avatar dcheng Committed by Commit bot

Service worker fixups for scoped_refptr operator T* removal.

BUG=110610

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

Cr-Commit-Position: refs/heads/master@{#292595}
parent 9d1dd593
......@@ -35,7 +35,7 @@ namespace content {
scoped_ptr<ServiceWorkerCacheStorageManager>
ServiceWorkerCacheStorageManager::Create(
const base::FilePath& path,
base::SequencedTaskRunner* cache_task_runner) {
const scoped_refptr<base::SequencedTaskRunner>& cache_task_runner) {
base::FilePath root_path = path;
if (!path.empty()) {
root_path = path.Append(ServiceWorkerContextCore::kServiceWorkerDirectory)
......@@ -138,7 +138,7 @@ void ServiceWorkerCacheStorageManager::SetBlobParametersForCache(
ServiceWorkerCacheStorageManager::ServiceWorkerCacheStorageManager(
const base::FilePath& path,
base::SequencedTaskRunner* cache_task_runner)
const scoped_refptr<base::SequencedTaskRunner>& cache_task_runner)
: root_path_(path),
cache_task_runner_(cache_task_runner),
request_context_(NULL) {
......
......@@ -36,7 +36,7 @@ class CONTENT_EXPORT ServiceWorkerCacheStorageManager {
public:
static scoped_ptr<ServiceWorkerCacheStorageManager> Create(
const base::FilePath& path,
base::SequencedTaskRunner* cache_task_runner);
const scoped_refptr<base::SequencedTaskRunner>& cache_task_runner);
static scoped_ptr<ServiceWorkerCacheStorageManager> Create(
ServiceWorkerCacheStorageManager* old_manager);
......@@ -78,7 +78,7 @@ class CONTENT_EXPORT ServiceWorkerCacheStorageManager {
ServiceWorkerCacheStorageManager(
const base::FilePath& path,
base::SequencedTaskRunner* cache_task_runner);
const scoped_refptr<base::SequencedTaskRunner>& cache_task_runner);
// The returned ServiceWorkerCacheStorage* is owned by
// service_worker_cache_storages_.
......@@ -92,7 +92,7 @@ class CONTENT_EXPORT ServiceWorkerCacheStorageManager {
return blob_context_;
}
base::FilePath root_path() const { return root_path_; }
scoped_refptr<base::SequencedTaskRunner> cache_task_runner() const {
const scoped_refptr<base::SequencedTaskRunner>& cache_task_runner() const {
return cache_task_runner_;
}
......
......@@ -99,7 +99,8 @@ class ServiceWorkerCacheTest : public testing::Test {
new storage::BlobData("blob-id:myblob"));
blob_data->AppendData(expected_blob_data_);
blob_handle_ = blob_storage_context->context()->AddFinishedBlob(blob_data);
blob_handle_ =
blob_storage_context->context()->AddFinishedBlob(blob_data.get());
body_response_.reset(
new ServiceWorkerResponse(GURL("http://example.com/body.html"),
......
......@@ -74,7 +74,7 @@ void ServiceWorkerProviderHost::UpdatePotentialControllees(
ServiceWorkerVersion* active_version) {
if (installing_version != installing_version_.get()) {
scoped_refptr<ServiceWorkerVersion> previous_version = installing_version_;
if (previous_version)
if (previous_version.get())
previous_version->RemovePotentialControllee(this);
if (installing_version)
installing_version->AddPotentialControllee(this);
......@@ -83,7 +83,7 @@ void ServiceWorkerProviderHost::UpdatePotentialControllees(
if (waiting_version != waiting_version_.get()) {
scoped_refptr<ServiceWorkerVersion> previous_version = waiting_version_;
if (previous_version)
if (previous_version.get())
previous_version->RemovePotentialControllee(this);
if (waiting_version)
waiting_version->AddPotentialControllee(this);
......@@ -92,7 +92,7 @@ void ServiceWorkerProviderHost::UpdatePotentialControllees(
if (active_version != active_version_.get()) {
scoped_refptr<ServiceWorkerVersion> previous_version = active_version_;
if (previous_version)
if (previous_version.get())
previous_version->RemovePotentialControllee(this);
if (active_version)
active_version->AddPotentialControllee(this);
......
......@@ -117,7 +117,7 @@ ServiceWorkerRegisterJob::Internal::Internal() {}
ServiceWorkerRegisterJob::Internal::~Internal() {}
void ServiceWorkerRegisterJob::set_registration(
ServiceWorkerRegistration* registration) {
const scoped_refptr<ServiceWorkerRegistration>& registration) {
DCHECK(phase_ == START || phase_ == REGISTER) << phase_;
DCHECK(!internal_.registration.get());
internal_.registration = registration;
......@@ -141,7 +141,7 @@ ServiceWorkerVersion* ServiceWorkerRegisterJob::new_version() {
}
void ServiceWorkerRegisterJob::set_uninstalling_registration(
ServiceWorkerRegistration* registration) {
const scoped_refptr<ServiceWorkerRegistration>& registration) {
DCHECK_EQ(phase_, WAIT_FOR_UNINSTALL);
internal_.uninstalling_registration = registration;
}
......@@ -149,7 +149,7 @@ void ServiceWorkerRegisterJob::set_uninstalling_registration(
ServiceWorkerRegistration*
ServiceWorkerRegisterJob::uninstalling_registration() {
DCHECK_EQ(phase_, WAIT_FOR_UNINSTALL);
return internal_.uninstalling_registration;
return internal_.uninstalling_registration.get();
}
void ServiceWorkerRegisterJob::SetPhase(Phase phase) {
......@@ -297,8 +297,9 @@ void ServiceWorkerRegisterJob::ContinueWithRegistrationForSameScriptUrl(
return;
}
ResolvePromise(
status, existing_registration, existing_registration->active_version());
ResolvePromise(status,
existing_registration.get(),
existing_registration->active_version());
Complete(SERVICE_WORKER_OK);
}
......
......@@ -99,11 +99,13 @@ class ServiceWorkerRegisterJob : public ServiceWorkerRegisterJobBase,
scoped_refptr<ServiceWorkerRegistration> uninstalling_registration;
};
void set_registration(ServiceWorkerRegistration* registration);
void set_registration(
const scoped_refptr<ServiceWorkerRegistration>& registration);
ServiceWorkerRegistration* registration();
void set_new_version(ServiceWorkerVersion* version);
ServiceWorkerVersion* new_version();
void set_uninstalling_registration(ServiceWorkerRegistration* registration);
void set_uninstalling_registration(
const scoped_refptr<ServiceWorkerRegistration>& registration);
ServiceWorkerRegistration* uninstalling_registration();
void SetPhase(Phase phase);
......
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