summaryrefslogtreecommitdiff
path: root/chromium/content/common/handle_enumerator_win.h
blob: 5fd49813760e3134914f35b6b28e4331700a1804 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_COMMON_HANDLE_ENUMERATOR_WIN_H_
#define CONTENT_COMMON_HANDLE_ENUMERATOR_WIN_H_

#include "base/memory/ref_counted.h"
#include "base/process/process.h"
#include "base/strings/string16.h"

namespace content {

enum HandleType {
  ProcessHandle,
  ThreadHandle,
  FileHandle,
  DirectoryHandle,
  KeyHandle,
  WindowStationHandle,
  DesktopHandle,
  ServiceHandle,
  EventHandle,
  MutexHandle,
  SemaphoreHandle,
  TimerHandle,
  NamedPipeHandle,
  JobHandle,
  FileMapHandle,
  AlpcPortHandle,
  OtherHandle
};

static HandleType StringToHandleType(const string16& type);

static string16 GetAccessString(HandleType handle_type, ACCESS_MASK access);

class HandleEnumerator : public base::RefCountedThreadSafe<HandleEnumerator> {
 public:
  explicit HandleEnumerator(bool all_handles):
      all_handles_(all_handles) { }

  void EnumerateHandles();

 private:
  bool all_handles_;

  DISALLOW_COPY_AND_ASSIGN(HandleEnumerator);
};

}  // namespace content

#endif  // CONTENT_COMMON_HANDLE_ENUMERATOR_WIN_H_