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

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

Issue 2496653002: Part 2 of base::IDMap refactor to eliminate IDMapOwnPointer/IDMapExternalPointer modes (Closed)
Patch Set: typedefs => using statements, update comments in base/id_map.h Created 4 years 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 <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void SetScreenOrientationForTests( 61 void SetScreenOrientationForTests(
62 ScreenOrientationAssociatedPtr& screen_orientation_for_tests) { 62 ScreenOrientationAssociatedPtr& screen_orientation_for_tests) {
63 screen_orientation_ = std::move(screen_orientation_for_tests); 63 screen_orientation_ = std::move(screen_orientation_for_tests);
64 } 64 }
65 65
66 // The pending_callbacks_ map is mostly meant to have a unique ID to associate 66 // The pending_callbacks_ map is mostly meant to have a unique ID to associate
67 // with every callback going trough the dispatcher. The map will own the 67 // with every callback going trough the dispatcher. The map will own the
68 // pointer in the sense that it will destroy it when Remove() will be called. 68 // pointer in the sense that it will destroy it when Remove() will be called.
69 // Furthermore, we only expect to have one callback at a time in this map, 69 // Furthermore, we only expect to have one callback at a time in this map,
70 // which is what IDMap was designed for. 70 // which is what IDMap was designed for.
71 typedef IDMap<blink::WebLockOrientationCallback, IDMapOwnPointer> CallbackMap; 71 using CallbackMap = IDMap<std::unique_ptr<blink::WebLockOrientationCallback>>;
72 CallbackMap pending_callbacks_; 72 CallbackMap pending_callbacks_;
73 73
74 ScreenOrientationAssociatedPtr screen_orientation_; 74 ScreenOrientationAssociatedPtr screen_orientation_;
75 75
76 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher); 76 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher);
77 }; 77 };
78 78
79 } // namespace content 79 } // namespace content
80 80
81 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ 81 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | content/renderer/service_worker/embedded_worker_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698