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

Side by Side Diff: chrome/service/cloud_print/print_system_win.cc

Issue 8207004: scoped_ptr and new[] don't mix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ffffffffff Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/service/cloud_print/print_system.h" 5 #include "chrome/service/cloud_print/print_system.h"
6 6
7 #include <objidl.h> 7 #include <objidl.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 #if defined(_WIN32_WINNT) 9 #if defined(_WIN32_WINNT)
10 #undef _WIN32_WINNT 10 #undef _WIN32_WINNT
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 NULL); 801 NULL);
802 DCHECK(printer_handle); 802 DCHECK(printer_handle);
803 bool ret = false; 803 bool ret = false;
804 if (printer_handle) { 804 if (printer_handle) {
805 DWORD bytes_needed = 0; 805 DWORD bytes_needed = 0;
806 GetJob(printer_handle, job_id, 1, NULL, 0, &bytes_needed); 806 GetJob(printer_handle, job_id, 1, NULL, 0, &bytes_needed);
807 DWORD last_error = GetLastError(); 807 DWORD last_error = GetLastError();
808 if (ERROR_INVALID_PARAMETER != last_error) { 808 if (ERROR_INVALID_PARAMETER != last_error) {
809 // ERROR_INVALID_PARAMETER normally means that the job id is not valid. 809 // ERROR_INVALID_PARAMETER normally means that the job id is not valid.
810 DCHECK(last_error == ERROR_INSUFFICIENT_BUFFER); 810 DCHECK(last_error == ERROR_INSUFFICIENT_BUFFER);
811 scoped_ptr<BYTE> job_info_buffer(new BYTE[bytes_needed]); 811 scoped_array<BYTE> job_info_buffer(new BYTE[bytes_needed]);
812 if (GetJob(printer_handle, job_id, 1, job_info_buffer.get(), bytes_needed, 812 if (GetJob(printer_handle, job_id, 1, job_info_buffer.get(), bytes_needed,
813 &bytes_needed)) { 813 &bytes_needed)) {
814 JOB_INFO_1 *job_info = 814 JOB_INFO_1 *job_info =
815 reinterpret_cast<JOB_INFO_1 *>(job_info_buffer.get()); 815 reinterpret_cast<JOB_INFO_1 *>(job_info_buffer.get());
816 if (job_info->pStatus) { 816 if (job_info->pStatus) {
817 WideToUTF8(job_info->pStatus, wcslen(job_info->pStatus), 817 WideToUTF8(job_info->pStatus, wcslen(job_info->pStatus),
818 &job_details->status_message); 818 &job_details->status_message);
819 } 819 }
820 job_details->platform_status_flags = job_info->Status; 820 job_details->platform_status_flags = job_info->Status;
821 if ((job_info->Status & JOB_STATUS_COMPLETE) || 821 if ((job_info->Status & JOB_STATUS_COMPLETE) ||
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); 871 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string));
872 return ret; 872 return ret;
873 } 873 }
874 874
875 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( 875 scoped_refptr<PrintSystem> PrintSystem::CreateInstance(
876 const base::DictionaryValue* print_system_settings) { 876 const base::DictionaryValue* print_system_settings) {
877 return new PrintSystemWin; 877 return new PrintSystemWin;
878 } 878 }
879 879
880 } // namespace cloud_print 880 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/browser/external_tab_container_win.cc ('k') | chrome_frame/test/urlmon_moniker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698