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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ExceptionState.h

Issue 2244203002: Fix "report the exception" in Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved reportException to ScriptCustomElementDefinition.cpp Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 virtual void throwDOMException(const ExceptionCode&, const String& message); 98 virtual void throwDOMException(const ExceptionCode&, const String& message);
99 virtual void throwTypeError(const String& message); 99 virtual void throwTypeError(const String& message);
100 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()); 100 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String());
101 virtual void throwRangeError(const String& message); 101 virtual void throwRangeError(const String& message);
102 102
103 bool hadException() const { return !m_exception.isEmpty() || m_code; } 103 bool hadException() const { return !m_exception.isEmpty() || m_code; }
104 void clearException(); 104 void clearException();
105 105
106 ExceptionCode code() const { return m_code; } 106 ExceptionCode code() const { return m_code; }
107 const String& message() const { return m_message; } 107 const String& message() const { return m_message; }
108 v8::Local<v8::Value> getException() { return m_exception.newLocal(m_isolate) ; }
Yuki 2016/08/18 07:57:09 m_exception may be empty. m_exception.isEmpty() ?
kojii 2016/08/18 08:06:52 Done.
108 109
109 bool throwIfNeeded() 110 bool throwIfNeeded()
110 { 111 {
111 if (!hadException()) 112 if (!hadException())
112 return false; 113 return false;
113 throwException(); 114 throwException();
114 return true; 115 return true;
115 } 116 }
116 117
117 // This method clears out the exception which |this| has. 118 // This method clears out the exception which |this| has.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 TrackExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Local<v8::Object>(), v8::Isolate::GetCurrent()) { } 175 TrackExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Local<v8::Object>(), v8::Isolate::GetCurrent()) { }
175 void throwDOMException(const ExceptionCode&, const String& message) override ; 176 void throwDOMException(const ExceptionCode&, const String& message) override ;
176 void throwTypeError(const String& message = String()) override; 177 void throwTypeError(const String& message = String()) override;
177 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage = String()) override; 178 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage = String()) override;
178 void throwRangeError(const String& message) override; 179 void throwRangeError(const String& message) override;
179 }; 180 };
180 181
181 } // namespace blink 182 } // namespace blink
182 183
183 #endif // ExceptionState_h 184 #endif // ExceptionState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698