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

Side by Side Diff: mojo/public/cpp/bindings/array.h

Issue 579503003: Revert of mojo: Create a basic clipboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « mojo/mojo_services.gypi ('k') | mojo/services/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_
7 7
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void reset() { 61 void reset() {
62 if (!vec_.empty()) { 62 if (!vec_.empty()) {
63 Traits::Finalize(&vec_); 63 Traits::Finalize(&vec_);
64 vec_.clear(); 64 vec_.clear();
65 } 65 }
66 is_null_ = true; 66 is_null_ = true;
67 } 67 }
68 68
69 bool is_null() const { return is_null_; } 69 bool is_null() const { return is_null_; }
70 70
71 ConstRefType front() const { return vec_.front(); }
72 RefType front() { return vec_.front(); }
73
74 size_t size() const { return vec_.size(); } 71 size_t size() const { return vec_.size(); }
75 72
76 ConstRefType at(size_t offset) const { return Traits::at(&vec_, offset); } 73 ConstRefType at(size_t offset) const { return Traits::at(&vec_, offset); }
77 ConstRefType operator[](size_t offset) const { return at(offset); } 74 ConstRefType operator[](size_t offset) const { return at(offset); }
78 75
79 RefType at(size_t offset) { return Traits::at(&vec_, offset); } 76 RefType at(size_t offset) { return Traits::at(&vec_, offset); }
80 RefType operator[](size_t offset) { return at(offset); } 77 RefType operator[](size_t offset) { return at(offset); }
81 78
82 void push_back(ForwardType value) { 79 void push_back(ForwardType value) {
83 is_null_ = false; 80 is_null_ = false;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 for (size_t i = 0; i < input.size(); ++i) 137 for (size_t i = 0; i < input.size(); ++i)
141 result[i] = TypeConverter<E, T>::Convert(input[i]); 138 result[i] = TypeConverter<E, T>::Convert(input[i]);
142 } 139 }
143 return result; 140 return result;
144 } 141 }
145 }; 142 };
146 143
147 } // namespace mojo 144 } // namespace mojo
148 145
149 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ 146 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_
OLDNEW
« no previous file with comments | « mojo/mojo_services.gypi ('k') | mojo/services/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698