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

Side by Side Diff: extensions/browser/api/serial/serial_connection.cc

Issue 622343002: replace OVERRIDE and FINAL with override and final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "extensions/browser/api/serial/serial_connection.h" 5 #include "extensions/browser/api/serial/serial_connection.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return device::serial::STOP_BITS_NONE; 133 return device::serial::STOP_BITS_NONE;
134 } 134 }
135 135
136 class SendBuffer : public device::ReadOnlyBuffer { 136 class SendBuffer : public device::ReadOnlyBuffer {
137 public: 137 public:
138 SendBuffer( 138 SendBuffer(
139 const std::string& data, 139 const std::string& data,
140 const base::Callback<void(int, device::serial::SendError)>& callback) 140 const base::Callback<void(int, device::serial::SendError)>& callback)
141 : data_(data), callback_(callback) {} 141 : data_(data), callback_(callback) {}
142 virtual ~SendBuffer() {} 142 virtual ~SendBuffer() {}
143 virtual const char* GetData() OVERRIDE { return data_.c_str(); } 143 virtual const char* GetData() override { return data_.c_str(); }
144 virtual uint32_t GetSize() OVERRIDE { 144 virtual uint32_t GetSize() override {
145 return static_cast<uint32_t>(data_.size()); 145 return static_cast<uint32_t>(data_.size());
146 } 146 }
147 virtual void Done(uint32_t bytes_read) OVERRIDE { 147 virtual void Done(uint32_t bytes_read) override {
148 callback_.Run(bytes_read, device::serial::SEND_ERROR_NONE); 148 callback_.Run(bytes_read, device::serial::SEND_ERROR_NONE);
149 } 149 }
150 virtual void DoneWithError(uint32_t bytes_read, int32_t error) OVERRIDE { 150 virtual void DoneWithError(uint32_t bytes_read, int32_t error) override {
151 callback_.Run(bytes_read, static_cast<device::serial::SendError>(error)); 151 callback_.Run(bytes_read, static_cast<device::serial::SendError>(error));
152 } 152 }
153 153
154 private: 154 private:
155 const std::string data_; 155 const std::string data_;
156 const base::Callback<void(int, device::serial::SendError)> callback_; 156 const base::Callback<void(int, device::serial::SendError)> callback_;
157 }; 157 };
158 158
159 class ReceiveBuffer : public device::WritableBuffer { 159 class ReceiveBuffer : public device::WritableBuffer {
160 public: 160 public:
161 ReceiveBuffer( 161 ReceiveBuffer(
162 scoped_refptr<net::IOBuffer> buffer, 162 scoped_refptr<net::IOBuffer> buffer,
163 uint32_t size, 163 uint32_t size,
164 const base::Callback<void(int, device::serial::ReceiveError)>& callback) 164 const base::Callback<void(int, device::serial::ReceiveError)>& callback)
165 : buffer_(buffer), size_(size), callback_(callback) {} 165 : buffer_(buffer), size_(size), callback_(callback) {}
166 virtual ~ReceiveBuffer() {} 166 virtual ~ReceiveBuffer() {}
167 virtual char* GetData() OVERRIDE { return buffer_->data(); } 167 virtual char* GetData() override { return buffer_->data(); }
168 virtual uint32_t GetSize() OVERRIDE { return size_; } 168 virtual uint32_t GetSize() override { return size_; }
169 virtual void Done(uint32_t bytes_written) OVERRIDE { 169 virtual void Done(uint32_t bytes_written) override {
170 callback_.Run(bytes_written, device::serial::RECEIVE_ERROR_NONE); 170 callback_.Run(bytes_written, device::serial::RECEIVE_ERROR_NONE);
171 } 171 }
172 virtual void DoneWithError(uint32_t bytes_written, int32_t error) OVERRIDE { 172 virtual void DoneWithError(uint32_t bytes_written, int32_t error) override {
173 callback_.Run(bytes_written, 173 callback_.Run(bytes_written,
174 static_cast<device::serial::ReceiveError>(error)); 174 static_cast<device::serial::ReceiveError>(error));
175 } 175 }
176 176
177 private: 177 private:
178 scoped_refptr<net::IOBuffer> buffer_; 178 scoped_refptr<net::IOBuffer> buffer_;
179 const uint32_t size_; 179 const uint32_t size_;
180 const base::Callback<void(int, device::serial::ReceiveError)> callback_; 180 const base::Callback<void(int, device::serial::ReceiveError)> callback_;
181 }; 181 };
182 182
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); 428 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit);
429 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); 429 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits);
430 if (input.cts_flow_control.get()) { 430 if (input.cts_flow_control.get()) {
431 output->has_cts_flow_control = true; 431 output->has_cts_flow_control = true;
432 output->cts_flow_control = *input.cts_flow_control; 432 output->cts_flow_control = *input.cts_flow_control;
433 } 433 }
434 return output.Pass(); 434 return output.Pass();
435 } 435 }
436 436
437 } // namespace mojo 437 } // namespace mojo
OLDNEW
« no previous file with comments | « extensions/browser/api/serial/serial_connection.h ('k') | extensions/browser/api/socket/socket_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698