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

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

Issue 17738004: Apply cross-origin auth prompt blocking to image resources only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Even simpler implementation using load flags. Created 7 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 | Annotate | Revision Log
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 // Creates ResourceRequestInfoImpl for a download or page save. 373 // Creates ResourceRequestInfoImpl for a download or page save.
374 // |download| should be true if the request is a file download. 374 // |download| should be true if the request is a file download.
375 ResourceRequestInfoImpl* CreateRequestInfo( 375 ResourceRequestInfoImpl* CreateRequestInfo(
376 int child_id, 376 int child_id,
377 int route_id, 377 int route_id,
378 bool download, 378 bool download,
379 ResourceContext* context); 379 ResourceContext* context);
380 380
381 // Relationship of resource being authenticated with the top level page. 381 // Relationship of resource being authenticated with the top level page.
382 enum HttpAuthResourceType { 382 enum HttpAuthRelationType {
383 HTTP_AUTH_RESOURCE_TOP, // Top-level page itself 383 HTTP_AUTH_RELATION_TOP, // Top-level page itself
384 HTTP_AUTH_RESOURCE_SAME_DOMAIN, // Sub-content from same domain 384 HTTP_AUTH_RELATION_SAME_DOMAIN, // Sub-content from same domain
385 HTTP_AUTH_RESOURCE_BLOCKED_CROSS, // Blocked Sub-content from cross domain 385 HTTP_AUTH_RELATION_BLOCKED_CROSS, // Blocked Sub-content from cross domain
386 HTTP_AUTH_RESOURCE_ALLOWED_CROSS, // Allowed Sub-content per command line 386 HTTP_AUTH_RELATION_ALLOWED_CROSS, // Allowed Sub-content per command line
387 HTTP_AUTH_RESOURCE_LAST 387 HTTP_AUTH_RELATION_LAST
388 }; 388 };
389 389
390 HttpAuthResourceType HttpAuthResourceTypeOf(net::URLRequest* request); 390 HttpAuthRelationType HttpAuthRelationTypeOf(const GURL& request_url,
391 const GURL& first_party);
391 392
392 // Returns whether the URLRequest identified by |transferred_request_id| is 393 // Returns whether the URLRequest identified by |transferred_request_id| is
393 // currently in the process of being transferred to a different renderer. 394 // currently in the process of being transferred to a different renderer.
394 // This happens if a request is redirected cross-site and needs to be resumed 395 // This happens if a request is redirected cross-site and needs to be resumed
395 // by a new render view. 396 // by a new render view.
396 bool IsTransferredNavigation( 397 bool IsTransferredNavigation(
397 const GlobalRequestID& transferred_request_id) const; 398 const GlobalRequestID& transferred_request_id) const;
398 399
399 ResourceLoader* GetLoader(const GlobalRequestID& id) const; 400 ResourceLoader* GetLoader(const GlobalRequestID& id) const;
400 ResourceLoader* GetLoader(int child_id, int request_id) const; 401 ResourceLoader* GetLoader(int child_id, int request_id) const;
401 402
402 // Registers |delegate| to receive resource IPC messages targeted to the 403 // Registers |delegate| to receive resource IPC messages targeted to the
403 // specified |id|. 404 // specified |id|.
404 void RegisterResourceMessageDelegate(const GlobalRequestID& id, 405 void RegisterResourceMessageDelegate(const GlobalRequestID& id,
405 ResourceMessageDelegate* delegate); 406 ResourceMessageDelegate* delegate);
406 void UnregisterResourceMessageDelegate(const GlobalRequestID& id, 407 void UnregisterResourceMessageDelegate(const GlobalRequestID& id,
407 ResourceMessageDelegate* delegate); 408 ResourceMessageDelegate* delegate);
408 409
410 int BuildLoadFlagsForRequest(const ResourceHostMsg_Request& request_data,
411 int child_id,
412 bool is_sync_load);
413
409 LoaderMap pending_loaders_; 414 LoaderMap pending_loaders_;
410 415
411 // Collection of temp files downloaded for child processes via 416 // Collection of temp files downloaded for child processes via
412 // the download_to_file mechanism. We avoid deleting them until 417 // the download_to_file mechanism. We avoid deleting them until
413 // the client no longer needs them. 418 // the client no longer needs them.
414 typedef std::map<int, scoped_refptr<webkit_blob::ShareableFileReference> > 419 typedef std::map<int, scoped_refptr<webkit_blob::ShareableFileReference> >
415 DeletableFilesMap; // key is request id 420 DeletableFilesMap; // key is request id
416 typedef std::map<int, DeletableFilesMap> 421 typedef std::map<int, DeletableFilesMap>
417 RegisteredTempFiles; // key is child process id 422 RegisteredTempFiles; // key is child process id
418 RegisteredTempFiles registered_temp_files_; 423 RegisteredTempFiles registered_temp_files_;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 typedef std::map<GlobalRoutingID, OfflinePolicy*> OfflineMap; 504 typedef std::map<GlobalRoutingID, OfflinePolicy*> OfflineMap;
500 505
501 OfflineMap offline_policy_map_; 506 OfflineMap offline_policy_map_;
502 507
503 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 508 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
504 }; 509 };
505 510
506 } // namespace content 511 } // namespace content
507 512
508 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 513 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/test/data/login/load_iframe_from_b.html ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698