RESOLVED FIXED 159834
Use SecurityOriginData as keys in StorageManager
https://bugs.webkit.org/show_bug.cgi?id=159834
Summary Use SecurityOriginData as keys in StorageManager
Alex Christensen
Reported 2016-07-15 14:16:55 PDT
Use SecurityOriginData as keys in StorageManager
Attachments
Patch (40.13 KB, patch)
2016-07-15 14:34 PDT, Alex Christensen
no flags
Patch (40.13 KB, patch)
2016-07-15 14:50 PDT, Alex Christensen
no flags
Patch (40.00 KB, patch)
2016-07-15 15:01 PDT, Alex Christensen
no flags
Patch (40.01 KB, patch)
2016-07-15 15:38 PDT, Alex Christensen
no flags
Patch (40.03 KB, patch)
2016-07-15 16:38 PDT, Alex Christensen
no flags
Patch (40.04 KB, patch)
2016-07-15 16:56 PDT, Alex Christensen
no flags
Archive of layout-test-results from ews115 for mac-yosemite (1.74 MB, application/zip)
2016-07-15 17:39 PDT, Build Bot
no flags
Patch (40.07 KB, patch)
2016-07-15 17:49 PDT, Alex Christensen
no flags
Patch (82.83 KB, patch)
2016-11-10 16:01 PST, Alex Christensen
no flags
Patch (81.37 KB, patch)
2016-11-10 16:42 PST, Alex Christensen
no flags
Patch (83.75 KB, patch)
2016-11-10 16:51 PST, Alex Christensen
no flags
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (2.02 MB, application/zip)
2016-11-10 17:48 PST, Build Bot
no flags
Archive of layout-test-results from ews124 for ios-simulator-wk2 (3.59 MB, application/zip)
2016-11-10 17:59 PST, Build Bot
no flags
Patch (83.83 KB, patch)
2016-11-10 18:43 PST, Alex Christensen
no flags
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (2.00 MB, application/zip)
2016-11-10 19:38 PST, Build Bot
no flags
Archive of layout-test-results from ews126 for ios-simulator-wk2 (865.86 KB, application/zip)
2016-11-10 19:49 PST, Build Bot
no flags
Patch (80.06 KB, patch)
2016-11-11 15:58 PST, Alex Christensen
no flags
Alex Christensen
Comment 1 2016-07-15 14:34:24 PDT
WebKit Commit Bot
Comment 2 2016-07-15 14:36:14 PDT
Attachment 283792 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/Storage/StorageManager.cpp:435: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 3 2016-07-15 14:50:27 PDT
WebKit Commit Bot
Comment 4 2016-07-15 14:51:45 PDT
Attachment 283794 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/Storage/StorageManager.cpp:435: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 5 2016-07-15 15:01:29 PDT
WebKit Commit Bot
Comment 6 2016-07-15 15:03:01 PDT
Attachment 283796 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/Storage/StorageManager.cpp:435: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 7 2016-07-15 15:38:17 PDT
WebKit Commit Bot
Comment 8 2016-07-15 15:39:39 PDT
Attachment 283803 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/Storage/StorageManager.cpp:435: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 9 2016-07-15 16:38:11 PDT
WebKit Commit Bot
Comment 10 2016-07-15 16:40:16 PDT
Attachment 283813 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/Storage/StorageManager.cpp:435: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 11 2016-07-15 16:56:50 PDT
WebKit Commit Bot
Comment 12 2016-07-15 16:58:14 PDT
Attachment 283816 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/Storage/StorageManager.cpp:435: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 13 2016-07-15 17:39:20 PDT
Comment on attachment 283816 [details] Patch Attachment 283816 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/1688364 Number of test failures exceeded the failure limit.
Build Bot
Comment 14 2016-07-15 17:39:23 PDT
Created attachment 283828 [details] Archive of layout-test-results from ews115 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-yosemite Platform: Mac OS X 10.10.5
Alex Christensen
Comment 15 2016-07-15 17:49:01 PDT
WebKit Commit Bot
Comment 16 2016-07-15 17:51:04 PDT
Attachment 283829 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/Storage/StorageManager.cpp:435: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 17 2016-07-17 09:53:04 PDT
Comment on attachment 283829 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=283829&action=review > Source/WebCore/page/SecurityOrigin.cpp:167 > + // FIXME: We should only use this on the main thread. I don’t understand this comment. What is "this" referring to? The SecurityOrigin::create function? The shouldTreatAsUniqueOrigin function? What is the fix for the problem the comment is describing? Why are we not making the fix at this time? > Source/WebCore/page/SecurityOrigin.cpp:169 > Ref<SecurityOrigin> origin(adoptRef(*new SecurityOrigin)); We should change this line of code to: auto origin = adoptRef(*new SecurityOrigin); > Source/WebCore/page/SecurityOriginData.cpp:110 > +bool operator==(const SecurityOrigin& a, const SecurityOriginData& b) > +{ > + return a.protocol() == b.protocol > + && a.host() == b.host > + && a.port() == b.port; > +} > + > +bool operator==(const SecurityOriginData& a, const SecurityOrigin& b) > +{ > + return a.protocol == b.protocol() > + && a.host == b.host() > + && a.port == b.port(); > +} It doesn’t seem right to use the == operation for this. There are so many other fields in a SecurityOrigin that this is ignoring. So this is some kind of matching operation, not an == operation. > Source/WebCore/page/SecurityOriginData.h:59 > +WEBCORE_EXPORT bool operator==(const SecurityOrigin&, const SecurityOriginData&); > +WEBCORE_EXPORT bool operator==(const SecurityOriginData&, const SecurityOrigin&); We should find another solution to whatever problem we are solving by adding these == operators. There are other techniques for using keys of different types in collections.
Alex Christensen
Comment 18 2016-07-18 11:15:11 PDT
(In reply to comment #17) > Comment on attachment 283829 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=283829&action=review > > > Source/WebCore/page/SecurityOrigin.cpp:167 > > + // FIXME: We should only use this on the main thread. > > I don’t understand this comment. What is "this" referring to? The > SecurityOrigin::create function? The shouldTreatAsUniqueOrigin function? shouldTreatAsUniqueOrigin > > What is the fix for the problem the comment is describing? Why are we not > making the fix at this time? There are still uses of shouldTreatAsUniqueOrigin on non-main threads that are outside the scope of this patch to fix.
Michael Catanzaro
Comment 19 2016-09-08 20:47:29 PDT
Comment on attachment 283829 [details] Patch I think you need to address Darin's comments before this is ready for review again. The operator== use is pretty concerning (marking objects are equal when they have different data fields, or when they're not even the same object)!
Alex Christensen
Comment 20 2016-11-10 16:01:47 PST
Alex Christensen
Comment 21 2016-11-10 16:42:14 PST
Alex Christensen
Comment 22 2016-11-10 16:51:55 PST
Build Bot
Comment 23 2016-11-10 17:48:37 PST
Comment on attachment 294442 [details] Patch Attachment 294442 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2494160 Number of test failures exceeded the failure limit.
Build Bot
Comment 24 2016-11-10 17:48:40 PST
Created attachment 294450 [details] Archive of layout-test-results from ews105 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 25 2016-11-10 17:59:51 PST
Comment on attachment 294442 [details] Patch Attachment 294442 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/2494167 Number of test failures exceeded the failure limit.
Build Bot
Comment 26 2016-11-10 17:59:55 PST
Created attachment 294451 [details] Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Daniel Bates
Comment 27 2016-11-10 18:09:05 PST
Comment on attachment 294442 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=294442&action=review > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:534 > - origins.add(WTFMove(origin)); > + origins.add(origin); Is this intentional? > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:577 > - origins.add(WTFMove(origin)); > + origins.add(origin); Ditto. > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:581 > - origins.add(WTFMove(origin)); > + origins.add(origin); Ditto. > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:691 > - if (!origin->isSameSchemeHostPort(&area->securityOrigin())) > + if (!(origin == area->securityOrigin())) This is a change in behavior. Is this intentional? I mean, SecurityOrigin::isSameSchemeHostPort() has special logic for file-based origins. > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:414 > + websiteData.entries.append(WebsiteData::Entry { WTFMove(origin).securityOrigin().ptr(), WebsiteDataType::MediaKeys, 0 }); Is the WTFMove() needed? > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:790 > + for (auto origin : origins) Did you mean to use "auto" to copy each SecurityOriginData object instead of "auto&"?
Alex Christensen
Comment 28 2016-11-10 18:43:09 PST
Build Bot
Comment 29 2016-11-10 19:38:55 PST
Comment on attachment 294458 [details] Patch Attachment 294458 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2494697 Number of test failures exceeded the failure limit.
Build Bot
Comment 30 2016-11-10 19:38:59 PST
Created attachment 294460 [details] Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 31 2016-11-10 19:49:40 PST
Comment on attachment 294458 [details] Patch Attachment 294458 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/2494704 Number of test failures exceeded the failure limit.
Build Bot
Comment 32 2016-11-10 19:49:43 PST
Created attachment 294461 [details] Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Alex Christensen
Comment 33 2016-11-10 22:58:18 PST
(In reply to comment #27) > Comment on attachment 294442 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=294442&action=review > > > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:534 > > - origins.add(WTFMove(origin)); > > + origins.add(origin); > > Is this intentional? Yes, the type is now const SecurityOriginData& instead of RefPtr<SecurityOrigin>. > > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:691 > > - if (!origin->isSameSchemeHostPort(&area->securityOrigin())) > > + if (!(origin == area->securityOrigin())) > > This is a change in behavior. Is this intentional? I mean, > SecurityOrigin::isSameSchemeHostPort() has special logic for file-based > origins. I won't change this behavior. Thanks. > > > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:414 > > + websiteData.entries.append(WebsiteData::Entry { WTFMove(origin).securityOrigin().ptr(), WebsiteDataType::MediaKeys, 0 }); > > Is the WTFMove() needed? No > > > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:790 > > + for (auto origin : origins) > > Did you mean to use "auto" to copy each SecurityOriginData object instead of > "auto&"? No, thanks. There's also some other issue causing a lot of crashing. Luckily it's easy to reproduce.
Alex Christensen
Comment 34 2016-11-11 15:58:33 PST
Brady Eidson
Comment 35 2016-11-11 16:11:44 PST
Comment on attachment 294557 [details] Patch After EWS, sure.
WebKit Commit Bot
Comment 36 2016-11-11 17:21:29 PST
Comment on attachment 294557 [details] Patch Clearing flags on attachment: 294557 Committed r208633: <http://trac.webkit.org/changeset/208633>
WebKit Commit Bot
Comment 37 2016-11-11 17:21:36 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.