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 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3476 } | 3476 } |
3477 | 3477 |
3478 void RenderViewImpl::PopulateDocumentStateFromPending( | 3478 void RenderViewImpl::PopulateDocumentStateFromPending( |
3479 DocumentState* document_state) { | 3479 DocumentState* document_state) { |
3480 const ViewMsg_Navigate_Params& params = *pending_navigation_params_.get(); | 3480 const ViewMsg_Navigate_Params& params = *pending_navigation_params_.get(); |
3481 document_state->set_request_time(params.request_time); | 3481 document_state->set_request_time(params.request_time); |
3482 | 3482 |
3483 InternalDocumentStateData* internal_data = | 3483 InternalDocumentStateData* internal_data = |
3484 InternalDocumentStateData::FromDocumentState(document_state); | 3484 InternalDocumentStateData::FromDocumentState(document_state); |
3485 | 3485 |
3486 if (!params.url.SchemeIs(chrome::kJavaScriptScheme) && | 3486 if (!params.url.SchemeIs(kJavaScriptScheme) && |
3487 params.navigation_type == ViewMsg_Navigate_Type::RESTORE) { | 3487 params.navigation_type == ViewMsg_Navigate_Type::RESTORE) { |
3488 // We're doing a load of a page that was restored from the last session. By | 3488 // We're doing a load of a page that was restored from the last session. By |
3489 // default this prefers the cache over loading (LOAD_PREFERRING_CACHE) which | 3489 // default this prefers the cache over loading (LOAD_PREFERRING_CACHE) which |
3490 // can result in stale data for pages that are set to expire. We explicitly | 3490 // can result in stale data for pages that are set to expire. We explicitly |
3491 // override that by setting the policy here so that as necessary we load | 3491 // override that by setting the policy here so that as necessary we load |
3492 // from the network. | 3492 // from the network. |
3493 internal_data->set_cache_policy_override( | 3493 internal_data->set_cache_policy_override( |
3494 WebURLRequest::UseProtocolCachePolicy); | 3494 WebURLRequest::UseProtocolCachePolicy); |
3495 } | 3495 } |
3496 | 3496 |
(...skipping 12 matching lines...) Expand all Loading... |
3509 document_state->set_can_load_local_resources(params.can_load_local_resources); | 3509 document_state->set_can_load_local_resources(params.can_load_local_resources); |
3510 } | 3510 } |
3511 | 3511 |
3512 NavigationState* RenderViewImpl::CreateNavigationStateFromPending() { | 3512 NavigationState* RenderViewImpl::CreateNavigationStateFromPending() { |
3513 const ViewMsg_Navigate_Params& params = *pending_navigation_params_.get(); | 3513 const ViewMsg_Navigate_Params& params = *pending_navigation_params_.get(); |
3514 NavigationState* navigation_state = NULL; | 3514 NavigationState* navigation_state = NULL; |
3515 | 3515 |
3516 // A navigation resulting from loading a javascript URL should not be treated | 3516 // A navigation resulting from loading a javascript URL should not be treated |
3517 // as a browser initiated event. Instead, we want it to look as if the page | 3517 // as a browser initiated event. Instead, we want it to look as if the page |
3518 // initiated any load resulting from JS execution. | 3518 // initiated any load resulting from JS execution. |
3519 if (!params.url.SchemeIs(chrome::kJavaScriptScheme)) { | 3519 if (!params.url.SchemeIs(kJavaScriptScheme)) { |
3520 navigation_state = NavigationState::CreateBrowserInitiated( | 3520 navigation_state = NavigationState::CreateBrowserInitiated( |
3521 params.page_id, | 3521 params.page_id, |
3522 params.pending_history_list_offset, | 3522 params.pending_history_list_offset, |
3523 params.should_clear_history_list, | 3523 params.should_clear_history_list, |
3524 params.transition); | 3524 params.transition); |
3525 navigation_state->set_transferred_request_child_id( | 3525 navigation_state->set_transferred_request_child_id( |
3526 params.transferred_request_child_id); | 3526 params.transferred_request_child_id); |
3527 navigation_state->set_transferred_request_request_id( | 3527 navigation_state->set_transferred_request_request_id( |
3528 params.transferred_request_request_id); | 3528 params.transferred_request_request_id); |
3529 navigation_state->set_allow_download(params.allow_download); | 3529 navigation_state->set_allow_download(params.allow_download); |
(...skipping 3005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6535 WebURL url = icon_urls[i].iconURL(); | 6535 WebURL url = icon_urls[i].iconURL(); |
6536 if (!url.isEmpty()) | 6536 if (!url.isEmpty()) |
6537 urls.push_back(FaviconURL(url, | 6537 urls.push_back(FaviconURL(url, |
6538 ToFaviconType(icon_urls[i].iconType()))); | 6538 ToFaviconType(icon_urls[i].iconType()))); |
6539 } | 6539 } |
6540 SendUpdateFaviconURL(urls); | 6540 SendUpdateFaviconURL(urls); |
6541 } | 6541 } |
6542 | 6542 |
6543 | 6543 |
6544 } // namespace content | 6544 } // namespace content |
OLD | NEW |