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

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

Issue 478693005: Oilpan: Ship Oilpan for serviceworkers/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 { 82 {
83 if (m_state != Initial) 83 if (m_state != Initial)
84 return; 84 return;
85 85
86 m_state = Pending; 86 m_state = Pending;
87 ScriptPromise::cast(scriptState, value).then( 87 ScriptPromise::cast(scriptState, value).then(
88 ThenFunction::createFunction(scriptState, this, ThenFunction::Fulfilled) , 88 ThenFunction::createFunction(scriptState, this, ThenFunction::Fulfilled) ,
89 ThenFunction::createFunction(scriptState, this, ThenFunction::Rejected)) ; 89 ThenFunction::createFunction(scriptState, this, ThenFunction::Rejected)) ;
90 } 90 }
91 91
92 void RespondWithObserver::sendResponse(PassRefPtrWillBeRawPtr<Response> response ) 92 void RespondWithObserver::sendResponse(Response* response)
93 { 93 {
94 if (!executionContext()) 94 if (!executionContext())
95 return; 95 return;
96 ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleFetchEven t(m_eventID, response); 96 ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleFetchEven t(m_eventID, response);
97 m_state = Done; 97 m_state = Done;
98 } 98 }
99 99
100 void RespondWithObserver::responseWasRejected() 100 void RespondWithObserver::responseWasRejected()
101 { 101 {
102 // FIXME: Throw a NetworkError to service worker's execution context. 102 // FIXME: Throw a NetworkError to service worker's execution context.
(...skipping 13 matching lines...) Expand all
116 } 116 }
117 117
118 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID) 118 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID)
119 : ContextLifecycleObserver(context) 119 : ContextLifecycleObserver(context)
120 , m_eventID(eventID) 120 , m_eventID(eventID)
121 , m_state(Initial) 121 , m_state(Initial)
122 { 122 {
123 } 123 }
124 124
125 } // namespace blink 125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698