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

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

Issue 2034153002: Makes RenderFrameObserver/RenderViewObserver::OnDestruct pure virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 4 years, 6 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 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_
6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ 6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/id_map.h" 9 #include "base/id_map.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 16 matching lines...) Expand all
27 NON_EXPORTED_BASE(public blink::WebScreenOrientationClient) { 27 NON_EXPORTED_BASE(public blink::WebScreenOrientationClient) {
28 public: 28 public:
29 explicit ScreenOrientationDispatcher(RenderFrame* render_frame); 29 explicit ScreenOrientationDispatcher(RenderFrame* render_frame);
30 ~ScreenOrientationDispatcher() override; 30 ~ScreenOrientationDispatcher() override;
31 31
32 private: 32 private:
33 friend class ScreenOrientationDispatcherTest; 33 friend class ScreenOrientationDispatcherTest;
34 34
35 // RenderFrameObserver implementation. 35 // RenderFrameObserver implementation.
36 bool OnMessageReceived(const IPC::Message& message) override; 36 bool OnMessageReceived(const IPC::Message& message) override;
37 void OnDestruct() override;
37 38
38 // blink::WebScreenOrientationClient implementation. 39 // blink::WebScreenOrientationClient implementation.
39 void lockOrientation(blink::WebScreenOrientationLockType orientation, 40 void lockOrientation(blink::WebScreenOrientationLockType orientation,
40 blink::WebLockOrientationCallback* callback) override; 41 blink::WebLockOrientationCallback* callback) override;
41 void unlockOrientation() override; 42 void unlockOrientation() override;
42 43
43 void OnLockSuccess(int request_id); 44 void OnLockSuccess(int request_id);
44 void OnLockError(int request_id, 45 void OnLockError(int request_id,
45 blink::WebLockOrientationError error); 46 blink::WebLockOrientationError error);
46 47
47 void CancelPendingLocks(); 48 void CancelPendingLocks();
48 49
49 // The pending_callbacks_ map is mostly meant to have a unique ID to associate 50 // The pending_callbacks_ map is mostly meant to have a unique ID to associate
50 // with every callback going trough the dispatcher. The map will own the 51 // with every callback going trough the dispatcher. The map will own the
51 // pointer in the sense that it will destroy it when Remove() will be called. 52 // pointer in the sense that it will destroy it when Remove() will be called.
52 // Furthermore, we only expect to have one callback at a time in this map, 53 // Furthermore, we only expect to have one callback at a time in this map,
53 // which is what IDMap was designed for. 54 // which is what IDMap was designed for.
54 typedef IDMap<blink::WebLockOrientationCallback, IDMapOwnPointer> CallbackMap; 55 typedef IDMap<blink::WebLockOrientationCallback, IDMapOwnPointer> CallbackMap;
55 CallbackMap pending_callbacks_; 56 CallbackMap pending_callbacks_;
56 57
57 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher); 58 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher);
58 }; 59 };
59 60
60 } // namespace content 61 } // namespace content
61 62
62 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ 63 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698