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 4914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4925 { | 4925 { |
4926 if (UNLIKELY(info.Length() < 1)) { | 4926 if (UNLIKELY(info.Length() < 1)) { |
4927 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate
()); | 4927 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate
()); |
4928 return; | 4928 return; |
4929 } | 4929 } |
4930 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 4930 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
4931 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), info.GetIsola
te()); | 4931 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), info.GetIsola
te()); |
4932 return; | 4932 return; |
4933 } | 4933 } |
4934 OwnPtr<TestCallback> testCallback = V8TestCallback::create(info[0], getExecu
tionContext()); | 4934 OwnPtr<TestCallback> testCallback = V8TestCallback::create(info[0], getExecu
tionContext()); |
4935 | |
4936 RefPtr<TestObj> impl = TestObj::create(testCallback); | 4935 RefPtr<TestObj> impl = TestObj::create(testCallback); |
4937 v8::Handle<v8::Object> wrapper = info.Holder(); | 4936 v8::Handle<v8::Object> wrapper = info.Holder(); |
4938 | 4937 |
4939 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te
stObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep
endent); | 4938 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te
stObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep
endent); |
4940 v8SetReturnValue(info, wrapper); | 4939 v8SetReturnValue(info, wrapper); |
4941 } | 4940 } |
4942 | 4941 |
4943 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 4942 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
4944 { | 4943 { |
4945 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | 4944 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5408 fromInternalPointer(object)->deref(); | 5407 fromInternalPointer(object)->deref(); |
5409 } | 5408 } |
5410 | 5409 |
5411 template<> | 5410 template<> |
5412 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5411 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
5413 { | 5412 { |
5414 return toV8(impl, creationContext, isolate); | 5413 return toV8(impl, creationContext, isolate); |
5415 } | 5414 } |
5416 | 5415 |
5417 } // namespace WebCore | 5416 } // namespace WebCore |
OLD | NEW |