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

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

Issue 1227783004: Fix virtual/override/final usage in Source/modules/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 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 | Annotate | Revision Log
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 "modules/serviceworkers/RespondWithObserver.h" 6 #include "modules/serviceworkers/RespondWithObserver.h"
7 7
8 #include "bindings/core/v8/ScriptFunction.h" 8 #include "bindings/core/v8/ScriptFunction.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 private: 46 private:
47 ThenFunction(ScriptState* scriptState, RespondWithObserver* observer, Resolv eType type) 47 ThenFunction(ScriptState* scriptState, RespondWithObserver* observer, Resolv eType type)
48 : ScriptFunction(scriptState) 48 : ScriptFunction(scriptState)
49 , m_observer(observer) 49 , m_observer(observer)
50 , m_resolveType(type) 50 , m_resolveType(type)
51 { 51 {
52 } 52 }
53 53
54 virtual ScriptValue call(ScriptValue value) override 54 ScriptValue call(ScriptValue value) override
55 { 55 {
56 ASSERT(m_observer); 56 ASSERT(m_observer);
57 ASSERT(m_resolveType == Fulfilled || m_resolveType == Rejected); 57 ASSERT(m_resolveType == Fulfilled || m_resolveType == Rejected);
58 if (m_resolveType == Rejected) { 58 if (m_resolveType == Rejected) {
59 m_observer->responseWasRejected(WebServiceWorkerResponseErrorPromise Rejected); 59 m_observer->responseWasRejected(WebServiceWorkerResponseErrorPromise Rejected);
60 value = ScriptPromise::reject(value.scriptState(), value).scriptValu e(); 60 value = ScriptPromise::reject(value.scriptState(), value).scriptValu e();
61 } else { 61 } else {
62 m_observer->responseWasFulfilled(value); 62 m_observer->responseWasFulfilled(value);
63 } 63 }
64 m_observer = nullptr; 64 m_observer = nullptr;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 , m_state(Initial) 182 , m_state(Initial)
183 { 183 {
184 } 184 }
185 185
186 DEFINE_TRACE(RespondWithObserver) 186 DEFINE_TRACE(RespondWithObserver)
187 { 187 {
188 ContextLifecycleObserver::trace(visitor); 188 ContextLifecycleObserver::trace(visitor);
189 } 189 }
190 190
191 } // namespace blink 191 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/RespondWithObserver.h ('k') | Source/modules/serviceworkers/ServiceWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698