summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_view_host.h
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-15 22:25:11 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-15 22:25:11 +0000
commit1c4947ffee0b7f5672737b542eb6adf466fcb223 (patch)
treeca2b1631479523a3a397fac842fe0870f422193f /chrome/browser/render_view_host.h
parentc0ce93d64e2374f29acf2130c5324dc54762f0fa (diff)
downloadchromium_src-1c4947ffee0b7f5672737b542eb6adf466fcb223.zip
chromium_src-1c4947ffee0b7f5672737b542eb6adf466fcb223.tar.gz
chromium_src-1c4947ffee0b7f5672737b542eb6adf466fcb223.tar.bz2
WaitableEvent is the replacement for Windows events. Previously in the code, a HANDLE from CreateEvent was used for signaling, both within a process and across processes.
WaitableEvent is the cross platform replacement for this. To convert: * HANDLE -> base::WaitableEvent* * ScopedHandle -> scoped_ptr<base::WaitableEvent> * CreateEvent -> new base::WaitableEvent * SetEvent -> base::WaitableEvent::Signal * ResetEvent -> base::WaitableEvent::Reset * ObjectWatcher -> base::WaitableEventWatcher * WaitForMultipleObjects -> static base::WaitableEvent::WaitMany ObjectWatcher remains for Windows specific code. WaitableEventWatcher has an identical interface save, * It uses WaitableEvents, not HANDLEs * It returns void from StartWatching and StopWatcher, rather than errors. System internal errors are fatal to the address space IMPORTANT: There are semantic differences between the different platforms. WaitableEvents on Windows are implemented on top of events. Windows events work across process and this is used mostly for modal dialog support. Windows events can be duplicated with DuplicateHandle. On other platforms, WaitableEvent works only within a single process. In the future we shall have to replace the current uses of cross-process events with IPCs. BEWARE: HANDLE, on Windows, is a void *. Since any pointer type coerces to void *, you can pass a WaitableEvent * where a HANDLE is expected without any build-time errors. Review URL: http://codereview.chromium.org/16554 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_host.h')
-rw-r--r--chrome/browser/render_view_host.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h
index f95720e..7b0ef7a 100644
--- a/chrome/browser/render_view_host.h
+++ b/chrome/browser/render_view_host.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include "base/scoped_handle.h"
+#include "base/scoped_ptr.h"
#include "chrome/browser/render_view_host_delegate.h"
#include "chrome/browser/render_widget_host.h"
#include "chrome/common/page_zoom.h"
@@ -33,6 +33,10 @@ struct WebDropData;
struct WebPreferences;
enum WindowOpenDisposition;
+namespace base {
+class WaitableEvent;
+}
+
namespace gfx {
class Point;
}
@@ -86,7 +90,7 @@ class RenderViewHost : public RenderWidgetHost {
explicit RenderViewHost(SiteInstance* instance,
RenderViewHostDelegate* delegate,
int routing_id,
- HANDLE modal_dialog_event);
+ base::WaitableEvent* modal_dialog_event);
virtual ~RenderViewHost();
SiteInstance* site_instance() const { return instance_; }
@@ -578,7 +582,7 @@ class RenderViewHost : public RenderWidgetHost {
// Handle to an event that's set when the page is showing a modal dialog box
// (or equivalent constrained window). The renderer and plugin processes
// check this to know if they should pump messages/tasks then.
- ScopedHandle modal_dialog_event_;
+ scoped_ptr<base::WaitableEvent> modal_dialog_event_;
// Multiple dialog boxes can be shown before the first one is finished,
// so we keep a counter to know when we can reset the modal dialog event.
@@ -618,7 +622,7 @@ class RenderViewHostFactory {
SiteInstance* instance,
RenderViewHostDelegate* delegate,
int routing_id,
- HANDLE modal_dialog_event) = 0;
+ base::WaitableEvent* modal_dialog_event) = 0;
};
#endif // CHROME_BROWSER_RENDER_VIEW_HOST_H__