| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | 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 URLRequest, but exists on the UI thread. | 7 // of 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_ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 resource_type_ = info->resource_type(); | 39 resource_type_ = info->resource_type(); |
| 40 frame_origin_ = info->frame_origin(); | 40 frame_origin_ = info->frame_origin(); |
| 41 main_frame_origin_ = info->main_frame_origin(); | 41 main_frame_origin_ = info->main_frame_origin(); |
| 42 filter_policy_ = info->filter_policy(); | 42 filter_policy_ = info->filter_policy(); |
| 43 | 43 |
| 44 // If request is from the worker process on behalf of a renderer, use | 44 // If request is from the worker process on behalf of a renderer, use |
| 45 // the renderer process id, since it consumes the notification response | 45 // the renderer process id, since it consumes the notification response |
| 46 // such as ssl state etc. | 46 // such as ssl state etc. |
| 47 const WorkerProcessHost::WorkerInstance* worker_instance = | 47 const WorkerProcessHost::WorkerInstance* worker_instance = |
| 48 WorkerService::GetInstance()->FindWorkerInstance(info->child_id()); | 48 WorkerService::GetInstance()->FindWorkerInstance(info->child_id()); |
| 49 origin_child_id_ = | 49 if (worker_instance) { |
| 50 worker_instance ? worker_instance->renderer_id() : info->child_id(); | 50 DCHECK(!worker_instance->worker_document_set()->IsEmpty()); |
| 51 const WorkerDocumentSet::DocumentInfoSet& parents = |
| 52 worker_instance->worker_document_set()->documents(); |
| 53 // TODO(atwilson): need to notify all associated renderers in the case |
| 54 // of ssl state change (http://crbug.com/25357). For now, just notify |
| 55 // the first one (works for dedicated workers and shared workers with |
| 56 // a single process). |
| 57 origin_child_id_ = parents.begin()->renderer_id(); |
| 58 } else { |
| 59 origin_child_id_ = info->child_id(); |
| 60 } |
| 51 } | 61 } |
| 52 | 62 |
| 53 virtual ~ResourceRequestDetails() {} | 63 virtual ~ResourceRequestDetails() {} |
| 54 | 64 |
| 55 const GURL& url() const { return url_; } | 65 const GURL& url() const { return url_; } |
| 56 const GURL& original_url() const { return original_url_; } | 66 const GURL& original_url() const { return original_url_; } |
| 57 const std::string& method() const { return method_; } | 67 const std::string& method() const { return method_; } |
| 58 const std::string& referrer() const { return referrer_; } | 68 const std::string& referrer() const { return referrer_; } |
| 59 const std::string& frame_origin() const { return frame_origin_; } | 69 const std::string& frame_origin() const { return frame_origin_; } |
| 60 const std::string& main_frame_origin() const { return main_frame_origin_; } | 70 const std::string& main_frame_origin() const { return main_frame_origin_; } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 new_url_(new_url) {} | 106 new_url_(new_url) {} |
| 97 | 107 |
| 98 // The URL to which we are being redirected. | 108 // The URL to which we are being redirected. |
| 99 const GURL& new_url() const { return new_url_; } | 109 const GURL& new_url() const { return new_url_; } |
| 100 | 110 |
| 101 private: | 111 private: |
| 102 GURL new_url_; | 112 GURL new_url_; |
| 103 }; | 113 }; |
| 104 | 114 |
| 105 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ | 115 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ |
| OLD | NEW |