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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 firstWindow->document()->reportException(event.release(), callStack, corsSta
tus); | 128 firstWindow->document()->reportException(event.release(), callStack, corsSta
tus); |
129 } | 129 } |
130 | 130 |
131 static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8
::AccessType type, v8::Local<v8::Value> data) | 131 static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8
::AccessType type, v8::Local<v8::Value> data) |
132 { | 132 { |
133 Frame* target = findFrame(host, data, v8::Isolate::GetCurrent()); | 133 Frame* target = findFrame(host, data, v8::Isolate::GetCurrent()); |
134 if (!target) | 134 if (!target) |
135 return; | 135 return; |
136 DOMWindow* targetWindow = target->domWindow(); | 136 DOMWindow* targetWindow = target->domWindow(); |
137 | 137 |
138 ExceptionState es(v8::Isolate::GetCurrent()); | 138 ExceptionState es(v8::Handle<v8::Object>(), v8::Isolate::GetCurrent()); |
139 es.throwSecurityError(targetWindow->sanitizedCrossDomainAccessErrorMessage(a
ctiveDOMWindow()), targetWindow->crossDomainAccessErrorMessage(activeDOMWindow()
)); | 139 es.throwSecurityError(targetWindow->sanitizedCrossDomainAccessErrorMessage(a
ctiveDOMWindow()), targetWindow->crossDomainAccessErrorMessage(activeDOMWindow()
)); |
140 es.throwIfNeeded(); | 140 es.throwIfNeeded(); |
141 } | 141 } |
142 | 142 |
143 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) | 143 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) |
144 { | 144 { |
145 if (ExecutionContext* executionContext = toExecutionContext(context)) { | 145 if (ExecutionContext* executionContext = toExecutionContext(context)) { |
146 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) | 146 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) |
147 return policy->allowEval(ScriptState::forContext(context)); | 147 return policy->allowEval(ScriptState::forContext(context)); |
148 } | 148 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 v8::ResourceConstraints resourceConstraints; | 218 v8::ResourceConstraints resourceConstraints; |
219 uint32_t here; | 219 uint32_t here; |
220 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 220 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
221 v8::SetResourceConstraints(&resourceConstraints); | 221 v8::SetResourceConstraints(&resourceConstraints); |
222 | 222 |
223 V8PerIsolateData::ensureInitialized(isolate); | 223 V8PerIsolateData::ensureInitialized(isolate); |
224 } | 224 } |
225 | 225 |
226 } // namespace WebCore | 226 } // namespace WebCore |
OLD | NEW |