| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 { | 69 { |
| 70 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) | 70 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) |
| 71 return; | 71 return; |
| 72 m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->g
etExecutionContext(), adoptPtr(handle.release()))); | 72 m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->g
etExecutionContext(), adoptPtr(handle.release()))); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void onError(const WebServiceWorkerError& error) override | 75 void onError(const WebServiceWorkerError& error) override |
| 76 { | 76 { |
| 77 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) | 77 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) |
| 78 return; | 78 return; |
| 79 ScriptState::Scope scope(m_resolver->getScriptState()); |
| 79 if (error.errorType == WebServiceWorkerError::ErrorTypeType) { | 80 if (error.errorType == WebServiceWorkerError::ErrorTypeType) { |
| 80 m_resolver->reject(V8ThrowException::createTypeError(m_resolver->get
ScriptState()->isolate(), error.message)); | 81 m_resolver->reject(V8ThrowException::createTypeError(m_resolver->get
ScriptState()->isolate(), error.message)); |
| 81 } else { | 82 } else { |
| 82 m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error)
); | 83 m_resolver->reject(ServiceWorkerErrorForUpdate::take(m_resolver.get(
), error)); |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 Persistent<ScriptPromiseResolver> m_resolver; | 88 Persistent<ScriptPromiseResolver> m_resolver; |
| 88 WTF_MAKE_NONCOPYABLE(RegistrationCallback); | 89 WTF_MAKE_NONCOPYABLE(RegistrationCallback); |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 class GetRegistrationCallback : public WebServiceWorkerProvider::WebServiceWorke
rGetRegistrationCallbacks { | 92 class GetRegistrationCallback : public WebServiceWorkerProvider::WebServiceWorke
rGetRegistrationCallbacks { |
| 92 public: | 93 public: |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 return; | 418 return; |
| 418 | 419 |
| 419 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { | 420 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { |
| 420 m_provider = client->provider(); | 421 m_provider = client->provider(); |
| 421 if (m_provider) | 422 if (m_provider) |
| 422 m_provider->setClient(this); | 423 m_provider->setClient(this); |
| 423 } | 424 } |
| 424 } | 425 } |
| 425 | 426 |
| 426 } // namespace blink | 427 } // namespace blink |
| OLD | NEW |