summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/plugin_process_host.cc4
-rw-r--r--chrome/browser/plugin_process_host.h15
-rw-r--r--chrome/browser/render_process_host.cc8
-rw-r--r--chrome/browser/render_process_host.h16
-rw-r--r--chrome/browser/render_widget_host.cc5
5 files changed, 23 insertions, 25 deletions
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index f64af9d..7ee3015 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -329,7 +329,7 @@ PluginProcessHost::PluginProcessHost(PluginService* plugin_service)
PluginProcessHost::~PluginProcessHost() {
if (process_.handle()) {
- watcher_.StopWatching();
+ MessageLoop::current()->WatchObject(process_.handle(), NULL);
ProcessWatcher::EnsureProcessTerminated(process_.handle());
}
}
@@ -461,7 +461,7 @@ bool PluginProcessHost::Init(const std::wstring& dll,
process_.set_handle(process);
}
- watcher_.StartWatching(process_.handle(), this);
+ MessageLoop::current()->WatchObject(process_.handle(), this);
// Give all plugins "background" priority. See http://b/issue?id=1280317.
process_.SetProcessBackgrounded(true);
diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h
index e9ea4c5..f4cf06b 100644
--- a/chrome/browser/plugin_process_host.h
+++ b/chrome/browser/plugin_process_host.h
@@ -27,14 +27,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
-#define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
+#ifndef CHROME_BROWSER_PLUGIN_PROCESS_HOST_H__
+#define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H__
#include <vector>
#include "base/basictypes.h"
#include "base/id_map.h"
-#include "base/object_watcher.h"
+#include "base/message_loop.h"
#include "base/process.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
@@ -59,7 +59,7 @@ class GURL;
// the renderer and plugin processes.
class PluginProcessHost : public IPC::Channel::Listener,
public IPC::Message::Sender,
- public base::ObjectWatcher::Delegate {
+ public MessageLoop::Watcher {
public:
PluginProcessHost(PluginService* plugin_service);
~PluginProcessHost();
@@ -75,7 +75,7 @@ class PluginProcessHost : public IPC::Channel::Listener,
// IPC::Message::Sender implementation:
virtual bool Send(IPC::Message* msg);
- // ObjectWatcher::Delegate implementation:
+ // MessageLoop watcher callback
virtual void OnObjectSignaled(HANDLE object);
// IPC::Channel::Listener implementation:
@@ -159,9 +159,6 @@ class PluginProcessHost : public IPC::Channel::Listener,
// The handle to our plugin process.
Process process_;
- // Used to watch the plugin process handle.
- base::ObjectWatcher watcher_;
-
// true while we're waiting the channel to be opened. In the meantime,
// plugin instance requests will be buffered.
bool opening_channel_;
@@ -182,4 +179,4 @@ class PluginProcessHost : public IPC::Channel::Listener,
DISALLOW_EVIL_CONSTRUCTORS(PluginProcessHost);
};
-#endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
+#endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H__
diff --git a/chrome/browser/render_process_host.cc b/chrome/browser/render_process_host.cc
index bb048ff..43ebb64 100644
--- a/chrome/browser/render_process_host.cc
+++ b/chrome/browser/render_process_host.cc
@@ -202,7 +202,7 @@ RenderProcessHost::~RenderProcessHost() {
channel_.reset();
if (process_.handle() && !run_renderer_in_process_) {
- watcher_.StopWatching();
+ MessageLoop::current()->WatchObject(process_.handle(), NULL);
ProcessWatcher::EnsureProcessTerminated(process_.handle());
}
@@ -420,7 +420,7 @@ bool RenderProcessHost::Init() {
process_.set_handle(process);
}
- watcher_.StartWatching(process_.handle(), this);
+ MessageLoop::current()->WatchObject(process_.handle(), this);
}
}
@@ -576,7 +576,7 @@ void RenderProcessHost::OnChannelConnected(int32 peer_pid) {
// returned by CreateProcess() has to the process object.
process_.set_handle(OpenProcess(MAXIMUM_ALLOWED, FALSE, peer_pid));
DCHECK(process_.handle());
- watcher_.StartWatching(process_.handle(), this);
+ MessageLoop::current()->WatchObject(process_.handle(), this);
}
} else {
// Need to verify that the peer_pid is actually the process we know, if
@@ -591,6 +591,8 @@ void RenderProcessHost::OnObjectSignaled(HANDLE object) {
DCHECK(channel_.get());
DCHECK_EQ(object, process_.handle());
+ MessageLoop::current()->WatchObject(object, NULL);
+
bool clean_shutdown = !process_util::DidProcessCrash(object);
process_.Close();
diff --git a/chrome/browser/render_process_host.h b/chrome/browser/render_process_host.h
index e64b8fe..117ad55 100644
--- a/chrome/browser/render_process_host.h
+++ b/chrome/browser/render_process_host.h
@@ -27,15 +27,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_RENDER_PROCESS_HOST_H_
-#define CHROME_BROWSER_RENDER_PROCESS_HOST_H_
+#ifndef CHROME_BROWSER_RENDER_PROCESS_HOST_H__
+#define CHROME_BROWSER_RENDER_PROCESS_HOST_H__
-#include <set>
#include <vector>
#include <windows.h>
#include "base/id_map.h"
-#include "base/object_watcher.h"
+#include "base/message_loop.h"
#include "base/process.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
@@ -62,8 +61,8 @@ class WebContents;
// are correlated with IDs. This way, the Views and the corresponding ViewHosts
// communicate through the two process objects.
class RenderProcessHost : public IPC::Channel::Listener,
+ public MessageLoop::Watcher,
public IPC::Channel::Sender,
- public base::ObjectWatcher::Delegate,
public NotificationObserver {
public:
// Returns the RenderProcessHost given its ID. Returns NULL if the ID does
@@ -156,7 +155,7 @@ class RenderProcessHost : public IPC::Channel::Listener,
virtual void OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
- // ObjectWatcher::Delegate
+ // MessageLoop watcher callback
virtual void OnObjectSignaled(HANDLE object);
// IPC::Channel::Sender callback
@@ -245,9 +244,6 @@ class RenderProcessHost : public IPC::Channel::Listener,
// Our renderer process.
Process process_;
- // Used to watch the renderer process handle.
- base::ObjectWatcher watcher_;
-
// The profile associated with this renderer process.
Profile* profile_;
@@ -293,4 +289,4 @@ inline std::wstring GenerateRandomChannelID(void* instance) {
}
-#endif // CHROME_BROWSER_RENDER_PROCESS_HOST_H_
+#endif // CHROME_BROWSER_RENDER_PROCESS_HOST_H__
diff --git a/chrome/browser/render_widget_host.cc b/chrome/browser/render_widget_host.cc
index 8f48a51..542f903 100644
--- a/chrome/browser/render_widget_host.cc
+++ b/chrome/browser/render_widget_host.cc
@@ -29,8 +29,11 @@
#include "chrome/browser/render_widget_host.h"
+#include <atlbase.h>
+#include <atlapp.h>
+
#include "base/gfx/bitmap_header.h"
-#include "base/message_loop.h"
+#include "base/histogram.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/render_process_host.h"
#include "chrome/browser/render_widget_helper.h"