Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/vcl/source/app/idle.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include <vcl/idle.hxx>
21
#include <vcl/scheduler.hxx>
22
23
Idle::Idle( bool bAuto, const char *pDebugName )
24
2.47M
    : Timer( bAuto, pDebugName )
25
2.47M
{
26
2.47M
    SetPriority( TaskPriority::DEFAULT_IDLE );
27
2.47M
}
28
29
Idle::Idle( const char *pDebugName )
30
2.47M
    : Idle( false, pDebugName )
31
2.47M
{
32
2.47M
}
33
34
void Idle::Start(const bool bStartTimer)
35
356k
{
36
356k
    Task::Start(false);
37
38
356k
    sal_uInt64 nPeriod = Scheduler::ImmediateTimeoutMs;
39
356k
    if (Scheduler::GetDeterministicMode())
40
0
    {
41
0
        switch ( GetPriority() )
42
0
        {
43
0
            case TaskPriority::DEFAULT_IDLE:
44
0
            case TaskPriority::LOWEST:
45
0
                nPeriod = Scheduler::InfiniteTimeoutMs;
46
0
                break;
47
0
            default:
48
0
                break;
49
0
        }
50
0
    }
51
52
356k
    if (bStartTimer)
53
356k
        Task::StartTimer(nPeriod);
54
356k
}
55
56
sal_uInt64 Idle::UpdateMinPeriod( sal_uInt64 /* nTimeNow */ ) const
57
2.79k
{
58
2.79k
    return Scheduler::ImmediateTimeoutMs;
59
2.79k
}
60
61
AutoIdle::AutoIdle( const char *pDebugName )
62
0
    : Idle( true, pDebugName )
63
0
{
64
0
}
65
66
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */