| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 ASSERT(document); | 95 ASSERT(document); |
| 96 | 96 |
| 97 // Make sure the document is added to the DOM Node map. Otherwise, the TestN
amedConstructor instance | 97 // Make sure the document is added to the DOM Node map. Otherwise, the TestN
amedConstructor instance |
| 98 // may end up being the only node in the map and get garbage-collected prema
turely. | 98 // may end up being the only node in the map and get garbage-collected prema
turely. |
| 99 toV8(document, info.Holder(), info.GetIsolate()); | 99 toV8(document, info.Holder(), info.GetIsolate()); |
| 100 | 100 |
| 101 if (UNLIKELY(info.Length() < 1)) { | 101 if (UNLIKELY(info.Length() < 1)) { |
| 102 throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "T
estNamedConstructor", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 102 throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "T
estNamedConstructor", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 ExceptionState es(info.GetIsolate()); | 105 ExceptionState es(info.Holder(), info.GetIsolate()); |
| 106 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); | 106 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); |
| 107 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); | 107 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); |
| 108 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul
l(info, 2)); | 108 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul
l(info, 2)); |
| 109 | 109 |
| 110 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru
ctor(*document, str1, str2, str3, es); | 110 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru
ctor(*document, str1, str2, str3, es); |
| 111 v8::Handle<v8::Object> wrapper = info.Holder(); | 111 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 112 if (es.throwIfNeeded()) | 112 if (es.throwIfNeeded()) |
| 113 return; | 113 return; |
| 114 | 114 |
| 115 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl.releas
e(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsola
te(), WrapperConfiguration::Dependent); | 115 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl.releas
e(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsola
te(), WrapperConfiguration::Dependent); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl, &wrap
perTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent); | 205 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl, &wrap
perTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent); |
| 206 return wrapper; | 206 return wrapper; |
| 207 } | 207 } |
| 208 | 208 |
| 209 void V8TestNamedConstructor::derefObject(void* object) | 209 void V8TestNamedConstructor::derefObject(void* object) |
| 210 { | 210 { |
| 211 fromInternalPointer(object)->deref(); | 211 fromInternalPointer(object)->deref(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace WebCore | 214 } // namespace WebCore |
| OLD | NEW |