| 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 | 607 |
| 608 return v8Value; | 608 return v8Value; |
| 609 } | 609 } |
| 610 | 610 |
| 611 v8::Isolate* toIsolate(ExecutionContext*); | 611 v8::Isolate* toIsolate(ExecutionContext*); |
| 612 v8::Isolate* toIsolate(Frame*); | 612 v8::Isolate* toIsolate(Frame*); |
| 613 | 613 |
| 614 WrapperWorldType worldType(v8::Isolate*); | 614 WrapperWorldType worldType(v8::Isolate*); |
| 615 WrapperWorldType worldTypeInMainThread(v8::Isolate*); | 615 WrapperWorldType worldTypeInMainThread(v8::Isolate*); |
| 616 | 616 |
| 617 DOMWrapperWorld* isolatedWorldForIsolate(v8::Isolate*); |
| 618 |
| 617 DOMWindow* toDOMWindow(v8::Handle<v8::Value>, v8::Isolate*); | 619 DOMWindow* toDOMWindow(v8::Handle<v8::Value>, v8::Isolate*); |
| 618 DOMWindow* toDOMWindow(v8::Handle<v8::Context>); | 620 DOMWindow* toDOMWindow(v8::Handle<v8::Context>); |
| 619 ExecutionContext* toExecutionContext(v8::Handle<v8::Context>); | 621 ExecutionContext* toExecutionContext(v8::Handle<v8::Context>); |
| 620 | 622 |
| 621 DOMWindow* activeDOMWindow(v8::Isolate*); | 623 DOMWindow* activeDOMWindow(v8::Isolate*); |
| 622 ExecutionContext* activeExecutionContext(v8::Isolate*); | 624 ExecutionContext* activeExecutionContext(v8::Isolate*); |
| 623 DOMWindow* firstDOMWindow(v8::Isolate*); | 625 DOMWindow* firstDOMWindow(v8::Isolate*); |
| 624 Document* currentDocument(v8::Isolate*); | 626 Document* currentDocument(v8::Isolate*); |
| 625 ExecutionContext* currentExecutionContext(v8::Isolate*); | 627 ExecutionContext* currentExecutionContext(v8::Isolate*); |
| 626 | 628 |
| 627 // Returns a V8 context associated with a ExecutionContext and a DOMWrapperW
orld. | 629 // Returns a V8 context associated with a ExecutionContext and a DOMWrapperW
orld. |
| 628 // This method returns an empty context if there is no frame or the frame is
already detached. | 630 // This method returns an empty context if there is no frame or the frame is
already detached. |
| 629 v8::Local<v8::Context> toV8Context(ExecutionContext*, DOMWrapperWorld*); | 631 v8::Local<v8::Context> toV8Context(ExecutionContext*, DOMWrapperWorld*); |
| 630 // Returns a V8 context associated with a Frame and a DOMWrapperWorld. | 632 // Returns a V8 context associated with a Frame and a DOMWrapperWorld. |
| 631 // This method returns an empty context if the frame is already detached. | 633 // This method returns an empty context if the frame is already detached. |
| 632 v8::Local<v8::Context> toV8Context(v8::Isolate*, Frame*, DOMWrapperWorld*); | 634 v8::Local<v8::Context> toV8Context(v8::Isolate*, Frame*, DOMWrapperWorld*); |
| 633 | 635 |
| 634 // Returns the frame object of the window object associated with | 636 // Returns the frame object of the window object associated with |
| 635 // a context, if the window is currently being displayed in the Frame. | 637 // a context, if the window is currently being displayed in the Frame. |
| 636 Frame* toFrameIfNotDetached(v8::Handle<v8::Context>); | 638 Frame* toFrameIfNotDetached(v8::Handle<v8::Context>); |
| 637 | 639 |
| 640 inline DOMWrapperWorld* isolatedWorldForEnteredContext(v8::Isolate* isolate) |
| 641 { |
| 642 v8::Handle<v8::Context> context = isolate->GetEnteredContext(); |
| 643 if (context.IsEmpty()) |
| 644 return 0; |
| 645 return DOMWrapperWorld::isolatedWorld(context); |
| 646 } |
| 647 |
| 638 // If the current context causes out of memory, JavaScript setting | 648 // If the current context causes out of memory, JavaScript setting |
| 639 // is disabled and it returns true. | 649 // is disabled and it returns true. |
| 640 bool handleOutOfMemory(); | 650 bool handleOutOfMemory(); |
| 641 v8::Local<v8::Value> handleMaxRecursionDepthExceeded(v8::Isolate*); | 651 v8::Local<v8::Value> handleMaxRecursionDepthExceeded(v8::Isolate*); |
| 642 void crashIfV8IsDead(); | 652 void crashIfV8IsDead(); |
| 643 | 653 |
| 644 inline bool isUndefinedOrNull(v8::Handle<v8::Value> value) | 654 inline bool isUndefinedOrNull(v8::Handle<v8::Value> value) |
| 645 { | 655 { |
| 646 return value->IsNull() || value->IsUndefined(); | 656 return value->IsNull() || value->IsUndefined(); |
| 647 } | 657 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 m_isolate->ClearInterrupt(); | 725 m_isolate->ClearInterrupt(); |
| 716 } | 726 } |
| 717 | 727 |
| 718 private: | 728 private: |
| 719 v8::Isolate* m_isolate; | 729 v8::Isolate* m_isolate; |
| 720 }; | 730 }; |
| 721 | 731 |
| 722 } // namespace WebCore | 732 } // namespace WebCore |
| 723 | 733 |
| 724 #endif // V8Binding_h | 734 #endif // V8Binding_h |
| OLD | NEW |