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

Unified Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 2423683002: Add Blink support for showing image placeholders using range requests. (Closed)
Patch Set: Change test data to "const unsigned char" instead of "const char" to fix warnings in windows build Created 4 years, 2 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: third_party/WebKit/Source/core/page/DragController.cpp
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp
index 5f2b5a7af08209d10865e5562a07c4b49745ad10..8dd8b7d81e128e2c81270e7177f003a7055cf92f 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -69,6 +69,7 @@
#include "core/page/DragState.h"
#include "core/page/Page.h"
#include "platform/DragImage.h"
+#include "platform/SharedBuffer.h"
#include "platform/geometry/IntRect.h"
#include "platform/geometry/IntSize.h"
#include "platform/graphics/BitmapImage.h"
@@ -84,6 +85,7 @@
#include "public/platform/WebScreenInfo.h"
#include "wtf/Assertions.h"
#include "wtf/CurrentTime.h"
+#include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h"
#include <memory>
@@ -1086,7 +1088,7 @@ bool DragController::startDrag(LocalFrame* src,
return false;
Element* element = toElement(node);
Image* image = getImage(element);
- if (!image || image->isNull())
+ if (!image || image->isNull() || !image->data() || !image->data()->size())
return false;
// We shouldn't be starting a drag for an image that can't provide an
// extension.
« no previous file with comments | « third_party/WebKit/Source/core/loader/ProgressTracker.cpp ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698