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

Unified Diff: Source/web/ContextMenuClientImpl.cpp

Issue 1112513005: Reload image bypassing the cache (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: japhet comments Created 5 years, 7 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: Source/web/ContextMenuClientImpl.cpp
diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp
index e7d9688ba2e7411ecc4141a9c6953e01668ff079..a1152c0e0395672f31e3d761b2e8ef043b00ff88 100644
--- a/Source/web/ContextMenuClientImpl.cpp
+++ b/Source/web/ContextMenuClientImpl.cpp
@@ -46,6 +46,7 @@
#include "core/frame/Settings.h"
#include "core/html/HTMLAnchorElement.h"
#include "core/html/HTMLFormElement.h"
+#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLMediaElement.h"
#include "core/html/HTMLPlugInElement.h"
@@ -60,6 +61,7 @@
#include "core/page/Page.h"
#include "platform/ContextMenu.h"
#include "platform/Widget.h"
+#include "platform/exported/WrappedResourceResponse.h"
#include "platform/text/TextBreakIterator.h"
#include "platform/weborigin/KURL.h"
#include "public/platform/WebPoint.h"
@@ -230,6 +232,11 @@ void ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu)
// An image can be null for many reasons, like being blocked, no image
// data received from server yet.
data.hasImageContents = r.image() && !r.image()->isNull();
+ if (data.hasImageContents) {
+ HTMLImageElement* imageElement = toHTMLImageElement(r.innerNodeOrImageMapImage());
+ if (imageElement && imageElement->cachedImage())
+ data.imageResponseExtraData = WrappedResourceResponse(imageElement->cachedImage()->response()).extraData();
+ }
} else if (!r.absoluteMediaURL().isEmpty()) {
data.srcURL = r.absoluteMediaURL();

Powered by Google App Engine
This is Rietveld 408576698