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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 | 113 |
114 String ServiceWorker::scriptURL() const | 114 String ServiceWorker::scriptURL() const |
115 { | 115 { |
116 return m_outerWorker->url().string(); | 116 return m_outerWorker->url().string(); |
117 } | 117 } |
118 | 118 |
119 const AtomicString& ServiceWorker::state() const | 119 const AtomicString& ServiceWorker::state() const |
120 { | 120 { |
121 DEFINE_STATIC_LOCAL(AtomicString, unknown, ("unknown", AtomicString::Constru
ctFromLiteral)); | 121 DEFINE_STATIC_LOCAL(AtomicString, unknown, ("unknown", AtomicString::Constru
ctFromLiteral)); |
122 DEFINE_STATIC_LOCAL(AtomicString, parsed, ("parsed", AtomicString::Construct
FromLiteral)); | |
123 DEFINE_STATIC_LOCAL(AtomicString, installing, ("installing", AtomicString::C
onstructFromLiteral)); | 122 DEFINE_STATIC_LOCAL(AtomicString, installing, ("installing", AtomicString::C
onstructFromLiteral)); |
124 DEFINE_STATIC_LOCAL(AtomicString, installed, ("installed", AtomicString::Con
structFromLiteral)); | 123 DEFINE_STATIC_LOCAL(AtomicString, installed, ("installed", AtomicString::Con
structFromLiteral)); |
125 DEFINE_STATIC_LOCAL(AtomicString, activating, ("activating", AtomicString::C
onstructFromLiteral)); | 124 DEFINE_STATIC_LOCAL(AtomicString, activating, ("activating", AtomicString::C
onstructFromLiteral)); |
126 DEFINE_STATIC_LOCAL(AtomicString, activated, ("activated", AtomicString::Con
structFromLiteral)); | 125 DEFINE_STATIC_LOCAL(AtomicString, activated, ("activated", AtomicString::Con
structFromLiteral)); |
127 DEFINE_STATIC_LOCAL(AtomicString, redundant, ("redundant", AtomicString::Con
structFromLiteral)); | 126 DEFINE_STATIC_LOCAL(AtomicString, redundant, ("redundant", AtomicString::Con
structFromLiteral)); |
128 | 127 |
129 switch (m_outerWorker->state()) { | 128 switch (m_outerWorker->state()) { |
130 case WebServiceWorkerStateUnknown: | 129 case WebServiceWorkerStateUnknown: |
131 // The web platform should never see this internal state | 130 // The web platform should never see this internal state |
132 ASSERT_NOT_REACHED(); | 131 ASSERT_NOT_REACHED(); |
133 return unknown; | 132 return unknown; |
134 case WebServiceWorkerStateParsed: | |
135 return parsed; | |
136 case WebServiceWorkerStateInstalling: | 133 case WebServiceWorkerStateInstalling: |
137 return installing; | 134 return installing; |
138 case WebServiceWorkerStateInstalled: | 135 case WebServiceWorkerStateInstalled: |
139 return installed; | 136 return installed; |
140 case WebServiceWorkerStateActivating: | 137 case WebServiceWorkerStateActivating: |
141 return activating; | 138 return activating; |
142 case WebServiceWorkerStateActivated: | 139 case WebServiceWorkerStateActivated: |
143 return activated; | 140 return activated; |
144 case WebServiceWorkerStateRedundant: | 141 case WebServiceWorkerStateRedundant: |
145 return redundant; | 142 return redundant; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 : AbstractWorker(executionContext) | 254 : AbstractWorker(executionContext) |
258 , WebServiceWorkerProxy(this) | 255 , WebServiceWorkerProxy(this) |
259 , m_outerWorker(worker) | 256 , m_outerWorker(worker) |
260 , m_proxyState(Initial) | 257 , m_proxyState(Initial) |
261 { | 258 { |
262 ASSERT(m_outerWorker); | 259 ASSERT(m_outerWorker); |
263 m_outerWorker->setProxy(this); | 260 m_outerWorker->setProxy(this); |
264 } | 261 } |
265 | 262 |
266 } // namespace blink | 263 } // namespace blink |
OLD | NEW |