Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: content/renderer/render_view_impl.cc

Issue 10544175: Add an ability to call WebKit's WebFrame::loadData via NavigationController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 3d29c1d9d06ebf3d3b18b454650097f3ecfbd3db..2c6614d9b13447cd6d2603d8a440aeb5680727b4 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -103,6 +103,7 @@
#include "media/base/message_loop_factory.h"
#include "media/filters/audio_renderer_impl.h"
#include "media/filters/gpu_video_decoder.h"
+#include "net/base/data_url.h"
#include "net/base/escape.h"
#include "net/base/net_errors.h"
#include "net/http/http_util.h"
@@ -1055,6 +1056,18 @@ void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) {
DCHECK_NE(params.page_id, -1);
main_frame->loadHistoryItem(
webkit_glue::HistoryItemFromString(params.state));
+ } else if (!params.base_url.is_empty()) {
+ // A loadData request with a specified base URL.
+ std::string mime_type, charset, data;
+ if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) {
+ main_frame->loadData(
+ WebData(data.c_str(), data.length()),
+ WebString::fromUTF8(mime_type),
+ WebString::fromUTF8(charset),
+ params.base_url,
+ params.history_url,
+ false);
+ }
} else {
// Navigate to the given URL.
WebURLRequest request(params.url);

Powered by Google App Engine
This is Rietveld 408576698