RESOLVED FIXED 37449
SecurityOrigin needs a way to remove individual OriginAccessEntries
https://bugs.webkit.org/show_bug.cgi?id=37449
Summary SecurityOrigin needs a way to remove individual OriginAccessEntries
Timothy Hatcher
Reported 2010-04-12 09:48:08 PDT
See summary.
Attachments
Proposed patch (32.27 KB, patch)
2010-04-12 10:27 PDT, Timothy Hatcher
aroben: review-
timothy: commit-queue-
Rename part (45.01 KB, patch)
2010-04-13 00:51 PDT, Timothy Hatcher
hyatt: review+
timothy: commit-queue-
Final part (33.37 KB, patch)
2010-04-13 10:21 PDT, Timothy Hatcher
hyatt: review+
timothy: commit-queue-
Timothy Hatcher
Comment 1 2010-04-12 10:27:04 PDT
Created attachment 53176 [details] Proposed patch
Adam Roben (:aroben)
Comment 2 2010-04-12 16:34:50 PDT
Comment on attachment 53176 [details] Proposed patch > +Testing: http://127.0.0.1:8000 http:localhost I find this output a little confusing to parse. Maybe adding "source origin=" and "destination origin=" would make it clearer, e.g., "Testing: source origin=http://127.0.0.1:8000 destination origin=http:localhost". > +Testing: http://127.0.0.1:8000 http:localhost allowing subdoamins Typo: subdoamins > +function nextTest() > +{ > + if (currentTest < tests.length) > + test.apply(null, tests[currentTest++]); > + else > + layoutTestController.notifyDone(); > +} Seems like a for loop or Array.forEach would work just fine. > + (WebCore::SecurityOrigin::whiteListAccessFromOrigin): Use the add method to preent a > + second hash lookup. Typo: preent > + (WebCore::SecurityOrigin::removeWhiteListAccessFromOrigin): Added. Find a matching > + OriginAccessEntry and remove it. This name is unfortunately not parallel with "whiteListAccessFromOrigin". That function uses the verb "white list", while your new function uses the noun "white list access". We either need a verb that means "un-white list", or we should rename whiteListAccessFromOrigin. Maybe addOriginAccessWhitelistEntry/removeOriginAccessWhitelistEntry? > +inline bool operator==(const OriginAccessEntry& a, const OriginAccessEntry& b) > +{ > + return a.protocol() == b.protocol() && a.host() == b.host() && a.subdomainSettings() == b.subdomainSettings(); > +} Protocols and hosts are supposed to be treated case-insensitively. r- because of the case-sensitivity issue (maybe you should add a test for this), but otherwise this looks good to go (though figuring out better names would be nice).
Timothy Hatcher
Comment 3 2010-04-13 00:51:31 PDT
Created attachment 53230 [details] Rename part
Timothy Hatcher
Comment 4 2010-04-13 10:21:58 PDT
Created attachment 53259 [details] Final part
Dave Hyatt
Comment 5 2010-04-13 14:55:13 PDT
Comment on attachment 53259 [details] Final part r=me
Dave Hyatt
Comment 6 2010-04-13 14:55:34 PDT
Comment on attachment 53230 [details] Rename part r=me
Timothy Hatcher
Comment 7 2010-04-13 15:33:26 PDT
Fixed in r57535 and 57537.
Note You need to log in before you can comment on or make changes to this bug.