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 | 7 |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 const int64 version_1_id = 1L; | 57 const int64 version_1_id = 1L; |
58 const int64 version_2_id = 2L; | 58 const int64 version_2_id = 2L; |
59 scoped_refptr<ServiceWorkerVersion> version_1 = | 59 scoped_refptr<ServiceWorkerVersion> version_1 = |
60 new ServiceWorkerVersion(registration, version_1_id, context_ptr_); | 60 new ServiceWorkerVersion(registration, version_1_id, context_ptr_); |
61 version_1->SetStatus(ServiceWorkerVersion::ACTIVE); | 61 version_1->SetStatus(ServiceWorkerVersion::ACTIVE); |
62 registration->set_active_version(version_1); | 62 registration->set_active_version(version_1); |
63 | 63 |
64 scoped_refptr<ServiceWorkerVersion> version_2 = | 64 scoped_refptr<ServiceWorkerVersion> version_2 = |
65 new ServiceWorkerVersion(registration, version_2_id, context_ptr_); | 65 new ServiceWorkerVersion(registration, version_2_id, context_ptr_); |
66 registration->set_pending_version(version_2); | 66 registration->set_waiting_version(version_2); |
67 | 67 |
68 registration->ActivatePendingVersion(); | 68 registration->ActivateWaitingVersion(); |
69 DCHECK_EQ(version_2, registration->active_version()); | 69 DCHECK_EQ(version_2, registration->active_version()); |
70 DCHECK(version_1->HasOneRef()); | 70 DCHECK(version_1->HasOneRef()); |
71 version_1 = NULL; | 71 version_1 = NULL; |
72 | 72 |
73 DCHECK(!version_2->HasOneRef()); | 73 DCHECK(!version_2->HasOneRef()); |
74 } | 74 } |
75 | 75 |
76 } // namespace content | 76 } // namespace content |
OLD | NEW |