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 21 matching lines...) Expand all Loading... |
32 #include "bindings/core/v8/V8Binding.h" | 32 #include "bindings/core/v8/V8Binding.h" |
33 | 33 |
34 #include "bindings/core/v8/ScriptController.h" | 34 #include "bindings/core/v8/ScriptController.h" |
35 #include "bindings/core/v8/V8AbstractEventListener.h" | 35 #include "bindings/core/v8/V8AbstractEventListener.h" |
36 #include "bindings/core/v8/V8BindingMacros.h" | 36 #include "bindings/core/v8/V8BindingMacros.h" |
37 #include "bindings/core/v8/V8Element.h" | 37 #include "bindings/core/v8/V8Element.h" |
38 #include "bindings/core/v8/V8NodeFilter.h" | 38 #include "bindings/core/v8/V8NodeFilter.h" |
39 #include "bindings/core/v8/V8NodeFilterCondition.h" | 39 #include "bindings/core/v8/V8NodeFilterCondition.h" |
40 #include "bindings/core/v8/V8ObjectConstructor.h" | 40 #include "bindings/core/v8/V8ObjectConstructor.h" |
41 #include "bindings/core/v8/V8Window.h" | 41 #include "bindings/core/v8/V8Window.h" |
42 #include "bindings/core/v8/V8WindowShell.h" | |
43 #include "bindings/core/v8/V8WorkerGlobalScope.h" | 42 #include "bindings/core/v8/V8WorkerGlobalScope.h" |
44 #include "bindings/core/v8/V8XPathNSResolver.h" | 43 #include "bindings/core/v8/V8XPathNSResolver.h" |
| 44 #include "bindings/core/v8/WindowProxy.h" |
45 #include "bindings/core/v8/WorkerScriptController.h" | 45 #include "bindings/core/v8/WorkerScriptController.h" |
46 #include "bindings/core/v8/custom/V8CustomXPathNSResolver.h" | 46 #include "bindings/core/v8/custom/V8CustomXPathNSResolver.h" |
47 #include "core/dom/Document.h" | 47 #include "core/dom/Document.h" |
48 #include "core/dom/Element.h" | 48 #include "core/dom/Element.h" |
49 #include "core/dom/NodeFilter.h" | 49 #include "core/dom/NodeFilter.h" |
50 #include "core/dom/QualifiedName.h" | 50 #include "core/dom/QualifiedName.h" |
51 #include "core/frame/LocalFrame.h" | 51 #include "core/frame/LocalFrame.h" |
52 #include "core/frame/Settings.h" | 52 #include "core/frame/Settings.h" |
53 #include "core/inspector/BindingVisitors.h" | 53 #include "core/inspector/BindingVisitors.h" |
54 #include "core/inspector/InspectorTraceEvents.h" | 54 #include "core/inspector/InspectorTraceEvents.h" |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 // did return |frame| we could get in trouble because the frame could be | 725 // did return |frame| we could get in trouble because the frame could be |
726 // navigated to another security origin. | 726 // navigated to another security origin. |
727 return 0; | 727 return 0; |
728 } | 728 } |
729 | 729 |
730 v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w
orld) | 730 v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w
orld) |
731 { | 731 { |
732 ASSERT(context); | 732 ASSERT(context); |
733 if (context->isDocument()) { | 733 if (context->isDocument()) { |
734 if (LocalFrame* frame = toDocument(context)->frame()) | 734 if (LocalFrame* frame = toDocument(context)->frame()) |
735 return frame->script().windowShell(world)->context(); | 735 return frame->script().windowProxy(world)->context(); |
736 } else if (context->isWorkerGlobalScope()) { | 736 } else if (context->isWorkerGlobalScope()) { |
737 if (WorkerScriptController* script = toWorkerGlobalScope(context)->scrip
t()) | 737 if (WorkerScriptController* script = toWorkerGlobalScope(context)->scrip
t()) |
738 return script->context(); | 738 return script->context(); |
739 } | 739 } |
740 return v8::Local<v8::Context>(); | 740 return v8::Local<v8::Context>(); |
741 } | 741 } |
742 | 742 |
743 v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world) | 743 v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world) |
744 { | 744 { |
745 if (!frame) | 745 if (!frame) |
746 return v8::Local<v8::Context>(); | 746 return v8::Local<v8::Context>(); |
747 v8::Local<v8::Context> context = frame->script().windowShell(world)->context
(); | 747 v8::Local<v8::Context> context = frame->script().windowProxy(world)->context
(); |
748 if (context.IsEmpty()) | 748 if (context.IsEmpty()) |
749 return v8::Local<v8::Context>(); | 749 return v8::Local<v8::Context>(); |
750 LocalFrame* attachedFrame= toFrameIfNotDetached(context); | 750 LocalFrame* attachedFrame= toFrameIfNotDetached(context); |
751 return frame == attachedFrame ? context : v8::Local<v8::Context>(); | 751 return frame == attachedFrame ? context : v8::Local<v8::Context>(); |
752 } | 752 } |
753 | 753 |
754 void crashIfV8IsDead() | 754 void crashIfV8IsDead() |
755 { | 755 { |
756 if (v8::V8::IsDead()) { | 756 if (v8::V8::IsDead()) { |
757 // FIXME: We temporarily deal with V8 internal error situations | 757 // FIXME: We temporarily deal with V8 internal error situations |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio
nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) | 915 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio
nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) |
916 { | 916 { |
917 int scriptId = 0; | 917 int scriptId = 0; |
918 String resourceName; | 918 String resourceName; |
919 int lineNumber = 1; | 919 int lineNumber = 1; |
920 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe
r); | 920 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe
r); |
921 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin
eNumber); | 921 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin
eNumber); |
922 } | 922 } |
923 | 923 |
924 } // namespace blink | 924 } // namespace blink |
OLD | NEW |