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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 { | 110 { |
111 if (!worker) | 111 if (!worker) |
112 return nullptr; | 112 return nullptr; |
113 | 113 |
114 RefPtrWillBeRawPtr<ServiceWorker> serviceWorker = getOrCreate(executionConte
xt, worker); | 114 RefPtrWillBeRawPtr<ServiceWorker> serviceWorker = getOrCreate(executionConte
xt, worker); |
115 return serviceWorker.release(); | 115 return serviceWorker.release(); |
116 } | 116 } |
117 | 117 |
118 bool ServiceWorker::hasPendingActivity() const | 118 bool ServiceWorker::hasPendingActivity() const |
119 { | 119 { |
120 if (AbstractWorker::hasPendingActivity()) | 120 if (ActiveDOMObject::hasPendingActivity()) |
121 return true; | 121 return true; |
122 if (m_wasStopped) | 122 if (m_wasStopped) |
123 return false; | 123 return false; |
124 return m_outerWorker->state() != WebServiceWorkerStateRedundant; | 124 return m_outerWorker->state() != WebServiceWorkerStateRedundant; |
125 } | 125 } |
126 | 126 |
127 void ServiceWorker::stop() | 127 void ServiceWorker::stop() |
128 { | 128 { |
129 m_wasStopped = true; | 129 m_wasStopped = true; |
130 } | 130 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // the embedder might risk accessing a to-be-finalized object that | 173 // the embedder might risk accessing a to-be-finalized object that |
174 // is not in a valid state. | 174 // is not in a valid state. |
175 // | 175 // |
176 // The dispose() method is hooked up to the garbage collector by | 176 // The dispose() method is hooked up to the garbage collector by |
177 // way of a "pre finalizer", a method that is run after marking | 177 // way of a "pre finalizer", a method that is run after marking |
178 // has completed, but before any sweeping takes place. | 178 // has completed, but before any sweeping takes place. |
179 m_outerWorker.clear(); | 179 m_outerWorker.clear(); |
180 } | 180 } |
181 | 181 |
182 } // namespace blink | 182 } // namespace blink |
OLD | NEW |