• ivandavid@chromium.org's avatar
    Revert of Fix for race condition where print preview hangs when attempting to... · b07c4c92
    ivandavid@chromium.org authored
    Revert of Fix for race condition where print preview hangs when attempting to print a PDF that hasn't loaded. (https://codereview.chromium.org/427723004/)
    
    Reason for revert:
    The changes fix an issue, but cause a more serious one. 
    
    crbug.com/402402
    
    Original issue's description:
    > Fix for race condition where print preview hangs when attempting to print a PDF that hasn't loaded.
    > 
    > If |type| in RequestPrintPreview() equals PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME and |is_loading_| is true, RequestPrintPreview() returns,
    > then is called again, right after |is_loading_| is set to false in DidStopLoading(). 
    > 
    > 
    > BUG=376969
    > TEST=See bug for steps to reproduce.
    > 
    > Additional way to reproduce:
    > Build blink_tests and browser_tests in out/Release. Then in src/webkit/tools/layout_tests run this command:
    > ./run_webkit_tests.py --platform browser_test.linux source_pdf/
    > 
    > you can replace linux with win or mac depending on your platform.
    > 
    > The program will attempt to save a PDF as a PDF through print preview. It will eventually fail because Print Preview will hang due to this bug.
    > If you want visual confirmation that this will happen open:
    > src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver.py.
    > 
    > Then add this line of code to the function cmd_line.
    > cmd.append('--enable-pixel-output-in-tests')
    > 
    > Then run the script again. Enabling pixel output will also make it significantly more likely for the bug to occur.
    > Its also more likely to happen on windows for some reason.
    > 
    > This is how I came across the bug.
    > 
    > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287982
    
    Review URL: https://codereview.chromium.org/463123004
    
    Cr-Commit-Position: refs/heads/master@{#289181}
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289181 0039d316-1c4b-4281-b951-d872f2087c98
    b07c4c92
print_web_view_helper.h 16.8 KB