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

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: WebNode instead of WebPoint Created 5 years, 8 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..09f63760904c17d1f6e8afcc9a72beb7798dc9fe 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"
@@ -230,6 +231,13 @@ 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) {
+ // We know that if absoluteImageURL() is not empty, then this
+ // is a image element.
+ HTMLImageElement* imageElement = toHTMLImageElement(r.innerNodeOrImageMapImage());
+ // TODO: Change "via" to "chrome-proxy" once the server starts sending lo-fi responses.
+ data.imageChromeProxyResponseHeader = imageElement->imageLoader().image()->response().httpHeaderField("via").utf8().data();
Nate Chapin 2015/05/01 18:46:51 What is "via"? It seems wrong to be digging down i
megjablon 2015/05/01 19:15:23 We need a way of telling the context menu that an
+ }
} else if (!r.absoluteMediaURL().isEmpty()) {
data.srcURL = r.absoluteMediaURL();

Powered by Google App Engine
This is Rietveld 408576698