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

Unified Diff: content/browser/service_worker/foreign_fetch_request_handler.cc

Issue 2116503004: Make Foreign Fetch an origin trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 4 years, 4 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: content/browser/service_worker/foreign_fetch_request_handler.cc
diff --git a/content/browser/service_worker/foreign_fetch_request_handler.cc b/content/browser/service_worker/foreign_fetch_request_handler.cc
index ac99dffe27615b689144e66c6ae2f1e9139a2888..2776f643f3cc63cac9379b607a0b20a7855ebf21 100644
--- a/content/browser/service_worker/foreign_fetch_request_handler.cc
+++ b/content/browser/service_worker/foreign_fetch_request_handler.cc
@@ -6,12 +6,16 @@
#include <string>
+#include "base/command_line.h"
#include "base/macros.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_response_info.h"
#include "content/browser/service_worker/service_worker_url_request_job.h"
#include "content/common/resource_request_body_impl.h"
#include "content/common/service_worker/service_worker_utils.h"
+#include "content/public/common/content_client.h"
+#include "content/public/common/content_switches.h"
+#include "content/public/common/origin_trial_policy.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_interceptor.h"
#include "storage/browser/blob/blob_storage_context.h"
@@ -60,6 +64,15 @@ void ForeignFetchRequestHandler::InitializeHandler(
RequestContextFrameType frame_type,
scoped_refptr<ResourceRequestBodyImpl> body,
bool initiated_in_secure_context) {
+ OriginTrialPolicy* origin_trial_policy =
+ GetContentClient()->GetOriginTrialPolicy();
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
pfeldman 2016/08/12 18:49:23 If I did not specify the experimental-web-platform
Marijn Kruisselbrink 2016/08/12 19:15:40 Ah, good point. I was trying to mimic what TrialTo
+ switches::kEnableExperimentalWebPlatformFeatures) &&
+ origin_trial_policy &&
+ origin_trial_policy->IsFeatureDisabled("ForeignFetch")) {
+ return;
+ }
+
if (!context_wrapper)
return;

Powered by Google App Engine
This is Rietveld 408576698