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

Side by Side Diff: Source/core/workers/WorkerMessagingProxy.cpp

Issue 20351002: Add 'error' parameter to 'window.onerror' handlers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 virtual void performTask(ScriptExecutionContext* context) 132 virtual void performTask(ScriptExecutionContext* context)
133 { 133 {
134 Worker* workerObject = m_messagingProxy->workerObject(); 134 Worker* workerObject = m_messagingProxy->workerObject();
135 if (!workerObject) 135 if (!workerObject)
136 return; 136 return;
137 137
138 // We don't bother checking the askedToTerminate() flag here, because ex ceptions should *always* be reported even if the thread is terminated. 138 // We don't bother checking the askedToTerminate() flag here, because ex ceptions should *always* be reported even if the thread is terminated.
139 // This is intentionally different than the behavior in MessageWorkerTas k, because terminated workers no longer deliver messages (section 4.6 of the Web Worker spec), but they do report exceptions. 139 // This is intentionally different than the behavior in MessageWorkerTas k, because terminated workers no longer deliver messages (section 4.6 of the Web Worker spec), but they do report exceptions.
140 140
141 bool errorHandled = !workerObject->dispatchEvent(ErrorEvent::create(m_er rorMessage, m_sourceURL, m_lineNumber, m_columnNumber)); 141 bool errorHandled = !workerObject->dispatchEvent(ErrorEvent::create(m_er rorMessage, m_sourceURL, m_lineNumber, m_columnNumber, ScriptValue()));
142 if (!errorHandled) 142 if (!errorHandled)
143 context->reportException(m_errorMessage, m_lineNumber, m_columnNumbe r, m_sourceURL, 0); 143 context->reportException(m_errorMessage, m_lineNumber, m_columnNumbe r, m_sourceURL, 0, ScriptValue());
144 } 144 }
145 145
146 String m_errorMessage; 146 String m_errorMessage;
147 int m_lineNumber; 147 int m_lineNumber;
148 int m_columnNumber; 148 int m_columnNumber;
149 String m_sourceURL; 149 String m_sourceURL;
150 WorkerMessagingProxy* m_messagingProxy; 150 WorkerMessagingProxy* m_messagingProxy;
151 }; 151 };
152 152
153 class WorkerGlobalScopeDestroyedTask : public ScriptExecutionContext::Task { 153 class WorkerGlobalScopeDestroyedTask : public ScriptExecutionContext::Task {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 471
472 m_workerThreadHadPendingActivity = hasPendingActivity; 472 m_workerThreadHadPendingActivity = hasPendingActivity;
473 } 473 }
474 474
475 bool WorkerMessagingProxy::hasPendingActivity() const 475 bool WorkerMessagingProxy::hasPendingActivity() const
476 { 476 {
477 return (m_unconfirmedMessageCount || m_workerThreadHadPendingActivity) && !m _askedToTerminate; 477 return (m_unconfirmedMessageCount || m_workerThreadHadPendingActivity) && !m _askedToTerminate;
478 } 478 }
479 479
480 } // namespace WebCore 480 } // namespace WebCore
OLDNEW
« Source/core/dom/ScriptExecutionContext.cpp ('K') | « Source/core/dom/ScriptExecutionContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698