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

Unified Diff: Source/core/editing/Editor.cpp

Issue 1112513005: Reload image bypassing the cache (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 7876e20081b96f5bb283b83733b6fe813e3dfa2c..2c56af45943c93565479e5f8e3b8b3346ef5b64a 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -463,6 +463,15 @@ static void writeImageNodeToPasteboard(Pasteboard* pasteboard, Node* node, const
pasteboard->writeImage(image.get(), url, title);
}
+static void reloadImageNode(Node* node, bool bypassCache)
+{
+ ASSERT(node);
+ if (isHTMLImageElement(*node)) {
+ HTMLImageElement& element = toHTMLImageElement(*node);
+ element.imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousError, bypassCache);
+ }
+}
+
// Returns whether caller should continue with "the default processing", which is the same as
// the event handler NOT setting the return value to false
bool Editor::dispatchCPPEvent(const AtomicString& eventType, DataTransferAccessPolicy policy, PasteMode pasteMode)
@@ -961,6 +970,11 @@ void Editor::copyImage(const HitTestResult& result)
writeImageNodeToPasteboard(Pasteboard::generalPasteboard(), result.innerNodeOrImageMapImage(), result.altDisplayString());
}
+void Editor::reloadImage(const HitTestResult& result, bool bypassCache)
Nate Chapin 2015/04/30 20:59:41 This doesn't really have anything to do with Edito
megjablon 2015/04/30 22:00:54 Do you have any ideas for an alternate path? I was
+{
+ reloadImageNode(result.innerNodeOrImageMapImage(), bypassCache);
+}
+
bool Editor::canUndo()
{
if (UndoStack* undoStack = this->undoStack())

Powered by Google App Engine
This is Rietveld 408576698