blob: afbd10ff024c65b1083ae3518abae92d8160ebe7 (
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
|
// Copyright 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.
#include "config.h"
#include "managed_memory_policy.h"
#include "priority_calculator.h"
namespace cc {
ManagedMemoryPolicy::ManagedMemoryPolicy(size_t bytesLimitWhenVisible)
: bytesLimitWhenVisible(bytesLimitWhenVisible)
, priorityCutoffWhenVisible(PriorityCalculator::allowEverythingCutoff())
, bytesLimitWhenNotVisible(0)
, priorityCutoffWhenNotVisible(PriorityCalculator::allowNothingCutoff())
{
}
ManagedMemoryPolicy::ManagedMemoryPolicy(size_t bytesLimitWhenVisible,
int priorityCutoffWhenVisible,
size_t bytesLimitWhenNotVisible,
int priorityCutoffWhenNotVisible)
: bytesLimitWhenVisible(bytesLimitWhenVisible)
, priorityCutoffWhenVisible(priorityCutoffWhenVisible)
, bytesLimitWhenNotVisible(bytesLimitWhenNotVisible)
, priorityCutoffWhenNotVisible(priorityCutoffWhenNotVisible)
{
}
bool ManagedMemoryPolicy::operator==(const ManagedMemoryPolicy& other) const
{
return bytesLimitWhenVisible == other.bytesLimitWhenVisible &&
priorityCutoffWhenVisible == other.priorityCutoffWhenVisible &&
bytesLimitWhenNotVisible == other.bytesLimitWhenNotVisible &&
priorityCutoffWhenNotVisible == other.priorityCutoffWhenNotVisible;
}
bool ManagedMemoryPolicy::operator!=(const ManagedMemoryPolicy& other) const
{
return !(*this == other);
}
} // namespace cc
|