| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "bindings/v8/V8Initializer.h" | 27 #include "bindings/v8/V8Initializer.h" |
| 28 | 28 |
| 29 #include "V8DOMWindow.h" |
| 29 #include "V8History.h" | 30 #include "V8History.h" |
| 30 #include "V8Location.h" | 31 #include "V8Location.h" |
| 31 #include "V8Window.h" | |
| 32 #include "bindings/v8/ScriptCallStackFactory.h" | 32 #include "bindings/v8/ScriptCallStackFactory.h" |
| 33 #include "bindings/v8/ScriptProfiler.h" | 33 #include "bindings/v8/ScriptProfiler.h" |
| 34 #include "bindings/v8/V8Binding.h" | 34 #include "bindings/v8/V8Binding.h" |
| 35 #include "bindings/v8/V8GCController.h" | 35 #include "bindings/v8/V8GCController.h" |
| 36 #include "bindings/v8/V8PerContextData.h" | 36 #include "bindings/v8/V8PerContextData.h" |
| 37 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
| 38 #include "core/inspector/ScriptCallStack.h" | 38 #include "core/inspector/ScriptCallStack.h" |
| 39 #include "core/page/DOMWindow.h" | 39 #include "core/page/DOMWindow.h" |
| 40 #include "core/page/Frame.h" | 40 #include "core/page/Frame.h" |
| 41 #include "core/platform/MemoryUsageSupport.h" | 41 #include "core/platform/MemoryUsageSupport.h" |
| 42 #include <v8-debug.h> | 42 #include <v8-debug.h> |
| 43 #include "wtf/RefPtr.h" | 43 #include "wtf/RefPtr.h" |
| 44 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
| 45 | 45 |
| 46 namespace WebCore { | 46 namespace WebCore { |
| 47 | 47 |
| 48 static Frame* findFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data, v
8::Isolate* isolate) | 48 static Frame* findFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data, v
8::Isolate* isolate) |
| 49 { | 49 { |
| 50 WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data); | 50 WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data); |
| 51 | 51 |
| 52 if (V8Window::info.equals(type)) { | 52 if (V8DOMWindow::info.equals(type)) { |
| 53 v8::Handle<v8::Object> windowWrapper = host->FindInstanceInPrototypeChai
n(V8Window::GetTemplate(isolate, worldTypeInMainThread(isolate))); | 53 v8::Handle<v8::Object> windowWrapper = host->FindInstanceInPrototypeChai
n(V8DOMWindow::GetTemplate(isolate, worldTypeInMainThread(isolate))); |
| 54 if (windowWrapper.IsEmpty()) | 54 if (windowWrapper.IsEmpty()) |
| 55 return 0; | 55 return 0; |
| 56 return V8Window::toNative(windowWrapper)->frame(); | 56 return V8DOMWindow::toNative(windowWrapper)->frame(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 if (V8History::info.equals(type)) | 59 if (V8History::info.equals(type)) |
| 60 return V8History::toNative(host)->frame(); | 60 return V8History::toNative(host)->frame(); |
| 61 | 61 |
| 62 if (V8Location::info.equals(type)) | 62 if (V8Location::info.equals(type)) |
| 63 return V8Location::toNative(host)->frame(); | 63 return V8Location::toNative(host)->frame(); |
| 64 | 64 |
| 65 // This function can handle only those types listed above. | 65 // This function can handle only those types listed above. |
| 66 ASSERT_NOT_REACHED(); | 66 ASSERT_NOT_REACHED(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 v8::ResourceConstraints resourceConstraints; | 168 v8::ResourceConstraints resourceConstraints; |
| 169 uint32_t here; | 169 uint32_t here; |
| 170 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 170 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
| 171 v8::SetResourceConstraints(&resourceConstraints); | 171 v8::SetResourceConstraints(&resourceConstraints); |
| 172 | 172 |
| 173 V8PerIsolateData::ensureInitialized(isolate); | 173 V8PerIsolateData::ensureInitialized(isolate); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace WebCore | 176 } // namespace WebCore |
| OLD | NEW |