Issue 380346 in chromium: File.app :- Blank image when png files opened

41 views
Skip to first unread message

chro...@googlecode.com

unread,
Jun 3, 2014, 4:58:30 PM6/3/14
to chromi...@chromium.org
Status: Untriaged
Owner: ----
CC: tturche...@chromium.org, joshwood...@google.com
Labels: Type-Bug Pri-1 OS-Chrome M-37 ReleaseBlock-Stable
Cr-Platform-Apps-FileManager

New issue 380346 by rookris...@chromium.org: File.app :- Blank image when
png files opened
http://code.google.com/p/chromium/issues/detail?id=380346

Google Chrome
37.0.2027.1 (Official Build 274414) dev
Platform
5923.0.0 (Official Build) dev-channel daisy

Please specify Cr-* of the system to which this bug/feature applies (add
the label below).

Steps To Reproduce:
1.Take a screenshot
2.Try opening the file


Expected Result:Should be able to open the png file

Actual Result: Blank image

How frequently does this problem reproduce? (Always, sometimes, hard to
reproduce?)
Always

What is the impact to the user, and is there a workaround? If so, what is
it?

Please provide any additional information below. Attach a screen shot or
log if possible.



Attachments:
photo (5).JPG 25.9 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Jun 3, 2014, 5:04:30 PM6/3/14
to chromi...@chromium.org

chro...@googlecode.com

unread,
Jun 3, 2014, 7:52:12 PM6/3/14
to chromi...@chromium.org
Updates:
Status: Assigned
Owner: hir...@chromium.org
Cc: -hir...@chromium.org
Labels: Iteration-108

Comment #4 on issue 380346 by joshwood...@chromium.org: File.app :- Blank
@hirono - Does this sound like you? Or a blink issue?

chro...@googlecode.com

unread,
Jun 4, 2014, 12:21:15 AM6/4/14
to chromi...@chromium.org
Updates:
Status: Started

Comment #5 on issue 380346 by hir...@chromium.org: File.app :- Blank image
It looks accessing chrome://resource URL is blocked wrongly.
Let me do bisect.

chro...@googlecode.com

unread,
Jun 4, 2014, 12:22:14 AM6/4/14
to chromi...@chromium.org
Updates:
Labels: -Iteration-108 Iteration-107

Comment #6 on issue 380346 by hir...@chromium.org: File.app :- Blank image
(No comment was entered for this change.)

chro...@googlecode.com

unread,
Jun 4, 2014, 1:18:53 AM6/4/14
to chromi...@chromium.org

Comment #7 on issue 380346 by hir...@chromium.org: File.app :- Blank image
Caused by blink roll 175159:175308.
Bisecting in blink tree...

chro...@googlecode.com

unread,
Jun 4, 2014, 1:47:12 AM6/4/14
to chromi...@chromium.org
Updates:
Status: Unconfirmed
Owner: ---
Cc: hir...@chromium.org kou...@chromium.org

Comment #8 on issue 380346 by hir...@chromium.org: File.app :- Blank image
Found a cause.
https://src.chromium.org/viewvc/blink?revision=173044&view=revision

@kouhei - PTAL the issue? It looks the background page of the extension
cannot load chrome://resource at the first launching time.

chro...@googlecode.com

unread,
Jun 4, 2014, 1:48:10 AM6/4/14
to chromi...@chromium.org
Updates:
Labels: -Cr-Platform-Apps-FileManager Cr-Blink

Comment #9 on issue 380346 by hir...@chromium.org: File.app :- Blank image
(No comment was entered for this change.)

chro...@googlecode.com

unread,
Jun 4, 2014, 3:56:12 AM6/4/14
to chromi...@chromium.org

Comment #10 on issue 380346 by hir...@chromium.org: File.app :- Blank image
The error message that shown in the background page is:

Not allowed to load local resource: chrome://resources/js/cr.js
_generated_background_page.html:1
Not allowed to load local resource:
chrome://resources/js/cr/event_target.js _generated_background_page.html:1
Not allowed to load local resource:
chrome://resources/js/cr/ui/array_data_model.js
_generated_background_page.html:1
Not allowed to load local resource: chrome://resources/js/load_time_data.js
_generated_background_page.html:1
Uncaught ReferenceError: cr is not defined volume_manager.js:475
Error in response to fileBrowserPrivate.getStrings: ReferenceError:
loadTimeData is not defined
at
chrome-extension://nlkncpkkdoccmpiclbokaimcnedabhhm/js/background.js:33:31
at Function.BackgroundComponents.load
(chrome-extension://nlkncpkkdoccmpiclbokaimcnedabhhm/js/background.js:32:27)
at
chrome-extension://nlkncpkkdoccmpiclbokaimcnedabhhm/js/background.js:56:56
_generated_background_page.html:1

We can see the same message by removing chrome://resources from the
extension permissions.
So it seems that the issue is not related with CSP (there is another error
message for CSP violation).

If another script is listed above chrome://resources/js/cr.js in the script
list({"app": {"background": {"scripts": ...}}}) of the manifest file, it
works fine.

chro...@googlecode.com

unread,
Jun 4, 2014, 4:05:23 AM6/4/14
to chromi...@chromium.org
Updates:
Cc: kal...@chromium.org

Comment #11 on issue 380346 by hir...@chromium.org: File.app :- Blank image
According to @kohei, it looks a lack of synchronization in extension
loading, because the blink patch 173044 makes page load faster and have
caused some other timing issues.

+kalman - Do you have any ideas around here?

chro...@googlecode.com

unread,
Jun 4, 2014, 5:28:33 AM6/4/14
to chromi...@chromium.org
Updates:
Status: Assigned
Owner: kou...@chromium.org

Comment #12 on issue 380346 by kou...@chromium.org: File.app :- Blank image
I think I broke the CSP implementation from the patch. This is not related
to src/chrome/.

It looks like CSP is actually initialized when V8WindowShell is initialized
and my patch delays the V8WindowShell execution. Thus making CSP only
applied after some <script> is run.

chro...@googlecode.com

unread,
Jun 4, 2014, 7:46:35 AM6/4/14
to chromi...@chromium.org

Comment #13 on issue 380346 by kou...@chromium.org: File.app :- Blank image
Sorry this is not related to csp. CSP w/o any <script> was not broken.

This is because the background page load do not wait for extension
permissions to be fully loaded (addOriginAccessWhitelistEntry).
Previously it took a few ms before start loading page resources so this
worked.
However my patch delays the v8 context initialize so the resources are
immediately fetched, and this turns out to be before extension permission
load.

chro...@googlecode.com

unread,
Jun 4, 2014, 10:03:35 AM6/4/14
to chromi...@chromium.org

Comment #15 on issue 380346 by kou...@chromium.org: File.app :- Blank image
Aha. Currently InitOriginPermissions calling addOriginAccessWhitelistEntry
is called from Dispatcher::DidCreateScriptContext however my patch delayed
this until first script execution. This call needs to be moved.

#0 0x0000555558df7157 in
WebCore::SecurityPolicy::addOriginAccessWhitelistEntry (sourceOrigin=...,
destinationProtocol=..., destinationDomain=...,
allowDestinationSubdomains=false)

at ../../third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp:116
#1 0x00005555593f5763 in
blink::WebSecurityPolicy::addOriginAccessWhitelistEntry (sourceOrigin=...,
destinationProtocol=..., destinationHost=...,
allowDestinationSubdomains=false)
at ../../third_party/WebKit/Source/web/WebSecurityPolicy.cpp:88
#2 0x000055555ddbe48d in extensions::Dispatcher::UpdateOriginPermissions
(this=0x2e0021b86620,
reason=extensions::UpdatedExtensionPermissionsInfo::ADDED,
extension=0x2e0022da3020, origins=...)
at ../../extensions/renderer/dispatcher.cc:832
#3 0x000055555ddbe2e1 in extensions::Dispatcher::InitOriginPermissions
(this=0x2e0021b86620,
extension=0x2e0022da3020,
context_type=extensions::Feature::BLESSED_EXTENSION_CONTEXT)
at ../../extensions/renderer/dispatcher.cc:808
#4 0x000055555ddbaefc in extensions::Dispatcher::DidCreateScriptContext
(this=0x2e0021b86620, frame=
0x365f66848550, v8_context=..., extension_group=0, world_id=0)
at ../../extensions/renderer/dispatcher.cc:262
#5 0x000055555722b0f4 in
ChromeContentRendererClient::DidCreateScriptContext (
this=0x5555663dcb88 <g_chrome_content_renderer_client+8>,
frame=0x365f66848550, context=...,
extension_group=0, world_id=0)
at ../../chrome/renderer/chrome_content_renderer_client.cc:1237
#6 0x000055555d9b5806 in content::RenderFrameImpl::didCreateScriptContext
(this=0x2e002206e460, frame=
0x365f66848550, context=..., extension_group=0, world_id=0)
at ../../content/renderer/render_frame_impl.cc:2633

chro...@googlecode.com

unread,
Jun 5, 2014, 11:17:47 PM6/5/14
to chromi...@chromium.org
Updates:
Cc: kin...@chromium.org

Comment #20 on issue 380346 by kin...@chromium.org: File.app :- Blank image
Issue 381252 has been merged into this issue.

chro...@googlecode.com

unread,
Jun 5, 2014, 11:31:46 PM6/5/14
to chromi...@chromium.org
Updates:
Cc: fuk...@chromium.org

Comment #21 on issue 380346 by kin...@chromium.org: File.app :- Blank image
+fukino san kindly offered to help writing Files.app side tests for
detecting this regression.

chro...@googlecode.com

unread,
Jun 12, 2014, 5:43:28 AM6/12/14
to chromi...@chromium.org

Comment #25 on issue 380346 by bugdro...@chromium.org: File.app :- Blank
image when png files opened
http://code.google.com/p/chromium/issues/detail?id=380346#c25

The following revision refers to this bug:

https://chromium.googlesource.com/chromium/src.git/+/62115ba4d4bbeadcd491cd3cfdacd292d4bf34f8

commit 62115ba4d4bbeadcd491cd3cfdacd292d4bf34f8
Author: kou...@chromium.org
<kou...@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Thu Jun 12 08:34:32 2014

Call InitOriginPermissions when extension is added to the renderer process.

This is to fix permission breakage on extension background pages after
blink patch r173044. Before this patch, permission settings were loaded
on V8 context initialize. However, the blink patch deferred the V8
context initialize until its first use.

This patch adds a call to |Dispatcher::InitOriginPermissions| on
|Dispatcher::OnActivateExtension| which is called when render process
for the extension is created.

TEST=Manually confirmed that Files.app image viewer can load images
on its first load.
BUG=380346, 380502

Review URL: https://codereview.chromium.org/315143003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276585
0039d316-1c4b-4281-b951-d872f2087c98

chro...@googlecode.com

unread,
Jun 12, 2014, 5:44:30 AM6/12/14
to chromi...@chromium.org

Comment #26 on issue 380346 by bugdro...@chromium.org: File.app :- Blank
image when png files opened
http://code.google.com/p/chromium/issues/detail?id=380346#c26

------------------------------------------------------------------
r276585 | kou...@chromium.org | 2014-06-12T08:34:32.968375Z

Changed paths:
M
http://src.chromium.org/viewvc/chrome/trunk/src/extensions/renderer/dispatcher.cc?r1=276585&r2=276584&pathrev=276585

Call InitOriginPermissions when extension is added to the renderer process.

This is to fix permission breakage on extension background pages after
blink patch r173044. Before this patch, permission settings were loaded
on V8 context initialize. However, the blink patch deferred the V8
context initialize until its first use.

This patch adds a call to |Dispatcher::InitOriginPermissions| on
|Dispatcher::OnActivateExtension| which is called when render process
for the extension is created.

TEST=Manually confirmed that Files.app image viewer can load images
on its first load.
BUG=380346, 380502

Review URL: https://codereview.chromium.org/315143003
-----------------------------------------------------------------

chro...@googlecode.com

unread,
Jul 10, 2014, 4:35:28 AM7/10/14
to chromi...@chromium.org

Comment #35 on issue 380346 by kin...@chromium.org: File.app :- Blank image
Issue 384401 has been merged into this issue.
Reply all
Reply to author
Forward
0 new messages