summaryrefslogtreecommitdiffstats
path: root/chrome/browser/mac
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 23:06:49 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 23:06:49 +0000
commit33b9820a5039e8a9925ddc0ebaced8f50112ce3b (patch)
treefc66820a0ea13d0160dfb3253028cb8a1d3b468f /chrome/browser/mac
parent1797640037e0127eb5f47bc60dc94b78a2b904b5 (diff)
downloadchromium_src-33b9820a5039e8a9925ddc0ebaced8f50112ce3b.zip
chromium_src-33b9820a5039e8a9925ddc0ebaced8f50112ce3b.tar.gz
chromium_src-33b9820a5039e8a9925ddc0ebaced8f50112ce3b.tar.bz2
Add OSSTATUS_LOG API.
Review URL: https://chromiumcodereview.appspot.com/9235084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/mac')
-rw-r--r--chrome/browser/mac/authorization_util.mm7
-rw-r--r--chrome/browser/mac/dock.mm12
-rw-r--r--chrome/browser/mac/install_from_dmg.mm8
-rw-r--r--chrome/browser/mac/keystone_glue.mm7
-rw-r--r--chrome/browser/mac/relauncher.cc5
5 files changed, 22 insertions, 17 deletions
diff --git a/chrome/browser/mac/authorization_util.mm b/chrome/browser/mac/authorization_util.mm
index 3c9504f..734ee7f 100644
--- a/chrome/browser/mac/authorization_util.mm
+++ b/chrome/browser/mac/authorization_util.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -13,6 +13,7 @@
#include "base/eintr_wrapper.h"
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
+#include "base/mac/mac_logging.h"
#import "base/mac/mac_util.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
@@ -28,7 +29,7 @@ AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) {
kAuthorizationFlagDefaults,
&authorization);
if (status != errAuthorizationSuccess) {
- LOG(ERROR) << "AuthorizationCreate: " << status;
+ OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate";
return NULL;
}
@@ -73,7 +74,7 @@ AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) {
NULL);
if (status != errAuthorizationSuccess) {
if (status != errAuthorizationCanceled) {
- LOG(ERROR) << "AuthorizationCopyRights: " << status;
+ OSSTATUS_LOG(ERROR, status) << "AuthorizationCopyRights";
}
return NULL;
}
diff --git a/chrome/browser/mac/dock.mm b/chrome/browser/mac/dock.mm
index 200e6b0..8928436 100644
--- a/chrome/browser/mac/dock.mm
+++ b/chrome/browser/mac/dock.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,6 +10,7 @@
#include <signal.h>
#include "base/logging.h"
+#include "base/mac/mac_logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_nsautorelease_pool.h"
@@ -86,7 +87,7 @@ pid_t PIDForProcessBundleID(const std::string& bundle_id) {
while ((status = GetNextProcess(&psn)) == noErr) {
pid_t process_pid;
if ((status = GetProcessPID(&psn, &process_pid)) != noErr) {
- LOG(ERROR) << "GetProcessPID: " << status;
+ OSSTATUS_LOG(ERROR, status) << "GetProcessPID";
continue;
}
@@ -98,14 +99,11 @@ pid_t PIDForProcessBundleID(const std::string& bundle_id) {
continue;
}
- CFStringRef process_bundle_id_cf = static_cast<CFStringRef>(
+ CFStringRef process_bundle_id_cf = base::mac::CFCast<CFStringRef>(
CFDictionaryGetValue(process_dictionary, kCFBundleIdentifierKey));
if (!process_bundle_id_cf) {
// Not all processes have a bundle ID.
continue;
- } else if (CFGetTypeID(process_bundle_id_cf) != CFStringGetTypeID()) {
- LOG(ERROR) << "process_bundle_id_cf not CFStringRef";
- continue;
}
std::string process_bundle_id =
@@ -117,7 +115,7 @@ pid_t PIDForProcessBundleID(const std::string& bundle_id) {
}
// status will be procNotFound (-600) if the process wasn't found.
- LOG(ERROR) << "GetNextProcess: " << status;
+ OSSTATUS_LOG(ERROR, status) << "GetNextProcess";
return -1;
}
diff --git a/chrome/browser/mac/install_from_dmg.mm b/chrome/browser/mac/install_from_dmg.mm
index caf05a0..1d11ecd 100644
--- a/chrome/browser/mac/install_from_dmg.mm
+++ b/chrome/browser/mac/install_from_dmg.mm
@@ -22,6 +22,7 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
+#include "base/mac/mac_logging.h"
#import "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_nsautorelease_pool.h"
@@ -308,7 +309,8 @@ bool InstallFromDiskImage(AuthorizationRef authorization_arg,
NULL, // pipe
&exit_status);
if (status != errAuthorizationSuccess) {
- LOG(ERROR) << "AuthorizationExecuteWithPrivileges install: " << status;
+ OSSTATUS_LOG(ERROR, status)
+ << "AuthorizationExecuteWithPrivileges install";
return false;
}
} else {
@@ -659,7 +661,7 @@ void EjectAndTrashDiskImage(const std::string& dmg_bsd_device_name) {
&disk_image_path_in_trash_c,
kFSFileOperationDefaultOptions);
if (status != noErr) {
- LOG(ERROR) << "FSPathMoveObjectToTrashSync: " << status;
+ OSSTATUS_LOG(ERROR, status) << "FSPathMoveObjectToTrashSync";
return;
}
@@ -677,7 +679,7 @@ void EjectAndTrashDiskImage(const std::string& dmg_bsd_device_name) {
kFNDirectoryModifiedMessage,
kNilOptions);
if (status != noErr) {
- LOG(ERROR) << "FNNotifyByPath: " << status;
+ OSSTATUS_LOG(ERROR, status) << "FNNotifyByPath";
return;
}
}
diff --git a/chrome/browser/mac/keystone_glue.mm b/chrome/browser/mac/keystone_glue.mm
index c0c1cd3..35eaca9 100644
--- a/chrome/browser/mac/keystone_glue.mm
+++ b/chrome/browser/mac/keystone_glue.mm
@@ -14,6 +14,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
+#include "base/mac/mac_logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/mac/scoped_nsexception_enabler.h"
@@ -853,7 +854,8 @@ NSString* const kVersionKey = @"KSVersion";
NULL, // pipe
&exit_status);
if (status != errAuthorizationSuccess) {
- LOG(ERROR) << "AuthorizationExecuteWithPrivileges preflight: " << status;
+ OSSTATUS_LOG(ERROR, status)
+ << "AuthorizationExecuteWithPrivileges preflight";
[self updateStatus:kAutoupdatePromoteFailed version:nil];
return;
}
@@ -940,7 +942,8 @@ NSString* const kVersionKey = @"KSVersion";
NULL, // pipe
&exit_status);
if (status != errAuthorizationSuccess) {
- LOG(ERROR) << "AuthorizationExecuteWithPrivileges postflight: " << status;
+ OSSTATUS_LOG(ERROR, status)
+ << "AuthorizationExecuteWithPrivileges postflight";
} else if (exit_status != 0) {
LOG(ERROR) << "keystone_promote_postflight status " << exit_status;
}
diff --git a/chrome/browser/mac/relauncher.cc b/chrome/browser/mac/relauncher.cc
index 700f8da..138ab17 100644
--- a/chrome/browser/mac/relauncher.cc
+++ b/chrome/browser/mac/relauncher.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -20,6 +20,7 @@
#include "base/eintr_wrapper.h"
#include "base/file_util.h"
#include "base/logging.h"
+#include "base/mac/mac_logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/path_service.h"
@@ -370,7 +371,7 @@ int RelauncherMain(const content::MainFunctionParams& main_parameters) {
OSStatus status = LSOpenApplication(&ls_parameters, NULL);
if (status != noErr) {
- LOG(ERROR) << "LSOpenApplication: " << status;
+ OSSTATUS_LOG(ERROR, status) << "LSOpenApplication";
return 1;
}