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

Side by Side Diff: content/browser/service_worker/service_worker_context_request_handler.h

Issue 637243003: Service Worker: Obey content settings when deciding to control a page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@content
Patch Set: explicit, and better log Created 6 years, 2 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_request_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER_H_
7 7
8 #include "content/browser/service_worker/service_worker_request_handler.h" 8 #include "content/browser/service_worker/service_worker_request_handler.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 class ServiceWorkerVersion; 12 class ServiceWorkerVersion;
13 13
14 // A request handler derivative used to handle requests from 14 // A request handler derivative used to handle requests from
15 // service workers. 15 // service workers.
16 class CONTENT_EXPORT ServiceWorkerContextRequestHandler 16 class CONTENT_EXPORT ServiceWorkerContextRequestHandler
17 : public ServiceWorkerRequestHandler { 17 : public ServiceWorkerRequestHandler {
18 public: 18 public:
19 ServiceWorkerContextRequestHandler( 19 ServiceWorkerContextRequestHandler(
20 base::WeakPtr<ServiceWorkerContextCore> context, 20 base::WeakPtr<ServiceWorkerContextCore> context,
21 base::WeakPtr<ServiceWorkerProviderHost> provider_host, 21 base::WeakPtr<ServiceWorkerProviderHost> provider_host,
22 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, 22 base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
23 ResourceType resource_type); 23 ResourceType resource_type);
24 virtual ~ServiceWorkerContextRequestHandler(); 24 virtual ~ServiceWorkerContextRequestHandler();
25 25
26 // Called via custom URLRequestJobFactory. 26 // Called via custom URLRequestJobFactory.
27 virtual net::URLRequestJob* MaybeCreateJob( 27 virtual net::URLRequestJob* MaybeCreateJob(
28 net::URLRequest* request, 28 net::URLRequest* request,
29 net::NetworkDelegate* network_delegate) override; 29 net::NetworkDelegate* network_delegate,
30 ResourceContext* resource_context) override;
30 31
31 virtual void GetExtraResponseInfo( 32 virtual void GetExtraResponseInfo(
32 bool* was_fetched_via_service_worker, 33 bool* was_fetched_via_service_worker,
33 bool* was_fallback_required_by_service_worker, 34 bool* was_fallback_required_by_service_worker,
34 GURL* original_url_via_service_worker, 35 GURL* original_url_via_service_worker,
35 base::TimeTicks* fetch_start_time, 36 base::TimeTicks* fetch_start_time,
36 base::TimeTicks* fetch_ready_time, 37 base::TimeTicks* fetch_ready_time,
37 base::TimeTicks* fetch_end_time) const override; 38 base::TimeTicks* fetch_end_time) const override;
38 39
39 private: 40 private:
40 bool ShouldAddToScriptCache(const GURL& url); 41 bool ShouldAddToScriptCache(const GURL& url);
41 bool ShouldReadFromScriptCache(const GURL& url, int64* response_id_out); 42 bool ShouldReadFromScriptCache(const GURL& url, int64* response_id_out);
42 43
43 scoped_refptr<ServiceWorkerVersion> version_; 44 scoped_refptr<ServiceWorkerVersion> version_;
44 45
45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextRequestHandler); 46 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextRequestHandler);
46 }; 47 };
47 48
48 } // namespace content 49 } // namespace content
49 50
50 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER _H_ 51 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER _H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_request_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698