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

Side by Side Diff: base/mac/scoped_aedesc.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « base/mac/os_crash_dumps.cc ('k') | base/mac/scoped_authorizationref.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_MAC_SCOPED_AEDESC_H_
6 #define BASE_MAC_SCOPED_AEDESC_H_
7
8 #import <CoreServices/CoreServices.h>
9
10 #include "base/basictypes.h"
11
12 namespace base {
13 namespace mac {
14
15 // The ScopedAEDesc is used to scope AppleEvent descriptors. On creation,
16 // it will store a NULL descriptor. On destruction, it will dispose of the
17 // descriptor.
18 //
19 // This class is parameterized for additional type safety checks. You can use
20 // the generic AEDesc type by not providing a template parameter:
21 // ScopedAEDesc<> desc;
22 template <typename AEDescType = AEDesc>
23 class ScopedAEDesc {
24 public:
25 ScopedAEDesc() {
26 AECreateDesc(typeNull, NULL, 0, &desc_);
27 }
28
29 ~ScopedAEDesc() {
30 AEDisposeDesc(&desc_);
31 }
32
33 // Used for in parameters.
34 operator const AEDescType*() {
35 return &desc_;
36 }
37
38 // Used for out parameters.
39 AEDescType* OutPointer() {
40 return &desc_;
41 }
42
43 private:
44 AEDescType desc_;
45
46 DISALLOW_COPY_AND_ASSIGN(ScopedAEDesc);
47 };
48
49 } // namespace mac
50 } // namespace base
51
52 #endif // BASE_MAC_SCOPED_AEDESC_H_
OLDNEW
« no previous file with comments | « base/mac/os_crash_dumps.cc ('k') | base/mac/scoped_authorizationref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698