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

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

Issue 1952893003: Implement custom element construction and some 'define' checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use DCHECK, revert RuntimeEnabledFeatures.in. Created 4 years, 7 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 : m_code(0) 77 : m_code(0)
78 , m_context(context) 78 , m_context(context)
79 , m_propertyName(0) 79 , m_propertyName(0)
80 , m_interfaceName(interfaceName) 80 , m_interfaceName(interfaceName)
81 , m_creationContext(creationContext) 81 , m_creationContext(creationContext)
82 , m_isolate(isolate) { ASSERT(m_context == ConstructionContext || m_cont ext == EnumerationContext || m_context == IndexedSetterContext || m_context == I ndexedGetterContext || m_context == IndexedDeletionContext); } 82 , m_isolate(isolate) { ASSERT(m_context == ConstructionContext || m_cont ext == EnumerationContext || m_context == IndexedSetterContext || m_context == I ndexedGetterContext || m_context == IndexedDeletionContext); }
83 83
84 virtual void throwDOMException(const ExceptionCode&, const String& message); 84 virtual void throwDOMException(const ExceptionCode&, const String& message);
85 virtual void throwTypeError(const String& message); 85 virtual void throwTypeError(const String& message);
86 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()); 86 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String());
87 virtual void throwSyntaxError(const String& message);
87 virtual void throwRangeError(const String& message); 88 virtual void throwRangeError(const String& message);
88 89
89 bool hadException() const { return !m_exception.isEmpty() || m_code; } 90 bool hadException() const { return !m_exception.isEmpty() || m_code; }
90 void clearException(); 91 void clearException();
91 92
92 ExceptionCode code() const { return m_code; } 93 ExceptionCode code() const { return m_code; }
93 const String& message() const { return m_message; } 94 const String& message() const { return m_message; }
94 95
95 bool throwIfNeeded() 96 bool throwIfNeeded()
96 { 97 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 }; 145 };
145 146
146 // Used if exceptions can/should not be directly thrown. 147 // Used if exceptions can/should not be directly thrown.
147 class CORE_EXPORT NonThrowableExceptionState final : public ExceptionState { 148 class CORE_EXPORT NonThrowableExceptionState final : public ExceptionState {
148 WTF_MAKE_NONCOPYABLE(NonThrowableExceptionState); 149 WTF_MAKE_NONCOPYABLE(NonThrowableExceptionState);
149 public: 150 public:
150 NonThrowableExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Local<v8::Object>(), v8::Isolate::GetCurrent()) { } 151 NonThrowableExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Local<v8::Object>(), v8::Isolate::GetCurrent()) { }
151 void throwDOMException(const ExceptionCode&, const String& message) override ; 152 void throwDOMException(const ExceptionCode&, const String& message) override ;
152 void throwTypeError(const String& message = String()) override; 153 void throwTypeError(const String& message = String()) override;
153 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage = String()) override; 154 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage = String()) override;
155 void throwSyntaxError(const String& message = String()) override;
Yuki 2016/05/11 01:59:02 https://engdoc.corp.google.com/eng/doc/devguide/cp
Yuki 2016/05/11 09:29:53 ping?
154 void throwRangeError(const String& message) override; 156 void throwRangeError(const String& message) override;
155 }; 157 };
156 158
157 // Used if any exceptions thrown are ignorable. 159 // Used if any exceptions thrown are ignorable.
158 class CORE_EXPORT TrackExceptionState final : public ExceptionState { 160 class CORE_EXPORT TrackExceptionState final : public ExceptionState {
159 WTF_MAKE_NONCOPYABLE(TrackExceptionState); 161 WTF_MAKE_NONCOPYABLE(TrackExceptionState);
160 public: 162 public:
161 TrackExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Local<v8::Object>(), v8::Isolate::GetCurrent()) { } 163 TrackExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Local<v8::Object>(), v8::Isolate::GetCurrent()) { }
162 void throwDOMException(const ExceptionCode&, const String& message) override ; 164 void throwDOMException(const ExceptionCode&, const String& message) override ;
163 void throwTypeError(const String& message = String()) override; 165 void throwTypeError(const String& message = String()) override;
164 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage = String()) override; 166 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage = String()) override;
167 void throwSyntaxError(const String& message = String()) override;
Yuki 2016/05/11 01:59:02 Ditto.
165 void throwRangeError(const String& message) override; 168 void throwRangeError(const String& message) override;
166 }; 169 };
167 170
168 } // namespace blink 171 } // namespace blink
169 172
170 #endif // ExceptionState_h 173 #endif // ExceptionState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698