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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 { | 269 { |
270 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 270 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
271 Frame* target = findFrame(isolate, host, data); | 271 Frame* target = findFrame(isolate, host, data); |
272 if (!target) | 272 if (!target) |
273 return; | 273 return; |
274 DOMWindow* targetWindow = target->domWindow(); | 274 DOMWindow* targetWindow = target->domWindow(); |
275 | 275 |
276 // FIXME: We should modify V8 to pass in more contextual information (contex
t, property, and object). | 276 // FIXME: We should modify V8 to pass in more contextual information (contex
t, property, and object). |
277 ExceptionState exceptionState(ExceptionState::UnknownContext, 0, 0, isolate-
>GetCurrentContext()->Global(), isolate); | 277 ExceptionState exceptionState(ExceptionState::UnknownContext, 0, 0, isolate-
>GetCurrentContext()->Global(), isolate); |
278 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr
rorMessage(currentDOMWindow(isolate)), targetWindow->crossDomainAccessErrorMessa
ge(currentDOMWindow(isolate))); | 278 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr
rorMessage(currentDOMWindow(isolate)), targetWindow->crossDomainAccessErrorMessa
ge(currentDOMWindow(isolate))); |
279 exceptionState.throwIfNeeded(); | |
280 } | 279 } |
281 | 280 |
282 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) | 281 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) |
283 { | 282 { |
284 if (ExecutionContext* executionContext = toExecutionContext(context)) { | 283 if (ExecutionContext* executionContext = toExecutionContext(context)) { |
285 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) | 284 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) |
286 return policy->allowEval(ScriptState::from(context), ContentSecurity
Policy::SendReport, ContentSecurityPolicy::WillThrowException); | 285 return policy->allowEval(ScriptState::from(context), ContentSecurity
Policy::SendReport, ContentSecurityPolicy::WillThrowException); |
287 } | 286 } |
288 return false; | 287 return false; |
289 } | 288 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 437 |
439 isolate->AddMessageListener(messageHandlerInWorker); | 438 isolate->AddMessageListener(messageHandlerInWorker); |
440 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 439 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
441 | 440 |
442 uint32_t here; | 441 uint32_t here; |
443 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 442 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
444 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 443 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
445 } | 444 } |
446 | 445 |
447 } // namespace blink | 446 } // namespace blink |
OLD | NEW |