| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void onSuccess(std::unique_ptr<WebServiceWorkerRegistration::Handle> webPass
Handle) override | 97 void onSuccess(std::unique_ptr<WebServiceWorkerRegistration::Handle> webPass
Handle) override |
| 98 { | 98 { |
| 99 OwnPtr<WebServiceWorkerRegistration::Handle> handle = adoptPtr(webPassHa
ndle.release()); | 99 OwnPtr<WebServiceWorkerRegistration::Handle> handle = adoptPtr(webPassHa
ndle.release()); |
| 100 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) | 100 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) |
| 101 return; | 101 return; |
| 102 if (!handle) { | 102 if (!handle) { |
| 103 // Resolve the promise with undefined. | 103 // Resolve the promise with undefined. |
| 104 m_resolver->resolve(); | 104 m_resolver->resolve(); |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->g
etExecutionContext(), handle.release())); | 107 m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->g
etExecutionContext(), std::move(handle))); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void onError(const WebServiceWorkerError& error) override | 110 void onError(const WebServiceWorkerError& error) override |
| 111 { | 111 { |
| 112 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) | 112 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) |
| 113 return; | 113 return; |
| 114 m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error)); | 114 m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error)); |
| 115 } | 115 } |
| 116 | 116 |
| 117 private: | 117 private: |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 return; | 417 return; |
| 418 | 418 |
| 419 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { | 419 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { |
| 420 m_provider = client->provider(); | 420 m_provider = client->provider(); |
| 421 if (m_provider) | 421 if (m_provider) |
| 422 m_provider->setClient(this); | 422 m_provider->setClient(this); |
| 423 } | 423 } |
| 424 } | 424 } |
| 425 | 425 |
| 426 } // namespace blink | 426 } // namespace blink |
| OLD | NEW |