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

Unified Diff: third_party/WebKit/Source/web/DevToolsEmulator.cpp

Issue 2570733002: [Devtools] Fixed devtools altering srcset image after close (Closed)
Patch Set: changes Created 4 years 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/resources/square200.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/DevToolsEmulator.cpp
diff --git a/third_party/WebKit/Source/web/DevToolsEmulator.cpp b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
index cb59bd0892dfe2ed841326ec0fe7cd32f6171b16..2d6137aa52a8c00d27124d4e45c18642c15d88eb 100644
--- a/third_party/WebKit/Source/web/DevToolsEmulator.cpp
+++ b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
@@ -4,6 +4,7 @@
#include "web/DevToolsEmulator.h"
+#include "core/fetch/MemoryCache.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
@@ -200,6 +201,9 @@ void DevToolsEmulator::enableDeviceEmulation(
m_emulationParams.scale == params.scale) {
return;
}
+ if (m_emulationParams.deviceScaleFactor != params.deviceScaleFactor ||
+ !m_deviceMetricsEnabled)
+ memoryCache()->evictResources();
m_emulationParams = params;
@@ -235,6 +239,7 @@ void DevToolsEmulator::disableDeviceEmulation() {
if (!m_deviceMetricsEnabled)
return;
+ memoryCache()->evictResources();
m_deviceMetricsEnabled = false;
m_webViewImpl->setBackgroundColorOverride(Color::transparent);
m_webViewImpl->page()->settings().setDeviceScaleAdjustment(
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/resources/square200.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698