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

Side by Side Diff: printing/backend/win_helper.cc

Issue 723743003: Remove implicit conversions from scoped_refptr to T* in printing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « printing/backend/print_backend_win.cc ('k') | 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 "printing/backend/win_helper.h" 5 #include "printing/backend/win_helper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 HRESULT hr = StreamFromPrintTicket(print_ticket, pt_stream.Receive()); 403 HRESULT hr = StreamFromPrintTicket(print_ticket, pt_stream.Receive());
404 if (FAILED(hr)) 404 if (FAILED(hr))
405 return dev_mode.Pass(); 405 return dev_mode.Pass();
406 406
407 HPTPROVIDER provider = NULL; 407 HPTPROVIDER provider = NULL;
408 hr = printing::XPSModule::OpenProvider(printer_name, 1, &provider); 408 hr = printing::XPSModule::OpenProvider(printer_name, 1, &provider);
409 if (SUCCEEDED(hr)) { 409 if (SUCCEEDED(hr)) {
410 ULONG size = 0; 410 ULONG size = 0;
411 DEVMODE* dm = NULL; 411 DEVMODE* dm = NULL;
412 // Use kPTJobScope, because kPTDocumentScope breaks duplex. 412 // Use kPTJobScope, because kPTDocumentScope breaks duplex.
413 hr = printing::XPSModule::ConvertPrintTicketToDevMode(provider, 413 hr = printing::XPSModule::ConvertPrintTicketToDevMode(
414 pt_stream, 414 provider, pt_stream.get(), kUserDefaultDevmode, kPTJobScope, &size, &dm,
415 kUserDefaultDevmode, 415 NULL);
416 kPTJobScope,
417 &size,
418 &dm,
419 NULL);
420 if (SUCCEEDED(hr)) { 416 if (SUCCEEDED(hr)) {
421 // Correct DEVMODE using DocumentProperties. See documentation for 417 // Correct DEVMODE using DocumentProperties. See documentation for
422 // PTConvertPrintTicketToDevMode. 418 // PTConvertPrintTicketToDevMode.
423 dev_mode = CreateDevMode(printer.Get(), dm); 419 dev_mode = CreateDevMode(printer.Get(), dm);
424 printing::XPSModule::ReleaseMemory(dm); 420 printing::XPSModule::ReleaseMemory(dm);
425 } 421 }
426 printing::XPSModule::CloseProvider(provider); 422 printing::XPSModule::CloseProvider(provider);
427 } 423 }
428 return dev_mode.Pass(); 424 return dev_mode.Pass();
429 } 425 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 *canceled = (result == IDCANCEL); 514 *canceled = (result == IDCANCEL);
519 if (result != IDOK) 515 if (result != IDOK)
520 return scoped_ptr<DEVMODE, base::FreeDeleter>(); 516 return scoped_ptr<DEVMODE, base::FreeDeleter>();
521 int size = out->dmSize; 517 int size = out->dmSize;
522 int extra_size = out->dmDriverExtra; 518 int extra_size = out->dmDriverExtra;
523 CHECK_GE(buffer_size, size + extra_size); 519 CHECK_GE(buffer_size, size + extra_size);
524 return out.Pass(); 520 return out.Pass();
525 } 521 }
526 522
527 } // namespace printing 523 } // namespace printing
OLDNEW
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698