OLD | NEW |
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/print_backend.h" | 5 #include "printing/backend/print_backend.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 | 10 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 static_cast<http_encryption_t>(encryption), | 233 static_cast<http_encryption_t>(encryption), |
234 cups_blocking == kValueTrue); | 234 cups_blocking == kValueTrue); |
235 } | 235 } |
236 | 236 |
237 int PrintBackendCUPS::GetDests(cups_dest_t** dests) { | 237 int PrintBackendCUPS::GetDests(cups_dest_t** dests) { |
238 if (print_server_url_.is_empty()) { // Use default (local) print server. | 238 if (print_server_url_.is_empty()) { // Use default (local) print server. |
239 // GnuTLS has a genuine small memory leak that is easier to annotate | 239 // GnuTLS has a genuine small memory leak that is easier to annotate |
240 // than suppress. See http://crbug.com/176888#c7 | 240 // than suppress. See http://crbug.com/176888#c7 |
241 // In theory any CUPS function can trigger this leak, but in | 241 // In theory any CUPS function can trigger this leak, but in |
242 // PrintBackendCUPS, this is the most likely spot. | 242 // PrintBackendCUPS, this is the most likely spot. |
243 // TODO(earthdok): remove this once the leak is fixed. | 243 // TODO(eugenis): remove this once the leak is fixed. |
244 ANNOTATE_SCOPED_MEMORY_LEAK; | 244 ANNOTATE_SCOPED_MEMORY_LEAK; |
245 return cupsGetDests(dests); | 245 return cupsGetDests(dests); |
246 } else { | 246 } else { |
247 HttpConnectionCUPS http(print_server_url_, cups_encryption_); | 247 HttpConnectionCUPS http(print_server_url_, cups_encryption_); |
248 http.SetBlocking(blocking_); | 248 http.SetBlocking(blocking_); |
249 return cupsGetDests2(http.http(), dests); | 249 return cupsGetDests2(http.http(), dests); |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 base::FilePath PrintBackendCUPS::GetPPD(const char* name) { | 253 base::FilePath PrintBackendCUPS::GetPPD(const char* name) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 << ", HTTP error: " << http_error; | 294 << ", HTTP error: " << http_error; |
295 base::DeleteFile(ppd_path, false); | 295 base::DeleteFile(ppd_path, false); |
296 ppd_path.clear(); | 296 ppd_path.clear(); |
297 } | 297 } |
298 } | 298 } |
299 } | 299 } |
300 return ppd_path; | 300 return ppd_path; |
301 } | 301 } |
302 | 302 |
303 } // namespace printing | 303 } // namespace printing |
OLD | NEW |