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

Side by Side Diff: chrome/browser/experiments/memory_ablation_experiment.h

Issue 2810833002: Add memory ablation experiment. (Closed)
Patch Set: Rebase 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXPERIMENTS_MEMORY_ABLATION_EXPERIMENT_H_
6 #define CHROME_BROWSER_EXPERIMENTS_MEMORY_ABLATION_EXPERIMENT_H_
7
8 #include <memory>
9
10 #include "base/feature_list.h"
11 #include "base/memory/ref_counted.h"
12
13 namespace base {
14 class SequencedTaskRunner;
15 }
16
17 extern const base::Feature kMemoryAblationFeature;
18 extern const char kMemoryAblationFeatureSizeParam[];
19
20 /* When enabled, this experiment allocates a chunk of memory to study
21 * correlation between memory usage and performance metrics.
22 */
23 class MemoryAblationExperiment {
24 public:
25 ~MemoryAblationExperiment();
26
27 // Starts the experiment if corresponding field trial is enabled
28 static void MaybeStart(scoped_refptr<base::SequencedTaskRunner> task_runner);
29
30 private:
31 MemoryAblationExperiment();
32
33 void Start(scoped_refptr<base::SequencedTaskRunner> task_runner, size_t size);
34
35 void AllocateMemory(size_t size);
36 void TouchMemory();
37
38 static MemoryAblationExperiment* GetInstance();
39
40 size_t memory_size_ = 0;
41 std::unique_ptr<uint8_t[]> memory_;
42 };
43
44 #endif // CHROME_BROWSER_EXPERIMENTS_MEMORY_ABLATION_EXPERIMENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/experiments/memory_ablation_experiment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698