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

Side by Side Diff: Source/bindings/v8/ExceptionState.h

Issue 121113004: Improve handling of failed integer type conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 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 | « Source/bindings/v8/Dictionary.h ('k') | Source/bindings/v8/ExceptionState.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) 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 private: 120 private:
121 void setException(v8::Handle<v8::Value>); 121 void setException(v8::Handle<v8::Value>);
122 122
123 String addExceptionContext(const String&) const; 123 String addExceptionContext(const String&) const;
124 124
125 ScopedPersistent<v8::Value> m_exception; 125 ScopedPersistent<v8::Value> m_exception;
126 v8::Handle<v8::Object> m_creationContext; 126 v8::Handle<v8::Object> m_creationContext;
127 v8::Isolate* m_isolate; 127 v8::Isolate* m_isolate;
128 }; 128 };
129 129
130 class TrackExceptionState : public ExceptionState { 130 // Used if exceptions can/should not be directly thrown.
131 class NonThrowableExceptionState : public ExceptionState {
131 public: 132 public:
132 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { } 133 NonThrowableExceptionState(): ExceptionState(v8::Handle<v8::Object>(), v8::I solate::GetCurrent()) { }
133 virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL; 134 virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL;
134 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL ; 135 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL ;
135 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE FINAL; 136 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE FINAL;
137 };
138
139 // Used if any exceptions thrown are ignorable.
140 class TrackExceptionState : public ExceptionState {
141 public:
142 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), v8::Isolate: :GetCurrent()) { }
143 virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL;
144 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL ;
145 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE FINAL;
136 }; 146 };
137 147
138 } // namespace WebCore 148 } // namespace WebCore
139 149
140 #endif // ExceptionState_h 150 #endif // ExceptionState_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/bindings/v8/ExceptionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698