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

Side by Side Diff: chrome/browser/devtools/device/adb/mock_adb_server.cc

Issue 669873002: Standardize usage of virtual/override/final in chrome/browser/devtools/ (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 "base/memory/weak_ptr.h" 5 #include "base/memory/weak_ptr.h"
6 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/threading/non_thread_safe.h" 9 #include "base/threading/non_thread_safe.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 class AdbParser : SimpleHttpServer::Parser, base::NonThreadSafe { 365 class AdbParser : SimpleHttpServer::Parser, base::NonThreadSafe {
366 public: 366 public:
367 static Parser* Create(const SimpleHttpServer::SendCallback& callback) { 367 static Parser* Create(const SimpleHttpServer::SendCallback& callback) {
368 return new AdbParser(callback); 368 return new AdbParser(callback);
369 } 369 }
370 370
371 explicit AdbParser(const SimpleHttpServer::SendCallback& callback) 371 explicit AdbParser(const SimpleHttpServer::SendCallback& callback)
372 : callback_(callback) { 372 : callback_(callback) {
373 } 373 }
374 374
375 virtual ~AdbParser() { 375 ~AdbParser() override {}
376 }
377 376
378 private: 377 private:
379 virtual int Consume(const char* data, int size) override { 378 int Consume(const char* data, int size) override {
380 CHECK(CalledOnValidThread()); 379 CHECK(CalledOnValidThread());
381 if (!selected_socket_.empty()) { 380 if (!selected_socket_.empty()) {
382 std::string message(data, size); 381 std::string message(data, size);
383 size_t request_end_pos = message.find(kHttpRequestTerminator); 382 size_t request_end_pos = message.find(kHttpRequestTerminator);
384 if (request_end_pos != std::string::npos) { 383 if (request_end_pos != std::string::npos) {
385 ProcessHTTPRequest(message.substr(0, request_end_pos)); 384 ProcessHTTPRequest(message.substr(0, request_end_pos));
386 return request_end_pos + strlen(kHttpRequestTerminator); 385 return request_end_pos + strlen(kHttpRequestTerminator);
387 } 386 }
388 return 0; 387 return 0;
389 } 388 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 539
541 void StopMockAdbServer() { 540 void StopMockAdbServer() {
542 BrowserThread::PostTaskAndReply( 541 BrowserThread::PostTaskAndReply(
543 BrowserThread::IO, 542 BrowserThread::IO,
544 FROM_HERE, 543 FROM_HERE,
545 base::Bind(&StopMockAdbServerOnIOThread), 544 base::Bind(&StopMockAdbServerOnIOThread),
546 base::MessageLoop::QuitClosure()); 545 base::MessageLoop::QuitClosure());
547 content::RunMessageLoop(); 546 content::RunMessageLoop();
548 } 547 }
549 548
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/adb/adb_device_provider.h ('k') | chrome/browser/devtools/device/android_web_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698