Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp

Issue 2059953003: service worker: Fix the type of a register promise reject value (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Use ServiceWorkerErrorForUpdate directly Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698