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