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

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

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 13 matching lines...) Expand all
24 } 24 }
25 25
26 namespace storage { 26 namespace storage {
27 class BlobStorageContext; 27 class BlobStorageContext;
28 } 28 }
29 29
30 namespace content { 30 namespace content {
31 31
32 class ResourceContext; 32 class ResourceContext;
33 class ResourceRequestBody; 33 class ResourceRequestBody;
34 class NavigationHandleImpl;
35 class NavigationURLLoaderImplCore;
34 class ServiceWorkerContextCore; 36 class ServiceWorkerContextCore;
35 class ServiceWorkerContextWrapper; 37 class ServiceWorkerContextWrapper;
36 class ServiceWorkerProviderHost; 38 class ServiceWorkerProviderHost;
37 struct ResourceResponseInfo; 39 struct ResourceResponseInfo;
38 40
39 // Abstract base class for routing network requests to ServiceWorkers. 41 // Abstract base class for routing network requests to ServiceWorkers.
40 // Created one per URLRequest and attached to each request. 42 // Created one per URLRequest and attached to each request.
41 class CONTENT_EXPORT ServiceWorkerRequestHandler 43 class CONTENT_EXPORT ServiceWorkerRequestHandler
42 : public base::SupportsUserData::Data { 44 : public base::SupportsUserData::Data {
43 public: 45 public:
46 // PlzNavigate
47 // Attaches a newly created handler if the given |request| needs to be handled
48 // by ServiceWorker.
49 static void InitializeForNavigation(
50 net::URLRequest* request,
51 ServiceWorkerContextWrapper* context_wrapper,
52 storage::BlobStorageContext* blob_storage_context,
53 int provider_id,
54 bool skip_service_worker,
55 ResourceType resource_type,
56 RequestContextType request_context_type,
57 RequestContextFrameType frame_type,
58 scoped_refptr<ResourceRequestBody> body);
59
44 // Attaches a newly created handler if the given |request| needs to 60 // Attaches a newly created handler if the given |request| needs to
45 // be handled by ServiceWorker. 61 // be handled by ServiceWorker.
46 // TODO(kinuko): While utilizing UserData to attach data to URLRequest 62 // TODO(kinuko): While utilizing UserData to attach data to URLRequest
47 // has some precedence, it might be better to attach this handler in a more 63 // has some precedence, it might be better to attach this handler in a more
48 // explicit way within content layer, e.g. have ResourceRequestInfoImpl 64 // explicit way within content layer, e.g. have ResourceRequestInfoImpl
49 // own it. 65 // own it.
50 static void InitializeHandler( 66 static void InitializeHandler(
51 net::URLRequest* request, 67 net::URLRequest* request,
52 ServiceWorkerContextWrapper* context_wrapper, 68 ServiceWorkerContextWrapper* context_wrapper,
53 storage::BlobStorageContext* blob_storage_context, 69 storage::BlobStorageContext* blob_storage_context,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 scoped_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_; 129 scoped_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_;
114 int old_process_id_; 130 int old_process_id_;
115 int old_provider_id_; 131 int old_provider_id_;
116 132
117 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); 133 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler);
118 }; 134 };
119 135
120 } // namespace content 136 } // namespace content
121 137
122 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ 138 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698