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

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: Review comments 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 23 matching lines...) Expand all
34 class ServiceWorkerContextCore; 34 class ServiceWorkerContextCore;
35 class ServiceWorkerContextWrapper; 35 class ServiceWorkerContextWrapper;
36 class ServiceWorkerProviderHost; 36 class ServiceWorkerProviderHost;
37 struct ResourceResponseInfo; 37 struct ResourceResponseInfo;
38 38
39 // Abstract base class for routing network requests to ServiceWorkers. 39 // Abstract base class for routing network requests to ServiceWorkers.
40 // Created one per URLRequest and attached to each request. 40 // Created one per URLRequest and attached to each request.
41 class CONTENT_EXPORT ServiceWorkerRequestHandler 41 class CONTENT_EXPORT ServiceWorkerRequestHandler
42 : public base::SupportsUserData::Data { 42 : public base::SupportsUserData::Data {
43 public: 43 public:
44 // PlzNavigate
45 // Attaches a newly created handler if the given |request| needs to be handled
46 // by ServiceWorker.
47 static void InitializeForNavigation(
48 net::URLRequest* request,
49 ServiceWorkerContextWrapper* context_wrapper,
50 storage::BlobStorageContext* blob_storage_context,
51 int provider_id,
52 bool skip_service_worker,
53 ResourceType resource_type,
54 RequestContextType request_context_type,
55 RequestContextFrameType frame_type,
56 scoped_refptr<ResourceRequestBody> body);
57
44 // Attaches a newly created handler if the given |request| needs to 58 // Attaches a newly created handler if the given |request| needs to
45 // be handled by ServiceWorker. 59 // be handled by ServiceWorker.
46 // TODO(kinuko): While utilizing UserData to attach data to URLRequest 60 // 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 61 // has some precedence, it might be better to attach this handler in a more
48 // explicit way within content layer, e.g. have ResourceRequestInfoImpl 62 // explicit way within content layer, e.g. have ResourceRequestInfoImpl
49 // own it. 63 // own it.
50 static void InitializeHandler( 64 static void InitializeHandler(
51 net::URLRequest* request, 65 net::URLRequest* request,
52 ServiceWorkerContextWrapper* context_wrapper, 66 ServiceWorkerContextWrapper* context_wrapper,
53 storage::BlobStorageContext* blob_storage_context, 67 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_; 127 scoped_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_;
114 int old_process_id_; 128 int old_process_id_;
115 int old_provider_id_; 129 int old_provider_id_;
116 130
117 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); 131 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler);
118 }; 132 };
119 133
120 } // namespace content 134 } // namespace content
121 135
122 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ 136 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698