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

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp

Issue 396963002: ServiceWorker: Bypass resolving a promise when ExecutionContext is gone (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 4 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 | « Source/modules/serviceworkers/ServiceWorkerError.cpp ('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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "ServiceWorkerRegistration.h" 6 #include "ServiceWorkerRegistration.h"
7 7
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" 8 #include "bindings/core/v8/CallbackPromiseAdapter.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
(...skipping 13 matching lines...) Expand all
24 #ifdef DISABLE_SERVICE_WORKER_REGISTRATION 24 #ifdef DISABLE_SERVICE_WORKER_REGISTRATION
25 typedef WebServiceWorker WebType; 25 typedef WebServiceWorker WebType;
26 #else 26 #else
27 typedef WebServiceWorkerRegistration WebType; 27 typedef WebServiceWorkerRegistration WebType;
28 #endif 28 #endif
29 static V8UndefinedType from(ScriptPromiseResolver* resolver, WebType* regist ration) 29 static V8UndefinedType from(ScriptPromiseResolver* resolver, WebType* regist ration)
30 { 30 {
31 ASSERT(!registration); // Anything passed here will be leaked. 31 ASSERT(!registration); // Anything passed here will be leaked.
32 return V8UndefinedType(); 32 return V8UndefinedType();
33 } 33 }
34 static void dispose(WebType* registration)
35 {
36 ASSERT(!registration); // Anything passed here will be leaked.
37 }
34 38
35 private: 39 private:
36 UndefinedValue(); 40 UndefinedValue();
37 }; 41 };
38 42
39 const AtomicString& ServiceWorkerRegistration::interfaceName() const 43 const AtomicString& ServiceWorkerRegistration::interfaceName() const
40 { 44 {
41 return EventTargetNames::ServiceWorkerRegistration; 45 return EventTargetNames::ServiceWorkerRegistration;
42 } 46 }
43 47
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 ASSERT(m_outerRegistration); 94 ASSERT(m_outerRegistration);
91 ScriptWrappable::init(this); 95 ScriptWrappable::init(this);
92 96
93 if (!executionContext) 97 if (!executionContext)
94 return; 98 return;
95 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro m(executionContext)) 99 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro m(executionContext))
96 m_provider = client->provider(); 100 m_provider = client->provider();
97 } 101 }
98 102
99 } // namespace blink 103 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerError.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698