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

Unified Diff: third_party/grpc/src/compiler/ruby_generator_helpers-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_helpers-inl.h
diff --git a/third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp b/third_party/grpc/src/compiler/ruby_generator_helpers-inl.h
similarity index 58%
copy from third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp
copy to third_party/grpc/src/compiler/ruby_generator_helpers-inl.h
index 8c287c763cb0bd11ffed567f0411acf44972e26c..9da7cab3c7f3dd5d33b023f67fc26a50cbd8686d 100644
--- a/third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp
+++ b/third_party/grpc/src/compiler/ruby_generator_helpers-inl.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2010 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,33 +28,38 @@
* 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.
+ *
*/
-#include "core/html/forms/ButtonInputType.h"
+#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H
+#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H
-#include "core/InputTypeNames.h"
-#include "wtf/PassOwnPtr.h"
+#include "src/compiler/config.h"
+#include "src/compiler/ruby_generator_string-inl.h"
-namespace blink {
+namespace grpc_ruby_generator {
-InputType* ButtonInputType::create(HTMLInputElement& element)
-{
- return new ButtonInputType(element);
-}
-
-const AtomicString& ButtonInputType::formControlType() const
-{
- return InputTypeNames::button;
-}
-
-bool ButtonInputType::supportsValidation() const
-{
+inline bool ServicesFilename(const grpc::protobuf::FileDescriptor *file,
+ grpc::string *file_name_or_error) {
+ // Get output file name.
+ static const unsigned proto_suffix_length = 6; // length of ".proto"
+ if (file->name().size() > proto_suffix_length &&
+ file->name().find_last_of(".proto") == file->name().size() - 1) {
+ *file_name_or_error =
+ file->name().substr(0, file->name().size() - proto_suffix_length) +
+ "_services.rb";
+ return true;
+ } else {
+ *file_name_or_error = "Invalid proto file name: must end with .proto";
return false;
+ }
}
-bool ButtonInputType::isTextButton() const
-{
- return true;
+inline grpc::string MessagesRequireName(
+ const grpc::protobuf::FileDescriptor *file) {
+ return Replace(file->name(), ".proto", "");
}
-} // namespace blink
+} // namespace grpc_ruby_generator
+
+#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H
« no previous file with comments | « third_party/grpc/src/compiler/ruby_generator.cc ('k') | third_party/grpc/src/compiler/ruby_generator_map-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698