mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:52:45 +00:00 
			
		
		
		
	LibWeb: Propagate Realm instead of VM more through Fetch
This makes Fetch rely less on using main_thread_vm().current_realm(), which relies on the dummy execution context if no JavaScript is currently running.
This commit is contained in:
		
							parent
							
								
									f7ff1fd985
								
							
						
					
					
						commit
						9acc542059
					
				
					 19 changed files with 62 additions and 49 deletions
				
			
		|  | @ -759,7 +759,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea | |||
|     // 4. If request’s service-workers mode is "all", then:
 | ||||
|     if (request->service_workers_mode() == Infrastructure::Request::ServiceWorkersMode::All) { | ||||
|         // 1. Let requestForServiceWorker be a clone of request.
 | ||||
|         auto request_for_service_worker = TRY(request->clone(vm)); | ||||
|         auto request_for_service_worker = TRY(request->clone(realm)); | ||||
| 
 | ||||
|         // 2. If requestForServiceWorker’s body is non-null, then:
 | ||||
|         if (!request_for_service_worker->body().has<Empty>()) { | ||||
|  | @ -1147,7 +1147,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet | |||
|             // NOTE: Implementations are encouraged to avoid teeing request’s body’s stream when request’s body’s
 | ||||
|             //       source is null as only a single body is needed in that case. E.g., when request’s body’s source
 | ||||
|             //       is null, redirects and authentication will end up failing the fetch.
 | ||||
|             http_request = TRY(request->clone(vm)); | ||||
|             http_request = TRY(request->clone(realm)); | ||||
| 
 | ||||
|             // 2. Set httpFetchParams to a copy of fetchParams.
 | ||||
|             // 3. Set httpFetchParams’s request to httpRequest.
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Luke Wilde
						Luke Wilde