OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 NavigationState* navigation_state = document_state->navigation_state(); | 1602 NavigationState* navigation_state = document_state->navigation_state(); |
1603 | 1603 |
1604 ViewHostMsg_FrameNavigate_Params params; | 1604 ViewHostMsg_FrameNavigate_Params params; |
1605 params.http_status_code = response.httpStatusCode(); | 1605 params.http_status_code = response.httpStatusCode(); |
1606 params.is_post = false; | 1606 params.is_post = false; |
1607 params.post_id = -1; | 1607 params.post_id = -1; |
1608 params.page_id = page_id_; | 1608 params.page_id = page_id_; |
1609 params.frame_id = frame->identifier(); | 1609 params.frame_id = frame->identifier(); |
1610 params.socket_address.set_host(response.remoteIPAddress().utf8()); | 1610 params.socket_address.set_host(response.remoteIPAddress().utf8()); |
1611 params.socket_address.set_port(response.remotePort()); | 1611 params.socket_address.set_port(response.remotePort()); |
1612 params.was_fetched_via_proxy = response.wasFetchedViaProxy(); | 1612 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); |
| 1613 if (extra_data) { |
| 1614 params.was_fetched_via_proxy = extra_data->wasFetchedViaProxy(); |
| 1615 } |
1613 params.was_within_same_page = navigation_state->was_within_same_page(); | 1616 params.was_within_same_page = navigation_state->was_within_same_page(); |
1614 if (!document_state->security_info().empty()) { | 1617 if (!document_state->security_info().empty()) { |
1615 // SSL state specified in the request takes precedence over the one in the | 1618 // SSL state specified in the request takes precedence over the one in the |
1616 // response. | 1619 // response. |
1617 // So far this is only intended for error pages that are not expected to be | 1620 // So far this is only intended for error pages that are not expected to be |
1618 // over ssl, so we should not get any clash. | 1621 // over ssl, so we should not get any clash. |
1619 DCHECK(response.securityInfo().isEmpty()); | 1622 DCHECK(response.securityInfo().isEmpty()); |
1620 params.security_info = document_state->security_info(); | 1623 params.security_info = document_state->security_info(); |
1621 } else { | 1624 } else { |
1622 params.security_info = response.securityInfo(); | 1625 params.security_info = response.securityInfo(); |
(...skipping 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3877 // If we are in view source mode, then just let the user see the source of | 3880 // If we are in view source mode, then just let the user see the source of |
3878 // the server's error page. | 3881 // the server's error page. |
3879 if (frame->isViewSourceModeEnabled()) | 3882 if (frame->isViewSourceModeEnabled()) |
3880 return; | 3883 return; |
3881 | 3884 |
3882 DocumentState* document_state = | 3885 DocumentState* document_state = |
3883 DocumentState::FromDataSource(frame->provisionalDataSource()); | 3886 DocumentState::FromDataSource(frame->provisionalDataSource()); |
3884 int http_status_code = response.httpStatusCode(); | 3887 int http_status_code = response.httpStatusCode(); |
3885 | 3888 |
3886 // Record page load flags. | 3889 // Record page load flags. |
3887 document_state->set_was_fetched_via_spdy(response.wasFetchedViaSPDY()); | |
3888 document_state->set_was_npn_negotiated(response.wasNpnNegotiated()); | |
3889 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); | 3890 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); |
3890 if (extra_data) { | 3891 if (extra_data) { |
| 3892 document_state->set_was_fetched_via_spdy( |
| 3893 extra_data->wasFetchedViaSPDY()); |
| 3894 document_state->set_was_npn_negotiated( |
| 3895 extra_data->wasNpnNegotiated()); |
3891 document_state->set_npn_negotiated_protocol( | 3896 document_state->set_npn_negotiated_protocol( |
3892 extra_data->npn_negotiated_protocol()); | 3897 extra_data->npn_negotiated_protocol()); |
| 3898 document_state->set_was_alternate_protocol_available( |
| 3899 extra_data->wasAlternateProtocolAvailable()); |
| 3900 document_state->set_was_fetched_via_proxy( |
| 3901 extra_data->wasFetchedViaProxy()); |
3893 } | 3902 } |
3894 document_state->set_was_alternate_protocol_available( | |
3895 response.wasAlternateProtocolAvailable()); | |
3896 document_state->set_was_fetched_via_proxy(response.wasFetchedViaProxy()); | |
3897 document_state->set_http_status_code(http_status_code); | 3903 document_state->set_http_status_code(http_status_code); |
3898 // Whether or not the http status code actually corresponds to an error is | 3904 // Whether or not the http status code actually corresponds to an error is |
3899 // only checked when the page is done loading, if |use_error_page| is | 3905 // only checked when the page is done loading, if |use_error_page| is |
3900 // still true. | 3906 // still true. |
3901 document_state->set_use_error_page(true); | 3907 document_state->set_use_error_page(true); |
3902 } | 3908 } |
3903 | 3909 |
3904 void RenderViewImpl::didFinishResourceLoad( | 3910 void RenderViewImpl::didFinishResourceLoad( |
3905 WebFrame* frame, unsigned identifier) { | 3911 WebFrame* frame, unsigned identifier) { |
3906 DocumentState* document_state = | 3912 DocumentState* document_state = |
(...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6723 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6729 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6724 RenderProcess::current()->ReleaseTransportDIB(dib); | 6730 RenderProcess::current()->ReleaseTransportDIB(dib); |
6725 } | 6731 } |
6726 | 6732 |
6727 void RenderViewImpl::DidCommitCompositorFrame() { | 6733 void RenderViewImpl::DidCommitCompositorFrame() { |
6728 RenderWidget::DidCommitCompositorFrame(); | 6734 RenderWidget::DidCommitCompositorFrame(); |
6729 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6735 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
6730 } | 6736 } |
6731 | 6737 |
6732 } // namespace content | 6738 } // namespace content |
OLD | NEW |