| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 return v8::Local<v8::Context>(); | 728 return v8::Local<v8::Context>(); |
| 729 } | 729 } |
| 730 | 730 |
| 731 v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world) | 731 v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world) |
| 732 { | 732 { |
| 733 if (!frame) | 733 if (!frame) |
| 734 return v8::Local<v8::Context>(); | 734 return v8::Local<v8::Context>(); |
| 735 v8::Local<v8::Context> context = frame->script().windowProxy(world)->context
(); | 735 v8::Local<v8::Context> context = frame->script().windowProxy(world)->context
(); |
| 736 if (context.IsEmpty()) | 736 if (context.IsEmpty()) |
| 737 return v8::Local<v8::Context>(); | 737 return v8::Local<v8::Context>(); |
| 738 LocalFrame* attachedFrame= toFrameIfNotDetached(context); | 738 LocalFrame* attachedFrame = toFrameIfNotDetached(context); |
| 739 return frame == attachedFrame ? context : v8::Local<v8::Context>(); | 739 return frame == attachedFrame ? context : v8::Local<v8::Context>(); |
| 740 } | 740 } |
| 741 | 741 |
| 742 void crashIfV8IsDead() | 742 void crashIfV8IsDead() |
| 743 { | 743 { |
| 744 if (v8::V8::IsDead()) { | 744 if (v8::V8::IsDead()) { |
| 745 // FIXME: We temporarily deal with V8 internal error situations | 745 // FIXME: We temporarily deal with V8 internal error situations |
| 746 // such as out-of-memory by crashing the renderer. | 746 // such as out-of-memory by crashing the renderer. |
| 747 CRASH(); | 747 CRASH(); |
| 748 } | 748 } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 | 920 |
| 921 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value
> value) | 921 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value
> value) |
| 922 { | 922 { |
| 923 v8::Local<v8::Object> result = v8::Object::New(isolate); | 923 v8::Local<v8::Object> result = v8::Object::New(isolate); |
| 924 result->Set(v8String(isolate, "value"), value); | 924 result->Set(v8String(isolate, "value"), value); |
| 925 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); | 925 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); |
| 926 return result; | 926 return result; |
| 927 } | 927 } |
| 928 | 928 |
| 929 } // namespace blink | 929 } // namespace blink |
| OLD | NEW |