~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/chromium/src/base/mac/scoped_aedesc.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
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_