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 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 DCHECK_NE(params.page_id, -1); | 1586 DCHECK_NE(params.page_id, -1); |
1587 WebHistoryItem item = PageStateToHistoryItem(params.page_state); | 1587 WebHistoryItem item = PageStateToHistoryItem(params.page_state); |
1588 if (!item.isNull()) { | 1588 if (!item.isNull()) { |
1589 // Ensure we didn't save the swapped out URL in UpdateState, since the | 1589 // Ensure we didn't save the swapped out URL in UpdateState, since the |
1590 // browser should never be telling us to navigate to swappedout://. | 1590 // browser should never be telling us to navigate to swappedout://. |
1591 CHECK(item.urlString() != WebString::fromUTF8(kSwappedOutURL)); | 1591 CHECK(item.urlString() != WebString::fromUTF8(kSwappedOutURL)); |
1592 frame->loadHistoryItem(item); | 1592 frame->loadHistoryItem(item); |
1593 } | 1593 } |
1594 } else if (!params.base_url_for_data_url.is_empty()) { | 1594 } else if (!params.base_url_for_data_url.is_empty()) { |
1595 // A loadData request with a specified base URL. | 1595 // A loadData request with a specified base URL. |
1596 std::string mime_type, charset, data; | 1596 std::string mime_type, charset; |
1597 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { | 1597 if (net::DataURL::Parse(params.url, &mime_type, &charset, NULL)) { |
| 1598 base::StringPiece data(base::RefCountedMemory::AsString( |
| 1599 params.data_for_data_url.get())); |
1598 frame->loadData( | 1600 frame->loadData( |
1599 WebData(data.c_str(), data.length()), | 1601 WebData(data.data(), data.size()), |
1600 WebString::fromUTF8(mime_type), | 1602 WebString::fromUTF8(mime_type), |
1601 WebString::fromUTF8(charset), | 1603 WebString::fromUTF8(charset), |
1602 params.base_url_for_data_url, | 1604 params.base_url_for_data_url, |
1603 params.history_url_for_data_url, | 1605 params.history_url_for_data_url, |
1604 false); | 1606 false); |
1605 } else { | 1607 } else { |
1606 CHECK(false) << | 1608 CHECK(false) << |
1607 "Invalid URL passed: " << params.url.possibly_invalid_spec(); | 1609 "Invalid URL passed: " << params.url.possibly_invalid_spec(); |
1608 } | 1610 } |
1609 } else { | 1611 } else { |
(...skipping 5073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6683 for (size_t i = 0; i < icon_urls.size(); i++) { | 6685 for (size_t i = 0; i < icon_urls.size(); i++) { |
6684 WebURL url = icon_urls[i].iconURL(); | 6686 WebURL url = icon_urls[i].iconURL(); |
6685 if (!url.isEmpty()) | 6687 if (!url.isEmpty()) |
6686 urls.push_back(FaviconURL(url, | 6688 urls.push_back(FaviconURL(url, |
6687 ToFaviconType(icon_urls[i].iconType()))); | 6689 ToFaviconType(icon_urls[i].iconType()))); |
6688 } | 6690 } |
6689 SendUpdateFaviconURL(urls); | 6691 SendUpdateFaviconURL(urls); |
6690 } | 6692 } |
6691 | 6693 |
6692 } // namespace content | 6694 } // namespace content |
OLD | NEW |