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

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: Updated comments 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 ba634a30ab6157a8274c7044d6f28c283fe57df1..d4732ca9b186a15da80a1e06478681b1cb86361b 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"
@@ -1054,6 +1055,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);
« content/public/browser/navigation_entry.h ('K') | « content/public/browser/navigation_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698