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