New issue
Advanced search Search tips

Issue 884031 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

File/Gallery App: RAW image loader quirks

Project Member Reported by tapted@chromium.org, Sep 14

Issue description

Chrome Version       : 70.0.3538.16
OS Version: Chrome


Loading the piex_loader PNaCL module we use for loading RAW image thumbnails in the files app and gallery with DCHECKs enabled fails on

void DetermineCharset(const std::string& mime_type,
                      const base::RefCountedMemory* data,
                      std::string* out_charset) {
  if (base::StartsWith(mime_type, "text/",
                       base::CompareCase::INSENSITIVE_ASCII)) {
    // All of our HTML files should be UTF-8 and for other resource types
    // (like images), charset doesn't matter.
    DCHECK(base::IsStringUTF8(base::StringPiece(
        reinterpret_cast<const char*>(data->front()), data->size())));
    *out_charset = "utf-8";
  }
}


this is in chrome_url_request_util.cc when making the chrome-extension://gobbeldeygok/piex.pexe.txt request


These are in file_manager_resource.grd:

IDR_IMAGE_LOADER_PIEX_LOADER_MANIFEST
IDR_IMAGE_LOADER_PIEX_LOADER_PNACL

although these look pretty boring:

==> piex.nmf.txt <==
{
  "program": {
    "portable": {
      "pnacl-translate": {
        "url": "piex.pexe.txt"
      }
    }
  }
}

==> piex.pexe.txt <==
<include src="../../internal/piex/piex.pexe">


That "include" actually causes grit to inline the piex.exe, which is binary data:

0000000   P   E   X   E 001  \0  \b  \0 021  \0 004  \0 002  \0  \0  \0


So, yes, the check should fail. Not sure what the right fix is.


Note this is also super-hard to test. RAW files tend to be 20MB+ and those two resources are only included in official-Chrome builds since they need access to src-internal.


Another quirk, which may be nothing, the NaCL module seems to load multiple times. This is expected after a delay -- the image_loader extension gets released if it gets no requests after ~5 seconds -- but these lines of output occur without the extension being unloaded between. There may be a bug in the loading logic. Seems there is one line for each image request.


[1,4160159168:23:35:41.067153] Native Client module will be loaded at base address 0x00000f1e00000000
[1,4160159168:23:35:43.954940] Native Client module will be loaded at base address 0x0000497400000000
[1,4160159168:23:35:44.070069] Native Client module will be loaded at base address 0x000020b200000000

 

Sign in to add a comment