OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_ | 5 #ifndef CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_ |
6 #define CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_ | 6 #define CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_ |
7 | 7 |
8 #include "base/mac/scoped_mach_port.h" | 8 #include "base/mac/scoped_mach_port.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Set the token used when communicating with the Mach service. | 39 // Set the token used when communicating with the Mach service. |
40 // Note: This can be called on any thread but must happen before the | 40 // Note: This can be called on any thread but must happen before the |
41 // thread-safe IOSurfaceManager interface is used. It is the responsibility | 41 // thread-safe IOSurfaceManager interface is used. It is the responsibility |
42 // of users of this class to ensure there are no races. | 42 // of users of this class to ensure there are no races. |
43 void set_token(const IOSurfaceManagerToken& token) { | 43 void set_token(const IOSurfaceManagerToken& token) { |
44 token_ = token; | 44 token_ = token; |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 friend struct DefaultSingletonTraits<ChildIOSurfaceManager>; | 48 friend struct base::DefaultSingletonTraits<ChildIOSurfaceManager>; |
49 | 49 |
50 ChildIOSurfaceManager(); | 50 ChildIOSurfaceManager(); |
51 ~ChildIOSurfaceManager() override; | 51 ~ChildIOSurfaceManager() override; |
52 | 52 |
53 base::mac::ScopedMachSendRight service_port_; | 53 base::mac::ScopedMachSendRight service_port_; |
54 IOSurfaceManagerToken token_; | 54 IOSurfaceManagerToken token_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(ChildIOSurfaceManager); | 56 DISALLOW_COPY_AND_ASSIGN(ChildIOSurfaceManager); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace content | 59 } // namespace content |
60 | 60 |
61 #endif // CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_ | 61 #endif // CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_ |
OLD | NEW |