summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 17:36:45 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 17:36:45 +0000
commit98894c33ef4fadaee7ee6db5a3b63f88608bb787 (patch)
tree68f591a2c6805bcbed6aacdbaff2d1fd01db649e /chrome
parent77cfd93acd54bffec8423e269dcd9132a3658102 (diff)
downloadchromium_src-98894c33ef4fadaee7ee6db5a3b63f88608bb787.zip
chromium_src-98894c33ef4fadaee7ee6db5a3b63f88608bb787.tar.gz
chromium_src-98894c33ef4fadaee7ee6db5a3b63f88608bb787.tar.bz2
Merge 283837 "Ensure pdf plugin sends DidStartLoading() consiste..."
> Ensure pdf plugin sends DidStartLoading() consistently > > There are situations where the pdf plugin will initialize itself in such a way > that it never notifies content/renderer/ that it has started. In so doing, it > also fails to send a stop message, since it tries to ensure it doesn't send > mismatched start/stop messages. > > Print preview decides when to display the preview based on when loading > stops. Since this only considers the page's content and not the pdf plugin's > initialization, there is a race condition where we may try to preview before > the plugin is ready. In this cases, we show "Loading preivew..." and never load > the actual preview. > > There is a hack in place in print_preview_web_helper.cc to delay the process of > showing the preview to maximize the chance that the pdf plugin will be ready. > This change should allow us to rip that out. > > BUG=376969 > > Review URL: https://codereview.chromium.org/397713005 TBR=japhet@chromium.org Review URL: https://codereview.chromium.org/414773002 git-svn-id: svn://svn.chromium.org/chrome/branches/2062/src@284979 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/printing/print_web_view_helper.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc
index 22005ec..47bc09ee 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/chrome/renderer/printing/print_web_view_helper.cc
@@ -1703,13 +1703,10 @@ void PrintWebViewHelper::RequestPrintPreview(PrintPreviewRequestType type) {
// |is_modifiable| value until they are fully loaded, which occurs when
// DidStopLoading() is called. Defer showing the preview until then.
} else {
- // TODO(japhet): This delay is a terrible hack. See crbug.com/376969
- // for the motivation.
- base::MessageLoop::current()->PostDelayedTask(
+ base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&PrintWebViewHelper::ShowScriptedPrintPreview,
- weak_ptr_factory_.GetWeakPtr()),
- base::TimeDelta::FromMilliseconds(100));
+ weak_ptr_factory_.GetWeakPtr()));
}
IPC::SyncMessage* msg =
new PrintHostMsg_SetupScriptedPrintPreview(routing_id());