Bug 951207 - Rename the chromium LOG macro to CHROMIUM_LOG; r=bent
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Tue, 17 Dec 2013 13:26:45 -0500
changeset 171131 9defe3666015ff19e25719e2a74ea36ca49f33fc
parent 171071 f542c81e7e31ebff879ad1a5983f8d99230cfa8f
child 171132 767fa53324158383c0e5581c24453f850f3dbf54
push idunknown
push userunknown
push dateunknown
reviewersbent
bugs951207
milestone29.0a1
Bug 951207 - Rename the chromium LOG macro to CHROMIUM_LOG; r=bent
ipc/chromium/src/base/chrome_application_mac.mm
ipc/chromium/src/base/debug_util_win.cc
ipc/chromium/src/base/file_util_posix.cc
ipc/chromium/src/base/file_util_win.cc
ipc/chromium/src/base/histogram.cc
ipc/chromium/src/base/logging.h
ipc/chromium/src/base/process_util_mac.mm
ipc/chromium/src/base/process_util_posix.cc
ipc/chromium/src/base/scoped_temp_dir.cc
ipc/chromium/src/base/stats_table.cc
ipc/chromium/src/base/system_monitor.cc
ipc/chromium/src/base/system_monitor_win.cc
ipc/chromium/src/chrome/common/chrome_switches.cc
ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
ipc/chromium/src/chrome/common/ipc_channel_posix.cc
ipc/chromium/src/chrome/common/ipc_channel_win.cc
ipc/chromium/src/chrome/common/mach_message_source_mac.cc
ipc/chromium/src/chrome/common/notification_service.cc
ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc
ipc/chromium/src/chrome/common/transport_dib_win.cc
ipc/dbus/DBusThread.cpp
ipc/dbus/DBusUtils.cpp
ipc/dbus/RawDBusConnection.cpp
ipc/glue/GeckoChildProcessHost.cpp
ipc/keystore/KeyStore.cpp
ipc/netd/Netd.cpp
ipc/nfc/Nfc.cpp
ipc/ril/Ril.cpp
ipc/unixsocket/UnixSocket.cpp
--- a/ipc/chromium/src/base/chrome_application_mac.mm
+++ b/ipc/chromium/src/base/chrome_application_mac.mm
@@ -16,18 +16,18 @@
 @synthesize handlingSendEvent = handlingSendEvent_;
 
 // Initialize NSApplication using the custom subclass.  Check whether NSApp
 // was already initialized using another class, because that would break
 // some things.
 + (NSApplication*)sharedApplication {
   NSApplication* app = [super sharedApplication];
   if (![NSApp isKindOfClass:self]) {
-    LOG(ERROR) << "NSApp should be of type " << [[self className] UTF8String]
-               << ", not " << [[NSApp className] UTF8String];
+    CHROMIUM_LOG(ERROR) << "NSApp should be of type " << [[self className] UTF8String]
+                        << ", not " << [[NSApp className] UTF8String];
     DCHECK(false) << "NSApp is of wrong type";
   }
   return app;
 }
 
 - (id)init {
   if ((self = [super init])) {
     eventHooks_.reset([[NSMutableArray alloc] init]);
--- a/ipc/chromium/src/base/debug_util_win.cc
+++ b/ipc/chromium/src/base/debug_util_win.cc
@@ -111,51 +111,51 @@ class SymbolContext {
       }
     }
 
     initialized_ = true;
     return init_error_ == ERROR_SUCCESS;
   }
 
   // Returns the error code of a failed initialization.  This should only be
-  // called if Init() has been called.  We do not LOG(FATAL) here because
-  // this code is called might be triggered by a LOG(FATAL) itself.  Instead,
+  // called if Init() has been called.  We do not CHROMIUM_LOG(FATAL) here because
+  // this code is called might be triggered by a CHROMIUM_LOG(FATAL) itself.  Instead,
   // we log an ERROR, and return ERROR_INVALID_DATA.
   DWORD init_error() {
     if (!initialized_) {
-      LOG(ERROR) << "Calling GetInitError() before Init() was called.  "
-                 << "Returning ERROR_INVALID_DATA.";
+      CHROMIUM_LOG(ERROR) << "Calling GetInitError() before Init() was called.  "
+                          << "Returning ERROR_INVALID_DATA.";
       return ERROR_INVALID_DATA;
     }
 
     return init_error_;
   }
 
   // Returns the process this was initialized for.  This should only be
-  // called if Init() has been called.  We LOG(ERROR) in this situation.
-  // LOG(FATAL) is not used because this code is might be triggered 
-  // by a LOG(FATAL) itself.
+  // called if Init() has been called.  We CHROMIUM_LOG(ERROR) in this situation.
+  // CHROMIUM_LOG(FATAL) is not used because this code is might be triggered 
+  // by a CHROMIUM_LOG(FATAL) itself.
   HANDLE process() {
     if (!initialized_) {
-      LOG(ERROR) << "Calling process() before Init() was called. "
-                 << "Returning NULL.";
+      CHROMIUM_LOG(ERROR) << "Calling process() before Init() was called. "
+                          << "Returning NULL.";
       return NULL;
     }
 
     return process_;
   }
 
   // For the given trace, attempts to resolve the symbols, and output a trace
   // to the ostream os.  The format for each line of the backtrace is:
   //
   //    <tab>SymbolName[0xAddress+Offset] (FileName:LineNo)
   // 
   // This function should only be called if Init() has been called.  We do not
-  // LOG(FATAL) here because this code is called might be triggered by a
-  // LOG(FATAL) itself.
+  // CHROMIUM_LOG(FATAL) here because this code is called might be triggered by a
+  // CHROMIUM_LOG(FATAL) itself.
   void OutputTraceToStream(const std::vector<void*>& trace, std::ostream* os) {
     AutoLock lock(lock_);
 
     for (size_t i = 0; (i < trace.size()) && os->good(); ++i) {
       const int kMaxNameLength = 256;
       DWORD_PTR frame = reinterpret_cast<DWORD_PTR>(trace[i]);
 
       // Code adapted from MSDN example:
--- a/ipc/chromium/src/base/file_util_posix.cc
+++ b/ipc/chromium/src/base/file_util_posix.cc
@@ -142,17 +142,17 @@ bool CopyDirectory(const FilePath& from_
 
 #ifdef ANDROID
   // XXX Need ftsless impl for bionic
   return false;
 #else
   char* dir_list[] = { top_dir, NULL };
   FTS* fts = fts_open(dir_list, FTS_PHYSICAL | FTS_NOSTAT, NULL);
   if (!fts) {
-    LOG(ERROR) << "fts_open failed: " << strerror(errno);
+    CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno);
     return false;
   }
 
   int error = 0;
   FTSENT* ent;
   while (!error && (ent = fts_read(fts)) != NULL) {
     // ent->fts_path is the source path, including from_path, so paste
     // the suffix after from_path onto to_path to create the target_path.
@@ -198,21 +198,21 @@ bool CopyDirectory(const FilePath& from_
       case FTS_DNR:  // Directory cannot be read.
       case FTS_ERR:  // Error.
       case FTS_NS:   // Stat failed.
         // Abort with the error.
         error = ent->fts_errno;
         break;
       case FTS_SL:      // Symlink.
       case FTS_SLNONE:  // Symlink with broken target.
-        LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
+        CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
             ent->fts_path;
         continue;
       case FTS_DEFAULT:  // Some other sort of file.
-        LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
+        CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
             ent->fts_path;
         continue;
       default:
         NOTREACHED();
         continue;  // Hope for the best!
     }
   }
   // fts_read may have returned NULL and set errno to indicate an error.
@@ -222,17 +222,17 @@ bool CopyDirectory(const FilePath& from_
   if (!fts_close(fts)) {
     // If we already have an error, let's use that error instead of the error
     // fts_close set.
     if (!error)
       error = errno;
   }
 
   if (error) {
-    LOG(ERROR) << "CopyDirectory(): " << strerror(error);
+    CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error);
     return false;
   }
   return true;
 #endif
 }
 
 bool PathExists(const FilePath& path) {
   struct stat file_info;
--- a/ipc/chromium/src/base/file_util_win.cc
+++ b/ipc/chromium/src/base/file_util_win.cc
@@ -308,35 +308,35 @@ int WriteFile(const FilePath& filename, 
   ScopedHandle file(CreateFile(filename.value().c_str(),
                                GENERIC_WRITE,
                                0,
                                NULL,
                                CREATE_ALWAYS,
                                0,
                                NULL));
   if (file == INVALID_HANDLE_VALUE) {
-    LOG(WARNING) << "CreateFile failed for path " << filename.value() <<
+    CHROMIUM_LOG(WARNING) << "CreateFile failed for path " << filename.value() <<
         " error code=" << GetLastError() <<
         " error text=" << win_util::FormatLastWin32Error();
     return -1;
   }
 
   DWORD written;
   BOOL result = ::WriteFile(file, data, size, &written, NULL);
   if (result && written == size)
     return static_cast<int>(written);
 
   if (!result) {
     // WriteFile failed.
-    LOG(WARNING) << "writing file " << filename.value() <<
+    CHROMIUM_LOG(WARNING) << "writing file " << filename.value() <<
         " failed, error code=" << GetLastError() <<
         " description=" << win_util::FormatLastWin32Error();
   } else {
     // Didn't write all the bytes.
-    LOG(WARNING) << "wrote" << written << " bytes to " <<
+    CHROMIUM_LOG(WARNING) << "wrote" << written << " bytes to " <<
         filename.value() << " expected " << size;
   }
   return -1;
 }
 
 // Gets the current working directory for the process.
 bool GetCurrentDirectory(FilePath* dir) {
   wchar_t system_buffer[MAX_PATH];
--- a/ipc/chromium/src/base/histogram.cc
+++ b/ipc/chromium/src/base/histogram.cc
@@ -16,17 +16,17 @@
 
 #include "base/logging.h"
 #include "base/pickle.h"
 #include "base/string_util.h"
 #include "base/logging.h"
 
 namespace base {
 
-#define DVLOG(x) LOG(ERROR)
+#define DVLOG(x) CHROMIUM_LOG(ERROR)
 #define CHECK_GT DCHECK_GT
 #define CHECK_LT DCHECK_LT
 typedef ::Lock Lock;
 typedef ::AutoLock AutoLock;
 
 // Static table of checksums for all possible 8 bit bytes.
 const uint32_t Histogram::kCrcTable[256] = {0x0, 0x77073096L, 0xee0e612cL,
 0x990951baL, 0x76dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0xedb8832L,
@@ -269,25 +269,25 @@ bool Histogram::DeserializeHistogramInfo
   if (!pickle.ReadString(&iter, &histogram_name) ||
       !pickle.ReadInt(&iter, &declared_min) ||
       !pickle.ReadInt(&iter, &declared_max) ||
       !pickle.ReadSize(&iter, &bucket_count) ||
       !pickle.ReadUInt32(&iter, &range_checksum) ||
       !pickle.ReadInt(&iter, &histogram_type) ||
       !pickle.ReadInt(&iter, &pickle_flags) ||
       !sample.Histogram::SampleSet::Deserialize(&iter, pickle)) {
-    LOG(ERROR) << "Pickle error decoding Histogram: " << histogram_name;
+    CHROMIUM_LOG(ERROR) << "Pickle error decoding Histogram: " << histogram_name;
     return false;
   }
   DCHECK(pickle_flags & kIPCSerializationSourceFlag);
   // Since these fields may have come from an untrusted renderer, do additional
   // checks above and beyond those in Histogram::Initialize()
   if (declared_max <= 0 || declared_min <= 0 || declared_max < declared_min ||
       INT_MAX / sizeof(Count) <= bucket_count || bucket_count < 2) {
-    LOG(ERROR) << "Values error decoding Histogram: " << histogram_name;
+    CHROMIUM_LOG(ERROR) << "Values error decoding Histogram: " << histogram_name;
     return false;
   }
 
   Flags flags = static_cast<Flags>(pickle_flags & ~kIPCSerializationSourceFlag);
 
   DCHECK_NE(NOT_VALID_IN_RENDERER, histogram_type);
 
   Histogram* render_histogram(NULL);
@@ -296,18 +296,18 @@ bool Histogram::DeserializeHistogramInfo
     render_histogram = Histogram::FactoryGet(
         histogram_name, declared_min, declared_max, bucket_count, flags);
   } else if (histogram_type == LINEAR_HISTOGRAM) {
     render_histogram = LinearHistogram::FactoryGet(
         histogram_name, declared_min, declared_max, bucket_count, flags);
   } else if (histogram_type == BOOLEAN_HISTOGRAM) {
     render_histogram = BooleanHistogram::FactoryGet(histogram_name, flags);
   } else {
-    LOG(ERROR) << "Error Deserializing Histogram Unknown histogram_type: "
-               << histogram_type;
+    CHROMIUM_LOG(ERROR) << "Error Deserializing Histogram Unknown histogram_type: "
+                        << histogram_type;
     return false;
   }
 
   DCHECK_EQ(render_histogram->declared_min(), declared_min);
   DCHECK_EQ(render_histogram->declared_max(), declared_max);
   DCHECK_EQ(render_histogram->bucket_count(), bucket_count);
   DCHECK_EQ(render_histogram->range_checksum(), range_checksum);
   DCHECK_EQ(render_histogram->histogram_type(), histogram_type);
@@ -452,17 +452,17 @@ Histogram::Histogram(const std::string& 
     range_checksum_(0) {
   Initialize();
 }
 
 Histogram::~Histogram() {
   if (StatisticsRecorder::dump_on_exit()) {
     std::string output;
     WriteAscii(true, "\n", &output);
-    LOG(INFO) << output;
+    CHROMIUM_LOG(INFO) << output;
   }
 
   // Just to make sure most derived class did this properly...
   DCHECK(ValidateBucketRanges());
 }
 
 // Calculate what range of values are held in each bucket.
 // We have to be careful that we don't pick a ratio between starting points in
@@ -1134,17 +1134,17 @@ StatisticsRecorder::StatisticsRecorder()
 }
 
 StatisticsRecorder::~StatisticsRecorder() {
   DCHECK(histograms_ && lock_);
 
   if (dump_on_exit_) {
     std::string output;
     WriteGraph("", &output);
-    LOG(INFO) << output;
+    CHROMIUM_LOG(INFO) << output;
   }
   // Clean up.
   HistogramMap* histograms = NULL;
   {
     base::AutoLock auto_lock(*lock_);
     histograms = histograms_;
     histograms_ = NULL;
     for (HistogramMap::iterator it = histograms->begin();
--- a/ipc/chromium/src/base/logging.h
+++ b/ipc/chromium/src/base/logging.h
@@ -84,40 +84,40 @@ mozilla::Logger& operator<<(mozilla::Log
 
 template<class T>
 const mozilla::EmptyLog& operator <<(const mozilla::EmptyLog& log, const T&)
 {
   return log;
 }
 
 #ifdef NO_CHROMIUM_LOGGING
-#define LOG(info) std::stringstream()
+#define CHROMIUM_LOG(info) std::stringstream()
 #define LOG_IF(info, condition) if (!(condition)) std::stringstream()
 #else
-#define LOG(info) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
+#define CHROMIUM_LOG(info) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
 #define LOG_IF(info, condition) \
   if (!(condition)) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
 #endif
 
 
 #ifdef DEBUG
-#define DLOG(info) LOG(info)
+#define DLOG(info) CHROMIUM_LOG(info)
 #define DLOG_IF(info) LOG_IF(info)
 #define DCHECK(condition) CHECK(condition)
 #else
 #define DLOG(info) mozilla::EmptyLog()
 #define DLOG_IF(info, condition) mozilla::EmptyLog()
 #define DCHECK(condition) while (false && (condition)) mozilla::EmptyLog()
 #endif
 
 #define LOG_ASSERT(cond) CHECK(0)
 #define DLOG_ASSERT(cond) DCHECK(0)
 
-#define NOTREACHED() LOG(ERROR)
-#define NOTIMPLEMENTED() LOG(ERROR)
+#define NOTREACHED() CHROMIUM_LOG(ERROR)
+#define NOTIMPLEMENTED() CHROMIUM_LOG(ERROR)
 
 #define CHECK(condition) LOG_IF(FATAL, condition)
 
 #define DCHECK_EQ(v1, v2) DCHECK((v1) == (v2))
 #define DCHECK_NE(v1, v2) DCHECK((v1) != (v2))
 #define DCHECK_LE(v1, v2) DCHECK((v1) <= (v2))
 #define DCHECK_LT(v1, v2) DCHECK((v1) < (v2))
 #define DCHECK_GE(v1, v2) DCHECK((v1) >= (v2))
--- a/ipc/chromium/src/base/process_util_mac.mm
+++ b/ipc/chromium/src/base/process_util_mac.mm
@@ -207,46 +207,46 @@ NamedProcessIterator::NamedProcessIterat
   // we get the list, we do a loop to keep trying until we get it.
   bool done = false;
   int try_num = 1;
   const int max_tries = 10;
   do {
     // Get the size of the buffer
     size_t len = 0;
     if (sysctl(mib, arraysize(mib), NULL, &len, NULL, 0) < 0) {
-      LOG(ERROR) << "failed to get the size needed for the process list";
+      CHROMIUM_LOG(ERROR) << "failed to get the size needed for the process list";
       kinfo_procs_.resize(0);
       done = true;
     } else {
       size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
       // Leave some spare room for process table growth (more could show up
       // between when we check and now)
       num_of_kinfo_proc += 4;
       kinfo_procs_.resize(num_of_kinfo_proc);
       len = num_of_kinfo_proc * sizeof(struct kinfo_proc);
       // Load the list of processes
       if (sysctl(mib, arraysize(mib), &kinfo_procs_[0], &len, NULL, 0) < 0) {
         // If we get a mem error, it just means we need a bigger buffer, so
         // loop around again.  Anything else is a real error and give up.
         if (errno != ENOMEM) {
-          LOG(ERROR) << "failed to get the process list";
+          CHROMIUM_LOG(ERROR) << "failed to get the process list";
           kinfo_procs_.resize(0);
           done = true;
         }
       } else {
         // Got the list, just make sure we're sized exactly right
         size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
         kinfo_procs_.resize(num_of_kinfo_proc);
         done = true;
       }
     }
   } while (!done && (try_num++ < max_tries));
 
   if (!done) {
-    LOG(ERROR) << "failed to collect the process list in a few tries";
+    CHROMIUM_LOG(ERROR) << "failed to collect the process list in a few tries";
     kinfo_procs_.resize(0);
   }
 }
 
 NamedProcessIterator::~NamedProcessIterator() {
 }
 
 const ProcessEntry* NamedProcessIterator::NextProcessEntry() {
@@ -275,32 +275,32 @@ bool NamedProcessIterator::CheckForNextP
     if ((kinfo->kp_proc.p_pid > 0) && (kinfo->kp_proc.p_stat == SZOMB))
       continue;
 
     int mib[] = { CTL_KERN, KERN_PROCARGS, kinfo->kp_proc.p_pid };
 
     // Found out what size buffer we need
     size_t data_len = 0;
     if (sysctl(mib, arraysize(mib), NULL, &data_len, NULL, 0) < 0) {
-      LOG(ERROR) << "failed to figure out the buffer size for a commandline";
+      CHROMIUM_LOG(ERROR) << "failed to figure out the buffer size for a commandline";
       continue;
     }
 
     data.resize(data_len);
     if (sysctl(mib, arraysize(mib), &data[0], &data_len, NULL, 0) < 0) {
-      LOG(ERROR) << "failed to fetch a commandline";
+      CHROMIUM_LOG(ERROR) << "failed to fetch a commandline";
       continue;
     }
 
     // Data starts w/ the full path null termed, so we have to extract just the
     // executable name from the path.
 
     size_t exec_name_end = data.find('\0');
     if (exec_name_end == std::string::npos) {
-      LOG(ERROR) << "command line data didn't match expected format";
+      CHROMIUM_LOG(ERROR) << "command line data didn't match expected format";
       continue;
     }
     size_t last_slash = data.rfind('/', exec_name_end);
     if (last_slash == std::string::npos)
       exec_name = data.substr(0, exec_name_end);
     else
       exec_name = data.substr(last_slash + 1, exec_name_end - last_slash - 1);
 
--- a/ipc/chromium/src/base/process_util_posix.cc
+++ b/ipc/chromium/src/base/process_util_posix.cc
@@ -246,17 +246,17 @@ ProcessMetrics::~ProcessMetrics() { }
 
 bool DidProcessCrash(bool* child_exited, ProcessHandle handle) {
   int status;
   const int result = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
   if (result == -1) {
     // The dead process originally spawned from Nuwa might be taken as not
     // crashed because the above waitpid() call returns -1 and ECHILD. The
     // caller shouldn't behave incorrectly because of this false negative.
-    LOG(ERROR) << "waitpid failed pid:" << handle << " errno:" << errno;
+    CHROMIUM_LOG(ERROR) << "waitpid failed pid:" << handle << " errno:" << errno;
     if (child_exited)
       *child_exited = false;
     return false;
   } else if (result == 0) {
     // the child hasn't exited yet.
     if (child_exited)
       *child_exited = false;
     return false;
--- a/ipc/chromium/src/base/scoped_temp_dir.cc
+++ b/ipc/chromium/src/base/scoped_temp_dir.cc
@@ -8,17 +8,17 @@
 #include "base/logging.h"
 #include "base/string_util.h"
 
 ScopedTempDir::ScopedTempDir() {
 }
 
 ScopedTempDir::~ScopedTempDir() {
   if (!path_.empty() && !file_util::Delete(path_, true))
-    LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
+    CHROMIUM_LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
 }
 
 bool ScopedTempDir::CreateUniqueTempDir() {
   // This "scoped_dir" prefix is only used on Windows and serves as a template
   // for the unique name.
   if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_dir"),
                                          &path_))
     return false;
--- a/ipc/chromium/src/base/stats_table.cc
+++ b/ipc/chromium/src/base/stats_table.cc
@@ -255,20 +255,20 @@ StatsTable::StatsTable(const std::string
     AlignedSize(max_threads * sizeof(int)) +
     AlignedSize((sizeof(int) * (max_counters * max_threads)));
 
   impl_ = StatsTablePrivate::New(name, table_size, max_threads, max_counters);
 
   // TODO(port): clean up this error reporting.
 #if defined(OS_WIN)
   if (!impl_)
-    LOG(ERROR) << "StatsTable did not initialize:" << GetLastError();
+    CHROMIUM_LOG(ERROR) << "StatsTable did not initialize:" << GetLastError();
 #elif defined(OS_POSIX)
   if (!impl_)
-    LOG(ERROR) << "StatsTable did not initialize:" << strerror(errno);
+    CHROMIUM_LOG(ERROR) << "StatsTable did not initialize:" << strerror(errno);
 #endif
 }
 
 StatsTable::~StatsTable() {
   // Before we tear down our copy of the table, be sure to
   // unregister our thread.
   UnregisterThread();
 
--- a/ipc/chromium/src/base/system_monitor.cc
+++ b/ipc/chromium/src/base/system_monitor.cc
@@ -52,28 +52,28 @@ void SystemMonitor::AddObserver(PowerObs
   observer_list_->AddObserver(obs);
 }
 
 void SystemMonitor::RemoveObserver(PowerObserver* obs) {
   observer_list_->RemoveObserver(obs);
 }
 
 void SystemMonitor::NotifyPowerStateChange() {
-  LOG(INFO) << "PowerStateChange: "
-           << (BatteryPower() ? "On" : "Off") << " battery";
+  CHROMIUM_LOG(INFO) << "PowerStateChange: "
+                     << (BatteryPower() ? "On" : "Off") << " battery";
   observer_list_->Notify(&PowerObserver::OnPowerStateChange, this);
 }
 
 void SystemMonitor::NotifySuspend() {
-  LOG(INFO) << "Power Suspending";
+  CHROMIUM_LOG(INFO) << "Power Suspending";
   observer_list_->Notify(&PowerObserver::OnSuspend, this);
 }
 
 void SystemMonitor::NotifyResume() {
-  LOG(INFO) << "Power Resuming";
+  CHROMIUM_LOG(INFO) << "Power Resuming";
   observer_list_->Notify(&PowerObserver::OnResume, this);
 }
 
 void SystemMonitor::Start() {
 #if defined(ENABLE_BATTERY_MONITORING)
   DCHECK(MessageLoop::current());  // Can't call start too early.
   SystemMonitor* monitor = Get();
   monitor->delayed_battery_check_.Start(
--- a/ipc/chromium/src/base/system_monitor_win.cc
+++ b/ipc/chromium/src/base/system_monitor_win.cc
@@ -33,17 +33,17 @@ void SystemMonitor::ProcessWmPowerBroadc
   ProcessPowerMessage(power_event);
 }
 
 // Function to query the system to see if it is currently running on
 // battery power.  Returns true if running on battery.
 bool SystemMonitor::IsBatteryPower() {
   SYSTEM_POWER_STATUS status;
   if (!GetSystemPowerStatus(&status)) {
-    LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError();
+    CHROMIUM_LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError();
     return false;
   }
   return (status.ACLineStatus == 0);
 }
 
 
 
 } // namespace base
--- a/ipc/chromium/src/chrome/common/chrome_switches.cc
+++ b/ipc/chromium/src/chrome/common/chrome_switches.cc
@@ -170,17 +170,17 @@ const wchar_t kEnableLogging[]          
 // Force logging to be disabled.  Logging is enabled by default in debug
 // builds.
 const wchar_t kDisableLogging[]                = L"disable-logging";
 
 // Sets the minimum log level. Valid values are from 0 to 3:
 // INFO = 0, WARNING = 1, LOG_ERROR = 2, LOG_FATAL = 3.
 const wchar_t kLoggingLevel[]                  = L"log-level";
 
-// Make plugin processes log their sent and received messages to LOG(INFO).
+// Make plugin processes log their sent and received messages to CHROMIUM_LOG(INFO).
 const wchar_t kLogPluginMessages[]             = L"log-plugin-messages";
 
 // Dump any accumualted histograms to the log when browser terminates (requires
 // logging to be enabled to really do anything).  Used by developers and test
 // scripts.
 const wchar_t kDumpHistogramsOnExit[]          = L"dump-histograms-on-exit";
 
 // enable remote debug / automation shell on the specified port
--- a/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
+++ b/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
@@ -12,17 +12,17 @@
 FileDescriptorSet::FileDescriptorSet()
     : consumed_descriptor_highwater_(0) {
 }
 
 FileDescriptorSet::~FileDescriptorSet() {
   if (consumed_descriptor_highwater_ == descriptors_.size())
     return;
 
-  LOG(WARNING) << "FileDescriptorSet destroyed with unconsumed descriptors";
+  CHROMIUM_LOG(WARNING) << "FileDescriptorSet destroyed with unconsumed descriptors";
   // We close all the descriptors where the close flag is set. If this
   // message should have been transmitted, then closing those with close
   // flags set mirrors the expected behaviour.
   //
   // If this message was received with more descriptors than expected
   // (which could a DOS against the browser by a rogue renderer) then all
   // the descriptors have their close flag set and we free all the extra
   // kernel resources.
--- a/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
+++ b/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
@@ -205,23 +205,23 @@ bool ServerAcceptFifoConnection(int serv
 
 bool ClientConnectToFifo(const std::string &pipe_name, int* client_socket) {
   DCHECK(client_socket);
   DCHECK_LT(pipe_name.length(), kMaxPipeNameLength);
 
   // Create socket.
   int fd = socket(AF_UNIX, SOCK_STREAM, 0);
   if (fd < 0) {
-    LOG(ERROR) << "fd is invalid";
+    CHROMIUM_LOG(ERROR) << "fd is invalid";
     return false;
   }
 
   // Make socket non-blocking
   if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
-    LOG(ERROR) << "fcntl failed";
+    CHROMIUM_LOG(ERROR) << "fcntl failed";
     HANDLE_EINTR(close(fd));
     return false;
   }
 
   // Create server side of socket.
   struct sockaddr_un  server_unix_addr;
   memset(&server_unix_addr, 0, sizeof(server_unix_addr));
   server_unix_addr.sun_family = AF_UNIX;
@@ -258,19 +258,19 @@ bool SetCloseOnExec(int fd) {
 Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode,
                                   Listener* listener)
     : factory_(this) {
   Init(mode, listener);
   uses_fifo_ = CommandLine::ForCurrentProcess()->HasSwitch(switches::kIPCUseFIFO);
 
   if (!CreatePipe(channel_id, mode)) {
     // The pipe may have been closed already.
-    LOG(WARNING) << "Unable to create pipe named \"" << channel_id <<
-                    "\" in " << (mode == MODE_SERVER ? "server" : "client") <<
-                    " mode error(" << strerror(errno) << ").";
+    CHROMIUM_LOG(WARNING) << "Unable to create pipe named \"" << channel_id <<
+                             "\" in " << (mode == MODE_SERVER ? "server" : "client") <<
+                             " mode error(" << strerror(errno) << ").";
   }
 }
 
 Channel::ChannelImpl::ChannelImpl(int fd, Mode mode, Listener* listener)
     : factory_(this) {
   Init(mode, listener);
   pipe_ = fd;
   waiting_connect_ = (MODE_SERVER == mode);
@@ -438,17 +438,17 @@ bool Channel::ChannelImpl::ProcessIncomi
       // recvmsg() returns 0 if the connection has closed or EAGAIN if no data
       // is waiting on the pipe.
       bytes_read = HANDLE_EINTR(recvmsg(pipe_, &msg, MSG_DONTWAIT));
 
       if (bytes_read < 0) {
         if (errno == EAGAIN) {
           return true;
         } else {
-          LOG(ERROR) << "pipe error (" << pipe_ << "): " << strerror(errno);
+          CHROMIUM_LOG(ERROR) << "pipe error (" << pipe_ << "): " << strerror(errno);
           return false;
         }
       } else if (bytes_read == 0) {
         // The pipe has closed...
         Close();
         return false;
       }
     }
@@ -486,19 +486,19 @@ bool Channel::ChannelImpl::ProcessIncomi
         if (cmsg->cmsg_level == SOL_SOCKET &&
             cmsg->cmsg_type == SCM_RIGHTS) {
           const unsigned payload_len = cmsg->cmsg_len - CMSG_LEN(0);
           DCHECK(payload_len % sizeof(int) == 0);
           wire_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg));
           num_wire_fds = payload_len / 4;
 
           if (msg.msg_flags & MSG_CTRUNC) {
-            LOG(ERROR) << "SCM_RIGHTS message was truncated"
-                       << " cmsg_len:" << cmsg->cmsg_len
-                       << " fd:" << pipe_;
+            CHROMIUM_LOG(ERROR) << "SCM_RIGHTS message was truncated"
+                                << " cmsg_len:" << cmsg->cmsg_len
+                                << " fd:" << pipe_;
             for (unsigned i = 0; i < num_wire_fds; ++i)
               HANDLE_EINTR(close(wire_fds[i]));
             return false;
           }
           break;
         }
       }
     }
@@ -510,17 +510,17 @@ bool Channel::ChannelImpl::ProcessIncomi
     if (input_overflow_buf_.empty()) {
       overflowp = NULL;
       p = input_buf_;
       end = p + bytes_read;
     } else {
       if (input_overflow_buf_.size() >
          static_cast<size_t>(kMaximumMessageSize - bytes_read)) {
         ClearAndShrink(input_overflow_buf_, Channel::kReadBufferSize);
-        LOG(ERROR) << "IPC message is too big";
+        CHROMIUM_LOG(ERROR) << "IPC message is too big";
         return false;
       }
       input_overflow_buf_.append(input_buf_, bytes_read);
       overflowp = p = input_overflow_buf_.data();
       end = p + input_overflow_buf_.size();
     }
 
     // A pointer to an array of |num_fds| file descriptors which includes any
@@ -557,22 +557,22 @@ bool Channel::ChannelImpl::ProcessIncomi
 
           if (m.header()->num_fds >
               FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE) {
             // There are too many descriptors in this message
             error = "Message requires an excessive number of descriptors";
           }
 
           if (error) {
-            LOG(WARNING) << error
-                         << " channel:" << this
-                         << " message-type:" << m.type()
-                         << " header()->num_fds:" << m.header()->num_fds
-                         << " num_fds:" << num_fds
-                         << " fds_i:" << fds_i;
+            CHROMIUM_LOG(WARNING) << error
+                                  << " channel:" << this
+                                  << " message-type:" << m.type()
+                                  << " header()->num_fds:" << m.header()->num_fds
+                                  << " num_fds:" << num_fds
+                                  << " fds_i:" << fds_i;
             // close the existing file descriptors so that we don't leak them
             for (unsigned i = fds_i; i < num_fds; ++i)
               HANDLE_EINTR(close(fds[i]));
             input_overflow_fds_.clear();
             // abort the connection
             return false;
           }
 
@@ -663,17 +663,17 @@ bool Channel::ChannelImpl::ProcessOutgoi
 
     if (message_send_bytes_written_ == 0 &&
         !msg->file_descriptor_set()->empty()) {
       // This is the first chunk of a message which has descriptors to send
       struct cmsghdr *cmsg;
       const unsigned num_fds = msg->file_descriptor_set()->size();
 
       if (num_fds > FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE) {
-        LOG(FATAL) << "Too many file descriptors!";
+        CHROMIUM_LOG(FATAL) << "Too many file descriptors!";
         // This should not be reached.
         return false;
       }
 
       msgh.msg_control = buf;
       msgh.msg_controllen = CMSG_SPACE(sizeof(int) * num_fds);
       cmsg = CMSG_FIRSTHDR(&msgh);
       cmsg->cmsg_level = SOL_SOCKET;
@@ -702,17 +702,17 @@ bool Channel::ChannelImpl::ProcessOutgoi
 #if !defined(OS_MACOSX)
     // On OSX CommitAll gets called later, once we get the RECEIVED_FDS_MESSAGE_TYPE
     // message.
     if (bytes_written > 0)
       msg->file_descriptor_set()->CommitAll();
 #endif
 
     if (bytes_written < 0 && errno != EAGAIN) {
-      LOG(ERROR) << "pipe error: " << strerror(errno);
+      CHROMIUM_LOG(ERROR) << "pipe error: " << strerror(errno);
       return false;
     }
 
     if (static_cast<size_t>(bytes_written) != amt_to_write) {
       if (bytes_written > 0) {
         // If write() fails with EAGAIN then bytes_written will be -1.
         message_send_bytes_written_ += bytes_written;
       }
--- a/ipc/chromium/src/chrome/common/ipc_channel_win.cc
+++ b/ipc/chromium/src/chrome/common/ipc_channel_win.cc
@@ -36,18 +36,18 @@ Channel::ChannelImpl::ChannelImpl(const 
                               Listener* listener)
     : ALLOW_THIS_IN_INITIALIZER_LIST(input_state_(this)),
       ALLOW_THIS_IN_INITIALIZER_LIST(output_state_(this)),
       ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {
   Init(mode, listener);
 
   if (!CreatePipe(channel_id, mode)) {
     // The pipe may have been closed already.
-    LOG(WARNING) << "Unable to create pipe named \"" << channel_id <<
-                    "\" in " << (mode == 0 ? "server" : "client") << " mode.";
+    CHROMIUM_LOG(WARNING) << "Unable to create pipe named \"" << channel_id <<
+                             "\" in " << (mode == 0 ? "server" : "client") << " mode.";
   }
 }
 
 Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id,
                                   HANDLE server_pipe,
                                   Mode mode, Listener* listener)
     : ALLOW_THIS_IN_INITIALIZER_LIST(input_state_(this)),
       ALLOW_THIS_IN_INITIALIZER_LIST(output_state_(this)),
@@ -190,17 +190,17 @@ bool Channel::ChannelImpl::CreatePipe(co
                         NULL,
                         OPEN_EXISTING,
                         SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION |
                             FILE_FLAG_OVERLAPPED,
                         NULL);
   }
   if (pipe_ == INVALID_HANDLE_VALUE) {
     // If this process is being closed, the pipe may be gone already.
-    LOG(WARNING) << "failed to create pipe: " << GetLastError();
+    CHROMIUM_LOG(WARNING) << "failed to create pipe: " << GetLastError();
     return false;
   }
 
   // Create the Hello message to be sent when Connect is called
   return EnqueueHelloMessage();
 }
 
 bool Channel::ChannelImpl::EnqueueHelloMessage() {
@@ -304,34 +304,34 @@ bool Channel::ChannelImpl::ProcessIncomi
                          &bytes_read,
                          &input_state_.context.overlapped);
       if (!ok) {
         DWORD err = GetLastError();
         if (err == ERROR_IO_PENDING) {
           input_state_.is_pending = true;
           return true;
         }
-        LOG(ERROR) << "pipe error: " << err;
+        CHROMIUM_LOG(ERROR) << "pipe error: " << err;
         return false;
       }
       input_state_.is_pending = true;
       return true;
     }
     DCHECK(bytes_read);
 
     // Process messages from input buffer.
 
     const char* p, *end;
     if (input_overflow_buf_.empty()) {
       p = input_buf_;
       end = p + bytes_read;
     } else {
       if (input_overflow_buf_.size() > (kMaximumMessageSize - bytes_read)) {
         input_overflow_buf_.clear();
-        LOG(ERROR) << "IPC message is too big";
+        CHROMIUM_LOG(ERROR) << "IPC message is too big";
         return false;
       }
       input_overflow_buf_.append(input_buf_, bytes_read);
       p = input_overflow_buf_.data();
       end = p + input_overflow_buf_.size();
     }
 
     while (p < end) {
@@ -371,17 +371,17 @@ bool Channel::ChannelImpl::ProcessOutgoi
                               // no connection?
   DCHECK(thread_check_->CalledOnValidThread());
 
   if (output_state_.is_pending) {
     DCHECK(context);
     output_state_.is_pending = false;
     if (!context || bytes_written == 0) {
       DWORD err = GetLastError();
-      LOG(ERROR) << "pipe error: " << err;
+      CHROMIUM_LOG(ERROR) << "pipe error: " << err;
       return false;
     }
     // Message was sent.
     DCHECK(!output_queue_.empty());
     Message* m = output_queue_.front();
     OutputQueuePop();
     delete m;
   }
@@ -406,17 +406,17 @@ bool Channel::ChannelImpl::ProcessOutgoi
 
 #ifdef IPC_MESSAGE_DEBUG_EXTRA
       DLOG(INFO) << "sent pending message @" << m << " on channel @" <<
                     this << " with type " << m->type();
 #endif
 
       return true;
     }
-    LOG(ERROR) << "pipe error: " << err;
+    CHROMIUM_LOG(ERROR) << "pipe error: " << err;
     return false;
   }
 
 #ifdef IPC_MESSAGE_DEBUG_EXTRA
   DLOG(INFO) << "sent message @" << m << " on channel @" << this <<
                 " with type " << m->type();
 #endif
 
--- a/ipc/chromium/src/chrome/common/mach_message_source_mac.cc
+++ b/ipc/chromium/src/chrome/common/mach_message_source_mac.cc
@@ -19,29 +19,29 @@ MachMessageSource::MachMessageSource(mac
   scoped_cftyperef<CFMachPortRef> cf_mach_port_ref(
      CFMachPortCreateWithPort(kCFAllocatorDefault,
                               port,
                               MachMessageSource::OnReceiveMachMessage,
                               &port_context,
                               NULL));
 
   if (cf_mach_port_ref.get() == NULL) {
-   LOG(WARNING) << "CFMachPortCreate failed";
+   CHROMIUM_LOG(WARNING) << "CFMachPortCreate failed";
    *success = false;
    return;
   }
 
   // Create a RL source.
   machport_runloop_ref_.reset(
      CFMachPortCreateRunLoopSource(kCFAllocatorDefault,
                                    cf_mach_port_ref.get(),
                                    0));
 
   if (machport_runloop_ref_.get() == NULL) {
-   LOG(WARNING) << "CFMachPortCreateRunLoopSource failed";
+   CHROMIUM_LOG(WARNING) << "CFMachPortCreateRunLoopSource failed";
    *success = false;
    return;
   }
 
   CFRunLoopAddSource(CFRunLoopGetCurrent(),
                     machport_runloop_ref_.get(),
                     kCFRunLoopCommonModes);
   *success = true;
--- a/ipc/chromium/src/chrome/common/notification_service.cc
+++ b/ipc/chromium/src/chrome/common/notification_service.cc
@@ -120,18 +120,18 @@ NotificationService::~NotificationServic
   lazy_tls_ptr.Pointer()->Set(NULL);
 
 #ifndef NDEBUG
   for (int i = 0; i < NotificationType::NOTIFICATION_TYPE_COUNT; i++) {
     if (observer_counts_[i] > 0) {
       // This may not be completely fixable -- see
       // http://code.google.com/p/chromium/issues/detail?id=11010 .
       // But any new leaks should be fixed.
-      LOG(WARNING) << observer_counts_[i] << " notification observer(s) leaked"
-          << " of notification type " << i;
+      CHROMIUM_LOG(WARNING) << observer_counts_[i] << " notification observer(s) leaked"
+                            << " of notification type " << i;
     }
   }
 #endif
 
   for (int i = 0; i < NotificationType::NOTIFICATION_TYPE_COUNT; i++) {
     NotificationSourceMap omap = observers_[i];
     for (NotificationSourceMap::iterator it = omap.begin();
          it != omap.end(); ++it) {
--- a/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc
+++ b/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc
@@ -110,18 +110,18 @@ private:
 
     if (0 == kill(process_, SIGKILL)) {
       // XXX this will block for whatever amount of time it takes the
       // XXX OS to tear down the process's resources.  might need to
       // XXX rethink this if it proves expensive
       WaitForChildExit();
     }
     else {
-      LOG(ERROR) << "Failed to deliver SIGKILL to " << process_ << "!"
-                 << "("<< errno << ").";
+      CHROMIUM_LOG(ERROR) << "Failed to deliver SIGKILL to " << process_ << "!"
+                          << "("<< errno << ").";
     }
     process_ = 0;
   }
 
   DISALLOW_EVIL_CONSTRUCTORS(ChildGrimReaper);
 };
 
 
--- a/ipc/chromium/src/chrome/common/transport_dib_win.cc
+++ b/ipc/chromium/src/chrome/common/transport_dib_win.cc
@@ -38,19 +38,19 @@ TransportDIB* TransportDIB::Create(size_
 
   return dib;
 }
 
 // static
 TransportDIB* TransportDIB::Map(TransportDIB::Handle handle) {
   TransportDIB* dib = new TransportDIB(handle);
   if (!dib->shared_memory_.Map(0 /* map whole shared memory segment */)) {
-    LOG(ERROR) << "Failed to map transport DIB"
-               << " handle:" << handle
-               << " error:" << GetLastError();
+    CHROMIUM_LOG(ERROR) << "Failed to map transport DIB"
+                        << " handle:" << handle
+                        << " error:" << GetLastError();
     delete dib;
     return NULL;
   }
 
   // There doesn't seem to be any way to find the size of the shared memory
   // region! GetFileSize indicates that the handle is invalid. Thus, we
   // conservatively set the size to the maximum and hope that the renderer
   // isn't about to ask us to read off the end of the array.
--- a/ipc/dbus/DBusThread.cpp
+++ b/ipc/dbus/DBusThread.cpp
@@ -52,23 +52,23 @@
 #include "mozilla/Monitor.h"
 #include "mozilla/FileUtils.h"
 #include "nsThreadUtils.h"
 #include "nsIThread.h"
 #include "nsXULAppAPI.h"
 #include "nsServiceManagerUtils.h"
 #include "nsCOMPtr.h"
 
-#undef LOG
+#undef CHROMIUM_LOG
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GonkDBus", args);
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GonkDBus", args);
 #else
 #define BTDEBUG true
-#define LOG(args...) if (BTDEBUG) printf(args);
+#define CHROMIUM_LOG(args...) if (BTDEBUG) printf(args);
 #endif
 
 namespace mozilla {
 namespace ipc {
 
 class DBusWatcher : public MessageLoopForIO::Watcher
 {
 public:
--- a/ipc/dbus/DBusUtils.cpp
+++ b/ipc/dbus/DBusUtils.cpp
@@ -15,22 +15,22 @@
 ** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
 #include <dbus/dbus.h>
 #include "nsAutoPtr.h"
 #include "DBusUtils.h"
 
-#undef LOG
+#undef CHROMIUM_LOG
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args);
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args);
 #else
-#define LOG(args...)  printf(args);
+#define CHROMIUM_LOG(args...)  printf(args);
 #endif
 
 namespace mozilla {
 namespace ipc {
 
 //
 // DBusMessageRefPtr
 //
@@ -67,21 +67,21 @@ void DBusReplyHandler::Callback(DBusMess
 //
 // Utility functions
 //
 
 void
 log_and_free_dbus_error(DBusError* err, const char* function, DBusMessage* msg)
 {
   if (msg) {
-    LOG("%s: D-Bus error in %s: %s (%s)", function,
-        dbus_message_get_member((msg)), (err)->name, (err)->message);
+    CHROMIUM_LOG("%s: D-Bus error in %s: %s (%s)", function,
+                 dbus_message_get_member((msg)), (err)->name, (err)->message);
   }	else {
-    LOG("%s: D-Bus error: %s (%s)", __FUNCTION__,
-        (err)->name, (err)->message);
+    CHROMIUM_LOG("%s: D-Bus error: %s (%s)", __FUNCTION__,
+                 (err)->name, (err)->message);
   }
   dbus_error_free((err));
 }
 
 int dbus_returns_int32(DBusMessage *reply)
 {
   DBusError err;
   int32_t ret = -1;
--- a/ipc/dbus/RawDBusConnection.cpp
+++ b/ipc/dbus/RawDBusConnection.cpp
@@ -7,25 +7,25 @@
 #include <dbus/dbus.h>
 #include "base/message_loop.h"
 #include "mozilla/Monitor.h"
 #include "nsThreadUtils.h"
 #include "DBusThread.h"
 #include "DBusUtils.h"
 #include "RawDBusConnection.h"
 
-#ifdef LOG
-#undef LOG
+#ifdef CHROMIUM_LOG
+#undef CHROMIUM_LOG
 #endif
 
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args);
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args);
 #else
-#define LOG(args...)  printf(args);
+#define CHROMIUM_LOG(args...)  printf(args);
 #endif
 
 /* TODO: Remove BlueZ constant */
 #define BLUEZ_DBUS_BASE_IFC "org.bluez"
 
 using namespace mozilla::ipc;
 
 //
@@ -283,21 +283,21 @@ DBusMessage* RawDBusConnection::BuildDBu
                                                  const char* aIntf,
                                                  const char* aFunc,
                                                  int aFirstArgType,
                                                  va_list aArgs)
 {
   DBusMessage* msg = dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC,
                                                   aPath, aIntf, aFunc);
   if (!msg) {
-    LOG("Could not allocate D-Bus message object!");
+    CHROMIUM_LOG("Could not allocate D-Bus message object!");
     return nullptr;
   }
 
   /* append arguments */
   if (!dbus_message_append_args_valist(msg, aFirstArgType, aArgs)) {
-    LOG("Could not append argument to method call!");
+    CHROMIUM_LOG("Could not append argument to method call!");
     dbus_message_unref(msg);
     return nullptr;
   }
 
   return msg;
 }
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -674,42 +674,42 @@ GeckoChildProcessHost::PerformAsyncLaunc
   // Wait for the child process to send us its 'task_t' data.
   const int kTimeoutMs = 10000;
 
   MachReceiveMessage child_message;
   ReceivePort parent_recv_port(mach_connection_name.c_str());
   kern_return_t err = parent_recv_port.WaitForMessage(&child_message, kTimeoutMs);
   if (err != KERN_SUCCESS) {
     std::string errString = StringPrintf("0x%x %s", err, mach_error_string(err));
-    LOG(ERROR) << "parent WaitForMessage() failed: " << errString;
+    CHROMIUM_LOG(ERROR) << "parent WaitForMessage() failed: " << errString;
     return false;
   }
 
   task_t child_task = child_message.GetTranslatedPort(0);
   if (child_task == MACH_PORT_NULL) {
-    LOG(ERROR) << "parent GetTranslatedPort(0) failed.";
+    CHROMIUM_LOG(ERROR) << "parent GetTranslatedPort(0) failed.";
     return false;
   }
 
   if (child_message.GetTranslatedPort(1) == MACH_PORT_NULL) {
-    LOG(ERROR) << "parent GetTranslatedPort(1) failed.";
+    CHROMIUM_LOG(ERROR) << "parent GetTranslatedPort(1) failed.";
     return false;
   }
   MachPortSender parent_sender(child_message.GetTranslatedPort(1));
 
   MachSendMessage parent_message(/* id= */0);
   if (!parent_message.AddDescriptor(bootstrap_port)) {
-    LOG(ERROR) << "parent AddDescriptor(" << bootstrap_port << ") failed.";
+    CHROMIUM_LOG(ERROR) << "parent AddDescriptor(" << bootstrap_port << ") failed.";
     return false;
   }
 
   err = parent_sender.SendMessage(parent_message, kTimeoutMs);
   if (err != KERN_SUCCESS) {
     std::string errString = StringPrintf("0x%x %s", err, mach_error_string(err));
-    LOG(ERROR) << "parent SendMessage() failed: " << errString;
+    CHROMIUM_LOG(ERROR) << "parent SendMessage() failed: " << errString;
     return false;
   }
 #endif
 
 //--------------------------------------------------
 #elif defined(OS_WIN)
 
   FilePath exePath;
--- a/ipc/keystore/KeyStore.cpp
+++ b/ipc/keystore/KeyStore.cpp
@@ -2,22 +2,22 @@
 /* vim: set sw=4 ts=8 et ft=cpp: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <fcntl.h>
 #include <sys/stat.h>
 
-#undef LOG
+#undef CHROMIUM_LOG
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
 #else
-#define LOG(args...)  printf(args);
+#define CHROMIUM_LOG(args...)  printf(args);
 #endif
 
 #include "KeyStore.h"
 #include "jsfriendapi.h"
 #include "MainThreadUtils.h" // For NS_IsMainThread.
 
 #include "plbase64.h"
 #include "certdb.h"
--- a/ipc/netd/Netd.cpp
+++ b/ipc/netd/Netd.cpp
@@ -13,17 +13,17 @@
 
 #include "nsWhitespaceTokenizer.h"
 #include "nsXULAppAPI.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
 
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
 #define ICS_SYS_USB_RNDIS_MAC "/sys/class/android_usb/android0/f_rndis/ethaddr"
 #define INVALID_SOCKET -1
 #define MAX_RECONNECT_TIMES 10
 
 namespace {
 
 mozilla::RefPtr<mozilla::ipc::NetdClient> gNetdClient;
 mozilla::RefPtr<mozilla::ipc::NetdConsumer> gNetdConsumer;
@@ -48,17 +48,17 @@ InitRndisAddress()
   char address[kEthernetAddressLength];
   int i = 0;
   int ret = 0;
   int length = 0;
   mozilla::ScopedClose fd;
 
   fd.rwget() = open(ICS_SYS_USB_RNDIS_MAC, O_WRONLY);
   if (fd.rwget() == -1) {
-    LOG("Unable to open file %s.", ICS_SYS_USB_RNDIS_MAC);
+    CHROMIUM_LOG("Unable to open file %s.", ICS_SYS_USB_RNDIS_MAC);
     return false;
   }
 
   property_get("ro.serialno", serialno, "1234567890ABCDEF");
 
   memset(address, 0, sizeof(address));
   // First byte is 0x02 to signify a locally administered address.
   address[0] = 0x02;
@@ -68,17 +68,17 @@ InitRndisAddress()
   }
 
   sprintf(mac, "%02x:%02x:%02x:%02x:%02x:%02x",
           address[0], address[1], address[2],
           address[3], address[4], address[5]);
   length = strlen(mac);
   ret = write(fd.get(), mac, length);
   if (ret != length) {
-    LOG("Fail to write file %s.", ICS_SYS_USB_RNDIS_MAC);
+    CHROMIUM_LOG("Fail to write file %s.", ICS_SYS_USB_RNDIS_MAC);
     return false;
   }
   return true;
 }
 
 } // anonymous namespace
 
 namespace mozilla {
@@ -101,55 +101,55 @@ NetdClient::~NetdClient()
 
 bool
 NetdClient::OpenSocket()
 {
   mSocket.rwget() = socket_local_client("netd",
                                         ANDROID_SOCKET_NAMESPACE_RESERVED,
                                         SOCK_STREAM);
   if (mSocket.rwget() < 0) {
-    LOG("Error connecting to : netd (%s) - will retry", strerror(errno));
+    CHROMIUM_LOG("Error connecting to : netd (%s) - will retry", strerror(errno));
     return false;
   }
   // Add FD_CLOEXEC flag.
   int flags = fcntl(mSocket.get(), F_GETFD);
   if (flags == -1) {
-    LOG("Error doing fcntl with F_GETFD command(%s)", strerror(errno));
+    CHROMIUM_LOG("Error doing fcntl with F_GETFD command(%s)", strerror(errno));
     return false;
   }
   flags |= FD_CLOEXEC;
   if (fcntl(mSocket.get(), F_SETFD, flags) == -1) {
-    LOG("Error doing fcntl with F_SETFD command(%s)", strerror(errno));
+    CHROMIUM_LOG("Error doing fcntl with F_SETFD command(%s)", strerror(errno));
     return false;
   }
   // Set non-blocking.
   if (fcntl(mSocket.get(), F_SETFL, O_NONBLOCK) == -1) {
-    LOG("Error set non-blocking socket(%s)", strerror(errno));
+    CHROMIUM_LOG("Error set non-blocking socket(%s)", strerror(errno));
     return false;
   }
   if (!MessageLoopForIO::current()->
       WatchFileDescriptor(mSocket.get(),
                           true,
                           MessageLoopForIO::WATCH_READ,
                           &mReadWatcher,
                           this)) {
-    LOG("Error set socket read watcher(%s)", strerror(errno));
+    CHROMIUM_LOG("Error set socket read watcher(%s)", strerror(errno));
     return false;
   }
 
   if (!mOutgoingQ.empty()) {
     MessageLoopForIO::current()->
       WatchFileDescriptor(mSocket.get(),
                           false,
                           MessageLoopForIO::WATCH_WRITE,
                           &mWriteWatcher,
                           this);
   }
 
-  LOG("Connected to netd");
+  CHROMIUM_LOG("Connected to netd");
   return true;
 }
 
 void NetdClient::OnLineRead(int aFd, nsDependentCSubstring& aMessage)
 {
   // Set errno to 0 first. For preventing to use the stale version of errno.
   errno = 0;
   // We found a line terminator. Each line is formatted as an
@@ -160,17 +160,17 @@ void NetdClient::OnLineRead(int aFd, nsD
     NetdCommand* response = new NetdCommand();
     // Passing all the response message, including the line terminator.
     response->mSize = aMessage.Length();
     memcpy(response->mData, aMessage.Data(), aMessage.Length());
     gNetdConsumer->MessageReceived(response);
   }
 
   if (!responseCode) {
-    LOG("Can't parse netd's response");
+    CHROMIUM_LOG("Can't parse netd's response");
   }
 }
 
 void
 NetdClient::OnFileCanWriteWithoutBlocking(int aFd)
 {
   MOZ_ASSERT(aFd == mSocket.get());
   WriteNetdCommand();
@@ -196,25 +196,25 @@ NetdClient::OnError()
 
 // static
 void
 NetdClient::Start()
 {
   MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
 
   if (!gNetdClient) {
-    LOG("Netd Client is not initialized");
+    CHROMIUM_LOG("Netd Client is not initialized");
     return;
   }
 
   if (!gNetdClient->OpenSocket()) {
     // Socket open failed, try again in a second.
-    LOG("Fail to connect to Netd");
+    CHROMIUM_LOG("Fail to connect to Netd");
     if (++gNetdClient->mReConnectTimes > MAX_RECONNECT_TIMES) {
-      LOG("Fail to connect to Netd after retry %d times", MAX_RECONNECT_TIMES);
+      CHROMIUM_LOG("Fail to connect to Netd after retry %d times", MAX_RECONNECT_TIMES);
       return;
     }
 
     MessageLoopForIO::current()->
       PostDelayedTask(FROM_HERE,
                       NewRunnableFunction(NetdClient::Start),
                       1000);
     return;
@@ -225,24 +225,24 @@ NetdClient::Start()
 // static
 void
 NetdClient::SendNetdCommandIOThread(NetdCommand* aMessage)
 {
   MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
   MOZ_ASSERT(aMessage);
 
   if (!gNetdClient) {
-    LOG("Netd Client is not initialized");
+    CHROMIUM_LOG("Netd Client is not initialized");
     return;
   }
 
   gNetdClient->mOutgoingQ.push(aMessage);
 
   if (gNetdClient->mSocket.get() == INVALID_SOCKET) {
-    LOG("Netd connection is not established, push the message to queue");
+    CHROMIUM_LOG("Netd connection is not established, push the message to queue");
     return;
   }
 
   gNetdClient->WriteNetdCommand();
 }
 
 void
 NetdClient::WriteNetdCommand()
@@ -254,27 +254,27 @@ NetdClient::WriteNetdCommand()
   }
 
   while (mCurrentWriteOffset < mCurrentNetdCommand->mSize) {
     ssize_t write_amount = mCurrentNetdCommand->mSize - mCurrentWriteOffset;
     ssize_t written = write(mSocket.get(),
                             mCurrentNetdCommand->mData + mCurrentWriteOffset,
                             write_amount);
     if (written < 0) {
-      LOG("Cannot write to network, error %d\n", (int) written);
+      CHROMIUM_LOG("Cannot write to network, error %d\n", (int) written);
       OnError();
       return;
     }
 
     if (written > 0) {
       mCurrentWriteOffset += written;
     }
 
     if (written != write_amount) {
-      LOG("WriteNetdCommand fail !!! Write is not completed");
+      CHROMIUM_LOG("WriteNetdCommand fail !!! Write is not completed");
       break;
     }
   }
 
   if (mCurrentWriteOffset != mCurrentNetdCommand->mSize) {
     MessageLoopForIO::current()->
       WatchFileDescriptor(mSocket.get(),
                           false,
@@ -299,17 +299,17 @@ InitNetdIOThread()
   property_get("ro.build.version.sdk", propValue, "0");
   // Assign rndis address for usb tethering in ICS.
   if (atoi(propValue) >= 15) {
     result = InitRndisAddress();
     // We don't return here because InitRnsisAddress() function is related to
     // usb tethering only. Others service such as wifi tethering still need
     // to use ipc to communicate with netd.
     if (!result) {
-      LOG("fail to give rndis interface an address");
+      CHROMIUM_LOG("fail to give rndis interface an address");
     }
   }
   gNetdClient = new NetdClient();
   gNetdClient->Start();
 }
 
 static void
 ShutdownNetdIOThread()
--- a/ipc/nfc/Nfc.cpp
+++ b/ipc/nfc/Nfc.cpp
@@ -7,22 +7,22 @@
 /* Copyright © 2013, Deutsche Telekom, Inc. */
 
 #include "mozilla/ipc/Nfc.h"
 
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 
-#undef LOG
+#undef CHROMIUM_LOG
 #if (defined(MOZ_WIDGET_GONK) && defined(DEBUG))
 #include <android/log.h>
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
 #else
-#define LOG(args...)
+#define CHROMIUM_LOG(args...)
 #endif
 
 #include "jsfriendapi.h"
 #include "nsThreadUtils.h" // For NS_IsMainThread.
 
 USING_WORKERS_NAMESPACE
 using namespace mozilla::ipc;
 
@@ -323,29 +323,29 @@ NfcConsumer::ReceiveSocketData(nsAutoPtr
     nsRefPtr<DispatchNFCEvent> dre(new DispatchNFCEvent(aMessage.forget()));
     mDispatcher->PostTask(dre);
 }
 
 void
 NfcConsumer::OnConnectSuccess()
 {
     // Nothing to do here.
-    LOG("NFC: %s\n", __FUNCTION__);
+    CHROMIUM_LOG("NFC: %s\n", __FUNCTION__);
 }
 
 void
 NfcConsumer::OnConnectError()
 {
-    LOG("NFC: %s\n", __FUNCTION__);
+    CHROMIUM_LOG("NFC: %s\n", __FUNCTION__);
     CloseSocket();
 }
 
 void
 NfcConsumer::OnDisconnect()
 {
-    LOG("NFC: %s\n", __FUNCTION__);
+    CHROMIUM_LOG("NFC: %s\n", __FUNCTION__);
     if (!mShutdown) {
         ConnectSocket(new NfcConnector(), mAddress.get(), 1000);
     }
 }
 
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/ril/Ril.cpp
+++ b/ipc/ril/Ril.cpp
@@ -6,22 +6,22 @@
 
 #include "mozilla/ipc/Ril.h"
 
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <netdb.h> // For gethostbyname.
 
-#undef LOG
+#undef CHROMIUM_LOG
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "Gonk", args)
 #else
-#define LOG(args...)  printf(args);
+#define CHROMIUM_LOG(args...)  printf(args);
 #endif
 
 #include "jsfriendapi.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h" // For NS_IsMainThread.
 
 USING_WORKERS_NAMESPACE
 using namespace mozilla::ipc;
@@ -356,29 +356,29 @@ RilConsumer::ReceiveSocketData(nsAutoPtr
     nsRefPtr<DispatchRILEvent> dre(new DispatchRILEvent(aMessage.forget()));
     mDispatcher->PostTask(dre);
 }
 
 void
 RilConsumer::OnConnectSuccess()
 {
     // Nothing to do here.
-    LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__);
+    CHROMIUM_LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__);
 }
 
 void
 RilConsumer::OnConnectError()
 {
-    LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__);
+    CHROMIUM_LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__);
     CloseSocket();
 }
 
 void
 RilConsumer::OnDisconnect()
 {
-    LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__);
+    CHROMIUM_LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__);
     if (!mShutdown) {
         ConnectSocket(new RilConnector(mClientId), mAddress.get(), 1000);
     }
 }
 
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/unixsocket/UnixSocket.cpp
+++ b/ipc/unixsocket/UnixSocket.cpp
@@ -19,23 +19,23 @@
 #include "mozilla/Monitor.h"
 #include "mozilla/FileUtils.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsXULAppAPI.h"
 
 static const size_t MAX_READ_SIZE = 1 << 16;
 
-#undef LOG
+#undef CHROMIUM_LOG
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
-#define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GonkDBus", args);
+#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GonkDBus", args);
 #else
 #define BTDEBUG true
-#define LOG(args...) if (BTDEBUG) printf(args);
+#define CHROMIUM_LOG(args...) if (BTDEBUG) printf(args);
 #endif
 
 static const int SOCKET_RETRY_TIME_MS = 1000;
 
 namespace mozilla {
 namespace ipc {
 
 class UnixSocketImpl : public MessageLoopForIO::Watcher
@@ -510,24 +510,24 @@ UnixSocketImpl::Accept()
     }
 
     if (!SetSocketFlags()) {
       return;
     }
 
     if (bind(mFd.get(), (struct sockaddr*)&mAddr, mAddrSize)) {
 #ifdef DEBUG
-      LOG("...bind(%d) gave errno %d", mFd.get(), errno);
+      CHROMIUM_LOG("...bind(%d) gave errno %d", mFd.get(), errno);
 #endif
       return;
     }
 
     if (listen(mFd.get(), 1)) {
 #ifdef DEBUG
-      LOG("...listen(%d) gave errno %d", mFd.get(), errno);
+      CHROMIUM_LOG("...listen(%d) gave errno %d", mFd.get(), errno);
 #endif
       return;
     }
 
     if (!mConnector->SetUpListenSocket(mFd)) {
       NS_WARNING("Could not set up listen socket!");
       nsRefPtr<OnSocketEventTask> t =
         new OnSocketEventTask(this, OnSocketEventTask::CONNECT_ERROR);
@@ -604,22 +604,22 @@ UnixSocketImpl::Connect()
       MessageLoopForIO::current()->WatchFileDescriptor(
         mFd.get(),
         false,
         MessageLoopForIO::WATCH_WRITE,
         &mWriteWatcher,
         this);
 
 #ifdef DEBUG
-      LOG("UnixSocket Connection delayed!");
+      CHROMIUM_LOG("UnixSocket Connection delayed!");
 #endif
       return;
     }
 #if DEBUG
-    LOG("Socket connect errno=%d\n", errno);
+    CHROMIUM_LOG("Socket connect errno=%d\n", errno);
 #endif
     mFd.reset(-1);
     nsRefPtr<OnSocketEventTask> t =
       new OnSocketEventTask(this, OnSocketEventTask::CONNECT_ERROR);
     NS_DispatchToMainThread(t);
     mConnectionStatus = SOCKET_DISCONNECTED;
     return;
   }