| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 6425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6436 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) { | 6436 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) { |
| 6437 data_url = params.url; | 6437 data_url = params.url; |
| 6438 } | 6438 } |
| 6439 } | 6439 } |
| 6440 #endif | 6440 #endif |
| 6441 std::string mime_type, charset, data; | 6441 std::string mime_type, charset, data; |
| 6442 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) { | 6442 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) { |
| 6443 const GURL base_url = params.base_url_for_data_url.is_empty() ? | 6443 const GURL base_url = params.base_url_for_data_url.is_empty() ? |
| 6444 params.url : params.base_url_for_data_url; | 6444 params.url : params.base_url_for_data_url; |
| 6445 bool replace = load_type == WebFrameLoadType::ReloadBypassingCache || | 6445 bool replace = load_type == WebFrameLoadType::ReloadBypassingCache || |
| 6446 load_type == WebFrameLoadType::ReloadMainResource || | 6446 load_type == WebFrameLoadType::ReloadMainResource; |
| 6447 load_type == WebFrameLoadType::Reload; | |
| 6448 | 6447 |
| 6449 frame->loadData( | 6448 frame->loadData( |
| 6450 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type), | 6449 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type), |
| 6451 WebString::fromUTF8(charset), base_url, | 6450 WebString::fromUTF8(charset), base_url, |
| 6452 // Needed so that history-url-only changes don't become reloads. | 6451 // Needed so that history-url-only changes don't become reloads. |
| 6453 params.history_url_for_data_url, replace, load_type, | 6452 params.history_url_for_data_url, replace, load_type, |
| 6454 item_for_history_navigation, history_load_type, is_client_redirect); | 6453 item_for_history_navigation, history_load_type, is_client_redirect); |
| 6455 } else { | 6454 } else { |
| 6456 CHECK(false) << "Invalid URL passed: " | 6455 CHECK(false) << "Invalid URL passed: " |
| 6457 << params.url.possibly_invalid_spec(); | 6456 << params.url.possibly_invalid_spec(); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6966 policy(info.defaultPolicy), | 6965 policy(info.defaultPolicy), |
| 6967 replaces_current_history_item(info.replacesCurrentHistoryItem), | 6966 replaces_current_history_item(info.replacesCurrentHistoryItem), |
| 6968 history_navigation_in_new_child_frame( | 6967 history_navigation_in_new_child_frame( |
| 6969 info.isHistoryNavigationInNewChildFrame), | 6968 info.isHistoryNavigationInNewChildFrame), |
| 6970 client_redirect(info.isClientRedirect), | 6969 client_redirect(info.isClientRedirect), |
| 6971 cache_disabled(info.isCacheDisabled), | 6970 cache_disabled(info.isCacheDisabled), |
| 6972 form(info.form), | 6971 form(info.form), |
| 6973 source_location(info.sourceLocation) {} | 6972 source_location(info.sourceLocation) {} |
| 6974 | 6973 |
| 6975 } // namespace content | 6974 } // namespace content |
| OLD | NEW |