summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 04:55:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 04:55:52 +0000
commit20305ec6f1acf21392c2f3938a14a96f1e28e76d (patch)
tree6eff1f7be4bad1a1362d3466f0ac59292dc51acc /printing
parentc6e8346b56ab61b35845aefcf9b241c654fe1253 (diff)
downloadchromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.zip
chromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.tar.gz
chromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.tar.bz2
Remove obsolete base/lock.h and fix up callers to use the new header file and
the base namespace. Fix several files including lock.h unnecessarily. BUG=none TEST=none Original review=http://codereview.chromium.org/6142009/ Patch by leviw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/backend/print_backend_cups.cc6
-rw-r--r--printing/printed_document.cc16
-rw-r--r--printing/printed_document.h4
-rw-r--r--printing/printed_document_cairo.cc2
-rw-r--r--printing/printed_document_mac.cc2
-rw-r--r--printing/printed_document_win.cc2
6 files changed, 16 insertions, 16 deletions
diff --git a/printing/backend/print_backend_cups.cc b/printing/backend/print_backend_cups.cc
index 90f2d33..01aa18d 100644
--- a/printing/backend/print_backend_cups.cc
+++ b/printing/backend/print_backend_cups.cc
@@ -13,9 +13,9 @@
#include "base/file_util.h"
#include "base/lazy_instance.h"
-#include "base/lock.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
+#include "base/synchronization/lock.h"
#include "base/values.h"
#include "googleurl/src/gurl.h"
#include "printing/backend/cups_helper.h"
@@ -220,8 +220,8 @@ int PrintBackendCUPS::GetDests(cups_dest_t** dests) {
FilePath PrintBackendCUPS::GetPPD(const char* name) {
// cupsGetPPD returns a filename stored in a static buffer in CUPS.
// Protect this code with lock.
- static Lock ppd_lock;
- AutoLock ppd_autolock(ppd_lock);
+ static base::Lock ppd_lock;
+ base::AutoLock ppd_autolock(ppd_lock);
FilePath ppd_path;
const char* ppd_file_path = NULL;
if (print_server_url_.is_empty()) { // Use default (local) print server.
diff --git a/printing/printed_document.cc b/printing/printed_document.cc
index f50bf83..0360b5b 100644
--- a/printing/printed_document.cc
+++ b/printing/printed_document.cc
@@ -78,7 +78,7 @@ void PrintedDocument::SetPage(int page_number,
page_rect,
has_visible_overlays));
{
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
mutable_.pages_[page_number] = page;
if (mutable_.shrink_factor == 0) {
mutable_.shrink_factor = shrink;
@@ -91,7 +91,7 @@ void PrintedDocument::SetPage(int page_number,
bool PrintedDocument::GetPage(int page_number,
scoped_refptr<PrintedPage>* page) {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
PrintedPages::const_iterator itr = mutable_.pages_.find(page_number);
if (itr != mutable_.pages_.end()) {
if (itr->second.get()) {
@@ -103,7 +103,7 @@ bool PrintedDocument::GetPage(int page_number,
}
bool PrintedDocument::IsComplete() const {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
if (!mutable_.page_count_)
return false;
PageNumber page(immutable_.settings_, mutable_.page_count_);
@@ -119,14 +119,14 @@ bool PrintedDocument::IsComplete() const {
}
void PrintedDocument::DisconnectSource() {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
mutable_.source_ = NULL;
}
uint32 PrintedDocument::MemoryUsage() const {
std::vector< scoped_refptr<PrintedPage> > pages_copy;
{
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
pages_copy.reserve(mutable_.pages_.size());
PrintedPages::const_iterator end = mutable_.pages_.end();
for (PrintedPages::const_iterator itr = mutable_.pages_.begin();
@@ -144,7 +144,7 @@ uint32 PrintedDocument::MemoryUsage() const {
}
void PrintedDocument::set_page_count(int max_page) {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
DCHECK_EQ(0, mutable_.page_count_);
mutable_.page_count_ = max_page;
if (immutable_.settings_.ranges.empty()) {
@@ -157,12 +157,12 @@ void PrintedDocument::set_page_count(int max_page) {
}
int PrintedDocument::page_count() const {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
return mutable_.page_count_;
}
int PrintedDocument::expected_page_count() const {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
return mutable_.expected_page_count_;
}
diff --git a/printing/printed_document.h b/printing/printed_document.h
index c471b80..599d453 100644
--- a/printing/printed_document.h
+++ b/printing/printed_document.h
@@ -7,10 +7,10 @@
#include <map>
-#include "base/lock.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/string16.h"
+#include "base/synchronization/lock.h"
#include "gfx/native_widget_types.h"
#include "googleurl/src/gurl.h"
#include "printing/print_settings.h"
@@ -194,7 +194,7 @@ class PrintedDocument : public base::RefCountedThreadSafe<PrintedDocument> {
// All writable data member access must be guarded by this lock. Needs to be
// mutable since it can be acquired from const member functions.
- mutable Lock lock_;
+ mutable base::Lock lock_;
// All the mutable members.
Mutable mutable_;
diff --git a/printing/printed_document_cairo.cc b/printing/printed_document_cairo.cc
index 76085e1..d24fef9 100644
--- a/printing/printed_document_cairo.cc
+++ b/printing/printed_document_cairo.cc
@@ -17,7 +17,7 @@ void PrintedDocument::RenderPrintedPage(
#ifndef NDEBUG
{
// Make sure the page is from our list.
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get());
}
#endif
diff --git a/printing/printed_document_mac.cc b/printing/printed_document_mac.cc
index 3c5a401..2651516 100644
--- a/printing/printed_document_mac.cc
+++ b/printing/printed_document_mac.cc
@@ -18,7 +18,7 @@ void PrintedDocument::RenderPrintedPage(
#ifndef NDEBUG
{
// Make sure the page is from our list.
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get());
}
#endif
diff --git a/printing/printed_document_win.cc b/printing/printed_document_win.cc
index 892de34..0cd0bb9 100644
--- a/printing/printed_document_win.cc
+++ b/printing/printed_document_win.cc
@@ -43,7 +43,7 @@ void PrintedDocument::RenderPrintedPage(
#ifndef NDEBUG
{
// Make sure the page is from our list.
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get());
}
#endif