|
|
Chromium Code Reviews
DescriptionMove PrintBrowser from SPV2 to SPV1
This patch removed the dependancy of PrintBrowser on SPV2 and moves it
over to stable SPV1.
CL for SPV2 here: https://codereview.chromium.org/2672983003
Design Doc here: https://docs.google.com/document/d/1G2RoH7yiwh_vosEHsHTwqETBvt2ij8p9ov0D3kIz4ww/edit
BUG=699518
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url: https://codereview.chromium.org/2802903002
Cr-Commit-Position: refs/heads/master@{#464875}
Committed: https://chromium.googlesource.com/chromium/src/+/aca9ff5295e91d1bba92e50285bf1ee2893de5e4
Patch Set 1 #Patch Set 2 : Only call PrintContext::end() if we are exiting Print mode not PrintBrowser mode #
Total comments: 2
Patch Set 3 : In the case of PrintBrowser PrintContext::end should not relayout. It should retain layout as is. #
Total comments: 4
Patch Set 4 : Clear the PrintContext when disposing of the FrameView #
Messages
Total messages: 32 (19 generated)
Description was changed from ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. BUG=699518 ========== to ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. BUG=699518 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ==========
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. BUG=699518 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ========== to ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. CL for SPV2 here: https://codereview.chromium.org/2672983003 Design Doc here: https://docs.google.com/document/d/1G2RoH7yiwh_vosEHsHTwqETBvt2ij8p9ov0D3kIz4... Added thestig@ as FYI. BUG=699518 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ==========
nainar@chromium.org changed reviewers: + pdr@chromium.org
Description was changed from ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. CL for SPV2 here: https://codereview.chromium.org/2672983003 Design Doc here: https://docs.google.com/document/d/1G2RoH7yiwh_vosEHsHTwqETBvt2ij8p9ov0D3kIz4... Added thestig@ as FYI. BUG=699518 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ========== to ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. CL for SPV2 here: https://codereview.chromium.org/2672983003 Design Doc here: https://docs.google.com/document/d/1G2RoH7yiwh_vosEHsHTwqETBvt2ij8p9ov0D3kIz4... BUG=699518 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
pdr, Could you PTAL?
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/04/06 at 19:42:56, nainar wrote: > pdr, > > Could you PTAL? LGTM
https://codereview.chromium.org/2802903002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/frame/FrameView.cpp (left): https://codereview.chromium.org/2802903002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/frame/FrameView.cpp:2969: m_printContext->end(); Did you mean to remove this? I think we still want to leave this. https://codereview.chromium.org/2802903002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/page/PrintContext.cpp (right): https://codereview.chromium.org/2802903002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/page/PrintContext.cpp:48: if (m_isPrinting && !RuntimeEnabledFeatures::printBrowserEnabled()) Ditto here. I think we should remove the changes to this line.
Hi pdr, Taking a look at the LocalFrame::SetPrinting() code we shouldn't be "relayouting" the code when you call PrintContext::end() if you are in PrintBrowser mode. This is as we want to retain the PrintBrowser layout for as long as the tab is open. I have edited LocalFrame::SetPrinting to reflect my understanding let me know if this sounds hacky and naive. Ran a bunch of Wikipedia pages and browsed Facebook for a total time of 10 minutes. Seems stable.
https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/frame/LocalFrame.cpp:603: } else if (!RuntimeEnabledFeatures::printBrowserEnabled()) { I see what you mean. Hmm... I don't know this code super well but it looks like we'll go through the ShouldUsePrintingLayout() codepath sometimes (for the main frame) when print browsing is enabled, and that also causes a layout. Do we need to prevent that layout as well? Is the codechange here just an optimization to not call SetPreferredLogicalWidthsDirty/SetNeedsLayout/SetShouldDoFullPaintInvalidationForViewAndAllDescendants? Is this change necessary for this patch? I wonder if we could defer that to a followup?
https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/frame/LocalFrame.cpp:603: } else if (!RuntimeEnabledFeatures::printBrowserEnabled()) { On 2017/04/14 at 23:28:04, pdr. wrote: > I see what you mean. Hmm... I don't know this code super well but it looks like we'll go through the ShouldUsePrintingLayout() codepath sometimes (for the main frame) when print browsing is enabled, and that also causes a layout. Do we need to prevent that layout as well? No we want that layout to happen so that we force layout to get the pagination > Is the codechange here just an optimization to not call SetPreferredLogicalWidthsDirty/SetNeedsLayout/SetShouldDoFullPaintInvalidationForViewAndAllDescendants? No its an optimization to not call UpdateLayout() > Is this change necessary for this patch? I wonder if we could defer that to a followup? Can pull it into a dependant patchset however PrintBrowser will not work without this change. Will crash every so often. Happy to pull it into a separate patch though.
https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/frame/LocalFrame.cpp:603: } else if (!RuntimeEnabledFeatures::printBrowserEnabled()) { On 2017/04/14 at 23:43:33, nainar wrote: > On 2017/04/14 at 23:28:04, pdr. wrote: > > I see what you mean. Hmm... I don't know this code super well but it looks like we'll go through the ShouldUsePrintingLayout() codepath sometimes (for the main frame) when print browsing is enabled, and that also causes a layout. Do we need to prevent that layout as well? > > No we want that layout to happen so that we force layout to get the pagination > > > Is the codechange here just an optimization to not call SetPreferredLogicalWidthsDirty/SetNeedsLayout/SetShouldDoFullPaintInvalidationForViewAndAllDescendants? > > No its an optimization to not call UpdateLayout() Couldn't UpdateLayout get called later? SetPrinting is called from FrameView::SetupPrintContext() which later calls UpdateStyleAndLayoutIfNeededRecursive. In general we can get UpdateLayout called at random times from javascript. > > > Is this change necessary for this patch? I wonder if we could defer that to a followup? > > Can pull it into a dependant patchset however PrintBrowser will not work without this change. Will crash every so often. Happy to pull it into a separate patch though. What's the crash?
https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/2802903002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/frame/LocalFrame.cpp:603: } else if (!RuntimeEnabledFeatures::printBrowserEnabled()) { On 2017/04/14 at 23:54:00, pdr. wrote: > On 2017/04/14 at 23:43:33, nainar wrote: > > On 2017/04/14 at 23:28:04, pdr. wrote: > > > I see what you mean. Hmm... I don't know this code super well but it looks like we'll go through the ShouldUsePrintingLayout() codepath sometimes (for the main frame) when print browsing is enabled, and that also causes a layout. Do we need to prevent that layout as well? > > > > No we want that layout to happen so that we force layout to get the pagination > > > > > Is the codechange here just an optimization to not call SetPreferredLogicalWidthsDirty/SetNeedsLayout/SetShouldDoFullPaintInvalidationForViewAndAllDescendants? > > > > No its an optimization to not call UpdateLayout() > > Couldn't UpdateLayout get called later? SetPrinting is called from FrameView::SetupPrintContext() which later calls UpdateStyleAndLayoutIfNeededRecursive. In general we can get UpdateLayout called at random times from javascript. Yup, I see what you mean - we can indeed force a Layout update from JS and NeedsLayout is true in UpdateStyleAndLayoutIfNeededRecursive() calling UpdateLayout there too. > > > > > > Is this change necessary for this patch? I wonder if we could defer that to a followup? > > > > Can pull it into a dependant patchset however PrintBrowser will not work without this change. Will crash every so often. Happy to pull it into a separate patch though. > > What's the crash? Sorry for the giant wall of text... Visiting https://wikipedia.org/wiki/Passports with --enable-print-browser gets you this: [38303:775:0414/165915.090642:275688420149106:FATAL:ThreadState.h(541)] Check failed: !state->SweepForbidden(). 0 libbase.dylib 0x0000000117c5bfae base::debug::StackTrace::StackTrace(unsigned long) + 174 1 libbase.dylib 0x0000000117c5c04d base::debug::StackTrace::StackTrace(unsigned long) + 29 2 libbase.dylib 0x0000000117c5a4ac base::debug::StackTrace::StackTrace() + 28 3 libbase.dylib 0x0000000117cf9130 logging::LogMessage::~LogMessage() + 80 4 libbase.dylib 0x0000000117cf6c35 logging::LogMessage::~LogMessage() + 21 5 libblink_platform.dylib 0x000000012307c318 blink::ThreadState::PrefinalizerRegistration<blink::ResourceFetcher>::PrefinalizerRegistration(blink::ResourceFetcher*) + 360 6 libblink_platform.dylib 0x000000012306e01d blink::ThreadState::PrefinalizerRegistration<blink::ResourceFetcher>::PrefinalizerRegistration(blink::ResourceFetcher*) + 29 7 libblink_platform.dylib 0x000000012306dcbf blink::ResourceFetcher::ResourceFetcher(blink::FetchContext*) + 95 8 libblink_platform.dylib 0x000000012306e3ad blink::ResourceFetcher::ResourceFetcher(blink::FetchContext*) + 29 9 libblink_core.dylib 0x000000012673389b blink::ResourceFetcher::Create(blink::FetchContext*) + 43 10 libblink_core.dylib 0x000000012782a529 blink::FrameFetchContext::CreateFetcherFromDocumentLoader(blink::DocumentLoader*) + 57 11 libblink_core.dylib 0x000000012782a060 blink::DocumentLoader::DocumentLoader(blink::LocalFrame*, blink::ResourceRequest const&, blink::SubstituteData const&, blink::ClientRedirectPolicy) + 208 12 libblink_core.dylib 0x000000012782a675 blink::DocumentLoader::DocumentLoader(blink::LocalFrame*, blink::ResourceRequest const&, blink::SubstituteData const&, blink::ClientRedirectPolicy) + 53 13 libblink_core.dylib 0x0000000127851e00 blink::DocumentLoader::Create(blink::LocalFrame*, blink::ResourceRequest const&, blink::SubstituteData const&, blink::ClientRedirectPolicy) + 256 14 libblink_core.dylib 0x0000000127851cc1 blink::EmptyLocalFrameClient::CreateDocumentLoader(blink::LocalFrame*, blink::ResourceRequest const&, blink::SubstituteData const&, blink::ClientRedirectPolicy) + 241 15 libblink_core.dylib 0x0000000127860cbe blink::FrameLoader::Init() + 286 16 libblink_core.dylib 0x0000000126d62ce7 blink::LocalFrame::Init() + 343 17 libblink_core.dylib 0x0000000127c6f0eb blink::SVGImage::DataChanged(bool) + 1851 18 libblink_platform.dylib 0x00000001229ff812 blink::Image::SetData(WTF::PassRefPtr<blink::SharedBuffer>, bool) + 210 19 libblink_core.dylib 0x00000001278eb5ef blink::ImageResourceContent::UpdateImage(WTF::PassRefPtr<blink::SharedBuffer>, blink::ImageResourceContent::UpdateImageOption, bool) + 1231 20 libblink_core.dylib 0x00000001278e23da blink::ImageResource::UpdateImage(WTF::PassRefPtr<blink::SharedBuffer>, blink::ImageResourceContent::UpdateImageOption, bool) + 106 21 libblink_core.dylib 0x00000001278e356d blink::ImageResource::Finish(double) + 173 22 libblink_platform.dylib 0x000000012307021c blink::Resource::Finish() + 28 23 libblink_platform.dylib 0x000000012306fe99 blink::ResourceFetcher::ResourceForStaticData(blink::FetchParameters const&, blink::ResourceFactory const&, blink::SubstituteData const&) + 2041 24 libblink_platform.dylib 0x0000000123072e3e blink::ResourceFetcher::RequestResource(blink::FetchParameters&, blink::ResourceFactory const&, blink::SubstituteData const&) + 1374 25 libblink_core.dylib 0x00000001278e131e blink::ImageResource::Fetch(blink::FetchParameters&, blink::ResourceFetcher*) + 574 26 libblink_core.dylib 0x00000001278e898d blink::ImageResourceContent::Fetch(blink::FetchParameters&, blink::ResourceFetcher*) + 29 27 libblink_core.dylib 0x00000001263fc570 blink::CSSImageValue::CacheImage(blink::Document const&, blink::CrossOriginAttributeValue) + 560 28 libblink_core.dylib 0x00000001266394c5 blink::ElementStyleResources::LoadPendingImage(blink::ComputedStyle*, blink::StylePendingImage*, blink::CrossOriginAttributeValue) + 149 29 libblink_core.dylib 0x0000000126639d7c blink::ElementStyleResources::LoadPendingImages(blink::ComputedStyle*) + 1292 30 libblink_core.dylib 0x000000012663a99f blink::ElementStyleResources::LoadPendingResources(blink::ComputedStyle*) + 47 31 libblink_core.dylib 0x000000012667f912 blink::StyleResolver::LoadPendingResources(blink::StyleResolverState&) + 50 32 libblink_core.dylib 0x00000001266867c9 blink::StyleResolver::ApplyMatchedStandardProperties(blink::StyleResolverState&, blink::MatchResult const&, blink::StyleResolver::CacheSuccess const&, blink::StyleResolver::NeedsApplyPass&) + 1913 33 libblink_core.dylib 0x0000000126680f92 blink::StyleResolver::ApplyMatchedPropertiesAndCustomPropertyAnimations(blink::StyleResolverState&, blink::MatchResult const&, blink::Element const*) + 370 34 libblink_core.dylib 0x0000000126680477 blink::StyleResolver::StyleForElement(blink::Element*, blink::ComputedStyle const*, blink::ComputedStyle const*, blink::StyleSharingBehavior, blink::RuleMatchingBehavior) + 2903 35 libblink_core.dylib 0x00000001267fe746 blink::Element::OriginalStyleForLayoutObject() + 310 36 libblink_core.dylib 0x00000001267fe36d blink::Element::StyleForLayoutObject() + 461 37 libblink_core.dylib 0x00000001267ff348 blink::Element::RecalcOwnStyle(blink::StyleRecalcChange) + 840 38 libblink_core.dylib 0x00000001267fec7c blink::Element::RecalcStyle(blink::StyleRecalcChange) + 1084 39 libblink_core.dylib 0x00000001266f1a96 blink::ContainerNode::RecalcDescendantStyles(blink::StyleRecalcChange) + 758 40 libblink_core.dylib 0x00000001267fee05 blink::Element::RecalcStyle(blink::StyleRecalcChange) + 1477 41 libblink_core.dylib 0x00000001266f1a96 blink::ContainerNode::RecalcDescendantStyles(blink::StyleRecalcChange) + 758 42 libblink_core.dylib 0x00000001267fee05 blink::Element::RecalcStyle(blink::StyleRecalcChange) + 1477 43 libblink_core.dylib 0x00000001266f1a96 blink::ContainerNode::RecalcDescendantStyles(blink::StyleRecalcChange) + 758 44 libblink_core.dylib 0x00000001267fee05 blink::Element::RecalcStyle(blink::StyleRecalcChange) + 1477 45 libblink_core.dylib 0x00000001266f1a96 blink::ContainerNode::RecalcDescendantStyles(blink::StyleRecalcChange) + 758 46 libblink_core.dylib 0x00000001267fee05 blink::Element::RecalcStyle(blink::StyleRecalcChange) + 1477 47 libblink_core.dylib 0x00000001266f1a96 blink::ContainerNode::RecalcDescendantStyles(blink::StyleRecalcChange) + 758 48 libblink_core.dylib 0x00000001267fee05 blink::Element::RecalcStyle(blink::StyleRecalcChange) + 1477 49 libblink_core.dylib 0x0000000126743040 blink::Document::UpdateStyle() + 1408 50 libblink_core.dylib 0x000000012673db38 blink::Document::UpdateStyleAndLayoutTree() + 1320 51 libblink_core.dylib 0x0000000126cd03c4 blink::FrameView::PerformPreLayoutTasks() + 724 52 libblink_core.dylib 0x0000000126ccd712 blink::FrameView::UpdateLayout() + 1634 53 libblink_core.dylib 0x0000000126d6567d blink::LocalFrame::SetPrinting(bool, blink::FloatSize const&, blink::FloatSize const&, float) + 317 54 libblink_core.dylib 0x000000012794e023 blink::PrintContext::end() + 275 55 libblink_core.dylib 0x000000012794d169 blink::PrintContext::~PrintContext() + 57 56 libblink_core.dylib 0x000000012794d1b5 blink::PrintContext::~PrintContext() + 21 57 libblink_core.dylib 0x0000000126d00963 blink::GarbageCollectedFinalized<blink::PrintContext>::FinalizeGarbageCollectedObject() + 35 58 libblink_core.dylib 0x0000000126d00935 blink::FinalizerTraitImpl<blink::PrintContext, true>::Finalize(void*) + 21 59 libblink_core.dylib 0x0000000126d00915 blink::FinalizerTrait<blink::PrintContext>::Finalize(void*) + 21 60 libblink_platform.dylib 0x0000000122ffa801 blink::HeapObjectHeader::Finalize(unsigned char*, unsigned long) + 97 61 libblink_platform.dylib 0x0000000123003063 blink::NormalPage::Sweep() + 819
I think this is a lifetime bug--we're destroying the FrameView that owns the print context, then later running the print context's destructor during garbage collection. Maybe we could add ClearPrintContext() to FrameView::Dispose() to fix this.
The CQ bit was checked by nainar@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/04/15 at 01:28:36, pdr wrote: > I think this is a lifetime bug--we're destroying the FrameView that owns the print context, then later running the print context's destructor during garbage collection. Maybe we could add ClearPrintContext() to FrameView::Dispose() to fix this. Yes! It does fix it. Uploaded a new patch with your fix. Thank you!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
LGTM
The CQ bit was checked by nainar@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 60001, "attempt_start_ts": 1492299166099230,
"parent_rev": "c226012b866b916e187030737404c6ed6ccfe15a", "commit_rev":
"aca9ff5295e91d1bba92e50285bf1ee2893de5e4"}
Message was sent while issue was closed.
Description was changed from ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. CL for SPV2 here: https://codereview.chromium.org/2672983003 Design Doc here: https://docs.google.com/document/d/1G2RoH7yiwh_vosEHsHTwqETBvt2ij8p9ov0D3kIz4... BUG=699518 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ========== to ========== Move PrintBrowser from SPV2 to SPV1 This patch removed the dependancy of PrintBrowser on SPV2 and moves it over to stable SPV1. CL for SPV2 here: https://codereview.chromium.org/2672983003 Design Doc here: https://docs.google.com/document/d/1G2RoH7yiwh_vosEHsHTwqETBvt2ij8p9ov0D3kIz4... BUG=699518 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2802903002 Cr-Commit-Position: refs/heads/master@{#464875} Committed: https://chromium.googlesource.com/chromium/src/+/aca9ff5295e91d1bba92e50285bf... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/aca9ff5295e91d1bba92e50285bf... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
