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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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
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 "modules/serviceworkers/ServiceWorkerRegistration.h" 5 #include "modules/serviceworkers/ServiceWorkerRegistration.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include "bindings/core/v8/CallbackPromiseAdapter.h" 9 #include "bindings/core/v8/CallbackPromiseAdapter.h"
10 #include "bindings/core/v8/ScriptPromise.h" 10 #include "bindings/core/v8/ScriptPromise.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 WTF::makeUnique< 105 WTF::makeUnique<
106 CallbackPromiseAdapter<void, ServiceWorkerErrorForUpdate>>(resolver)); 106 CallbackPromiseAdapter<void, ServiceWorkerErrorForUpdate>>(resolver));
107 return promise; 107 return promise;
108 } 108 }
109 109
110 ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState) { 110 ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState) {
111 ServiceWorkerContainerClient* client = 111 ServiceWorkerContainerClient* client =
112 ServiceWorkerContainerClient::from(getExecutionContext()); 112 ServiceWorkerContainerClient::from(getExecutionContext());
113 if (!client || !client->provider()) 113 if (!client || !client->provider())
114 return ScriptPromise::rejectWithDOMException( 114 return ScriptPromise::rejectWithDOMException(
115 scriptState, DOMException::create(InvalidStateError, 115 scriptState,
116 "Failed to unregister a " 116 DOMException::create(InvalidStateError,
117 "ServiceWorkerRegistration: No " 117 "Failed to unregister a "
118 "associated provider is available.")); 118 "ServiceWorkerRegistration: No "
119 "associated provider is available."));
119 120
120 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); 121 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
121 ScriptPromise promise = resolver->promise(); 122 ScriptPromise promise = resolver->promise();
122 m_handle->registration()->unregister( 123 m_handle->registration()->unregister(
123 client->provider(), 124 client->provider(),
124 WTF::makeUnique<CallbackPromiseAdapter<bool, ServiceWorkerError>>( 125 WTF::makeUnique<CallbackPromiseAdapter<bool, ServiceWorkerError>>(
125 resolver)); 126 resolver));
126 return promise; 127 return promise;
127 } 128 }
128 129
(...skipping 30 matching lines...) Expand all
159 } 160 }
160 161
161 void ServiceWorkerRegistration::contextDestroyed(ExecutionContext*) { 162 void ServiceWorkerRegistration::contextDestroyed(ExecutionContext*) {
162 if (m_stopped) 163 if (m_stopped)
163 return; 164 return;
164 m_stopped = true; 165 m_stopped = true;
165 m_handle->registration()->proxyStopped(); 166 m_handle->registration()->proxyStopped();
166 } 167 }
167 168
168 } // namespace blink 169 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698