OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if !defined(OS_MACOSX) | 9 #if !defined(OS_MACOSX) |
10 #include <gcrypt.h> | 10 #include <gcrypt.h> |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 } | 201 } |
202 GURL print_server_url(print_server_url_str.c_str()); | 202 GURL print_server_url(print_server_url_str.c_str()); |
203 return new PrintBackendCUPS(print_server_url); | 203 return new PrintBackendCUPS(print_server_url); |
204 } | 204 } |
205 | 205 |
206 int PrintBackendCUPS::GetDests(cups_dest_t** dests) { | 206 int PrintBackendCUPS::GetDests(cups_dest_t** dests) { |
207 if (print_server_url_.is_empty()) { // Use default (local) print server. | 207 if (print_server_url_.is_empty()) { // Use default (local) print server. |
208 return cupsGetDests(dests); | 208 return cupsGetDests(dests); |
209 } else { | 209 } else { |
210 HttpConnectionCUPS http(print_server_url_); | 210 HttpConnectionCUPS http(print_server_url_); |
211 http.SetBlocking(false); | |
sanjeevr
2010/12/15 23:06:30
Since this is a generic helper, perhaps pass a boo
| |
211 return cupsGetDests2(http.http(), dests); | 212 return cupsGetDests2(http.http(), dests); |
212 } | 213 } |
213 } | 214 } |
214 | 215 |
215 FilePath PrintBackendCUPS::GetPPD(const char* name) { | 216 FilePath PrintBackendCUPS::GetPPD(const char* name) { |
216 // cupsGetPPD returns a filename stored in a static buffer in CUPS. | 217 // cupsGetPPD returns a filename stored in a static buffer in CUPS. |
217 // Protect this code with lock. | 218 // Protect this code with lock. |
218 static Lock ppd_lock; | 219 static Lock ppd_lock; |
219 AutoLock ppd_autolock(ppd_lock); | 220 AutoLock ppd_autolock(ppd_lock); |
220 FilePath ppd_path; | 221 FilePath ppd_path; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 << ", content length: " << content_len; | 254 << ", content length: " << content_len; |
254 file_util::Delete(ppd_path, false); | 255 file_util::Delete(ppd_path, false); |
255 ppd_path.clear(); | 256 ppd_path.clear(); |
256 } | 257 } |
257 } | 258 } |
258 } | 259 } |
259 return ppd_path; | 260 return ppd_path; |
260 } | 261 } |
261 | 262 |
262 } // namespace printing | 263 } // namespace printing |
OLD | NEW |