Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: chrome/renderer/pepper/ppb_pdf_impl.cc

Issue 23498038: Run a nested message loop so that the browser doesn't hang. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/pepper/ppb_pdf_impl.h" 5 #include "chrome/renderer/pepper/ppb_pdf_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/safe_numerics.h" 9 #include "base/safe_numerics.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 PP_Var message) { 402 PP_Var message) {
403 content::PepperPluginInstance* instance = 403 content::PepperPluginInstance* instance =
404 content::PepperPluginInstance::Get(instance_id); 404 content::PepperPluginInstance::Get(instance_id);
405 if (!instance) 405 if (!instance)
406 return PP_MakeUndefined(); 406 return PP_MakeUndefined();
407 407
408 std::string actual_value; 408 std::string actual_value;
409 scoped_refptr<ppapi::StringVar> message_string( 409 scoped_refptr<ppapi::StringVar> message_string(
410 ppapi::StringVar::FromPPVar(message)); 410 ppapi::StringVar::FromPPVar(message));
411 411
412 instance->GetRenderView()->Send( 412 IPC::SyncMessage* msg = new ChromeViewHostMsg_PDFModalPromptForPassword(
413 new ChromeViewHostMsg_PDFModalPromptForPassword( 413 instance->GetRenderView()->GetRoutingID(),
414 instance->GetRenderView()->GetRoutingID(), 414 message_string->value(),
415 message_string->value(), 415 &actual_value);
416 &actual_value)); 416 msg->EnableMessagePumping();
417 instance->GetRenderView()->Send(msg);
417 418
418 return ppapi::StringVar::StringToPPVar(actual_value); 419 return ppapi::StringVar::StringToPPVar(actual_value);
419 } 420 }
420 421
421 const PPB_PDF ppb_pdf = { 422 const PPB_PDF ppb_pdf = {
422 &GetLocalizedString, 423 &GetLocalizedString,
423 &GetResourceImage, 424 &GetResourceImage,
424 &GetFontFileWithFallback, 425 &GetFontFileWithFallback,
425 &GetFontTableForPrivateFontFile, 426 &GetFontTableForPrivateFontFile,
426 &SearchString, 427 &SearchString,
(...skipping 19 matching lines...) Expand all
446 447
447 // static 448 // static
448 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { 449 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) {
449 #if defined(ENABLE_FULL_PRINTING) 450 #if defined(ENABLE_FULL_PRINTING)
450 WebKit::WebElement element = GetWebElement(instance_id); 451 WebKit::WebElement element = GetWebElement(instance_id);
451 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); 452 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element);
452 if (helper) 453 if (helper)
453 helper->PrintNode(element); 454 helper->PrintNode(element);
454 #endif // ENABLE_FULL_PRINTING 455 #endif // ENABLE_FULL_PRINTING
455 } 456 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698