Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: Source/bindings/v8/V8Initializer.cpp

Issue 68563003: Create DOM exceptions in the correct context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased onto df9a982fbe97 Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/v8/V8Binding.cpp ('k') | Source/bindings/v8/V8ThrowException.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 exceptionState(v8::Isolate::GetCurrent()); 138 ExceptionState exceptionState(v8::Handle<v8::Object>(), v8::Isolate::GetCurr ent());
139 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr rorMessage(activeDOMWindow()), targetWindow->crossDomainAccessErrorMessage(activ eDOMWindow())); 139 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr rorMessage(activeDOMWindow()), targetWindow->crossDomainAccessErrorMessage(activ eDOMWindow()));
140 exceptionState.throwIfNeeded(); 140 exceptionState.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
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Binding.cpp ('k') | Source/bindings/v8/V8ThrowException.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698