| OLD | NEW |
| 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 Loading... |
| 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 typedef IDMap<std::unique_ptr<blink::WebLockOrientationCallback>> CallbackMap; |
| 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_ |
| OLD | NEW |