OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/automation/url_request_automation_job.h" | 5 #include "chrome/browser/automation/url_request_automation_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 net::HostPortPair URLRequestAutomationJob::GetSocketAddress() const { | 246 net::HostPortPair URLRequestAutomationJob::GetSocketAddress() const { |
247 return socket_address_; | 247 return socket_address_; |
248 } | 248 } |
249 | 249 |
250 bool URLRequestAutomationJob::MayFilterMessage(const IPC::Message& message, | 250 bool URLRequestAutomationJob::MayFilterMessage(const IPC::Message& message, |
251 int* request_id) { | 251 int* request_id) { |
252 switch (message.type()) { | 252 switch (message.type()) { |
253 case AutomationMsg_RequestStarted::ID: | 253 case AutomationMsg_RequestStarted::ID: |
254 case AutomationMsg_RequestData::ID: | 254 case AutomationMsg_RequestData::ID: |
255 case AutomationMsg_RequestEnd::ID: { | 255 case AutomationMsg_RequestEnd::ID: { |
256 void* iter = NULL; | 256 PickleIterator iter(message); |
257 if (message.ReadInt(&iter, request_id)) | 257 if (message.ReadInt(&iter, request_id)) |
258 return true; | 258 return true; |
259 break; | 259 break; |
260 } | 260 } |
261 } | 261 } |
262 | 262 |
263 return false; | 263 return false; |
264 } | 264 } |
265 | 265 |
266 void URLRequestAutomationJob::OnMessage(const IPC::Message& message) { | 266 void URLRequestAutomationJob::OnMessage(const IPC::Message& message) { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 if (!is_done()) { | 489 if (!is_done()) { |
490 NotifyDone(request_status_); | 490 NotifyDone(request_status_); |
491 } | 491 } |
492 // Reset any pending reads. | 492 // Reset any pending reads. |
493 if (pending_buf_) { | 493 if (pending_buf_) { |
494 pending_buf_ = NULL; | 494 pending_buf_ = NULL; |
495 pending_buf_size_ = 0; | 495 pending_buf_size_ = 0; |
496 NotifyReadComplete(0); | 496 NotifyReadComplete(0); |
497 } | 497 } |
498 } | 498 } |
OLD | NEW |