OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 std::unique_ptr<WebServiceWorker::Handle> handle) { | 127 std::unique_ptr<WebServiceWorker::Handle> handle) { |
128 return getOrCreate(executionContext, std::move(handle)); | 128 return getOrCreate(executionContext, std::move(handle)); |
129 } | 129 } |
130 | 130 |
131 bool ServiceWorker::hasPendingActivity() const { | 131 bool ServiceWorker::hasPendingActivity() const { |
132 if (m_wasStopped) | 132 if (m_wasStopped) |
133 return false; | 133 return false; |
134 return m_handle->serviceWorker()->state() != WebServiceWorkerStateRedundant; | 134 return m_handle->serviceWorker()->state() != WebServiceWorkerStateRedundant; |
135 } | 135 } |
136 | 136 |
137 void ServiceWorker::stop() { | 137 void ServiceWorker::contextDestroyed() { |
138 m_wasStopped = true; | 138 m_wasStopped = true; |
139 } | 139 } |
140 | 140 |
141 ServiceWorker* ServiceWorker::getOrCreate( | 141 ServiceWorker* ServiceWorker::getOrCreate( |
142 ExecutionContext* executionContext, | 142 ExecutionContext* executionContext, |
143 std::unique_ptr<WebServiceWorker::Handle> handle) { | 143 std::unique_ptr<WebServiceWorker::Handle> handle) { |
144 if (!handle) | 144 if (!handle) |
145 return nullptr; | 145 return nullptr; |
146 | 146 |
147 ServiceWorker* existingWorker = | 147 ServiceWorker* existingWorker = |
(...skipping 19 matching lines...) Expand all Loading... |
167 m_handle->serviceWorker()->setProxy(this); | 167 m_handle->serviceWorker()->setProxy(this); |
168 } | 168 } |
169 | 169 |
170 ServiceWorker::~ServiceWorker() {} | 170 ServiceWorker::~ServiceWorker() {} |
171 | 171 |
172 DEFINE_TRACE(ServiceWorker) { | 172 DEFINE_TRACE(ServiceWorker) { |
173 AbstractWorker::trace(visitor); | 173 AbstractWorker::trace(visitor); |
174 } | 174 } |
175 | 175 |
176 } // namespace blink | 176 } // namespace blink |
OLD | NEW |