• Adam Rice's avatar
    Add UnencodableHandling::kNoUnencodables · b4edab24
    Adam Rice authored
    The are no unencodable characters in UTF-8, however previously callers
    to blink::TextCoder::Encode had to pass a dummy UnencodableHandling
    argument. Add a kNoUnencodables value to the UnencodableHandling which is
    an explicit no-op. Also add DCHECKs that is is only used for UTF-8 or
    UTF-16.
    
    Convert callers to use kNoUnencodables where the encoding is statically
    known to be UTF-8.
    
    It's still valid to use other values for the UnencodableHandling
    argument with UTF-8 or UTF-16; kNoUnencodables simply documents that it
    makes no difference.
    
    Change-Id: I5eebe4c76ae4006ee91f3884f94ec3b5e410685b
    Reviewed-on: https://chromium-review.googlesource.com/1206055Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
    Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
    Commit-Queue: Adam Rice <ricea@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#589451}
    b4edab24
text_encoder.cc 3.43 KB