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

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

Issue 2870263002: Rename ScopedComPtr::Receive to ScopedComPtr::GetAddressOf (Closed)
Patch Set: Rebase to 2a6f440 Created 3 years, 7 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 | « printing/backend/print_backend_win.cc ('k') | remoting/host/audio_capturer_win.cc » ('j') | 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 if (!xps_initializer.initialized()) { 398 if (!xps_initializer.initialized()) {
399 // TODO(sanjeevr): Handle legacy proxy case (with no prntvpt.dll) 399 // TODO(sanjeevr): Handle legacy proxy case (with no prntvpt.dll)
400 return dev_mode; 400 return dev_mode;
401 } 401 }
402 402
403 printing::ScopedPrinterHandle printer; 403 printing::ScopedPrinterHandle printer;
404 if (!printer.OpenPrinter(printer_name.c_str())) 404 if (!printer.OpenPrinter(printer_name.c_str()))
405 return dev_mode; 405 return dev_mode;
406 406
407 base::win::ScopedComPtr<IStream> pt_stream; 407 base::win::ScopedComPtr<IStream> pt_stream;
408 HRESULT hr = StreamFromPrintTicket(print_ticket, pt_stream.Receive()); 408 HRESULT hr = StreamFromPrintTicket(print_ticket, pt_stream.GetAddressOf());
409 if (FAILED(hr)) 409 if (FAILED(hr))
410 return dev_mode; 410 return dev_mode;
411 411
412 HPTPROVIDER provider = NULL; 412 HPTPROVIDER provider = NULL;
413 hr = printing::XPSModule::OpenProvider(printer_name, 1, &provider); 413 hr = printing::XPSModule::OpenProvider(printer_name, 1, &provider);
414 if (SUCCEEDED(hr)) { 414 if (SUCCEEDED(hr)) {
415 ULONG size = 0; 415 ULONG size = 0;
416 DEVMODE* dm = NULL; 416 DEVMODE* dm = NULL;
417 // Use kPTJobScope, because kPTDocumentScope breaks duplex. 417 // Use kPTJobScope, because kPTDocumentScope breaks duplex.
418 hr = printing::XPSModule::ConvertPrintTicketToDevMode( 418 hr = printing::XPSModule::ConvertPrintTicketToDevMode(
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 *canceled = (result == IDCANCEL); 553 *canceled = (result == IDCANCEL);
554 if (result != IDOK) 554 if (result != IDOK)
555 return std::unique_ptr<DEVMODE, base::FreeDeleter>(); 555 return std::unique_ptr<DEVMODE, base::FreeDeleter>();
556 int size = out->dmSize; 556 int size = out->dmSize;
557 int extra_size = out->dmDriverExtra; 557 int extra_size = out->dmDriverExtra;
558 CHECK_GE(buffer_size, size + extra_size); 558 CHECK_GE(buffer_size, size + extra_size);
559 return out; 559 return out;
560 } 560 }
561 561
562 } // namespace printing 562 } // namespace printing
OLDNEW
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | remoting/host/audio_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698