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

Side by Side Diff: Source/wtf/text/TextCodec.h

Issue 802203004: replace COMPILE_ASSERT with static assert in wtf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: final fixups Created 6 years 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/wtf/text/StringImpl.cpp ('k') | Source/wtf/unicode/Unicode.h » ('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) 2004, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // More bytes are coming, don't flush the codec. 59 // More bytes are coming, don't flush the codec.
60 DoNotFlush = 0, 60 DoNotFlush = 0,
61 61
62 // A fetch has hit EOF. Some codecs handle fetches differently, for compat r easons. 62 // A fetch has hit EOF. Some codecs handle fetches differently, for compat r easons.
63 FetchEOF, 63 FetchEOF,
64 64
65 // Do a full flush of the codec. 65 // Do a full flush of the codec.
66 DataEOF 66 DataEOF
67 }; 67 };
68 68
69 COMPILE_ASSERT(!DoNotFlush, DoNotFlush_is_falsy); 69 static_assert(!DoNotFlush, "DoNotFlush should be falsy");
70 COMPILE_ASSERT(FetchEOF, FetchEOF_is_truthy); 70 static_assert(FetchEOF, "FetchEOF should be truthy");
71 COMPILE_ASSERT(DataEOF, DataEOF_is_truthy); 71 static_assert(DataEOF, "DataEOF should be truthy");
72 72
73 73
74 class TextCodec { 74 class TextCodec {
75 WTF_MAKE_NONCOPYABLE(TextCodec); WTF_MAKE_FAST_ALLOCATED; 75 WTF_MAKE_NONCOPYABLE(TextCodec); WTF_MAKE_FAST_ALLOCATED;
76 public: 76 public:
77 TextCodec() { } 77 TextCodec() { }
78 virtual ~TextCodec(); 78 virtual ~TextCodec();
79 79
80 String decode(const char* str, size_t length, FlushBehavior flush = DoNotFlu sh) 80 String decode(const char* str, size_t length, FlushBehavior flush = DoNotFlu sh)
81 { 81 {
(...skipping 14 matching lines...) Expand all
96 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name); 96 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name);
97 97
98 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData); 98 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData);
99 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData); 99 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData);
100 100
101 } // namespace WTF 101 } // namespace WTF
102 102
103 using WTF::TextCodec; 103 using WTF::TextCodec;
104 104
105 #endif // TextCodec_h 105 #endif // TextCodec_h
OLDNEW
« no previous file with comments | « Source/wtf/text/StringImpl.cpp ('k') | Source/wtf/unicode/Unicode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698