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

Unified Diff: content/browser/mach_broker_mac.cc

Issue 11274038: content/browser: Move more files into the content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win - part2 Created 8 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/host_zoom_map_impl_unittest.cc ('k') | content/browser/mach_broker_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/mach_broker_mac.cc
diff --git a/content/browser/mach_broker_mac.cc b/content/browser/mach_broker_mac.cc
index 01007a0343e6b4c27e5d66003ced0a6061bd83bc..a520a19155eef5cbd8b6d4ec240bbf23bda4dbb6 100644
--- a/content/browser/mach_broker_mac.cc
+++ b/content/browser/mach_broker_mac.cc
@@ -21,13 +21,15 @@
#include "content/public/browser/notification_types.h"
#include "content/public/common/content_switches.h"
-using content::BrowserThread;
+namespace content {
namespace {
+
// Prints a string representation of a Mach error code.
std::string MachErrorCode(kern_return_t err) {
return base::StringPrintf("0x%x %s", err, mach_error_string(err));
}
+
} // namespace
class MachListenerThreadDelegate : public base::PlatformThread::Delegate {
@@ -173,25 +175,24 @@ mach_port_t MachBroker::TaskForPid(base::ProcessHandle pid) const {
}
void MachBroker::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
+ const NotificationSource& source,
+ const NotificationDetails& details) {
// TODO(rohitrao): These notifications do not always carry the proper PIDs,
// especially when the renderer is already gone or has crashed. Find a better
// way to listen for child process deaths. http://crbug.com/55734
base::ProcessHandle handle = 0;
switch (type) {
- case content::NOTIFICATION_RENDERER_PROCESS_CLOSED:
+ case NOTIFICATION_RENDERER_PROCESS_CLOSED:
handle =
- content::Details<content::RenderProcessHost::RendererClosedDetails>(
+ Details<RenderProcessHost::RendererClosedDetails>(
details)->handle;
break;
- case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED:
- handle = content::Source<content::RenderProcessHost>(source)->
- GetHandle();
+ case NOTIFICATION_RENDERER_PROCESS_TERMINATED:
+ handle = Source<RenderProcessHost>(source)->GetHandle();
break;
- case content::NOTIFICATION_CHILD_PROCESS_CRASHED:
- case content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED:
- handle = content::Details<content::ChildProcessData>(details)->handle;
+ case NOTIFICATION_CHILD_PROCESS_CRASHED:
+ case NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED:
+ handle = Details<ChildProcessData>(details)->handle;
break;
default:
NOTREACHED() << "Unexpected notification";
@@ -216,12 +217,14 @@ MachBroker::MachBroker() : listener_thread_started_(false) {
MachBroker::~MachBroker() {}
void MachBroker::RegisterNotifications() {
- registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
- content::NotificationService::AllBrowserContextsAndSources());
- registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
- content::NotificationService::AllBrowserContextsAndSources());
- registrar_.Add(this, content::NOTIFICATION_CHILD_PROCESS_CRASHED,
- content::NotificationService::AllBrowserContextsAndSources());
- registrar_.Add(this, content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED,
- content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_CLOSED,
+ NotificationService::AllBrowserContextsAndSources());
+ registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_TERMINATED,
+ NotificationService::AllBrowserContextsAndSources());
+ registrar_.Add(this, NOTIFICATION_CHILD_PROCESS_CRASHED,
+ NotificationService::AllBrowserContextsAndSources());
+ registrar_.Add(this, NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED,
+ NotificationService::AllBrowserContextsAndSources());
}
+
+} // namespace content
« no previous file with comments | « content/browser/host_zoom_map_impl_unittest.cc ('k') | content/browser/mach_broker_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698