| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This class simulates what wininet does when a dns lookup fails. | 4 // This class simulates what wininet does when a dns lookup fails. |
| 5 | 5 |
| 6 #ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ | 6 #ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ |
| 7 #define CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ | 7 #define CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ |
| 8 #pragma once | 8 #pragma once |
| 9 | 9 |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| 11 #include "chrome/common/ref_counted_util.h" | 11 #include "chrome/common/ref_counted_util.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // Protected net::URLRequestJob override. | 76 // Protected net::URLRequestJob override. |
| 77 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); | 77 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); |
| 78 | 78 |
| 79 void StartAsync(); | 79 void StartAsync(); |
| 80 void Cleanup(); | 80 void Cleanup(); |
| 81 void DisconnectFromMessageFilter(); | 81 void DisconnectFromMessageFilter(); |
| 82 | 82 |
| 83 // IPC message handlers. | 83 // IPC message handlers. |
| 84 void OnRequestStarted(int id, const AutomationURLResponse& response); | 84 void OnRequestStarted(int id, const AutomationURLResponse& response); |
| 85 void OnDataAvailable(int id, const std::string& bytes); | 85 void OnDataAvailable(int id, const std::string& bytes); |
| 86 void OnRequestEnd(int id, const URLRequestStatus& status); | 86 void OnRequestEnd(int id, const net::URLRequestStatus& status); |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 virtual ~URLRequestAutomationJob(); | 89 virtual ~URLRequestAutomationJob(); |
| 90 | 90 |
| 91 // Task which is scheduled in the URLRequestAutomationJob::ReadRawData | 91 // Task which is scheduled in the URLRequestAutomationJob::ReadRawData |
| 92 // function, which completes the job. | 92 // function, which completes the job. |
| 93 void NotifyJobCompletionTask(); | 93 void NotifyJobCompletionTask(); |
| 94 | 94 |
| 95 int id_; | 95 int id_; |
| 96 int tab_; | 96 int tab_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 121 // Contains the request status code, which is eventually passed to the http | 121 // Contains the request status code, which is eventually passed to the http |
| 122 // stack when we receive a Read request for a completed job. | 122 // stack when we receive a Read request for a completed job. |
| 123 URLRequestStatus request_status_; | 123 URLRequestStatus request_status_; |
| 124 | 124 |
| 125 ScopedRunnableMethodFactory<URLRequestAutomationJob> method_factory_; | 125 ScopedRunnableMethodFactory<URLRequestAutomationJob> method_factory_; |
| 126 | 126 |
| 127 DISALLOW_COPY_AND_ASSIGN(URLRequestAutomationJob); | 127 DISALLOW_COPY_AND_ASSIGN(URLRequestAutomationJob); |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 #endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ | 130 #endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ |
| OLD | NEW |