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

Side by Side Diff: third_party/protobuf/src/google/protobuf/duration.proto

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved. 2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/ 3 // https://developers.google.com/protocol-buffers/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 15 matching lines...) Expand all
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 30
31 syntax = "proto3"; 31 syntax = "proto3";
32 32
33 package google.protobuf; 33 package google.protobuf;
34 34
35 option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 35 option csharp_namespace = "Google.Protobuf.WellKnownTypes";
36 option cc_enable_arenas = true;
36 option go_package = "github.com/golang/protobuf/ptypes/duration"; 37 option go_package = "github.com/golang/protobuf/ptypes/duration";
37 option java_package = "com.google.protobuf"; 38 option java_package = "com.google.protobuf";
38 option java_outer_classname = "DurationProto"; 39 option java_outer_classname = "DurationProto";
39 option java_multiple_files = true; 40 option java_multiple_files = true;
40 option java_generate_equals_and_hash = true;
41 option objc_class_prefix = "GPB"; 41 option objc_class_prefix = "GPB";
42 42
43 // A Duration represents a signed, fixed-length span of time represented 43 // A Duration represents a signed, fixed-length span of time represented
44 // as a count of seconds and fractions of seconds at nanosecond 44 // as a count of seconds and fractions of seconds at nanosecond
45 // resolution. It is independent of any calendar and concepts like "day" 45 // resolution. It is independent of any calendar and concepts like "day"
46 // or "month". It is related to Timestamp in that the difference between 46 // or "month". It is related to Timestamp in that the difference between
47 // two Timestamp values is a Duration and it can be added or subtracted 47 // two Timestamp values is a Duration and it can be added or subtracted
48 // from a Timestamp. Range is approximately +-10,000 years. 48 // from a Timestamp. Range is approximately +-10,000 years.
49 // 49 //
50 // Example 1: Compute Duration from two Timestamps in pseudo code. 50 // Example 1: Compute Duration from two Timestamps in pseudo code.
(...skipping 23 matching lines...) Expand all
74 // end.nanos = start.nanos + duration.nanos; 74 // end.nanos = start.nanos + duration.nanos;
75 // 75 //
76 // if (end.nanos < 0) { 76 // if (end.nanos < 0) {
77 // end.seconds -= 1; 77 // end.seconds -= 1;
78 // end.nanos += 1000000000; 78 // end.nanos += 1000000000;
79 // } else if (end.nanos >= 1000000000) { 79 // } else if (end.nanos >= 1000000000) {
80 // end.seconds += 1; 80 // end.seconds += 1;
81 // end.nanos -= 1000000000; 81 // end.nanos -= 1000000000;
82 // } 82 // }
83 // 83 //
84 // Example 3: Compute Duration from datetime.timedelta in Python.
85 //
86 // td = datetime.timedelta(days=3, minutes=10)
87 // duration = Duration()
88 // duration.FromTimedelta(td)
89 //
84 // 90 //
85 message Duration { 91 message Duration {
86 92
87 // Signed seconds of the span of time. Must be from -315,576,000,000 93 // Signed seconds of the span of time. Must be from -315,576,000,000
88 // to +315,576,000,000 inclusive. 94 // to +315,576,000,000 inclusive.
89 int64 seconds = 1; 95 int64 seconds = 1;
90 96
91 // Signed fractions of a second at nanosecond resolution of the span 97 // Signed fractions of a second at nanosecond resolution of the span
92 // of time. Durations less than one second are represented with a 0 98 // of time. Durations less than one second are represented with a 0
93 // `seconds` field and a positive or negative `nanos` field. For durations 99 // `seconds` field and a positive or negative `nanos` field. For durations
94 // of one second or more, a non-zero value for the `nanos` field must be 100 // of one second or more, a non-zero value for the `nanos` field must be
95 // of the same sign as the `seconds` field. Must be from -999,999,999 101 // of the same sign as the `seconds` field. Must be from -999,999,999
96 // to +999,999,999 inclusive. 102 // to +999,999,999 inclusive.
97 int32 nanos = 2; 103 int32 nanos = 2;
98 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698