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

Side by Side Diff: content/browser/service_worker/service_worker_controllee_request_handler.cc

Issue 1652493002: Use request initiator to check for cross origin requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_controllee_request_handl er.h" 5 #include "content/browser/service_worker/service_worker_controllee_request_handl er.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 return true; 446 return true;
447 } 447 }
448 448
449 void ServiceWorkerControlleeRequestHandler::MainResourceLoadFailed() { 449 void ServiceWorkerControlleeRequestHandler::MainResourceLoadFailed() {
450 DCHECK(provider_host_); 450 DCHECK(provider_host_);
451 // Detach the controller so subresource requests also skip the worker. 451 // Detach the controller so subresource requests also skip the worker.
452 provider_host_->NotifyControllerLost(); 452 provider_host_->NotifyControllerLost();
453 } 453 }
454 454
455 GURL ServiceWorkerControlleeRequestHandler::GetRequestingOrigin() {
456 DCHECK(provider_host_);
457 return provider_host_->document_url().GetOrigin();
458 }
459
460 void ServiceWorkerControlleeRequestHandler::ClearJob() { 455 void ServiceWorkerControlleeRequestHandler::ClearJob() {
461 job_.reset(); 456 job_.reset();
462 was_fetched_via_service_worker_ = false; 457 was_fetched_via_service_worker_ = false;
463 was_fallback_required_ = false; 458 was_fallback_required_ = false;
464 original_url_via_service_worker_ = GURL(); 459 original_url_via_service_worker_ = GURL();
465 response_type_via_service_worker_ = 460 response_type_via_service_worker_ =
466 blink::WebServiceWorkerResponseTypeDefault; 461 blink::WebServiceWorkerResponseTypeDefault;
467 } 462 }
468 463
469 } // namespace content 464 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698