Closed Bug 1297370 Opened 8 years ago Closed 8 years ago

An error occurs when importing canvas snapshot. NetUtil.jsm: asyncFetch() requires the channel to have one of the security flags set in the loadinfo (see nsILoadInfo)

Categories

(DevTools Graveyard :: Canvas Debugger, defect, P1)

defect

Tracking

(firefox49 verified, firefox50 verified, firefox51 verified)

VERIFIED FIXED
Firefox 51
Tracking Status
firefox49 --- verified
firefox50 --- verified
firefox51 --- verified

People

(Reporter: magicp.jp, Assigned: ckerschb)

References

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20160822064441

Steps to reproduce:

1. Start Nightly
2. Go to "http://helloracer.com/webgl/"
3. Open DevTools > Canvas
4. Click Reload and Recording
5. Save snapshot in local
6. Import the snapshot
7. Check error in Browser Console


Actual results:

An error occurs when importing canvas snapshot.

NetUtil.jsm: asyncFetch() requires the channel to have one of the security flags set in the loadinfo (see nsILoadInfo). Please create channel using NetUtil.newChannel()	NetUtil.jsm:158
  NetUtil_asyncFetch	resource://gre/modules/NetUtil.jsm:158:17
  SnapshotsListView<._onImportButtonClick	chrome://devtools/content/canvasdebugger/snapshotslist.js:370:5
  bound	self-hosted
  oncommand	chrome://devtools/content/canvasdebugger/canvasdebugger.xul:1:1

Regression range:
https://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=f7d385fac19af534b7c1e8b199e1c5eb4f3034c4&tochange=95d1ed3bea77c89f9637396f5e7a53955c013a42


Expected results:

Import works without error
Blocks: 1268595
Has Regression Range: --- → yes
Has STR: --- → yes
Component: Untriaged → Developer Tools: Canvas Debugger
OS: Unspecified → All
Hardware: Unspecified → All
Christoph, what's going wrong here?
Flags: needinfo?(ckerschb)
See Also: → 1297375
Assignee: nobody → ckerschb
Blocks: 1182535
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [domsecurity-active]
It's missing one of the securityFlags needed to call asyncOpen2() on it. In fact we should use |loadUsingSystemPrincipal = true| for that load, similar to the other callsite within browser/devtools. See [1] which is the other callsite within browser/devtools which we converted at the same time within the same bug. That conversion btw landed in FF41, so this feature has been broken for a long time. I suppose we should uplift to all channels?

[1] https://hg.mozilla.org/mozilla-central/rev/eccbddbe4761#l3.19
Flags: needinfo?(ckerschb)
Attachment #8783965 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 8783965 [details] [diff] [review]
bug_1297370_update_snapshot.patch

(In reply to Christoph Kerschbaumer [:ckerschb] from comment #2)
> That conversion btw landed in FF41, so this feature has been
> broken for a long time. I suppose we should uplift to all channels?

I mean, not sure it meets ESR criteria, or ones for release. But definitely aurora+beta. Rest is up to you.
Attachment #8783965 - Flags: review?(gijskruitbosch+bugs) → review+
Comment on attachment 8783965 [details] [diff] [review]
bug_1297370_update_snapshot.patch

Approval Request Comment

Importing *.json into the canvas debugger fails without this patch. The Bug that regressed that landed in FF41, so this feature has been broken for quite some time.

[Feature/regressing bug #]:
Bug 1167053 - Convert NetUtil.newChannel2 callsites to use new API - update newChannel2

[User impact if declined]:
See approval request.

[Describe test coverage new/current, TreeHerder]:
Tested manually using the description in comment 0.

[Risks and why]:
Low, because it only provides the necessary default when loading a local file into the debugger.

[String/UUID change made/needed]:
no
Attachment #8783965 - Flags: approval-mozilla-beta?
Attachment #8783965 - Flags: approval-mozilla-aurora?
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/dab0693cae68
Provide security flag for channel within snapshotlist. r=gijs
Keywords: checkin-needed
Wes, just want to make sure this lands today in m-c so I will have time to uplift to beta for tomorrow.
Flags: needinfo?(wkocher)
https://hg.mozilla.org/mozilla-central/rev/dab0693cae68
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
verified in 51 (Build ID: 20160826030226)
Comment on attachment 8783965 [details] [diff] [review]
bug_1297370_update_snapshot.patch

We want developers to be able to import json, let's uplift to beta. 
Verified in nightly and the risk seems limited to this feature.
Attachment #8783965 - Flags: approval-mozilla-beta?
Attachment #8783965 - Flags: approval-mozilla-beta+
Attachment #8783965 - Flags: approval-mozilla-aurora?
Attachment #8783965 - Flags: approval-mozilla-aurora+
I have reproduced this bug with Nightly 51.0a1 (2016-08-23) on Windows 8.1 (64 Bit!).

This bug's fix is verified on Latest Beta 49.0b8 and Latest Aurora 50.0a2.

Latest Beta 49.0b8 :
Build ID : 20160829102229
User Agent : Mozilla/5.0 (Windows NT 6.3; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0

Latest Aurora 50.0a2 :
Build ID : 20160901004001
User Agent : Mozilla/5.0 (Windows NT 6.3; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0

[bugday-20160831]
Status: RESOLVED → VERIFIED
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: