~mir-team/qtmir/update-surface-observer

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/processcontroller.h

  • Committer: CI bot
  • Author(s): Ted Gould
  • Date: 2014-10-30 21:48:07 UTC
  • mfrom: (252.1.22 ual-pause)
  • Revision ID: ps-jenkins@lists.canonical.com-20141030214807-xmy7xifra09p893o
Use UAL pause/resume functions for stopping/continuing all tasks in the cgroup Fixes: 1379786, 1379788, 1382039
Approved by: Gerry Boland, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2014 Canonical, Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it under
5
 
 * the terms of the GNU Lesser General Public License version 3, as published by
6
 
 * the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 
 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
 
 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
 
 * Lesser General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 */
17
 
 
18
 
#ifndef PROCESS_CONTROLLER_H
19
 
#define PROCESS_CONTROLLER_H
20
 
 
21
 
#include <QSharedPointer>
22
 
 
23
 
#include <sys/types.h>
24
 
 
25
 
namespace qtmir
26
 
{
27
 
 
28
 
class ProcessController
29
 
{
30
 
public:
31
 
    class OomController
32
 
    {
33
 
    public:
34
 
        OomController();
35
 
        OomController(const OomController&) = delete;
36
 
        virtual ~OomController() = default;
37
 
 
38
 
        OomController& operator=(const OomController&) = delete;
39
 
 
40
 
        virtual void ensureProcessLikelyToBeKilled(pid_t);
41
 
        virtual void ensureProcessLessLikelyToBeKilled(pid_t);
42
 
        virtual void ensureProcessUnlikelyToBeKilled(pid_t);
43
 
    };
44
 
 
45
 
    ProcessController();
46
 
    ProcessController(const ProcessController&) = delete;
47
 
    virtual ~ProcessController();
48
 
 
49
 
    ProcessController& operator=(const ProcessController&) = delete;
50
 
 
51
 
    virtual const QSharedPointer<OomController>& oomController() const;
52
 
 
53
 
    virtual bool sigStopProcessGroupForPid(pid_t pid) const;
54
 
    virtual bool sigContinueProcessGroupForPid(pid_t pid) const;
55
 
 
56
 
protected:
57
 
    QSharedPointer<OomController> m_oomController;
58
 
};
59
 
 
60
 
} // namespace qtmir
61
 
 
62
 
#endif // PROCESS_CONTROLLER_H