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

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

Issue 8487001: Remove 13 exit time constructors and 3 static initializers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.cc ('k') | printing/pdf_metafile_cg_mac.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) 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 "printing/backend/print_backend.h" 5 #include "printing/backend/print_backend.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <dlfcn.h> 9 #include <dlfcn.h>
10 #include <errno.h> 10 #include <errno.h>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } else { 255 } else {
256 HttpConnectionCUPS http(print_server_url_); 256 HttpConnectionCUPS http(print_server_url_);
257 http.SetBlocking(blocking_); 257 http.SetBlocking(blocking_);
258 return cupsGetDests2(http.http(), dests); 258 return cupsGetDests2(http.http(), dests);
259 } 259 }
260 } 260 }
261 261
262 FilePath PrintBackendCUPS::GetPPD(const char* name) { 262 FilePath PrintBackendCUPS::GetPPD(const char* name) {
263 // cupsGetPPD returns a filename stored in a static buffer in CUPS. 263 // cupsGetPPD returns a filename stored in a static buffer in CUPS.
264 // Protect this code with lock. 264 // Protect this code with lock.
265 static base::Lock ppd_lock; 265 CR_DEFINE_STATIC_LOCAL(base::Lock, ppd_lock, ());
266 base::AutoLock ppd_autolock(ppd_lock); 266 base::AutoLock ppd_autolock(ppd_lock);
267 FilePath ppd_path; 267 FilePath ppd_path;
268 const char* ppd_file_path = NULL; 268 const char* ppd_file_path = NULL;
269 if (print_server_url_.is_empty()) { // Use default (local) print server. 269 if (print_server_url_.is_empty()) { // Use default (local) print server.
270 ppd_file_path = cupsGetPPD(name); 270 ppd_file_path = cupsGetPPD(name);
271 if (ppd_file_path) 271 if (ppd_file_path)
272 ppd_path = FilePath(ppd_file_path); 272 ppd_path = FilePath(ppd_file_path);
273 } else { 273 } else {
274 // cupsGetPPD2 gets stuck sometimes in an infinite time due to network 274 // cupsGetPPD2 gets stuck sometimes in an infinite time due to network
275 // configuration/issues. To prevent that, use non-blocking http connection 275 // configuration/issues. To prevent that, use non-blocking http connection
(...skipping 25 matching lines...) Expand all
301 << ", HTTP error: " << http_error; 301 << ", HTTP error: " << http_error;
302 file_util::Delete(ppd_path, false); 302 file_util::Delete(ppd_path, false);
303 ppd_path.clear(); 303 ppd_path.clear();
304 } 304 }
305 } 305 }
306 } 306 }
307 return ppd_path; 307 return ppd_path;
308 } 308 }
309 309
310 } // namespace printing 310 } // namespace printing
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.cc ('k') | printing/pdf_metafile_cg_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698