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

Unified Diff: extensions/common/feature_switch.h

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: extensions/common/feature_switch.h
diff --git a/extensions/common/feature_switch.h b/extensions/common/feature_switch.h
index 6e2f8e7abad26aea46e520971f32ce80d79f2f54..390a758dd685be3c5a9aac7e8284470befb73cd2 100644
--- a/extensions/common/feature_switch.h
+++ b/extensions/common/feature_switch.h
@@ -41,6 +41,7 @@ class FeatureSwitch {
static FeatureSwitch* trace_app_source();
static FeatureSwitch* load_media_router_component_extension();
static FeatureSwitch* native_crx_bindings();
+ static FeatureSwitch* yield_between_content_script_runs();
enum DefaultValue {
DEFAULT_ENABLED,
@@ -53,6 +54,12 @@ class FeatureSwitch {
OVERRIDE_DISABLED
};
+ enum CachedValue {
+ NOT_CACHED,
+ CACHED_ENABLED,
+ CACHED_DISABLED
+ };
+
// A temporary override for the switch value.
class ScopedOverride {
public:
@@ -88,12 +95,14 @@ class FeatureSwitch {
private:
std::string GetLegacyEnableFlag() const;
std::string GetLegacyDisableFlag() const;
+ bool ComputeValue() const;
const base::CommandLine* command_line_;
const char* switch_name_;
const char* field_trial_name_;
bool default_value_;
OverrideValue override_value_;
+ mutable CachedValue cached_value_;
Devlin 2017/03/10 03:18:45 nit: maybe use a base::Optional<bool> here?
Kunihiko Sakamoto 2017/03/10 07:07:28 Done.
DISALLOW_COPY_AND_ASSIGN(FeatureSwitch);
};

Powered by Google App Engine
This is Rietveld 408576698