summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/printing/print_web_view_helper.h
diff options
context:
space:
mode:
authorivandavid@chromium.org <ivandavid@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-15 21:21:17 +0000
committerivandavid@chromium.org <ivandavid@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-15 21:22:51 +0000
commit4dc0a3b7b1fe7b844a215ecf86fd2b7ad49dab7c (patch)
treee99cf21214787ec5c7bb00b4692fe80a6de9d8bc /chrome/renderer/printing/print_web_view_helper.h
parent4aae9986448ac493c92e84c45080a37c6b2aba00 (diff)
downloadchromium_src-4dc0a3b7b1fe7b844a215ecf86fd2b7ad49dab7c.zip
chromium_src-4dc0a3b7b1fe7b844a215ecf86fd2b7ad49dab7c.tar.gz
chromium_src-4dc0a3b7b1fe7b844a215ecf86fd2b7ad49dab7c.tar.bz2
Defer request to print a PDF when the user initiates the entire frame and the PDF hasn't loaded.
Original fix: https://codereview.chromium.org/427723004/ The original fix was reverted, however it actually shouldn't have been because it was mostly correct. This fix is the same as the old one, with an additional change. The call to DidStopLoading() in Instance::DocumentLoadComplete was moved to an earlier part of the function, causing DidStopLoading to be called before the print preview request. BUG=376969 Review URL: https://codereview.chromium.org/467343003 Cr-Commit-Position: refs/heads/master@{#290010} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/printing/print_web_view_helper.h')
-rw-r--r--chrome/renderer/printing/print_web_view_helper.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/renderer/printing/print_web_view_helper.h b/chrome/renderer/printing/print_web_view_helper.h
index 71ff88c..6c254c8 100644
--- a/chrome/renderer/printing/print_web_view_helper.h
+++ b/chrome/renderer/printing/print_web_view_helper.h
@@ -7,6 +7,7 @@
#include <vector>
+#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
@@ -461,6 +462,12 @@ class PrintWebViewHelper
bool is_loading_;
bool is_scripted_preview_delayed_;
base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_;
+
+ // Used to fix a race condition where the source is a PDF and print preview
+ // hangs because RequestPrintPreview is called before DidStopLoading() is
+ // called. This is a store for the RequestPrintPreview() call and its
+ // parameters so that it can be invoked after DidStopLoading.
+ base::Closure on_stop_loading_closure_;
DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper);
};