summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/common/jstemplate_builder.cc10
-rw-r--r--chrome/common/jstemplate_builder.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/chrome/common/jstemplate_builder.cc b/chrome/common/jstemplate_builder.cc
index eb95674..9d0d46b 100644
--- a/chrome/common/jstemplate_builder.cc
+++ b/chrome/common/jstemplate_builder.cc
@@ -16,19 +16,19 @@
namespace {
-// True when building version 2 templates. See UseVersion2 class.
-bool g_version2 = false;
+// Non-zero when building version 2 templates. See UseVersion2 class.
+int g_version2 = 0;
} // namespace
namespace jstemplate_builder {
-UseVersion2::UseVersion2() : previous_value_(g_version2) {
- g_version2 = true;
+UseVersion2::UseVersion2() {
+ g_version2++;
}
UseVersion2::~UseVersion2() {
- g_version2 = previous_value_;
+ g_version2--;
}
std::string GetTemplateHtml(const base::StringPiece& html_template,
diff --git a/chrome/common/jstemplate_builder.h b/chrome/common/jstemplate_builder.h
index e925349..19afbc0 100644
--- a/chrome/common/jstemplate_builder.h
+++ b/chrome/common/jstemplate_builder.h
@@ -33,8 +33,6 @@ class UseVersion2 {
~UseVersion2();
private:
- bool previous_value_;
-
DISALLOW_COPY_AND_ASSIGN(UseVersion2);
};