| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_registration.h" | 5 #include "content/browser/service_worker/service_worker_registration.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 : io_thread_(BrowserThread::IO, &message_loop_) {} | 23 : io_thread_(BrowserThread::IO, &message_loop_) {} |
| 24 | 24 |
| 25 virtual void SetUp() OVERRIDE { | 25 virtual void SetUp() OVERRIDE { |
| 26 context_.reset( | 26 context_.reset( |
| 27 new ServiceWorkerContextCore(base::FilePath(), | 27 new ServiceWorkerContextCore(base::FilePath(), |
| 28 base::ThreadTaskRunnerHandle::Get(), | 28 base::ThreadTaskRunnerHandle::Get(), |
| 29 base::ThreadTaskRunnerHandle::Get(), | 29 base::ThreadTaskRunnerHandle::Get(), |
| 30 base::ThreadTaskRunnerHandle::Get(), | 30 base::ThreadTaskRunnerHandle::Get(), |
| 31 NULL, | 31 NULL, |
| 32 NULL, | 32 NULL, |
| 33 NULL, |
| 33 NULL)); | 34 NULL)); |
| 34 context_ptr_ = context_->AsWeakPtr(); | 35 context_ptr_ = context_->AsWeakPtr(); |
| 35 } | 36 } |
| 36 | 37 |
| 37 virtual void TearDown() OVERRIDE { | 38 virtual void TearDown() OVERRIDE { |
| 38 context_.reset(); | 39 context_.reset(); |
| 39 base::RunLoop().RunUntilIdle(); | 40 base::RunLoop().RunUntilIdle(); |
| 40 } | 41 } |
| 41 | 42 |
| 42 class RegistrationListener : public ServiceWorkerRegistration::Listener { | 43 class RegistrationListener : public ServiceWorkerRegistration::Listener { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 scoped_ptr<ServiceWorkerRegistrationHandle> handle( | 170 scoped_ptr<ServiceWorkerRegistrationHandle> handle( |
| 170 new ServiceWorkerRegistrationHandle(context_ptr_, | 171 new ServiceWorkerRegistrationHandle(context_ptr_, |
| 171 NULL, | 172 NULL, |
| 172 kProviderId, | 173 kProviderId, |
| 173 registration.get())); | 174 registration.get())); |
| 174 registration->NotifyRegistrationFailed(); | 175 registration->NotifyRegistrationFailed(); |
| 175 // Don't crash when handle gets destructed. | 176 // Don't crash when handle gets destructed. |
| 176 } | 177 } |
| 177 | 178 |
| 178 } // namespace content | 179 } // namespace content |
| OLD | NEW |