Closed
Bug 1167100
Opened 9 years ago
Closed 9 years ago
User nsIPrincipal.originAttribute in ContentPrincipalInfo
Categories
(Core :: DOM: Content Processes, defect)
Core
DOM: Content Processes
Tracking
()
RESOLVED
FIXED
mozilla44
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
Attachments
(1 file, 3 obsolete files)
17.71 KB,
patch
|
Details | Diff | Splinter Review |
As we will use originAttribute to wrap appId/inBrowser in Bug 1163254, so ContentPrincipalInfo should leverage that instead of handling appId/isBrowser by itself.
Updated•9 years ago
|
Component: IPC → DOM: Content Processes
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → allstars.chh
Assignee | ||
Comment 1•9 years ago
|
||
So far I think following changes are needed: 1. Bug 1188776 and Bug 1165272 need to be done first. 2. dom/base/nsJSEnvironment.cpp for updating structured clone of Principal. 3. dom/cache/CacheStorage.cpp for checking appId is unknown. 4. dom/cache/DBSchema.cpp for using OriginAttributes and constructing ContentPrincipalInfo. 5. dom/workers/ServiceWorkerRegistrar.cpp for reading/writing originAttributes into serviceworker.txt and test case in dom/workers/test/gtest/TestReadWrite.cpp. 6. updating ipc/glue/BackgroundUtils.cpp and ipc/glue/PBackgroundSharedTypes.ipdlh
Comment 2•9 years ago
|
||
(In reply to Yoshi Huang[:allstars.chh] from comment #1) > 4. dom/cache/DBSchema.cpp for using OriginAttributes and constructing > ContentPrincipalInfo. The serialized origin attributes are stored in the database. If this changes we need a migration written to avoid corrupting the data. > 5. dom/workers/ServiceWorkerRegistrar.cpp for reading/writing > originAttributes into serviceworker.txt > and test case in dom/workers/test/gtest/TestReadWrite.cpp. Same thing. This needs to migrate existing data on disk.
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Ben Kelly [:bkelly] from comment #2) > (In reply to Yoshi Huang[:allstars.chh] from comment #1) > > 4. dom/cache/DBSchema.cpp for using OriginAttributes and constructing > > ContentPrincipalInfo. > > The serialized origin attributes are stored in the database. If this > changes we need a migration written to avoid corrupting the data. > I won't change the serialized origin. I will only change how we get OriginAttributes in InsertEntry and how we construct ContentPrincipalInfo in ReadResponse. Just change the const > > 5. dom/workers/ServiceWorkerRegistrar.cpp for reading/writing > > originAttributes into serviceworker.txt > > and test case in dom/workers/test/gtest/TestReadWrite.cpp. > > Same thing. This needs to migrate existing data on disk. Dimi will fix this in Bug 1189235.
Assignee | ||
Comment 4•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Attachment #8651732 -
Flags: review?(bobbyholley)
Comment 5•9 years ago
|
||
Comment on attachment 8651732 [details] [diff] [review] Patch. Review of attachment 8651732 [details] [diff] [review]: ----------------------------------------------------------------- This looks great - thank you Yoshi! ::: ipc/glue/BackgroundUtils.cpp @@ +80,3 @@ > rv = secMan->GetSimpleCodebasePrincipal(uri, getter_AddRefs(principal)); > } else { > + principal = BasePrincipal::CreateCodebasePrincipal(uri, const_cast<OriginAttributes&>(info.attrs())); instead of the const_cast, can you just make CreateCodebasePrincipal accept const OriginAttributes& ?
Attachment #8651732 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 6•9 years ago
|
||
I found the Mn-e10s will always have UNEXPECTED_ERROR after applying my patch on try server, although my local run is green. Will spend more time to check this. https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&tochange=487c57e377c2&fromchange=dbd6e7b9a9e1
Updated•9 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8665230 [details] [diff] [review] Patch v2. Review of attachment 8665230 [details] [diff] [review]: ----------------------------------------------------------------- re-send r? again for Bug 1203916 and Bug 1163254 have been landed. https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d6d069d4198
Attachment #8665230 -
Flags: review?(bobbyholley)
Comment 9•9 years ago
|
||
Comment on attachment 8665230 [details] [diff] [review] Patch v2. Review of attachment 8665230 [details] [diff] [review]: ----------------------------------------------------------------- Looks great, thanks Yoshi!
Attachment #8665230 -
Flags: review?(bobbyholley) → review+
Comment 11•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d0e88c95f3c5
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
I had to back this out for causing crashes: https://hg.mozilla.org/mozilla-central/rev/ccee6614fd9d
Status: RESOLVED → REOPENED
Flags: needinfo?(allstars.chh)
Resolution: FIXED → ---
Assignee | ||
Comment 13•9 years ago
|
||
Comment 15•9 years ago
|
||
I think we should do bug 1209843 instead.
Comment 16•9 years ago
|
||
(In reply to Wes Kocher (:KWierso) from comment #12) > I had to back this out for causing crashes: > https://hg.mozilla.org/mozilla-central/rev/ccee6614fd9d Could this be the reason for crashes as reported in bug 1209508?
Assignee | ||
Updated•9 years ago
|
Attachment #8667635 -
Attachment is obsolete: true
Assignee | ||
Comment 17•9 years ago
|
||
Comment on attachment 8665230 [details] [diff] [review] Patch v2. Review of attachment 8665230 [details] [diff] [review]: ----------------------------------------------------------------- ::: ipc/glue/BackgroundUtils.cpp @@ +202,5 @@ > bool isUnknownAppId; > rv = aPrincipal->GetUnknownAppId(&isUnknownAppId); > if (NS_WARN_IF(NS_FAILED(rv))) { > return rv; > } line 202 ~ line 206 are dead code, will remove this as well.
Assignee | ||
Comment 18•9 years ago
|
||
rebase https://hg.mozilla.org/try/pushloghtml?changeset=8483e1db11c1
Attachment #8665230 -
Attachment is obsolete: true
Flags: needinfo?(allstars.chh)
Comment 20•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/27576be038ea
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•