security/sandbox/win/src/handle_closer_agent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/sandbox/win/src/handle_closer_agent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
     1.5 +// Use of this source code is governed by a BSD-style license that can be
     1.6 +// found in the LICENSE file.
     1.7 +
     1.8 +#ifndef SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_
     1.9 +#define SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_
    1.10 +
    1.11 +#include "base/basictypes.h"
    1.12 +#include "base/strings/string16.h"
    1.13 +#include "sandbox/win/src/handle_closer.h"
    1.14 +#include "sandbox/win/src/sandbox_types.h"
    1.15 +
    1.16 +namespace sandbox {
    1.17 +
    1.18 +// Target process code to close the handle list copied over from the broker.
    1.19 +class HandleCloserAgent {
    1.20 + public:
    1.21 +  HandleCloserAgent() {}
    1.22 +
    1.23 +  // Reads the serialized list from the broker and creates the lookup map.
    1.24 +  void InitializeHandlesToClose();
    1.25 +
    1.26 +  // Closes any handles matching those in the lookup map.
    1.27 +  bool CloseHandles();
    1.28 +
    1.29 +  // True if we have handles waiting to be closed
    1.30 +  static bool NeedsHandlesClosed();
    1.31 +
    1.32 + private:
    1.33 +  HandleMap handles_to_close_;
    1.34 +
    1.35 +  DISALLOW_COPY_AND_ASSIGN(HandleCloserAgent);
    1.36 +};
    1.37 +
    1.38 +}  // namespace sandbox
    1.39 +
    1.40 +#endif  // SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_

mercurial