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

Side by Side Diff: chrome/browser/renderer_host/resource_dispatcher_host.h

Issue 6025009: Get rid of RenderViewHostDelegate::Resource and dispatch the IPC messages dir... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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
11 11
12 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ 12 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_
13 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ 13 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_
14 #pragma once 14 #pragma once
15 15
16 #include <map> 16 #include <map>
17 #include <string> 17 #include <string>
18 #include <vector> 18 #include <vector>
19 19
20 #include "base/basictypes.h" 20 #include "base/basictypes.h"
21 #include "base/gtest_prod_util.h" 21 #include "base/gtest_prod_util.h"
22 #include "base/observer_list.h" 22 #include "base/observer_list.h"
23 #include "base/scoped_ptr.h" 23 #include "base/scoped_ptr.h"
24 #include "base/timer.h" 24 #include "base/timer.h"
25 #include "chrome/common/child_process_info.h" 25 #include "chrome/common/child_process_info.h"
26 #include "chrome/common/notification_type.h"
26 #include "chrome/browser/renderer_host/resource_queue.h" 27 #include "chrome/browser/renderer_host/resource_queue.h"
27 #include "ipc/ipc_message.h" 28 #include "ipc/ipc_message.h"
28 #include "net/url_request/url_request.h" 29 #include "net/url_request/url_request.h"
29 #include "webkit/glue/resource_type.h" 30 #include "webkit/glue/resource_type.h"
30 31
31 class CrossSiteResourceHandler; 32 class CrossSiteResourceHandler;
32 class DownloadFileManager; 33 class DownloadFileManager;
33 class DownloadRequestLimiter; 34 class DownloadRequestLimiter;
34 class LoginHandler; 35 class LoginHandler;
36 class NotificationDetails;
37 class NotificationSource;
35 class PluginService; 38 class PluginService;
36 class ResourceDispatcherHostRequestInfo; 39 class ResourceDispatcherHostRequestInfo;
37 class ResourceHandler; 40 class ResourceHandler;
38 class ResourceMessageFilter; 41 class ResourceMessageFilter;
39 class SafeBrowsingService; 42 class SafeBrowsingService;
40 class SaveFileManager; 43 class SaveFileManager;
41 class SSLClientAuthHandler; 44 class SSLClientAuthHandler;
42 class UserScriptListener; 45 class UserScriptListener;
43 class URLRequestContext; 46 class URLRequestContext;
44 class WebKitThread; 47 class WebKitThread;
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // have "chrome-extension://" scheme. 416 // have "chrome-extension://" scheme.
414 static void ApplyExtensionLocalizationFilter( 417 static void ApplyExtensionLocalizationFilter(
415 const GURL& url, 418 const GURL& url,
416 const ResourceType::Type& resource_type, 419 const ResourceType::Type& resource_type,
417 ResourceDispatcherHostRequestInfo* request_info); 420 ResourceDispatcherHostRequestInfo* request_info);
418 421
419 // Determine request priority based on how critical this resource typically 422 // Determine request priority based on how critical this resource typically
420 // is to user-perceived page load performance. 423 // is to user-perceived page load performance.
421 static net::RequestPriority DetermineRequestPriority(ResourceType::Type type); 424 static net::RequestPriority DetermineRequestPriority(ResourceType::Type type);
422 425
426 // Sends the given notification on the UI thread.
427 template <class T>
428 static void NotifyOnUI(NotificationType type, T* detail);
429
423 PendingRequestList pending_requests_; 430 PendingRequestList pending_requests_;
424 431
425 // Collection of temp files downloaded for child processes via 432 // Collection of temp files downloaded for child processes via
426 // the download_to_file mechanism. We avoid deleting them until 433 // the download_to_file mechanism. We avoid deleting them until
427 // the client no longer needs them. 434 // the client no longer needs them.
428 typedef std::map<int, scoped_refptr<webkit_blob::DeletableFileReference> > 435 typedef std::map<int, scoped_refptr<webkit_blob::DeletableFileReference> >
429 DeletableFilesMap; // key is request id 436 DeletableFilesMap; // key is request id
430 typedef std::map<int, DeletableFilesMap> 437 typedef std::map<int, DeletableFilesMap>
431 RegisteredTempFiles; // key is child process id 438 RegisteredTempFiles; // key is child process id
432 RegisteredTempFiles registered_temp_files_; 439 RegisteredTempFiles registered_temp_files_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // Used during IPC message dispatching so that the handlers can get a pointer 501 // Used during IPC message dispatching so that the handlers can get a pointer
495 // to the source of the message. 502 // to the source of the message.
496 ResourceMessageFilter* filter_; 503 ResourceMessageFilter* filter_;
497 504
498 static bool is_prefetch_enabled_; 505 static bool is_prefetch_enabled_;
499 506
500 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); 507 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost);
501 }; 508 };
502 509
503 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ 510 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698