Changeset 117728 in webkit
- Timestamp:
- May 20, 2012 10:42:25 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117726 r117728 1 2012-05-20 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Pass Isolate to throwError()s in bindings/v8/*.{h,cpp} 4 https://bugs.webkit.org/show_bug.cgi?id=86977 5 6 Reviewed by Adam Barth. 7 8 The objective is to pass Isolate around in V8 bindings. 9 This patch passes Isolate to throwError()s in bindings/v8/*.{h,cpp} 10 except for a couple of non-trivial cases. I'll upload a follow-up patch 11 for the non-trivial cases. 12 13 No tests. No change in behavior. 14 15 * bindings/v8/DateExtension.cpp: 16 (WebCore::DateExtension::OnSleepDetected): 17 * bindings/v8/SerializedScriptValue.cpp: 18 (WebCore::SerializedScriptValue::transferArrayBuffers): 19 (WebCore::SerializedScriptValue::SerializedScriptValue): 20 * bindings/v8/SerializedScriptValue.h: 21 * bindings/v8/V8NPObject.cpp: 22 (WebCore::npObjectInvokeImpl): 23 (WebCore::npObjectPropertyEnumerator): 24 * bindings/v8/V8Proxy.cpp: 25 (WebCore::V8Proxy::checkNewLegal): 26 1 27 2012-05-20 Keishi Hattori <keishi@webkit.org> 2 28 -
trunk/Source/WebCore/bindings/v8/DateExtension.cpp
r113111 r117728 117 117 } 118 118 119 v8::Handle<v8::Value> DateExtension::OnSleepDetected(const v8::Arguments& )119 v8::Handle<v8::Value> DateExtension::OnSleepDetected(const v8::Arguments& args) 120 120 { 121 V8Proxy::throwError(V8Proxy::GeneralError, "Too much time spent in unload handler." );121 V8Proxy::throwError(V8Proxy::GeneralError, "Too much time spent in unload handler.", args.GetIsolate()); 122 122 return v8::Undefined(); 123 123 } -
trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
r117377 r117728 2155 2155 } 2156 2156 2157 PassOwnPtr<SerializedScriptValue::ArrayBufferContentsArray> SerializedScriptValue::transferArrayBuffers(ArrayBufferArray& arrayBuffers, bool& didThrow )2157 PassOwnPtr<SerializedScriptValue::ArrayBufferContentsArray> SerializedScriptValue::transferArrayBuffers(ArrayBufferArray& arrayBuffers, bool& didThrow, v8::Isolate* isolate) 2158 2158 { 2159 2159 for (size_t i = 0; i < arrayBuffers.size(); i++) { 2160 2160 if (arrayBuffers[i]->isNeutered()) { 2161 throwError(INVALID_STATE_ERR );2161 throwError(INVALID_STATE_ERR, isolate); 2162 2162 didThrow = true; 2163 2163 return nullptr; … … 2177 2177 bool result = arrayBuffers[i]->transfer(contents->at(i), neuteredViews); 2178 2178 if (!result) { 2179 throwError(INVALID_STATE_ERR );2179 throwError(INVALID_STATE_ERR, isolate); 2180 2180 didThrow = true; 2181 2181 return nullptr; … … 2214 2214 // of the TryCatch scope. 2215 2215 didThrow = true; 2216 throwError(DATA_CLONE_ERR );2216 throwError(DATA_CLONE_ERR, isolate); 2217 2217 return; 2218 2218 case Serializer::InvalidStateError: 2219 2219 didThrow = true; 2220 throwError(INVALID_STATE_ERR );2220 throwError(INVALID_STATE_ERR, isolate); 2221 2221 return; 2222 2222 case Serializer::JSFailure: … … 2229 2229 m_data = String(StringImpl::adopt(writer.data())).isolatedCopy(); 2230 2230 if (arrayBuffers) 2231 m_arrayBufferContentsArray = transferArrayBuffers(*arrayBuffers, didThrow );2231 m_arrayBufferContentsArray = transferArrayBuffers(*arrayBuffers, didThrow, isolate); 2232 2232 return; 2233 2233 case Serializer::JSException: -
trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h
r117377 r117728 89 89 explicit SerializedScriptValue(const String& wireData); 90 90 91 static PassOwnPtr<ArrayBufferContentsArray> transferArrayBuffers(ArrayBufferArray&, bool& didThrow );91 static PassOwnPtr<ArrayBufferContentsArray> transferArrayBuffers(ArrayBufferArray&, bool& didThrow, v8::Isolate*); 92 92 93 93 String m_data; -
trunk/Source/WebCore/bindings/v8/V8NPObject.cpp
r117383 r117728 93 93 // internal fields. 94 94 if (args.Holder()->InternalFieldCount() != npObjectInternalFieldCount) 95 return V8Proxy::throwError(V8Proxy::ReferenceError, "NPMethod called on non-NPObject" );95 return V8Proxy::throwError(V8Proxy::ReferenceError, "NPMethod called on non-NPObject", args.GetIsolate()); 96 96 97 97 npObject = v8ObjectToNPObject(args.Holder()); … … 100 100 // Verify that our wrapper wasn't using a NPObject which has already been deleted. 101 101 if (!npObject || !_NPN_IsAlive(npObject)) 102 return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted" );102 return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", args.GetIsolate()); 103 103 104 104 // Wrap up parameters. … … 134 134 135 135 if (!retval) 136 V8Proxy::throwError(V8Proxy::GeneralError, "Error calling method on NPObject." );136 V8Proxy::throwError(V8Proxy::GeneralError, "Error calling method on NPObject.", args.GetIsolate()); 137 137 138 138 for (int i = 0; i < numArgs; i++) … … 326 326 // has already been deleted. 327 327 if (!npObject || !_NPN_IsAlive(npObject)) 328 V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted" );328 V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", info.GetIsolate()); 329 329 330 330 if (NP_CLASS_STRUCT_VERSION_HAS_ENUM(npObject->_class) && npObject->_class->enumerate) { -
trunk/Source/WebCore/bindings/v8/V8Proxy.cpp
r117466 r117728 713 713 { 714 714 if (ConstructorMode::current() == ConstructorMode::CreateNewObject) 715 return throwError(TypeError, "Illegal constructor" );715 return throwError(TypeError, "Illegal constructor", args.GetIsolate()); 716 716 717 717 return args.This();
Note: See TracChangeset
for help on using the changeset viewer.