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

Unified Diff: Source/bindings/core/v8/V8DOMConfiguration.h

Issue 1310443005: [bindings] Compact ConstantConfiguration by using |union| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/bindings/templates/constants.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8DOMConfiguration.h
diff --git a/Source/bindings/core/v8/V8DOMConfiguration.h b/Source/bindings/core/v8/V8DOMConfiguration.h
index ce95d77deeae3c280105fef88d1795ea88a134c7..b0d8874093d8685616fcb7eacf17a176b9147487 100644
--- a/Source/bindings/core/v8/V8DOMConfiguration.h
+++ b/Source/bindings/core/v8/V8DOMConfiguration.h
@@ -125,10 +125,28 @@ public:
struct ConstantConfiguration {
ConstantConfiguration& operator=(const ConstantConfiguration&) = delete;
DISALLOW_ALLOCATION();
+ ConstantConfiguration(const char* const name, unsigned value, ConstantType type)
+ : name(name)
+ , ivalue(value)
+ , type(type) {}
+ ConstantConfiguration(const char* const name, int value, ConstantType type)
+ : name(name)
+ , ivalue(value)
+ , type(type) {}
+ ConstantConfiguration(const char* const name, double value, ConstantType type)
+ : name(name)
+ , dvalue(value)
+ , type(type) {}
+ ConstantConfiguration(const char* const name, const char* const value, ConstantType type)
+ : name(name)
+ , svalue(value)
+ , type(type) {}
const char* const name;
- int ivalue;
- double dvalue;
- const char* const svalue;
+ union {
+ int ivalue;
+ double dvalue;
+ const char* const svalue;
+ };
ConstantType type;
};
« no previous file with comments | « no previous file | Source/bindings/templates/constants.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698