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

Side by Side Diff: third_party/WebKit/Source/core/events/ErrorEvent.cpp

Issue 2804533002: Update Error Event inside a worker to provide the exact exception value (Closed)
Patch Set: nits Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/events/ErrorEvent.h ('k') | no next file » | 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 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 m_location = SourceLocation::create( 52 m_location = SourceLocation::create(
53 initializer.hasFilename() ? initializer.filename() : String(), 53 initializer.hasFilename() ? initializer.filename() : String(),
54 initializer.hasLineno() ? initializer.lineno() : 0, 54 initializer.hasLineno() ? initializer.lineno() : 0,
55 initializer.hasColno() ? initializer.colno() : 0, nullptr); 55 initializer.hasColno() ? initializer.colno() : 0, nullptr);
56 if (initializer.hasError()) 56 if (initializer.hasError())
57 m_error = initializer.error(); 57 m_error = initializer.error();
58 } 58 }
59 59
60 ErrorEvent::ErrorEvent(const String& message, 60 ErrorEvent::ErrorEvent(const String& message,
61 std::unique_ptr<SourceLocation> location, 61 std::unique_ptr<SourceLocation> location,
62 ScriptValue error,
62 DOMWrapperWorld* world) 63 DOMWrapperWorld* world)
63 : Event(EventTypeNames::error, false, true), 64 : Event(EventTypeNames::error, false, true),
64 m_sanitizedMessage(message), 65 m_sanitizedMessage(message),
65 m_location(std::move(location)), 66 m_location(std::move(location)),
67 m_error(error),
66 m_world(world) {} 68 m_world(world) {}
67 69
68 void ErrorEvent::setUnsanitizedMessage(const String& message) { 70 void ErrorEvent::setUnsanitizedMessage(const String& message) {
69 DCHECK(m_unsanitizedMessage.isEmpty()); 71 DCHECK(m_unsanitizedMessage.isEmpty());
70 m_unsanitizedMessage = message; 72 m_unsanitizedMessage = message;
71 } 73 }
72 74
73 ErrorEvent::~ErrorEvent() {} 75 ErrorEvent::~ErrorEvent() {}
74 76
75 const AtomicString& ErrorEvent::interfaceName() const { 77 const AtomicString& ErrorEvent::interfaceName() const {
(...skipping 10 matching lines...) Expand all
86 if (world() != &scriptState->world()) 88 if (world() != &scriptState->world())
87 return ScriptValue(); 89 return ScriptValue();
88 return m_error; 90 return m_error;
89 } 91 }
90 92
91 DEFINE_TRACE(ErrorEvent) { 93 DEFINE_TRACE(ErrorEvent) {
92 Event::trace(visitor); 94 Event::trace(visitor);
93 } 95 }
94 96
95 } // namespace blink 97 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/ErrorEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698