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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "V8History.h" | 29 #include "V8History.h" |
30 #include "V8Location.h" | 30 #include "V8Location.h" |
31 #include "V8Window.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/dom/ExceptionCode.h" |
38 #include "core/inspector/ScriptCallStack.h" | 39 #include "core/inspector/ScriptCallStack.h" |
39 #include "core/page/DOMWindow.h" | 40 #include "core/page/DOMWindow.h" |
40 #include "core/page/Frame.h" | 41 #include "core/page/Frame.h" |
41 #include "core/platform/MemoryUsageSupport.h" | 42 #include "core/platform/MemoryUsageSupport.h" |
42 #include <v8-debug.h> | 43 #include <v8-debug.h> |
43 #include "wtf/RefPtr.h" | 44 #include "wtf/RefPtr.h" |
44 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
45 | 46 |
46 namespace WebCore { | 47 namespace WebCore { |
47 | 48 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 firstWindow->document()->reportException(errorMessage, message->GetLineNumbe
r(), resource, callStack); | 95 firstWindow->document()->reportException(errorMessage, message->GetLineNumbe
r(), resource, callStack); |
95 } | 96 } |
96 | 97 |
97 static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8
::AccessType type, v8::Local<v8::Value> data) | 98 static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8
::AccessType type, v8::Local<v8::Value> data) |
98 { | 99 { |
99 Frame* target = findFrame(host, data, v8::Isolate::GetCurrent()); | 100 Frame* target = findFrame(host, data, v8::Isolate::GetCurrent()); |
100 if (!target) | 101 if (!target) |
101 return; | 102 return; |
102 DOMWindow* targetWindow = target->document()->domWindow(); | 103 DOMWindow* targetWindow = target->document()->domWindow(); |
103 targetWindow->printErrorMessage(targetWindow->crossDomainAccessErrorMessage(
activeDOMWindow())); | 104 targetWindow->printErrorMessage(targetWindow->crossDomainAccessErrorMessage(
activeDOMWindow())); |
| 105 |
| 106 setDOMException(SecurityError, v8::Isolate::GetCurrent()); |
104 } | 107 } |
105 | 108 |
106 static void initializeV8Common() | 109 static void initializeV8Common() |
107 { | 110 { |
108 v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue); | 111 v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue); |
109 v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); | 112 v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); |
110 v8::V8::IgnoreOutOfMemoryException(); | 113 v8::V8::IgnoreOutOfMemoryException(); |
111 | 114 |
112 v8::Debug::SetLiveEditEnabled(false); | 115 v8::Debug::SetLiveEditEnabled(false); |
113 } | 116 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 170 |
168 v8::ResourceConstraints resourceConstraints; | 171 v8::ResourceConstraints resourceConstraints; |
169 uint32_t here; | 172 uint32_t here; |
170 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 173 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
171 v8::SetResourceConstraints(&resourceConstraints); | 174 v8::SetResourceConstraints(&resourceConstraints); |
172 | 175 |
173 V8PerIsolateData::ensureInitialized(isolate); | 176 V8PerIsolateData::ensureInitialized(isolate); |
174 } | 177 } |
175 | 178 |
176 } // namespace WebCore | 179 } // namespace WebCore |
OLD | NEW |