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

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

Issue 20351002: Add 'error' parameter to 'window.onerror' handlers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Constructor. Created 7 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/V8Initializer.cpp ('k') | Source/bindings/v8/custom/V8ErrorEventCustom.cpp » ('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, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, Script Value* exception) 185 void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, Script Value* exception)
186 { 186 {
187 if (isExecutionForbidden()) 187 if (isExecutionForbidden())
188 return; 188 return;
189 189
190 WorkerGlobalScopeExecutionState state; 190 WorkerGlobalScopeExecutionState state;
191 evaluate(sourceCode.source(), sourceCode.url().string(), sourceCode.startPos ition(), &state); 191 evaluate(sourceCode.source(), sourceCode.url().string(), sourceCode.startPos ition(), &state);
192 if (state.hadException) { 192 if (state.hadException) {
193 if (exception) 193 if (exception) {
194 *exception = state.exception; 194 *exception = state.exception;
195 else 195 } else {
196 m_workerGlobalScope->reportException(state.errorMessage, state.lineN umber, state.columnNumber, state.sourceURL, 0); 196 RefPtr<ErrorEvent> event = ErrorEvent::create(state.errorMessage, st ate.sourceURL, state.lineNumber, state.columnNumber);
197 m_workerGlobalScope->reportException(event, 0);
198 }
197 } 199 }
198 } 200 }
199 201
200 void WorkerScriptController::scheduleExecutionTermination() 202 void WorkerScriptController::scheduleExecutionTermination()
201 { 203 {
202 // The mutex provides a memory barrier to ensure that once 204 // The mutex provides a memory barrier to ensure that once
203 // termination is scheduled, isExecutionTerminating will 205 // termination is scheduled, isExecutionTerminating will
204 // accurately reflect that state when called from another thread. 206 // accurately reflect that state when called from another thread.
205 { 207 {
206 MutexLocker locker(m_scheduledTerminationMutex); 208 MutexLocker locker(m_scheduledTerminationMutex);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 v8::Handle<v8::Object> global = context->Global(); 249 v8::Handle<v8::Object> global = context->Global();
248 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTempla te(context->GetIsolate(), WorkerWorld)); 250 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTempla te(context->GetIsolate(), WorkerWorld));
249 // Return 0 if the current executing context is not the worker context. 251 // Return 0 if the current executing context is not the worker context.
250 if (global.IsEmpty()) 252 if (global.IsEmpty())
251 return 0; 253 return 0;
252 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ; 254 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ;
253 return workerGlobalScope->script(); 255 return workerGlobalScope->script();
254 } 256 }
255 257
256 } // namespace WebCore 258 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Initializer.cpp ('k') | Source/bindings/v8/custom/V8ErrorEventCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698