| 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->was_fetched_via_proxy(); |
| 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 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3874 // If we are in view source mode, then just let the user see the source of | 3877 // If we are in view source mode, then just let the user see the source of |
| 3875 // the server's error page. | 3878 // the server's error page. |
| 3876 if (frame->isViewSourceModeEnabled()) | 3879 if (frame->isViewSourceModeEnabled()) |
| 3877 return; | 3880 return; |
| 3878 | 3881 |
| 3879 DocumentState* document_state = | 3882 DocumentState* document_state = |
| 3880 DocumentState::FromDataSource(frame->provisionalDataSource()); | 3883 DocumentState::FromDataSource(frame->provisionalDataSource()); |
| 3881 int http_status_code = response.httpStatusCode(); | 3884 int http_status_code = response.httpStatusCode(); |
| 3882 | 3885 |
| 3883 // Record page load flags. | 3886 // Record page load flags. |
| 3884 document_state->set_was_fetched_via_spdy(response.wasFetchedViaSPDY()); | |
| 3885 document_state->set_was_npn_negotiated(response.wasNpnNegotiated()); | |
| 3886 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); | 3887 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); |
| 3887 if (extra_data) { | 3888 if (extra_data) { |
| 3889 document_state->set_was_fetched_via_spdy( |
| 3890 extra_data->was_fetched_via_spdy()); |
| 3891 document_state->set_was_npn_negotiated( |
| 3892 extra_data->was_npn_negotiated()); |
| 3888 document_state->set_npn_negotiated_protocol( | 3893 document_state->set_npn_negotiated_protocol( |
| 3889 extra_data->npn_negotiated_protocol()); | 3894 extra_data->npn_negotiated_protocol()); |
| 3895 document_state->set_was_alternate_protocol_available( |
| 3896 extra_data->was_alternate_protocol_available()); |
| 3897 document_state->set_was_fetched_via_proxy( |
| 3898 extra_data->was_fetched_via_proxy()); |
| 3890 } | 3899 } |
| 3891 document_state->set_was_alternate_protocol_available( | |
| 3892 response.wasAlternateProtocolAvailable()); | |
| 3893 document_state->set_was_fetched_via_proxy(response.wasFetchedViaProxy()); | |
| 3894 document_state->set_http_status_code(http_status_code); | 3900 document_state->set_http_status_code(http_status_code); |
| 3895 // Whether or not the http status code actually corresponds to an error is | 3901 // Whether or not the http status code actually corresponds to an error is |
| 3896 // only checked when the page is done loading, if |use_error_page| is | 3902 // only checked when the page is done loading, if |use_error_page| is |
| 3897 // still true. | 3903 // still true. |
| 3898 document_state->set_use_error_page(true); | 3904 document_state->set_use_error_page(true); |
| 3899 } | 3905 } |
| 3900 | 3906 |
| 3901 void RenderViewImpl::didFinishResourceLoad( | 3907 void RenderViewImpl::didFinishResourceLoad( |
| 3902 WebFrame* frame, unsigned identifier) { | 3908 WebFrame* frame, unsigned identifier) { |
| 3903 DocumentState* document_state = | 3909 DocumentState* document_state = |
| (...skipping 2819 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 |