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

Side by Side Diff: Source/bindings/core/v8/ExceptionStatePlaceholder.h

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed config.gni. Minor cleanups. Created 6 years, 5 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 public: 46 public:
47 IgnorableExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Handle<v8::Object>(), 0) { } 47 IgnorableExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Handle<v8::Object>(), 0) { }
48 ExceptionState& returnThis() { return *this; } 48 ExceptionState& returnThis() { return *this; }
49 virtual void throwDOMException(const ExceptionCode&, const String& message = String()) OVERRIDE { } 49 virtual void throwDOMException(const ExceptionCode&, const String& message = String()) OVERRIDE { }
50 virtual void throwTypeError(const String& message = String()) OVERRIDE { } 50 virtual void throwTypeError(const String& message = String()) OVERRIDE { }
51 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE { } 51 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE { }
52 }; 52 };
53 53
54 #define IGNORE_EXCEPTION (::WebCore::IgnorableExceptionState().returnThis()) 54 #define IGNORE_EXCEPTION (::WebCore::IgnorableExceptionState().returnThis())
55 55
56 #if ASSERT_ENABLED 56 #if ENABLE(ASSERT)
57 57
58 class NoExceptionStateAssertionChecker FINAL : public ExceptionState { 58 class NoExceptionStateAssertionChecker FINAL : public ExceptionState {
59 public: 59 public:
60 NoExceptionStateAssertionChecker(const char* file, int line); 60 NoExceptionStateAssertionChecker(const char* file, int line);
61 ExceptionState& returnThis() { return *this; } 61 ExceptionState& returnThis() { return *this; }
62 virtual void throwDOMException(const ExceptionCode&, const String& message = String()) OVERRIDE; 62 virtual void throwDOMException(const ExceptionCode&, const String& message = String()) OVERRIDE;
63 virtual void throwTypeError(const String& message = String()) OVERRIDE; 63 virtual void throwTypeError(const String& message = String()) OVERRIDE;
64 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE; 64 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE;
65 65
66 private: 66 private:
67 const char* m_file; 67 const char* m_file;
68 int m_line; 68 int m_line;
69 }; 69 };
70 70
71 #define ASSERT_NO_EXCEPTION (::WebCore::NoExceptionStateAssertionChecker(__FILE_ _, __LINE__).returnThis()) 71 #define ASSERT_NO_EXCEPTION (::WebCore::NoExceptionStateAssertionChecker(__FILE_ _, __LINE__).returnThis())
72 72
73 #else 73 #else
74 74
75 #define ASSERT_NO_EXCEPTION (::WebCore::IgnorableExceptionState().returnThis()) 75 #define ASSERT_NO_EXCEPTION (::WebCore::IgnorableExceptionState().returnThis())
76 76
77 #endif 77 #endif
78 78
79 } // namespace WebCore 79 } // namespace WebCore
80 80
81 #endif // ExceptionStatePlaceholder_h 81 #endif // ExceptionStatePlaceholder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698