summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 13:40:36 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 13:40:36 +0000
commit7c2ebfd68efed75ac4099c6698bc157eb6eaa20e (patch)
tree18a21b777051c4a11adc0b798574249e758f32a0 /mojo
parent66d11ca864b194eb6fb03a08a7c826af987b930f (diff)
downloadchromium_src-7c2ebfd68efed75ac4099c6698bc157eb6eaa20e.zip
chromium_src-7c2ebfd68efed75ac4099c6698bc157eb6eaa20e.tar.gz
chromium_src-7c2ebfd68efed75ac4099c6698bc157eb6eaa20e.tar.bz2
Fix ownership bug with ViewObserver::OnViewInputEvent
It needs to take a const EventPtr& otherwise the first observer owns the event and all others get NULL. BUG=365012 TEST=none R=ben@chromium.org Review URL: https://codereview.chromium.org/324753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276012 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo')
-rw-r--r--mojo/examples/embedded_app/embedded_app.cc4
-rw-r--r--mojo/examples/nesting_app/nesting_app.cc4
-rw-r--r--mojo/examples/window_manager/window_manager.cc4
-rw-r--r--mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc2
-rw-r--r--mojo/services/public/cpp/view_manager/view_observer.h2
5 files changed, 8 insertions, 8 deletions
diff --git a/mojo/examples/embedded_app/embedded_app.cc b/mojo/examples/embedded_app/embedded_app.cc
index a692f5a..adcef02 100644
--- a/mojo/examples/embedded_app/embedded_app.cc
+++ b/mojo/examples/embedded_app/embedded_app.cc
@@ -66,7 +66,7 @@ class EmbeddedApp : public Application,
}
// Overridden from ViewObserver:
- virtual void OnViewInputEvent(View* view, EventPtr event) OVERRIDE {
+ virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE {
if (event->action == ui::ET_MOUSE_RELEASED)
window_manager_->CloseWindow(view->node()->id());
}
@@ -94,4 +94,4 @@ Application* Application::Create() {
return new examples::EmbeddedApp;
}
-} // namespace mojo \ No newline at end of file
+} // namespace mojo
diff --git a/mojo/examples/nesting_app/nesting_app.cc b/mojo/examples/nesting_app/nesting_app.cc
index 3c06c8d..249cc37 100644
--- a/mojo/examples/nesting_app/nesting_app.cc
+++ b/mojo/examples/nesting_app/nesting_app.cc
@@ -58,7 +58,7 @@ class NestingApp : public Application,
}
// Overridden from ViewObserver:
- virtual void OnViewInputEvent(View* view, EventPtr event) OVERRIDE {
+ virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE {
if (event->action == ui::ET_MOUSE_RELEASED)
window_manager_->CloseWindow(view->node()->id());
}
@@ -75,4 +75,4 @@ Application* Application::Create() {
return new examples::NestingApp;
}
-} // namespace mojo \ No newline at end of file
+} // namespace mojo
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index cbdde1a..92d0403 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -66,7 +66,7 @@ class WindowManager : public Application,
}
// Overridden from ViewObserver:
- virtual void OnViewInputEvent(View* view, EventPtr event) OVERRIDE {
+ virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE {
if (event->action == ui::ET_MOUSE_RELEASED) {
if (event->flags & ui::EF_LEFT_MOUSE_BUTTON)
CreateWindow("mojo:mojo_embedded_app");
@@ -125,4 +125,4 @@ Application* Application::Create() {
return new examples::WindowManager;
}
-} // namespace mojo \ No newline at end of file
+} // namespace mojo
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc
index 4c5ee31..555673d 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc
@@ -711,7 +711,7 @@ void ViewManagerSynchronizer::OnViewInputEvent(
if (view) {
FOR_EACH_OBSERVER(ViewObserver,
*ViewPrivate(view).observers(),
- OnViewInputEvent(view, event.Pass()));
+ OnViewInputEvent(view, event));
}
ack_callback.Run();
}
diff --git a/mojo/services/public/cpp/view_manager/view_observer.h b/mojo/services/public/cpp/view_manager/view_observer.h
index 2e3571d..9e189fd 100644
--- a/mojo/services/public/cpp/view_manager/view_observer.h
+++ b/mojo/services/public/cpp/view_manager/view_observer.h
@@ -25,7 +25,7 @@ class ViewObserver {
virtual void OnViewDestroy(View* view, DispositionChangePhase phase) {}
- virtual void OnViewInputEvent(View* view, EventPtr event) {}
+ virtual void OnViewInputEvent(View* view, const EventPtr& event) {}
protected:
virtual ~ViewObserver() {}