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

Side by Side Diff: content/renderer/screen_orientation/screen_orientation_observer.h

Issue 613203002: Have PlatformEventObserver implementations orderly stop on destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up a comment. Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/renderer/platform_event_observer.h" 5 #include "content/public/renderer/platform_event_observer.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 // ScreenOrientationObserver is a helper class implementing the 9 // ScreenOrientationObserver is a helper class implementing the
10 // PlatformEventObserver template with blink::WebPlatformEventListener, which is 10 // PlatformEventObserver template with blink::WebPlatformEventListener, which is
11 // a pure virtual class because it doesn't expect listeners. 11 // a pure virtual class because it doesn't expect listeners.
12 // It is implemented on top of PlatformEventObserver to make sure it follows a 12 // It is implemented on top of PlatformEventObserver to make sure it follows a
13 // common code path even though it only uses part of this code path: it is not 13 // common code path even though it only uses part of this code path: it is not
14 // expected to receive messages back but should send messages to start/stop 14 // expected to receive messages back but should send messages to start/stop
15 // listening. 15 // listening.
16 // The intent of this class is to make sure that platforms that can't listen for 16 // The intent of this class is to make sure that platforms that can't listen for
17 // display rotations at a marginal cost can be told when to actually do it. 17 // display rotations at a marginal cost can be told when to actually do it.
18 class ScreenOrientationObserver 18 class ScreenOrientationObserver
19 : public PlatformEventObserver<blink::WebPlatformEventListener> { 19 : public PlatformEventObserver<blink::WebPlatformEventListener> {
20 public: 20 public:
21 ScreenOrientationObserver(); 21 ScreenOrientationObserver();
22 virtual ~ScreenOrientationObserver();
22 23
23 // Overriding this method just to make sure |listener| is always null. 24 // Overriding this method just to make sure |listener| is always null.
24 virtual void Start(blink::WebPlatformEventListener* listener) OVERRIDE; 25 virtual void Start(blink::WebPlatformEventListener* listener) OVERRIDE;
25 26
26 protected: 27 protected:
27 virtual void SendStartMessage() OVERRIDE; 28 virtual void SendStartMessage() OVERRIDE;
28 virtual void SendStopMessage() OVERRIDE; 29 virtual void SendStopMessage() OVERRIDE;
29 }; 30 };
30 31
31 }; // namespace content 32 }; // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gamepad_shared_memory_reader.cc ('k') | content/renderer/screen_orientation/screen_orientation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698