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

Unified Diff: extensions/common/features/feature_channel.h

Issue 2854293003: Fix losing of scoped feature channel in tests when it's equal to stable (Closed)
Patch Set: Take account of override count Created 3 years, 7 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/features/feature_channel.h
diff --git a/extensions/common/features/feature_channel.h b/extensions/common/features/feature_channel.h
index 5533e5d588ce5f6226992202997c65112ecf9350..8393967cec4a2c145e78b6f36c4b20aa6fe62f69 100644
--- a/extensions/common/features/feature_channel.h
+++ b/extensions/common/features/feature_channel.h
@@ -18,20 +18,22 @@ version_info::Channel GetCurrentChannel();
// Sets the current channel as seen by the Feature system. In the browser
// process this should be chrome::GetChannel(), and in the renderer this will
-// need to come from an IPC.
+// need to come from an IPC. Note that the value set through this function may
+// be overridden by |ScopedCurrentChannel|.
void SetCurrentChannel(version_info::Channel channel);
-// Gets the default channel as seen by the Feature system.
-version_info::Channel GetDefaultChannel();
-
// Scoped channel setter. Use for tests.
+// Note that the lifetimes of multiple instances of this class must be disjoint
+// or nested, but never overlapping.
class ScopedCurrentChannel {
public:
explicit ScopedCurrentChannel(version_info::Channel channel);
~ScopedCurrentChannel();
private:
- version_info::Channel original_channel_;
+ const version_info::Channel channel_;
+ const version_info::Channel original_overridden_channel_;
+ const int original_override_count_;
DISALLOW_COPY_AND_ASSIGN(ScopedCurrentChannel);
};
« no previous file with comments | « chrome/browser/extensions/chrome_extensions_browser_client.cc ('k') | extensions/common/features/feature_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698