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

Unified Diff: third_party/grpc/src/compiler/ruby_generator_map-inl.h

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/src/compiler/ruby_generator_map-inl.h
diff --git a/third_party/WebKit/Source/core/svg/SVGTransformListTearOff.h b/third_party/grpc/src/compiler/ruby_generator_map-inl.h
similarity index 57%
copy from third_party/WebKit/Source/core/svg/SVGTransformListTearOff.h
copy to third_party/grpc/src/compiler/ruby_generator_map-inl.h
index 33a4e972a26b163eec058c1a2305e47a3219ed05..6b87774f2136b576a47fdd822b4d1dc9163359f2 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransformListTearOff.h
+++ b/third_party/grpc/src/compiler/ruby_generator_map-inl.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,36 +28,46 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-#ifndef SVGTransformListTearOff_h
-#define SVGTransformListTearOff_h
-
-#include "core/svg/SVGTransformList.h"
-#include "core/svg/SVGTransformTearOff.h"
-#include "core/svg/properties/SVGListPropertyTearOffHelper.h"
+#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H
+#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H
-namespace blink {
+#include "src/compiler/config.h"
-class SVGTransformListTearOff final
- : public SVGListPropertyTearOffHelper<SVGTransformListTearOff, SVGTransformList>
- , public ScriptWrappable {
- DEFINE_WRAPPERTYPEINFO();
-public:
- static SVGTransformListTearOff* create(SVGTransformList* target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName = QualifiedName::null())
- {
- return new SVGTransformListTearOff(target, contextElement, propertyIsAnimVal, attributeName);
- }
+#include <iostream>
+#include <initializer_list>
+#include <map>
+#include <ostream> // NOLINT
+#include <vector>
- ~SVGTransformListTearOff() override;
+using std::initializer_list;
+using std::map;
+using std::vector;
- SVGTransformTearOff* createSVGTransformFromMatrix(SVGMatrixTearOff*) const;
- SVGTransformTearOff* consolidate(ExceptionState&);
+namespace grpc_ruby_generator {
-private:
- SVGTransformListTearOff(SVGTransformList*, SVGElement*, PropertyIsAnimValType, const QualifiedName&);
-};
+// Converts an initializer list of the form { key0, value0, key1, value1, ... }
+// into a map of key* to value*. Is merely a readability helper for later code.
+inline std::map<grpc::string, grpc::string> ListToDict(
+ const initializer_list<grpc::string> &values) {
+ if (values.size() % 2 != 0) {
+ std::cerr << "Not every 'key' has a value in `values`."
+ << std::endl;
+ }
+ std::map<grpc::string, grpc::string> value_map;
+ auto value_iter = values.begin();
+ for (unsigned i = 0; i < values.size() / 2; ++i) {
+ grpc::string key = *value_iter;
+ ++value_iter;
+ grpc::string value = *value_iter;
+ value_map[key] = value;
+ ++value_iter;
+ }
+ return value_map;
+}
-} // namespace blink
+} // namespace grpc_ruby_generator
-#endif // SVGTransformListTearOff_h
+#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H
« no previous file with comments | « third_party/grpc/src/compiler/ruby_generator_helpers-inl.h ('k') | third_party/grpc/src/compiler/ruby_generator_string-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698