| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 | 8 |
| 9 #include <vector> |
| 9 #include "chrome/common/ref_counted_util.h" | 10 #include "chrome/common/ref_counted_util.h" |
| 10 #include "net/http/http_response_headers.h" | 11 #include "net/http/http_response_headers.h" |
| 11 #include "net/url_request/url_request.h" | 12 #include "net/url_request/url_request.h" |
| 12 #include "net/url_request/url_request_job.h" | 13 #include "net/url_request/url_request_job.h" |
| 13 | 14 |
| 14 class AutomationResourceMessageFilter; | 15 class AutomationResourceMessageFilter; |
| 15 | 16 |
| 16 namespace IPC { | 17 namespace IPC { |
| 17 class Message; | 18 class Message; |
| 18 struct AutomationURLResponse; | 19 struct AutomationURLResponse; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 44 void OnMessage(const IPC::Message& message); | 45 void OnMessage(const IPC::Message& message); |
| 45 | 46 |
| 46 int id() const { | 47 int id() const { |
| 47 return id_; | 48 return id_; |
| 48 } | 49 } |
| 49 | 50 |
| 50 int request_id() const { | 51 int request_id() const { |
| 51 return request_id_; | 52 return request_id_; |
| 52 } | 53 } |
| 53 | 54 |
| 55 // Returns true if the cookie passed in exists in the list of cookies |
| 56 // parsed from the HTTP response header. |
| 57 static bool IsCookiePresentInCookieHeader( |
| 58 const std::string& cookie_name, |
| 59 const std::vector<std::string>& header_cookies); |
| 60 |
| 54 protected: | 61 protected: |
| 55 // Protected URLRequestJob override. | 62 // Protected URLRequestJob override. |
| 56 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); | 63 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); |
| 57 | 64 |
| 58 void StartAsync(); | 65 void StartAsync(); |
| 59 void Cleanup(); | 66 void Cleanup(); |
| 60 void DisconnectFromMessageFilter(); | 67 void DisconnectFromMessageFilter(); |
| 61 | 68 |
| 62 // IPC message handlers. | 69 // IPC message handlers. |
| 63 void OnRequestStarted(int tab, int id, | 70 void OnRequestStarted(int tab, int id, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 87 // The previous HTTP/HTTPs protocol factories. We pass unhandled | 94 // The previous HTTP/HTTPs protocol factories. We pass unhandled |
| 88 // requests off to these factories | 95 // requests off to these factories |
| 89 static URLRequest::ProtocolFactory* old_http_factory_; | 96 static URLRequest::ProtocolFactory* old_http_factory_; |
| 90 static URLRequest::ProtocolFactory* old_https_factory_; | 97 static URLRequest::ProtocolFactory* old_https_factory_; |
| 91 | 98 |
| 92 DISALLOW_COPY_AND_ASSIGN(URLRequestAutomationJob); | 99 DISALLOW_COPY_AND_ASSIGN(URLRequestAutomationJob); |
| 93 }; | 100 }; |
| 94 | 101 |
| 95 #endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ | 102 #endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ |
| 96 | 103 |
| OLD | NEW |