| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // The ResourceRequestDetails object contains additional details about a | 5 // The ResourceRequestDetails object contains additional details about a |
| 6 // resource request. It copies many of the publicly accessible member variables | 6 // resource request. It copies many of the publicly accessible member variables |
| 7 // of net::URLRequest, but exists on the UI thread. | 7 // of net::URLRequest, but exists on the UI thread. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ | 9 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ |
| 10 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ | 10 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | |
| 16 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" | |
| 17 #include "chrome/browser/worker_host/worker_service.h" | |
| 18 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 19 #include "net/url_request/url_request_status.h" | 16 #include "net/url_request/url_request_status.h" |
| 17 #include "webkit/glue/resource_type.h" |
| 20 | 18 |
| 21 namespace net { | 19 namespace net { |
| 22 class URLRequest; | 20 class URLRequest; |
| 23 } // namespace net | 21 } // namespace net |
| 24 | 22 |
| 25 // Details about a resource request notification. | 23 // Details about a resource request notification. |
| 26 class ResourceRequestDetails { | 24 class ResourceRequestDetails { |
| 27 public: | 25 public: |
| 28 ResourceRequestDetails(const net::URLRequest* request, int cert_id); | 26 ResourceRequestDetails(const net::URLRequest* request, int cert_id); |
| 29 | 27 |
| 30 virtual ~ResourceRequestDetails(); | 28 virtual ~ResourceRequestDetails(); |
| 31 | 29 |
| 32 const GURL& url() const { return url_; } | 30 const GURL& url() const { return url_; } |
| 33 const GURL& original_url() const { return original_url_; } | 31 const GURL& original_url() const { return original_url_; } |
| 34 const std::string& method() const { return method_; } | 32 const std::string& method() const { return method_; } |
| 35 const std::string& referrer() const { return referrer_; } | 33 const std::string& referrer() const { return referrer_; } |
| 36 const std::string& frame_origin() const { return frame_origin_; } | 34 const std::string& frame_origin() const { return frame_origin_; } |
| 37 const std::string& main_frame_origin() const { return main_frame_origin_; } | 35 const std::string& main_frame_origin() const { return main_frame_origin_; } |
| 38 bool has_upload() const { return has_upload_; } | 36 bool has_upload() const { return has_upload_; } |
| 39 int load_flags() const { return load_flags_; } | 37 int load_flags() const { return load_flags_; } |
| 40 int origin_child_id() const { return origin_child_id_; } | 38 int origin_child_id() const { return origin_child_id_; } |
| 41 const URLRequestStatus& status() const { return status_; } | 39 const URLRequestStatus& status() const { return status_; } |
| 42 int ssl_cert_id() const { return ssl_cert_id_; } | 40 int ssl_cert_id() const { return ssl_cert_id_; } |
| 43 int ssl_cert_status() const { return ssl_cert_status_; } | 41 int ssl_cert_status() const { return ssl_cert_status_; } |
| 44 ResourceType::Type resource_type() const { return resource_type_; } | 42 ResourceType::Type resource_type() const { return resource_type_; } |
| 43 int render_process_id() const { return render_process_id_; } |
| 44 int render_view_id() const { return render_view_id_; } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 GURL url_; | 47 GURL url_; |
| 48 GURL original_url_; | 48 GURL original_url_; |
| 49 std::string method_; | 49 std::string method_; |
| 50 std::string referrer_; | 50 std::string referrer_; |
| 51 std::string frame_origin_; | 51 std::string frame_origin_; |
| 52 std::string main_frame_origin_; | 52 std::string main_frame_origin_; |
| 53 bool has_upload_; | 53 bool has_upload_; |
| 54 int load_flags_; | 54 int load_flags_; |
| 55 int origin_child_id_; | 55 int origin_child_id_; |
| 56 URLRequestStatus status_; | 56 URLRequestStatus status_; |
| 57 int ssl_cert_id_; | 57 int ssl_cert_id_; |
| 58 int ssl_cert_status_; | 58 int ssl_cert_status_; |
| 59 ResourceType::Type resource_type_; | 59 ResourceType::Type resource_type_; |
| 60 int render_process_id_; |
| 61 int render_view_id_; |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 // Details about a redirection of a resource request. | 64 // Details about a redirection of a resource request. |
| 63 class ResourceRedirectDetails : public ResourceRequestDetails { | 65 class ResourceRedirectDetails : public ResourceRequestDetails { |
| 64 public: | 66 public: |
| 65 ResourceRedirectDetails(const net::URLRequest* request, | 67 ResourceRedirectDetails(const net::URLRequest* request, |
| 66 int cert_id, | 68 int cert_id, |
| 67 const GURL& new_url); | 69 const GURL& new_url); |
| 68 virtual ~ResourceRedirectDetails(); | 70 virtual ~ResourceRedirectDetails(); |
| 69 | 71 |
| 70 // The URL to which we are being redirected. | 72 // The URL to which we are being redirected. |
| 71 const GURL& new_url() const { return new_url_; } | 73 const GURL& new_url() const { return new_url_; } |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 GURL new_url_; | 76 GURL new_url_; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ | 79 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ |
| OLD | NEW |