1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef nsCharsetSource_h_
6 #define nsCharsetSource_h_
7 
8 // note: the value order defines the priority; higher numbers take priority
9 enum nsCharsetSource {
10   kCharsetUninitialized,
11   kCharsetFromFallback,
12   kCharsetFromDocTypeDefault,  // This and up confident for XHR
13   // Start subdividing source for telemetry purposes
14   kCharsetFromInitialAutoDetectionASCII,
15   kCharsetFromInitialAutoDetectionWouldHaveBeenUTF8,
16   kCharsetFromInitialAutoDetectionWouldNotHaveBeenUTF8Generic,
17   kCharsetFromInitialAutoDetectionWouldNotHaveBeenUTF8Content,
18   kCharsetFromInitialAutoDetectionWouldNotHaveBeenUTF8DependedOnTLD,
19   // End subdividing source for telemetry purposes
20   kCharsetFromParentFrame,  // Same-origin parent takes precedence over detector
21                             // to avoid breaking tests. (Also, the HTML spec
22                             // says so.)
23   kCharsetFromXmlDeclaration,
24   kCharsetFromMetaTag,
25   kCharsetFromChannel,
26   kCharsetFromOtherComponent,
27   kCharsetFromInitialUserForcedAutoDetection,
28   // Start subdividing source for telemetry purposes
29   // Deliberately no Final version of ASCII
30   kCharsetFromFinalAutoDetectionWouldHaveBeenUTF8,
31   kCharsetFromFinalAutoDetectionWouldNotHaveBeenUTF8Generic,
32   kCharsetFromFinalAutoDetectionWouldNotHaveBeenUTF8Content,
33   kCharsetFromFinalAutoDetectionWouldNotHaveBeenUTF8DependedOnTLD,
34   kCharsetFromFinalAutoDetectionFile,
35   // End subdividing source for telemetry purposes
36   kCharsetFromFinalUserForcedAutoDetection,
37   kCharsetFromXmlDeclarationUtf16,  // This one is overridden by
38                                     // kCharsetFromChannel
39   kCharsetFromByteOrderMark,
40   kCharsetFromUtf8OnlyMime,  // For JSON, WebVTT and such
41   kCharsetFromBuiltIn,       // resource: URLs
42 };
43 
44 #endif /* nsCharsetSource_h_ */
45