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

Unified Diff: third_party/grpc/src/proto/math/math.proto

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
« no previous file with comments | « third_party/grpc/src/proto/grpc/testing/test.proto ('k') | third_party/grpc/src/python/grpcio/.gitignore » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/src/proto/math/math.proto
diff --git a/breakpad/linux/generate-test-dump.cc b/third_party/grpc/src/proto/math/math.proto
similarity index 55%
copy from breakpad/linux/generate-test-dump.cc
copy to third_party/grpc/src/proto/math/math.proto
index b0dca00a3679a062cb398d4f1cca95867ef6279c..311e148c021f66a8ed450e8258c60961314f546f 100644
--- a/breakpad/linux/generate-test-dump.cc
+++ b/third_party/grpc/src/proto/math/math.proto
@@ -1,4 +1,5 @@
-// Copyright (c) 2009, Google Inc.
+
+// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,41 +28,53 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// This code exists to generate minidump files for testing.
-
-#include <stdlib.h>
+syntax = "proto3";
-#include <unistd.h>
+package math;
-#include "breakpad/src/client/linux/handler/exception_handler.h"
-#include "breakpad/src/common/linux/linux_libc_support.h"
-#include "third_party/lss/linux_syscall_support.h"
+message DivArgs {
+ int64 dividend = 1;
+ int64 divisor = 2;
+}
-static bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
- void* context, bool success) {
- if (!success) {
- static const char msg[] = "Failed to write minidump\n";
- sys_write(2, msg, sizeof(msg) - 1);
- return false;
- }
+message DivReply {
+ int64 quotient = 1;
+ int64 remainder = 2;
+}
- static const char msg[] = "Wrote minidump: ";
- sys_write(2, msg, sizeof(msg) - 1);
- sys_write(2, descriptor.path(), strlen(descriptor.path()));
- sys_write(2, "\n", 1);
+message FibArgs {
+ int64 limit = 1;
+}
- return true;
+message Num {
+ int64 num = 1;
}
-static void DoSomethingWhichCrashes() {
- int local_var = 1;
- *reinterpret_cast<volatile char*>(NULL) = 1;
+message FibReply {
+ int64 count = 1;
}
-int main() {
- google_breakpad::MinidumpDescriptor minidump(".");
- google_breakpad::ExceptionHandler breakpad(minidump, NULL, DumpCallback, NULL,
- true, -1);
- DoSomethingWhichCrashes();
- return 0;
+service Math {
+ // Div divides args.dividend by args.divisor and returns the quotient and
+ // remainder.
+ rpc Div (DivArgs) returns (DivReply) {
+ }
+
+ // DivMany accepts an arbitrary number of division args from the client stream
+ // and sends back the results in the reply stream. The stream continues until
+ // the client closes its end; the server does the same after sending all the
+ // replies. The stream ends immediately if either end aborts.
+ rpc DivMany (stream DivArgs) returns (stream DivReply) {
+ }
+
+ // Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib
+ // generates up to limit numbers; otherwise it continues until the call is
+ // canceled. Unlike Fib above, Fib has no final FibReply.
+ rpc Fib (FibArgs) returns (stream Num) {
+ }
+
+ // Sum sums a stream of numbers, returning the final result once the stream
+ // is closed.
+ rpc Sum (stream Num) returns (Num) {
+ }
}
« no previous file with comments | « third_party/grpc/src/proto/grpc/testing/test.proto ('k') | third_party/grpc/src/python/grpcio/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698