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

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

Issue 625433002: Pages controlled by ServiceWorkers should not participate in AppCaching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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_REQUEST_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/supports_user_data.h" 10 #include "base/supports_user_data.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 scoped_refptr<ResourceRequestBody> body); 60 scoped_refptr<ResourceRequestBody> body);
61 61
62 // Returns the handler attached to |request|. This may return NULL 62 // Returns the handler attached to |request|. This may return NULL
63 // if no handler is attached. 63 // if no handler is attached.
64 static ServiceWorkerRequestHandler* GetHandler( 64 static ServiceWorkerRequestHandler* GetHandler(
65 net::URLRequest* request); 65 net::URLRequest* request);
66 66
67 // Creates a protocol interceptor for ServiceWorker. 67 // Creates a protocol interceptor for ServiceWorker.
68 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor(); 68 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor();
69 69
70 // Returns true if the request falls into the scope of a ServiceWorker.
71 // It's only reliable after the ServiceWorkerRequestHandler MaybeCreateJob
72 // method run to completion for this request. The AppCache handler uses
falken 2014/10/14 01:24:49 nit: runs
73 // this to avoid colliding with ServiceWorkers.
74 static bool IsControlledByServiceWorker(net::URLRequest* request);
75
70 virtual ~ServiceWorkerRequestHandler(); 76 virtual ~ServiceWorkerRequestHandler();
71 77
72 // Called via custom URLRequestJobFactory. 78 // Called via custom URLRequestJobFactory.
73 virtual net::URLRequestJob* MaybeCreateJob( 79 virtual net::URLRequestJob* MaybeCreateJob(
74 net::URLRequest* request, 80 net::URLRequest* request,
75 net::NetworkDelegate* network_delegate) = 0; 81 net::NetworkDelegate* network_delegate) = 0;
76 82
77 virtual void GetExtraResponseInfo( 83 virtual void GetExtraResponseInfo(
78 bool* was_fetched_via_service_worker, 84 bool* was_fetched_via_service_worker,
79 bool* was_fallback_required_by_service_worker, 85 bool* was_fallback_required_by_service_worker,
(...skipping 14 matching lines...) Expand all
94 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; 100 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_;
95 ResourceType resource_type_; 101 ResourceType resource_type_;
96 102
97 private: 103 private:
98 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); 104 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler);
99 }; 105 };
100 106
101 } // namespace content 107 } // namespace content
102 108
103 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ 109 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698