summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/updater/extension_cache_delegate.cc
blob: b3ba719acc4a9705f7bd6c11cdc28d02f8fce96e (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
// Copyright 2015 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 "chrome/browser/extensions/updater/extension_cache_delegate.h"

namespace extensions {
namespace {

// Default maximum size of local cache on disk, in bytes.
const size_t kDefaultCacheSizeLimit = 256 * 1024 * 1024;

// Default minimum size of local cache on disk, in bytes.
const int kDefaultMinimumCacheSize = 1024 * 1024;

// Maximum age of unused extensions in the cache.
const int kMaxCacheAgeInDays = 30;

}  // namespace

ExtensionCacheDelegate::~ExtensionCacheDelegate() {
}

size_t ExtensionCacheDelegate::GetMinimumCacheSize() const {
  return kDefaultMinimumCacheSize;
}

size_t ExtensionCacheDelegate::GetMaximumCacheSize() const {
  return kDefaultCacheSizeLimit;
}

base::TimeDelta ExtensionCacheDelegate::GetMaximumCacheAge() const {
  return base::TimeDelta::FromDays(kMaxCacheAgeInDays);
}

}  // namespace extensions