summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc24
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.h2
-rw-r--r--chrome/browser/renderer_host/render_process_host.cc2
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc9
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc19
5 files changed, 31 insertions, 25 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 8fc3742..95c3942 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -38,6 +38,7 @@
#include "chrome/common/debug_flags.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/logging_chrome.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/process_watcher.h"
@@ -140,7 +141,8 @@ BrowserRenderProcessHost::BrowserRenderProcessHost(Profile* profile)
profile->GetPrefs()->GetBoolean(prefs::kBlockPopups));
NotificationService::current()->AddObserver(this,
- NOTIFY_USER_SCRIPTS_LOADED, NotificationService::AllSources());
+ NotificationType::USER_SCRIPTS_LOADED,
+ NotificationService::AllSources());
// Note: When we create the BrowserRenderProcessHost, it's technically backgrounded,
// because it has no visible listeners. But the process doesn't
@@ -162,7 +164,7 @@ BrowserRenderProcessHost::~BrowserRenderProcessHost() {
profile()->GetPrefs()->RemovePrefObserver(prefs::kBlockPopups, this);
NotificationService::current()->RemoveObserver(this,
- NOTIFY_USER_SCRIPTS_LOADED, NotificationService::AllSources());
+ NotificationType::USER_SCRIPTS_LOADED, NotificationService::AllSources());
}
// When we're started with the --start-renderers-manually flag, we pop up a
@@ -382,7 +384,8 @@ bool BrowserRenderProcessHost::Init() {
bool on_sandbox_desktop = (desktop != NULL);
NotificationService::current()->Notify(
- NOTIFY_RENDERER_PROCESS_IN_SBOX, Source<BrowserRenderProcessHost>(this),
+ NotificationType::RENDERER_PROCESS_IN_SBOX,
+ Source<BrowserRenderProcessHost>(this),
Details<bool>(&on_sandbox_desktop));
ResumeThread(target.hThread);
@@ -392,7 +395,7 @@ bool BrowserRenderProcessHost::Init() {
// Help the process a little. It can't start the debugger by itself if
// the process is in a sandbox.
if (child_needs_help)
- DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId);
+ DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId);
} else
#endif // OS_WIN and sandbox
{
@@ -665,9 +668,10 @@ void BrowserRenderProcessHost::OnChannelError() {
if (!notified_termination_) {
// If |close_expected| is false, it means the renderer process went away
// before the web views expected it; count it as a crash.
- NotificationService::current()->Notify(NOTIFY_RENDERER_PROCESS_TERMINATED,
- Source<RenderProcessHost>(this),
- Details<bool>(&clean_shutdown));
+ NotificationService::current()->Notify(
+ NotificationType::RENDERER_PROCESS_TERMINATED,
+ Source<RenderProcessHost>(this),
+ Details<bool>(&clean_shutdown));
notified_termination_ = true;
}
@@ -744,8 +748,8 @@ void BrowserRenderProcessHost::SetBackgrounded(bool backgrounded) {
void BrowserRenderProcessHost::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type) {
- case NOTIFY_PREF_CHANGED: {
+ switch (type.value) {
+ case NotificationType::PREF_CHANGED: {
std::wstring* pref_name_in = Details<std::wstring>(details).ptr();
DCHECK(Source<PrefService>(source).ptr() == profile()->GetPrefs());
if (*pref_name_in == prefs::kBlockPopups) {
@@ -756,7 +760,7 @@ void BrowserRenderProcessHost::Observe(NotificationType type,
}
break;
}
- case NOTIFY_USER_SCRIPTS_LOADED: {
+ case NotificationType::USER_SCRIPTS_LOADED: {
base::SharedMemory* shared_memory =
Details<base::SharedMemory>(details).ptr();
if (shared_memory) {
diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h
index 70c085c..b4ce17a 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.h
+++ b/chrome/browser/renderer_host/browser_render_process_host.h
@@ -21,7 +21,7 @@
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_observer.h"
#include "chrome/common/render_messages.h"
class PrefService;
diff --git a/chrome/browser/renderer_host/render_process_host.cc b/chrome/browser/renderer_host/render_process_host.cc
index 3ec8328..7a9ede0 100644
--- a/chrome/browser/renderer_host/render_process_host.cc
+++ b/chrome/browser/renderer_host/render_process_host.cc
@@ -77,7 +77,7 @@ void RenderProcessHost::Release(int listener_id) {
if (!notified_termination_) {
bool close_expected = true;
NotificationService::current()->Notify(
- NOTIFY_RENDERER_PROCESS_TERMINATED,
+ NotificationType::RENDERER_PROCESS_TERMINATED,
Source<RenderProcessHost>(this),
Details<bool>(&close_expected));
notified_termination_ = true;
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index 5914c74..a163705 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -321,7 +321,7 @@ void RenderWidgetHost::RendererExited() {
void RenderWidgetHost::Destroy() {
NotificationService::current()->Notify(
- NOTIFY_RENDER_WIDGET_HOST_DESTROYED,
+ NotificationType::RENDER_WIDGET_HOST_DESTROYED,
Source<RenderWidgetHost>(this),
NotificationService::NoDetails());
@@ -348,9 +348,10 @@ void RenderWidgetHost::CheckRendererIsUnresponsive() {
}
// OK, looks like we have a hung renderer!
- NotificationService::current()->Notify(NOTIFY_RENDERER_PROCESS_HANG,
- Source<RenderWidgetHost>(this),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ NotificationType::RENDERER_PROCESS_HANG,
+ Source<RenderWidgetHost>(this),
+ NotificationService::NoDetails());
is_unresponsive_ = true;
NotifyRendererUnresponsive();
}
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 50368c0..3882372 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -34,8 +34,7 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/tab_contents/web_contents.h"
-#include "chrome/common/notification_source.h"
-#include "chrome/common/notification_types.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/stl_util-inl.h"
#include "net/base/auth.h"
@@ -1069,10 +1068,10 @@ class NotificationTask : public Task {
if (tab_contents) {
// Issue the notification.
- NotificationService::current()->
- Notify(type_,
- Source<NavigationController>(tab_contents->controller()),
- Details<ResourceRequestDetails>(details_.get()));
+ NotificationService::current()->Notify(
+ type_,
+ Source<NavigationController>(tab_contents->controller()),
+ Details<ResourceRequestDetails>(details_.get()));
}
}
@@ -1110,7 +1109,7 @@ void ResourceDispatcherHost::NotifyResponseStarted(URLRequest* request,
// Notify the observers on the UI thread.
ui_loop_->PostTask(FROM_HERE,
- new NotificationTask(NOTIFY_RESOURCE_RESPONSE_STARTED, request,
+ new NotificationTask(NotificationType::RESOURCE_RESPONSE_STARTED, request,
new ResourceRequestDetails(request,
GetCertID(request, render_process_host_id))));
}
@@ -1124,7 +1123,8 @@ void ResourceDispatcherHost::NotifyResponseCompleted(
// Notify the observers on the UI thread.
ui_loop_->PostTask(FROM_HERE,
- new NotificationTask(NOTIFY_RESOURCE_RESPONSE_COMPLETED, request,
+ new NotificationTask(NotificationType::RESOURCE_RESPONSE_COMPLETED,
+ request,
new ResourceRequestDetails(request,
GetCertID(request, render_process_host_id))));
}
@@ -1140,7 +1140,8 @@ void ResourceDispatcherHost::NofityReceivedRedirect(URLRequest* request,
// Notify the observers on the UI thread.
ui_loop_->PostTask(FROM_HERE,
- new NotificationTask(NOTIFY_RESOURCE_RECEIVED_REDIRECT, request,
+ new NotificationTask(NotificationType::RESOURCE_RECEIVED_REDIRECT,
+ request,
new ResourceRedirectDetails(request,
cert_id,
new_url)));