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

Side by Side Diff: Source/core/dom/ScriptExecutionContext.cpp

Issue 21071003: Trigger `window.onerror` only for exceptions thrown in the same world. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: feedback Created 7 years, 3 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/core/dom/ErrorEvent.cpp ('k') | Source/core/workers/WorkerMessagingProxy.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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 235
236 bool ScriptExecutionContext::dispatchErrorEvent(PassRefPtr<ErrorEvent> event, Ac cessControlStatus corsStatus) 236 bool ScriptExecutionContext::dispatchErrorEvent(PassRefPtr<ErrorEvent> event, Ac cessControlStatus corsStatus)
237 { 237 {
238 EventTarget* target = errorEventTarget(); 238 EventTarget* target = errorEventTarget();
239 if (!target) 239 if (!target)
240 return false; 240 return false;
241 241
242 RefPtr<ErrorEvent> errorEvent = event; 242 RefPtr<ErrorEvent> errorEvent = event;
243 if (shouldSanitizeScriptError(errorEvent->filename(), corsStatus)) 243 if (shouldSanitizeScriptError(errorEvent->filename(), corsStatus))
244 errorEvent = ErrorEvent::createSanitizedError(); 244 errorEvent = ErrorEvent::createSanitizedError(errorEvent->world());
245 245
246 ASSERT(!m_inDispatchErrorEvent); 246 ASSERT(!m_inDispatchErrorEvent);
247 m_inDispatchErrorEvent = true; 247 m_inDispatchErrorEvent = true;
248 target->dispatchEvent(errorEvent); 248 target->dispatchEvent(errorEvent);
249 m_inDispatchErrorEvent = false; 249 m_inDispatchErrorEvent = false;
250 return errorEvent->defaultPrevented(); 250 return errorEvent->defaultPrevented();
251 } 251 }
252 252
253 int ScriptExecutionContext::circularSequentialID() 253 int ScriptExecutionContext::circularSequentialID()
254 { 254 {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 ScriptExecutionContext::Task::~Task() 313 ScriptExecutionContext::Task::~Task()
314 { 314 {
315 } 315 }
316 316
317 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext ) 317 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext )
318 { 318 {
319 m_databaseContext = databaseContext; 319 m_databaseContext = databaseContext;
320 } 320 }
321 321
322 } // namespace WebCore 322 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ErrorEvent.cpp ('k') | Source/core/workers/WorkerMessagingProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698