| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 Frame* toFrameIfNotDetached(v8::Handle<v8::Context>); | 539 Frame* toFrameIfNotDetached(v8::Handle<v8::Context>); |
| 540 | 540 |
| 541 inline DOMWrapperWorld* isolatedWorldForEnteredContext() | 541 inline DOMWrapperWorld* isolatedWorldForEnteredContext() |
| 542 { | 542 { |
| 543 v8::Handle<v8::Context> context = v8::Context::GetEntered(); | 543 v8::Handle<v8::Context> context = v8::Context::GetEntered(); |
| 544 if (context.IsEmpty()) | 544 if (context.IsEmpty()) |
| 545 return 0; | 545 return 0; |
| 546 return DOMWrapperWorld::isolatedWorld(context); | 546 return DOMWrapperWorld::isolatedWorld(context); |
| 547 } | 547 } |
| 548 | 548 |
| 549 // FIXME: This will be soon embedded in the generated code. |
| 550 template<class Collection> static void indexedPropertyEnumerator(const v8::P
ropertyCallbackInfo<v8::Array>& info) |
| 551 { |
| 552 Collection* collection = reinterpret_cast<Collection*>(info.Holder()->Ge
tAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)); |
| 553 int length = collection->length(); |
| 554 v8::Handle<v8::Array> properties = v8::Array::New(length); |
| 555 for (int i = 0; i < length; ++i) { |
| 556 // FIXME: Do we need to check that the item function returns a non-n
ull value for this index? |
| 557 v8::Handle<v8::Integer> integer = v8::Integer::New(i, info.GetIsolat
e()); |
| 558 properties->Set(integer, integer); |
| 559 } |
| 560 v8SetReturnValue(info, properties); |
| 561 } |
| 562 |
| 549 // If the current context causes out of memory, JavaScript setting | 563 // If the current context causes out of memory, JavaScript setting |
| 550 // is disabled and it returns true. | 564 // is disabled and it returns true. |
| 551 bool handleOutOfMemory(); | 565 bool handleOutOfMemory(); |
| 552 // FIXME: This should receive an Isolate. | 566 // FIXME: This should receive an Isolate. |
| 553 v8::Local<v8::Value> handleMaxRecursionDepthExceeded(); | 567 v8::Local<v8::Value> handleMaxRecursionDepthExceeded(); |
| 554 | 568 |
| 555 void crashIfV8IsDead(); | 569 void crashIfV8IsDead(); |
| 556 | 570 |
| 557 template <class T> | 571 template <class T> |
| 558 v8::Handle<T> unsafeHandleFromRawValue(const T* value) | 572 v8::Handle<T> unsafeHandleFromRawValue(const T* value) |
| 559 { | 573 { |
| 560 const v8::Handle<T>* handle = reinterpret_cast<const v8::Handle<T>*>(&va
lue); | 574 const v8::Handle<T>* handle = reinterpret_cast<const v8::Handle<T>*>(&va
lue); |
| 561 return *handle; | 575 return *handle; |
| 562 } | 576 } |
| 563 | 577 |
| 564 } // namespace WebCore | 578 } // namespace WebCore |
| 565 | 579 |
| 566 #endif // V8Binding_h | 580 #endif // V8Binding_h |
| OLD | NEW |