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

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

Issue 2032653003: Limit foreign fetch to only intercept requests made from secure contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: properly initialize new ResourceRequest member Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_FOREIGN_FETCH_REQUEST_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 storage::BlobStorageContext* blob_storage_context, 54 storage::BlobStorageContext* blob_storage_context,
55 int process_id, 55 int process_id,
56 int provider_id, 56 int provider_id,
57 bool skip_service_worker, 57 bool skip_service_worker,
58 FetchRequestMode request_mode, 58 FetchRequestMode request_mode,
59 FetchCredentialsMode credentials_mode, 59 FetchCredentialsMode credentials_mode,
60 FetchRedirectMode redirect_mode, 60 FetchRedirectMode redirect_mode,
61 ResourceType resource_type, 61 ResourceType resource_type,
62 RequestContextType request_context_type, 62 RequestContextType request_context_type,
63 RequestContextFrameType frame_type, 63 RequestContextFrameType frame_type,
64 scoped_refptr<ResourceRequestBody> body); 64 scoped_refptr<ResourceRequestBody> body,
65 bool initiated_in_secure_context);
65 66
66 // Returns the handler attached to |request|. This may return null 67 // Returns the handler attached to |request|. This may return null
67 // if no handler is attached. 68 // if no handler is attached.
68 static ForeignFetchRequestHandler* GetHandler(net::URLRequest* request); 69 static ForeignFetchRequestHandler* GetHandler(net::URLRequest* request);
69 70
70 // Creates a protocol interceptor for foreign fetch. 71 // Creates a protocol interceptor for foreign fetch.
71 static std::unique_ptr<net::URLRequestInterceptor> CreateInterceptor( 72 static std::unique_ptr<net::URLRequestInterceptor> CreateInterceptor(
72 ResourceContext* resource_context); 73 ResourceContext* resource_context);
73 74
74 ~ForeignFetchRequestHandler() override; 75 ~ForeignFetchRequestHandler() override;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 bool use_network_ = false; 125 bool use_network_ = false;
125 126
126 base::WeakPtrFactory<ForeignFetchRequestHandler> weak_factory_; 127 base::WeakPtrFactory<ForeignFetchRequestHandler> weak_factory_;
127 128
128 DISALLOW_COPY_AND_ASSIGN(ForeignFetchRequestHandler); 129 DISALLOW_COPY_AND_ASSIGN(ForeignFetchRequestHandler);
129 }; 130 };
130 131
131 } // namespace content 132 } // namespace content
132 133
133 #endif // CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_ 134 #endif // CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698