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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 return NULL; | 1591 return NULL; |
1592 | 1592 |
1593 return i->second; | 1593 return i->second; |
1594 } | 1594 } |
1595 | 1595 |
1596 static int GetCertID(net::URLRequest* request, int child_id) { | 1596 static int GetCertID(net::URLRequest* request, int child_id) { |
1597 if (request->ssl_info().cert) { | 1597 if (request->ssl_info().cert) { |
1598 return CertStore::GetSharedInstance()->StoreCert(request->ssl_info().cert, | 1598 return CertStore::GetSharedInstance()->StoreCert(request->ssl_info().cert, |
1599 child_id); | 1599 child_id); |
1600 } | 1600 } |
1601 // If there is no SSL info attached to this request, we must either be a non | |
1602 // secure request, or the request has been canceled or failed (before the SSL | |
1603 // info was populated), or the response is an error (we have seen 403, 404, | |
1604 // and 501) made up by the proxy. | |
1605 DCHECK(!request->url().SchemeIsSecure() || | |
1606 (request->status().status() == URLRequestStatus::CANCELED) || | |
1607 (request->status().status() == URLRequestStatus::FAILED) || | |
1608 ((request->response_headers()->response_code() >= 400) && | |
1609 (request->response_headers()->response_code() <= 599))); | |
1610 return 0; | 1601 return 0; |
1611 } | 1602 } |
1612 | 1603 |
1613 void ResourceDispatcherHost::NotifyResponseStarted(net::URLRequest* request, | 1604 void ResourceDispatcherHost::NotifyResponseStarted(net::URLRequest* request, |
1614 int child_id) { | 1605 int child_id) { |
1615 // Notify the observers on the IO thread. | 1606 // Notify the observers on the IO thread. |
1616 FOR_EACH_OBSERVER(Observer, observer_list_, OnRequestStarted(this, request)); | 1607 FOR_EACH_OBSERVER(Observer, observer_list_, OnRequestStarted(this, request)); |
1617 | 1608 |
1618 int render_process_id, render_view_id; | 1609 int render_process_id, render_view_id; |
1619 if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) | 1610 if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1960 return is_prefetch_enabled_; | 1951 return is_prefetch_enabled_; |
1961 } | 1952 } |
1962 | 1953 |
1963 // static | 1954 // static |
1964 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1955 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
1965 is_prefetch_enabled_ = value; | 1956 is_prefetch_enabled_ = value; |
1966 } | 1957 } |
1967 | 1958 |
1968 // static | 1959 // static |
1969 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1960 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
OLD | NEW |