Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: storage/browser/quota/quota_settings.h

Issue 2777183010: [Quota] Lower quota for ephemeral mode (ie. session only) (Closed)
Patch Set: randomize Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_SETTINGS_H_ 5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_SETTINGS_H_
6 #define STORAGE_BROWSER_QUOTA_QUOTA_SETTINGS_H_ 6 #define STORAGE_BROWSER_QUOTA_QUOTA_SETTINGS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/optional.h" 12 #include "base/optional.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "storage/browser/storage_browser_export.h" 14 #include "storage/browser/storage_browser_export.h"
15 15
16 namespace storage { 16 namespace storage {
17 17
18 // Settings the storage lib embedder must provide to the QuotaManager. 18 // Settings the storage lib embedder must provide to the QuotaManager.
19 struct QuotaSettings { 19 struct QuotaSettings {
20 QuotaSettings() = default; 20 QuotaSettings() = default;
21 QuotaSettings(int64_t pool_size, 21 QuotaSettings(int64_t pool_size,
22 int64_t per_host_quota, 22 int64_t per_host_quota,
23 int64_t should_remain_available, 23 int64_t should_remain_available,
24 int64_t must_remain_available) 24 int64_t must_remain_available)
25 : pool_size(pool_size), 25 : pool_size(pool_size),
26 per_host_quota(per_host_quota), 26 per_host_quota(per_host_quota),
27 session_only_per_host_quota(per_host_quota),
27 should_remain_available(should_remain_available), 28 should_remain_available(should_remain_available),
28 must_remain_available(must_remain_available) {} 29 must_remain_available(must_remain_available) {}
29 30
30 // The target size in bytes of the shared pool of disk space the quota 31 // The target size in bytes of the shared pool of disk space the quota
31 // system allows for use by websites using HTML5 storage apis, for 32 // system allows for use by websites using HTML5 storage apis, for
32 // example an embedder may use 50% of the total volume size. 33 // example an embedder may use 50% of the total volume size.
33 int64_t pool_size = 0; 34 int64_t pool_size = 0;
34 35
35 // The amount in bytes of the pool an individual site may consume. The 36 // The amount in bytes of the pool an individual site may consume. The
36 // value must be less than or equal to the pool_size. 37 // value must be less than or equal to the pool_size.
37 int64_t per_host_quota = 0; 38 int64_t per_host_quota = 0;
38 39
40 // The amount allotted to origins that are considered session only
41 // according to the SpecialStoargePolicy provided by the embedder.
jsbell 2017/04/04 16:23:57 typo: 'Stoarge'
michaeln 2017/04/05 01:20:56 Done.
42 int64_t session_only_per_host_quota = 0;
43
39 // The amount of space that should remain available on the storage 44 // The amount of space that should remain available on the storage
40 // volume. As the volume approaches this limit, the quota system gets 45 // volume. As the volume approaches this limit, the quota system gets
41 // more aggressive about evicting data. 46 // more aggressive about evicting data.
42 int64_t should_remain_available = 0; 47 int64_t should_remain_available = 0;
43 48
44 // The amount of space that must remain available on the storage 49 // The amount of space that must remain available on the storage
45 // volume. As the volume approaches this limit, the quota system gets 50 // volume. As the volume approaches this limit, the quota system gets
46 // very aggressive about disallowing new data. 51 // very aggressive about disallowing new data.
47 int64_t must_remain_available = 0; 52 int64_t must_remain_available = 0;
48 53
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Returns settings that provide given |per_host_quota| and a total poolsize of 86 // Returns settings that provide given |per_host_quota| and a total poolsize of
82 // five times that. 87 // five times that.
83 inline QuotaSettings GetHardCodedSettings(int64_t per_host_quota) { 88 inline QuotaSettings GetHardCodedSettings(int64_t per_host_quota) {
84 return QuotaSettings(per_host_quota * 5, per_host_quota, 89 return QuotaSettings(per_host_quota * 5, per_host_quota,
85 per_host_quota, per_host_quota); 90 per_host_quota, per_host_quota);
86 } 91 }
87 92
88 } // namespace storage 93 } // namespace storage
89 94
90 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ 95 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698