OLD | NEW |
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 " \"id\": \"44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" | 146 " \"id\": \"44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" |
147 " \"thumbnailUrl\": \"/thumb/44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" | 147 " \"thumbnailUrl\": \"/thumb/44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" |
148 " \"title\": \"More Activity\",\n" | 148 " \"title\": \"More Activity\",\n" |
149 " \"type\": \"page\",\n" | 149 " \"type\": \"page\",\n" |
150 " \"url\": \"about:blank\",\n" | 150 " \"url\": \"about:blank\",\n" |
151 " \"webSocketDebuggerUrl\": \"ws:///devtools/page/" | 151 " \"webSocketDebuggerUrl\": \"ws:///devtools/page/" |
152 "44681551-ADFD-2411-076B-3AB14C1C60E2\"\n" | 152 "44681551-ADFD-2411-076B-3AB14C1C60E2\"\n" |
153 "}]"; | 153 "}]"; |
154 | 154 |
155 static const int kBufferSize = 16*1024; | 155 static const int kBufferSize = 16*1024; |
156 static const int kAdbPort = 5037; | 156 static const uint16 kAdbPort = 5037; |
157 | 157 |
158 static const int kAdbMessageHeaderSize = 4; | 158 static const int kAdbMessageHeaderSize = 4; |
159 | 159 |
160 class SimpleHttpServer : base::NonThreadSafe { | 160 class SimpleHttpServer : base::NonThreadSafe { |
161 public: | 161 public: |
162 class Parser { | 162 class Parser { |
163 public: | 163 public: |
164 virtual int Consume(const char* data, int size) = 0; | 164 virtual int Consume(const char* data, int size) = 0; |
165 virtual ~Parser() {} | 165 virtual ~Parser() {} |
166 }; | 166 }; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 void StopMockAdbServer() { | 540 void StopMockAdbServer() { |
541 BrowserThread::PostTaskAndReply( | 541 BrowserThread::PostTaskAndReply( |
542 BrowserThread::IO, | 542 BrowserThread::IO, |
543 FROM_HERE, | 543 FROM_HERE, |
544 base::Bind(&StopMockAdbServerOnIOThread), | 544 base::Bind(&StopMockAdbServerOnIOThread), |
545 base::MessageLoop::QuitClosure()); | 545 base::MessageLoop::QuitClosure()); |
546 content::RunMessageLoop(); | 546 content::RunMessageLoop(); |
547 } | 547 } |
548 | 548 |
OLD | NEW |