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

Unified Diff: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp

Issue 1723353002: Add deprecation message for AppCache in insecure contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Rebase on ToT Created 4 years, 10 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/loader/appcache/ApplicationCacheHost.cpp
diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
index ad70de0bbead8f9141f15fc29372b275707c65d7..fb2e8a710af31492b54b46eb339cfbb9fefd7830 100644
--- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
+++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
@@ -33,8 +33,11 @@
#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "core/events/ApplicationCacheErrorEvent.h"
#include "core/events/ProgressEvent.h"
+#include "core/frame/Deprecation.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/OriginsUsingFeatures.h"
#include "core/frame/Settings.h"
+#include "core/frame/UseCounter.h"
#include "core/inspector/InspectorApplicationCacheAgent.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/loader/DocumentLoader.h"
@@ -115,14 +118,25 @@ void ApplicationCacheHost::selectCacheWithoutManifest()
void ApplicationCacheHost::selectCacheWithManifest(const KURL& manifestURL)
{
+ DCHECK(m_documentLoader);
+
+ LocalFrame* frame = m_documentLoader->frame();
+ Document* document = frame->document();
+ if (document->isSecureContext()) {
+ UseCounter::count(document, UseCounter::ApplicationCacheManifestSelectSecureOrigin);
+ UseCounter::countCrossOriginIframe(*document, UseCounter::ApplicationCacheManifestSelectSecureOrigin);
+ } else {
+ Deprecation::countDeprecation(document, UseCounter::ApplicationCacheManifestSelectInsecureOrigin);
+ UseCounter::countCrossOriginIframe(*document, UseCounter::ApplicationCacheManifestSelectInsecureOrigin);
jochen (gone - plz use gerrit) 2016/02/29 15:44:42 This hits ASSERT(Deprecation::deprecationMessage(f
jww 2016/03/01 19:55:02 Yikes, thanks. It appears that I also did this for
+ OriginsUsingFeatures::countAnyWorld(*document, OriginsUsingFeatures::Feature::ApplicationCacheManifestSelectInsecureOrigin);
+ }
if (m_host && !m_host->selectCacheWithManifest(manifestURL)) {
// It's a foreign entry, restart the current navigation from the top
// of the navigation algorithm. The navigation will not result in the
// same resource being loaded, because "foreign" entries are never picked
// during navigation.
// see ApplicationCacheGroup::selectCache()
- LocalFrame* frame = m_documentLoader->frame();
- frame->navigate(*frame->document(), frame->document()->url(), true, UserGestureStatus::None);
+ frame->navigate(*document, document->url(), true, UserGestureStatus::None);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698