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

Unified Diff: chrome/renderer/mock_printer.cc

Issue 7647010: Print preview page selection should not require a rerendering of draft pages. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix win browser_test failures. Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/mock_printer.h ('k') | chrome/renderer/mock_render_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/mock_printer.cc
diff --git a/chrome/renderer/mock_printer.cc b/chrome/renderer/mock_printer.cc
index ac2c77994cde1240d97284b08aa7c46a97c84bbe..4168178316152a31677570adaab37ba2861686e2 100644
--- a/chrome/renderer/mock_printer.cc
+++ b/chrome/renderer/mock_printer.cc
@@ -98,10 +98,17 @@ void MockPrinter::ScriptedPrint(int cookie,
}
void MockPrinter::UpdateSettings(int cookie,
- PrintMsg_PrintPages_Params* params) {
+ PrintMsg_PrintPages_Params* params,
+ const std::vector<int>& pages) {
EXPECT_EQ(document_cookie_, cookie);
memset(params, 0, sizeof(PrintMsg_PrintPages_Params));
Chris Guillory 2011/08/16 20:08:53 Looking at this further I think line is your issue
kmadhusu 2011/08/16 20:53:21 hmm.. interesting.. I tested without the memset li
+ // On Release version, MSVS crashes the application if we try to assign an
+ // empty vector to an empty vector. Always check for empty vector before
+ // assigning it to another vector.
+ if (pages.size() != 0)
+ params->pages = pages;
+
SetPrintParams(&(params->params));
printer_status_ = PRINTER_PRINTING;
}
« no previous file with comments | « chrome/renderer/mock_printer.h ('k') | chrome/renderer/mock_render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698