RESOLVED FIXED 88499
WebCoreSupport needs objects each of which follows major WebCore objects
https://bugs.webkit.org/show_bug.cgi?id=88499
Summary WebCoreSupport needs objects each of which follows major WebCore objects
Hajime Morrita
Reported 2012-06-06 21:57:25 PDT
One reason of Bug 87993 is that Internals objects don't follow typical WebCore lifetime model. It should follow either Document(or Window), Frame or Page.
Attachments
Patch (32.95 KB, patch)
2012-06-06 23:37 PDT, Hajime Morrita
no flags
Patch (36.53 KB, patch)
2012-06-07 00:12 PDT, Hajime Morrita
no flags
Archive of layout-test-results from ec2-cr-linux-02 (117.06 KB, application/zip)
2012-06-07 06:28 PDT, WebKit Review Bot
no flags
Patch (41.00 KB, patch)
2012-06-13 22:58 PDT, Hajime Morrita
no flags
Patch (44.35 KB, patch)
2012-06-14 00:06 PDT, Hajime Morrita
no flags
Patch (41.88 KB, patch)
2012-06-14 17:34 PDT, Hajime Morrita
no flags
Patch (43.39 KB, patch)
2012-06-14 18:32 PDT, Hajime Morrita
no flags
Patch (44.14 KB, patch)
2012-06-20 22:57 PDT, Hajime Morrita
no flags
Archive of layout-test-results from ec2-cr-linux-04 (532.89 KB, application/zip)
2012-06-20 23:31 PDT, WebKit Review Bot
no flags
Patch (52.00 KB, patch)
2012-06-21 02:17 PDT, Hajime Morrita
no flags
Archive of layout-test-results from ec2-cr-linux-01 (717.69 KB, application/zip)
2012-06-21 05:56 PDT, WebKit Review Bot
no flags
Patch (52.13 KB, patch)
2012-06-21 20:40 PDT, Hajime Morrita
no flags
Patch (35.32 KB, patch)
2012-06-26 18:21 PDT, Hajime Morrita
no flags
Patch for landing (38.04 KB, patch)
2012-07-11 00:43 PDT, Hajime Morrita
no flags
Patch for landing (38.02 KB, patch)
2012-07-11 01:46 PDT, Hajime Morrita
no flags
Hajime Morrita
Comment 1 2012-06-06 23:37:14 PDT
Hajime Morrita
Comment 2 2012-06-06 23:38:17 PDT
This change is a part of reorg for addressing Bug 87933.
Hajime Morrita
Comment 3 2012-06-07 00:12:56 PDT
Build Bot
Comment 4 2012-06-07 02:40:18 PDT
WebKit Review Bot
Comment 5 2012-06-07 06:28:00 PDT
Comment on attachment 146215 [details] Patch Attachment 146215 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12906950 New failing tests: http/tests/inspector/extensions-headers.html http/tests/inspector/extensions-ignore-cache.html http/tests/inspector/console-xhr-logging.html http/tests/inspector/console-xhr-logging-async.html http/tests/inspector/console-cd.html http/tests/inspector/console-cd-completions.html http/tests/inspector/injected-script-for-origin.html http/tests/inspector/console-cross-origin-iframe-logging.html http/tests/inspector/network-preflight-options.html http/tests/inspector/extensions-network-redirect.html http/tests/appcache/crash-when-navigating-away-then-back.html http/tests/inspector/modify-cross-domain-rule.html http/tests/inspector/inspect-iframe-from-different-domain.html http/tests/inspector/change-iframe-src.html http/tests/inspector/compiler-script-mapping.html http/tests/inspector/extensions-useragent.html http/tests/inspector/compiler-source-mapping-debug.html http/tests/inspector/resource-har-conversion.html http/tests/inspector/resource-har-headers.html http/tests/inspector/console-resource-errors.html compositing/geometry/fixed-position-transform-composited-page-scale.html
WebKit Review Bot
Comment 6 2012-06-07 06:28:04 PDT
Created attachment 146273 [details] Archive of layout-test-results from ec2-cr-linux-02 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-02 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Alexey Proskuryakov
Comment 7 2012-06-07 08:59:03 PDT
Comment on attachment 146215 [details] Patch I don't understand why Internals and InternalsController need to be separate.
Hajime Morrita
Comment 8 2012-06-07 17:39:43 PDT
(In reply to comment #7) > (From update of attachment 146215 [details]) > I don't understand why Internals and InternalsController need to be separate. This is because - Internals follows Document lifetime and holds document, that enable us to kill redudant Document* parameters from many Internals APIs in following changes. InternalsController needs to survive across document to keep InternalSettings alive. So it need to follow Page lifetime. - Supplement<T> cannot be RefCounted. But Internals should be.
Jesus Sanchez-Palencia
Comment 9 2012-06-11 12:57:36 PDT
(In reply to comment #8) > (In reply to comment #7) > > (From update of attachment 146215 [details] [details]) > > I don't understand why Internals and InternalsController need to be separate. > > This is because > > - Internals follows Document lifetime and holds document, > that enable us to kill redudant Document* parameters from many Internals APIs > in following changes. > InternalsController needs to survive across document to keep InternalSettings > alive. So it need to follow Page lifetime. > - Supplement<T> cannot be RefCounted. But Internals should be. I like the approach of this patch and I agree it allows us not only to fix https://bugs.webkit.org/show_bug.cgi?id=87993 but that it also enables us to find more room for future improvements.
Alexey Proskuryakov
Comment 10 2012-06-11 13:48:21 PDT
> > I don't understand why Internals and InternalsController need to be separate. > > This is because > > - Internals follows Document lifetime and holds document, This is not actually true. Internals is exposed to JS, so it has its own lifetime. It has an unnecessary inheritance from FrameDestructionObserver, but it doesn't depend on frames or documents in reality. > that enable us to kill redudant Document* parameters from many Internals APIs > in following changes. This needs to be done, but is not a reason to keep Internals and InternalsController separate. > InternalsController needs to survive across document to keep InternalSettings > alive. So it need to follow Page lifetime. I think that you are really saying that InternalSettings need to match Page lifetime, and that I'd agree with. We already have two objects (Internals and InternalSettings), and son't need a third one. > - Supplement<T> cannot be RefCounted. But Internals should be. If Supplement cannot do something, don't use it :). Relying on some other code is not an excuse for wrong design.
Hajime Morrita
Comment 11 2012-06-11 18:36:22 PDT
Hi Alexey, thanks for your feedback! (In reply to comment #10) > > > I don't understand why Internals and InternalsController need to be separate. > > > > This is because > > > > - Internals follows Document lifetime and holds document, > > This is not actually true. Internals is exposed to JS, so it has its own lifetime. It has an unnecessary inheritance from FrameDestructionObserver, but it doesn't depend on frames or documents in reality. Yeah, I'm going to get rid of FrameDestructionObserver from Internals. > > > that enable us to kill redudant Document* parameters from many Internals APIs > > in following changes. > > This needs to be done, but is not a reason to keep Internals and InternalsController separate. > Makes sense. > > InternalsController needs to survive across document to keep InternalSettings > > alive. So it need to follow Page lifetime. > > I think that you are really saying that InternalSettings need to match Page lifetime, and that I'd agree with. We already have two objects (Internals and InternalSettings), and son't need a third one. > Yup, On lifetime, that what I meant to say. > > - Supplement<T> cannot be RefCounted. But Internals should be. > > If Supplement cannot do something, don't use it :). Relying on some other code is not an excuse for wrong design. Agreed. I'll try to figure out another approach. Canceling r?.
Hajime Morrita
Comment 12 2012-06-13 22:58:08 PDT
Early Warning System Bot
Comment 13 2012-06-13 23:21:51 PDT
Build Bot
Comment 14 2012-06-13 23:27:15 PDT
Build Bot
Comment 15 2012-06-13 23:47:51 PDT
Gyuyoung Kim
Comment 16 2012-06-13 23:51:00 PDT
Hajime Morrita
Comment 17 2012-06-14 00:06:16 PDT
Hajime Morrita
Comment 18 2012-06-14 17:34:31 PDT
Build Bot
Comment 19 2012-06-14 17:58:31 PDT
Hajime Morrita
Comment 20 2012-06-14 18:32:55 PDT
WebKit Review Bot
Comment 21 2012-06-14 23:16:30 PDT
Comment on attachment 147698 [details] Patch Attachment 147698 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12956585
Alexey Proskuryakov
Comment 22 2012-06-15 09:54:13 PDT
Comment on attachment 147698 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147698&action=review I didn't examine the patch carefully. The direction looks good. > Source/WebCore/ChangeLog:15 > + Now InternalSettings object is created per frame instead of per page. I thought the opposite was the goal. Is this accurate? > Source/WebCore/ChangeLog:20 > + No new tests. covered by existing ones. I'd have just omitted this line. Changes in functionality that's not exposed to customers rarely need tests. > Source/WebCore/testing/Internals.idl:86 > - void setPagination(in Document document, in DOMString mode, in long gap) raises(DOMException); > + //void setPagination(in Document document, in DOMString mode, in long gap) raises(DOMException); ?
Jesus Sanchez-Palencia
Comment 23 2012-06-15 14:07:53 PDT
Comment on attachment 147698 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147698&action=review >> Source/WebCore/ChangeLog:15 >> + Now InternalSettings object is created per frame instead of per page. > > I thought the opposite was the goal. Is this accurate? I didn't get it as well, sorry. Btw, Internals will still be bounded to ScriptExecutionContext, right? > Source/WebKit2/ChangeLog:10 > +2012-06-13 Tim Horton <timothy_horton@apple.com> This was probably added by mistake, wasn't it? > Source/WebCore/testing/Internals.idl:118 > + //void setUserPreferredLanguages(in sequence<String> languages); Both of the above were moved to InternalSettings, right? You forgot to remove these lines, I believe :). > Source/WebCore/testing/Internals.idl:142 > + //void allowRoundingHacks(); Ditto.
Hajime Morrita
Comment 24 2012-06-18 22:38:01 PDT
Comment on attachment 147698 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147698&action=review >>> Source/WebCore/ChangeLog:15 >>> + Now InternalSettings object is created per frame instead of per page. >> >> I thought the opposite was the goal. Is this accurate? > > I didn't get it as well, sorry. Btw, Internals will still be bounded to ScriptExecutionContext, right? - I changed a design and makes InternalSettings more like just a wrapper of WebCore::Settings, and extract could-be-changed states into InternalSettings::Backup. Then, per-test state is encapsulated behind the Backup object. - The lifetime of Internals object is ScriptExceptionContext, as Jesus mentioned. It's going to be a simple wrapper of Document objecct. Frame object is no longer involved its lifetime. >> Source/WebCore/ChangeLog:20 >> + No new tests. covered by existing ones. > > I'd have just omitted this line. Changes in functionality that's not exposed to customers rarely need tests. True. will remove. >> Source/WebKit2/ChangeLog:10 >> +2012-06-13 Tim Horton <timothy_horton@apple.com> > > This was probably added by mistake, wasn't it? Oops. Thanks for the catch! Will fix.
Hajime Morrita
Comment 25 2012-06-18 22:39:10 PDT
I'll update the patch once my gardening duty is over. Thanks for your feedback!
Hajime Morrita
Comment 26 2012-06-20 22:57:44 PDT
Hajime Morrita
Comment 27 2012-06-20 23:01:12 PDT
> > I thought the opposite was the goal. Is this accurate? Alexey is right. My description was wrong. Fixed it. Sorry for the confusion. I'd appreciate if you folks took another look. Thanks,
WebKit Review Bot
Comment 28 2012-06-20 23:31:06 PDT
Comment on attachment 148733 [details] Patch Attachment 148733 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13030016 New failing tests: media/track/track-language-preference.html
WebKit Review Bot
Comment 29 2012-06-20 23:31:11 PDT
Created attachment 148738 [details] Archive of layout-test-results from ec2-cr-linux-04 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-04 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Hajime Morrita
Comment 30 2012-06-21 02:17:36 PDT
WebKit Review Bot
Comment 31 2012-06-21 05:56:34 PDT
Comment on attachment 148751 [details] Patch Attachment 148751 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13036090 New failing tests: media/track/track-language-preference.html
WebKit Review Bot
Comment 32 2012-06-21 05:56:40 PDT
Created attachment 148777 [details] Archive of layout-test-results from ec2-cr-linux-01 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-01 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Hajime Morrita
Comment 33 2012-06-21 20:40:09 PDT
Jesus Sanchez-Palencia
Comment 34 2012-06-22 05:41:52 PDT
(In reply to comment #33) > Created an attachment (id=148953) [details] > Patch LGTM!
Hajime Morrita
Comment 35 2012-06-24 17:28:30 PDT
(In reply to comment #34) > > LGTM! Thanks! I'd like to hear Alexey's impression. Or find someone who can stamp this a few days later.
Alexey Proskuryakov
Comment 36 2012-06-26 02:10:12 PDT
Looks like a good improvement to me. - internals.allowRoundingHacks(); + internals.settings.allowRoundingHacks(); This specifically I'm not so sure about. Better internal objects don't mean that callers should be using a longer expression just to change a setting. The same lifetime improvements could be made without changing how one invokes settings setters.
Hajime Morrita
Comment 37 2012-06-26 18:21:30 PDT
Hajime Morrita
Comment 38 2012-06-26 18:24:04 PDT
Hi Alexey, thanks for your feedback! (In reply to comment #36) > Looks like a good improvement to me. > > - internals.allowRoundingHacks(); > + internals.settings.allowRoundingHacks(); > > This specifically I'm not so sure about. Better internal objects don't mean that callers should be using a longer expression just to change a setting. The same lifetime improvements could be made without changing how one invokes settings setters. Makes sense. I updated the patch to leave original functions as aliases. Although we no longer need to pass Document as a parameter, such cleanup will come as followup changes.
Hajime Morrita
Comment 39 2012-07-10 22:55:53 PDT
ap: ping?
Alexey Proskuryakov
Comment 40 2012-07-10 23:34:08 PDT
Comment on attachment 149656 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149656&action=review I won't have a chance to review carefully soon, but this has been extensively discussed, and looks like a definitive improvement. > Source/WebCore/testing/Internals.idl:-135 > - boolean hasAutocorrectedMarker(in Document document, in long from, in long length) raises (DOMException); This change is not mentioned in ChangeLog comments. Was this function unused?
Alexey Proskuryakov
Comment 41 2012-07-10 23:34:50 PDT
Comment on attachment 149656 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149656&action=review > Source/WebCore/ChangeLog:8 > + This change Unfinished sentence here.
Hajime Morrita
Comment 42 2012-07-10 23:55:14 PDT
Comment on attachment 149656 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149656&action=review Thanks! I'll land this shortly. >> Source/WebCore/testing/Internals.idl:-135 >> - boolean hasAutocorrectedMarker(in Document document, in long from, in long length) raises (DOMException); > > This change is not mentioned in ChangeLog comments. Was this function unused? Looks like an accidental removal. Will recover bofore landing. Thanks for the catch!
Hajime Morrita
Comment 43 2012-07-11 00:43:33 PDT
Created attachment 151625 [details] Patch for landing
WebKit Review Bot
Comment 44 2012-07-11 01:32:12 PDT
Comment on attachment 151625 [details] Patch for landing Rejecting attachment 151625 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: git/webkit-commit-queue/Source/WebKit/chromium/tools/grit --revision 55 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' 21>At revision 55. ________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' ________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' Updating webkit projects from gyp files... Full output: http://queues.webkit.org/results/13180372
Hajime Morrita
Comment 45 2012-07-11 01:46:13 PDT
Created attachment 151646 [details] Patch for landing
WebKit Review Bot
Comment 46 2012-07-11 04:27:09 PDT
Comment on attachment 151646 [details] Patch for landing Clearing flags on attachment: 151646 Committed r122326: <http://trac.webkit.org/changeset/122326>
WebKit Review Bot
Comment 47 2012-07-11 04:27:17 PDT
All reviewed patches have been landed. Closing bug.
Simon Fraser (smfr)
Comment 48 2012-09-18 16:01:47 PDT
*** Bug 89610 has been marked as a duplicate of this bug. ***
Tony Chang
Comment 49 2013-01-18 10:27:41 PST
*** Bug 87993 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.