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

Unified Diff: third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp

Issue 2888333002: Send certificate errors from worker fetch context for off-main-thread-fetch. (Closed)
Patch Set: incorporated kinuko's comment Created 3 years, 7 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/WorkerFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
index 93e5c20c9dad3406d10710f9f56e476a1f11926f..cbda72d44c5e427ebc473ee644d909fd8fde02d2 100644
--- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -6,6 +6,7 @@
#include "core/frame/Deprecation.h"
#include "core/frame/UseCounter.h"
+#include "core/loader/MixedContentChecker.h"
#include "core/timing/WorkerGlobalScopePerformance.h"
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -15,6 +16,8 @@
#include "platform/loader/fetch/ResourceFetcher.h"
#include "platform/scheduler/child/web_scheduler.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebMixedContent.h"
+#include "public/platform/WebMixedContentContextType.h"
#include "public/platform/WebThread.h"
#include "public/platform/WebURLRequest.h"
#include "public/platform/WebWorkerFetchContext.h"
@@ -190,6 +193,25 @@ void WorkerFetchContext::AddAdditionalRequestHeaders(ResourceRequest& request,
request.SetHTTPHeaderField("Save-Data", "on");
}
+void WorkerFetchContext::DispatchDidReceiveResponse(
+ unsigned long identifier,
+ const ResourceResponse& response,
+ WebURLRequest::FrameType frame_type,
+ WebURLRequest::RequestContext request_context,
+ Resource* resource,
+ ResourceResponseType) {
+ if (response.HasMajorCertificateErrors()) {
+ WebMixedContentContextType context_type =
+ WebMixedContent::ContextTypeFromRequestContext(
+ request_context, false /* strictMixedContentCheckingForPlugin */);
+ if (context_type == WebMixedContentContextType::kBlockable) {
+ web_context_->DidRunContentWithCertificateErrors(response.Url());
+ } else {
+ web_context_->DidDisplayContentWithCertificateErrors(response.Url());
+ }
+ }
+}
+
void WorkerFetchContext::AddResourceTiming(const ResourceTimingInfo& info) {
WorkerGlobalScopePerformance::performance(*worker_global_scope_)
->AddResourceTiming(info);
« no previous file with comments | « third_party/WebKit/Source/core/loader/WorkerFetchContext.h ('k') | third_party/WebKit/public/platform/WebWorkerFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698