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

Unified Diff: content/renderer/render_view_impl.cc

Issue 518693002: Fix a crash when saving a <canvas> or <img> image which is large. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CONTENT_EXPORT Created 6 years, 3 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 14af979938f2e758ec3b481c3515fa277b3738e3..83ad0605626fa2085644fc9772b27e4717faa535 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -40,6 +40,7 @@
#include "content/child/npapi/webplugin_delegate_impl.h"
#include "content/child/request_extra_data.h"
#include "content/child/webmessageportchannel_impl.h"
+#include "content/common/content_constants_internal.h"
#include "content/common/database_messages.h"
#include "content/common/dom_storage/dom_storage_types.h"
#include "content/common/drag_messages.h"
@@ -1721,6 +1722,13 @@ void RenderViewImpl::printPage(WebLocalFrame* frame) {
PrintPage(frame, handling_input_event_));
}
+void RenderViewImpl::saveImageFromDataURL(const blink::WebString& data_url) {
+ // Note: We should basically send GURL but we use size-limited string instead
+ // in order to send a larger data url to save a image for <canvas> or <img>.
+ if (data_url.length() < kMaxLengthOfDataURLString)
+ Send(new ViewHostMsg_SaveImageFromDataURL(routing_id_, data_url.utf8()));
+}
+
bool RenderViewImpl::enumerateChosenDirectory(
const WebString& path,
WebFileChooserCompletion* chooser_completion) {
« content/browser/renderer_host/render_message_filter.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698