OLD | NEW |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 void RespondWithObserver::responseWasFulfilled(const ScriptValue& value) | 108 void RespondWithObserver::responseWasFulfilled(const ScriptValue& value) |
109 { | 109 { |
110 if (!executionContext()) | 110 if (!executionContext()) |
111 return; | 111 return; |
112 if (!V8Response::hasInstance(value.v8Value(), toIsolate(executionContext()))
) { | 112 if (!V8Response::hasInstance(value.v8Value(), toIsolate(executionContext()))
) { |
113 responseWasRejected(); | 113 responseWasRejected(); |
114 return; | 114 return; |
115 } | 115 } |
116 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value.v8Value()
); | 116 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value.v8Value()
); |
117 sendResponse(V8Response::toNative(object)); | 117 sendResponse(V8Response::toImpl(object)); |
118 } | 118 } |
119 | 119 |
120 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID) | 120 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID) |
121 : ContextLifecycleObserver(context) | 121 : ContextLifecycleObserver(context) |
122 , m_eventID(eventID) | 122 , m_eventID(eventID) |
123 , m_state(Initial) | 123 , m_state(Initial) |
124 { | 124 { |
125 } | 125 } |
126 | 126 |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |