OLD | NEW |
---|---|
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 30 matching lines...) Expand all Loading... | |
41 class DocumentEncodingData { | 41 class DocumentEncodingData { |
42 DISALLOW_NEW(); | 42 DISALLOW_NEW(); |
43 public: | 43 public: |
44 DocumentEncodingData(); | 44 DocumentEncodingData(); |
45 explicit DocumentEncodingData(const TextResourceDecoder&); | 45 explicit DocumentEncodingData(const TextResourceDecoder&); |
46 | 46 |
47 const WTF::TextEncoding& encoding() const { return m_encoding; } | 47 const WTF::TextEncoding& encoding() const { return m_encoding; } |
48 void setEncoding(const WTF::TextEncoding&); | 48 void setEncoding(const WTF::TextEncoding&); |
49 bool wasDetectedHeuristically() const { return m_wasDetectedHeuristically; } | 49 bool wasDetectedHeuristically() const { return m_wasDetectedHeuristically; } |
50 bool sawDecodingError() const { return m_sawDecodingError; } | 50 bool sawDecodingError() const { return m_sawDecodingError; } |
51 | 51 bool attemptedToDetermineEncodingFromContentSniffing() const { return m_atte mptedToDetermineEncodingFromContentSniffing; } |
52 bool encodingWasDetectedFromContentSniffing() const { return m_encodingWasDe tectedFromContentSniffing; } | |
52 private: | 53 private: |
tkent
2015/12/01 01:18:02
nit: add a blink line before |private:|.
Jinsuk Kim
2015/12/01 02:13:52
Done.
| |
53 WTF::TextEncoding m_encoding; | 54 WTF::TextEncoding m_encoding; |
54 bool m_wasDetectedHeuristically; | 55 bool m_wasDetectedHeuristically; |
56 bool m_attemptedToDetermineEncodingFromContentSniffing; | |
57 bool m_encodingWasDetectedFromContentSniffing; | |
55 bool m_sawDecodingError; | 58 bool m_sawDecodingError; |
56 }; | 59 }; |
57 | 60 |
58 template<> struct CrossThreadCopierBase<false, false, false, DocumentEncodingDat a> : public CrossThreadCopierPassThrough<DocumentEncodingData> { | 61 template<> struct CrossThreadCopierBase<false, false, false, DocumentEncodingDat a> : public CrossThreadCopierPassThrough<DocumentEncodingData> { |
59 }; | 62 }; |
60 | 63 |
61 inline bool operator!=(const DocumentEncodingData& a, const DocumentEncodingData & b) | 64 inline bool operator!=(const DocumentEncodingData& a, const DocumentEncodingData & b) |
62 { | 65 { |
63 return a.encoding() != b.encoding() | 66 return a.encoding() != b.encoding() |
64 || a.wasDetectedHeuristically() != b.wasDetectedHeuristically() | 67 || a.wasDetectedHeuristically() != b.wasDetectedHeuristically() |
68 || a.attemptedToDetermineEncodingFromContentSniffing() != b.attemptedToD etermineEncodingFromContentSniffing() | |
69 || a.encodingWasDetectedFromContentSniffing() != b.encodingWasDetectedFr omContentSniffing() | |
65 || a.sawDecodingError() != b.sawDecodingError(); | 70 || a.sawDecodingError() != b.sawDecodingError(); |
66 } | 71 } |
67 | 72 |
68 } // namespace blink | 73 } // namespace blink |
69 | 74 |
70 #endif // DocumentEncodingData_h | 75 #endif // DocumentEncodingData_h |
OLD | NEW |