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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 ExceptionState exceptionState(v8::Handle<v8::Object>(), isolate); | 139 ExceptionState exceptionState(v8::Handle<v8::Object>(), isolate); |
140 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr
rorMessage(activeDOMWindow(isolate)), targetWindow->crossDomainAccessErrorMessag
e(activeDOMWindow(isolate))); | 140 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr
rorMessage(activeDOMWindow(isolate)), targetWindow->crossDomainAccessErrorMessag
e(activeDOMWindow(isolate))); |
141 exceptionState.throwIfNeeded(); | 141 exceptionState.throwIfNeeded(); |
142 } | 142 } |
143 | 143 |
144 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) | 144 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) |
145 { | 145 { |
146 if (ExecutionContext* executionContext = toExecutionContext(context)) { | 146 if (ExecutionContext* executionContext = toExecutionContext(context)) { |
147 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) | 147 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) |
148 return policy->allowScriptEval(ScriptState::forContext(context)); | 148 return policy->allowEval(ScriptState::forContext(context)); |
149 } | 149 } |
150 return false; | 150 return false; |
151 } | 151 } |
152 | 152 |
153 static void initializeV8Common(v8::Isolate* isolate) | 153 static void initializeV8Common(v8::Isolate* isolate) |
154 { | 154 { |
155 v8::ResourceConstraints constraints; | 155 v8::ResourceConstraints constraints; |
156 constraints.ConfigureDefaults(static_cast<uint64_t>(blink::Platform::current
()->physicalMemoryMB()) << 20, static_cast<uint32_t>(blink::Platform::current()-
>numberOfProcessors())); | 156 constraints.ConfigureDefaults(static_cast<uint64_t>(blink::Platform::current
()->physicalMemoryMB()) << 20, static_cast<uint32_t>(blink::Platform::current()-
>numberOfProcessors())); |
157 v8::SetResourceConstraints(isolate, &constraints); | 157 v8::SetResourceConstraints(isolate, &constraints); |
158 | 158 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 v8::V8::AddMessageListener(messageHandlerInWorker); | 222 v8::V8::AddMessageListener(messageHandlerInWorker); |
223 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); | 223 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); |
224 | 224 |
225 v8::ResourceConstraints resourceConstraints; | 225 v8::ResourceConstraints resourceConstraints; |
226 uint32_t here; | 226 uint32_t here; |
227 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 227 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
228 v8::SetResourceConstraints(isolate, &resourceConstraints); | 228 v8::SetResourceConstraints(isolate, &resourceConstraints); |
229 } | 229 } |
230 | 230 |
231 } // namespace WebCore | 231 } // namespace WebCore |
OLD | NEW |