| 1 | /* |
| 2 | * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 | * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY |
| 15 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 17 | * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 18 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #pragma once |
| 27 | |
| 28 | #include <wtf/Forward.h> |
| 29 | |
| 30 | namespace JSC { |
| 31 | |
| 32 | enum class MessageSource : uint8_t { |
| 33 | XML, |
| 34 | JS, |
| 35 | Network, |
| 36 | ConsoleAPI, |
| 37 | Storage, |
| 38 | AppCache, |
| 39 | Rendering, |
| 40 | CSS, |
| 41 | Security, |
| 42 | ContentBlocker, |
| 43 | Other, |
| 44 | Media, |
| 45 | WebRTC, |
| 46 | MediaSource, |
| 47 | }; |
| 48 | |
| 49 | enum class MessageType { |
| 50 | Log, |
| 51 | Dir, |
| 52 | DirXML, |
| 53 | Table, |
| 54 | Trace, |
| 55 | StartGroup, |
| 56 | StartGroupCollapsed, |
| 57 | EndGroup, |
| 58 | Clear, |
| 59 | Assert, |
| 60 | Timing, |
| 61 | Profile, |
| 62 | ProfileEnd, |
| 63 | Image, |
| 64 | }; |
| 65 | |
| 66 | enum class MessageLevel : uint8_t { |
| 67 | Log = 1, |
| 68 | Warning = 2, |
| 69 | Error = 3, |
| 70 | Debug = 4, |
| 71 | Info = 5, |
| 72 | }; |
| 73 | |
| 74 | } // namespace JSC |
| 75 | |
| 76 | namespace WTF { |
| 77 | |
| 78 | template<> struct EnumTraits<JSC::MessageSource> { |
| 79 | using values = EnumValues< |
| 80 | JSC::MessageSource, |
| 81 | JSC::MessageSource::XML, |
| 82 | JSC::MessageSource::JS, |
| 83 | JSC::MessageSource::Network, |
| 84 | JSC::MessageSource::ConsoleAPI, |
| 85 | JSC::MessageSource::Storage, |
| 86 | JSC::MessageSource::AppCache, |
| 87 | JSC::MessageSource::Rendering, |
| 88 | JSC::MessageSource::CSS, |
| 89 | JSC::MessageSource::Security, |
| 90 | JSC::MessageSource::ContentBlocker, |
| 91 | JSC::MessageSource::Other, |
| 92 | JSC::MessageSource::Media, |
| 93 | JSC::MessageSource::WebRTC, |
| 94 | JSC::MessageSource::MediaSource |
| 95 | >; |
| 96 | }; |
| 97 | |
| 98 | template<> struct EnumTraits<JSC::MessageLevel> { |
| 99 | using values = EnumValues< |
| 100 | JSC::MessageLevel, |
| 101 | JSC::MessageLevel::Log, |
| 102 | JSC::MessageLevel::Warning, |
| 103 | JSC::MessageLevel::Error, |
| 104 | JSC::MessageLevel::Debug, |
| 105 | JSC::MessageLevel::Info |
| 106 | >; |
| 107 | }; |
| 108 | |
| 109 | } // namespace WTF |
| 110 | |
| 111 | using JSC::MessageSource; |
| 112 | using JSC::MessageType; |
| 113 | using JSC::MessageLevel; |
| 114 | |