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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.h

Issue 2466843002: Cancel the request when URLLoader is gone (Closed)
Patch Set: fix Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This is the browser side of the resource dispatcher, it receives requests 5 // This is the browser side of the resource dispatcher, it receives requests
6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and 6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and
7 // dispatches them to URLRequests. It then forwards the messages from the 7 // dispatches them to URLRequests. It then forwards the messages from the
8 // URLRequests back to the correct process for handling. 8 // URLRequests back to the correct process for handling.
9 // 9 //
10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 bool is_content_initiated, 335 bool is_content_initiated,
336 bool do_not_prompt_for_login, 336 bool do_not_prompt_for_login,
337 ResourceContext* context); 337 ResourceContext* context);
338 338
339 bool is_shutdown() const { return is_shutdown_; } 339 bool is_shutdown() const { return is_shutdown_; }
340 340
341 // Creates a new request ID for browser initiated requests. See the comments 341 // Creates a new request ID for browser initiated requests. See the comments
342 // of |request_id_| for the details. Must be called on the IO thread. 342 // of |request_id_| for the details. Must be called on the IO thread.
343 int MakeRequestID(); 343 int MakeRequestID();
344 344
345 // Cancels a request as requested by a renderer.
346 // Note that this cancel is subtly different from the other CancelRequest
347 // methods in this file, which also tear down the loader.
348 void CancelRequestFromRenderer(GlobalRequestID request_id);
349
345 private: 350 private:
346 friend class ResourceDispatcherHostTest; 351 friend class ResourceDispatcherHostTest;
347 352
348 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 353 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
349 TestBlockedRequestsProcessDies); 354 TestBlockedRequestsProcessDies);
350 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 355 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
351 CalculateApproximateMemoryCost); 356 CalculateApproximateMemoryCost);
352 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 357 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
353 DetachableResourceTimesOut); 358 DetachableResourceTimesOut);
354 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 359 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 772
768 // Points to the registered download handler intercept. 773 // Points to the registered download handler intercept.
769 CreateDownloadHandlerIntercept create_download_handler_intercept_; 774 CreateDownloadHandlerIntercept create_download_handler_intercept_;
770 775
771 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 776 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
772 }; 777 };
773 778
774 } // namespace content 779 } // namespace content
775 780
776 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 781 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698