| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 { | 277 { |
| 278 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 278 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 279 Frame* target = findFrame(isolate, host, data); | 279 Frame* target = findFrame(isolate, host, data); |
| 280 if (!target) | 280 if (!target) |
| 281 return; | 281 return; |
| 282 DOMWindow* targetWindow = target->domWindow(); | 282 DOMWindow* targetWindow = target->domWindow(); |
| 283 | 283 |
| 284 // FIXME: We should modify V8 to pass in more contextual information (contex
t, property, and object). | 284 // FIXME: We should modify V8 to pass in more contextual information (contex
t, property, and object). |
| 285 ExceptionState exceptionState(ExceptionState::UnknownContext, 0, 0, isolate-
>GetCurrentContext()->Global(), isolate); | 285 ExceptionState exceptionState(ExceptionState::UnknownContext, 0, 0, isolate-
>GetCurrentContext()->Global(), isolate); |
| 286 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr
rorMessage(currentDOMWindow(isolate)), targetWindow->crossDomainAccessErrorMessa
ge(currentDOMWindow(isolate))); | 286 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr
rorMessage(currentDOMWindow(isolate)), targetWindow->crossDomainAccessErrorMessa
ge(currentDOMWindow(isolate))); |
| 287 exceptionState.throwIfNeeded(); | |
| 288 } | 287 } |
| 289 | 288 |
| 290 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) | 289 static bool codeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> conte
xt) |
| 291 { | 290 { |
| 292 if (ExecutionContext* executionContext = toExecutionContext(context)) { | 291 if (ExecutionContext* executionContext = toExecutionContext(context)) { |
| 293 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) | 292 if (ContentSecurityPolicy* policy = toDocument(executionContext)->conten
tSecurityPolicy()) |
| 294 return policy->allowEval(ScriptState::from(context), ContentSecurity
Policy::SendReport, ContentSecurityPolicy::WillThrowException); | 293 return policy->allowEval(ScriptState::from(context), ContentSecurity
Policy::SendReport, ContentSecurityPolicy::WillThrowException); |
| 295 } | 294 } |
| 296 return false; | 295 return false; |
| 297 } | 296 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 452 |
| 454 isolate->AddMessageListener(messageHandlerInWorker); | 453 isolate->AddMessageListener(messageHandlerInWorker); |
| 455 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 454 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 456 | 455 |
| 457 uint32_t here; | 456 uint32_t here; |
| 458 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 457 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 459 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 458 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 460 } | 459 } |
| 461 | 460 |
| 462 } // namespace blink | 461 } // namespace blink |
| OLD | NEW |