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

Unified Diff: chrome/browser/renderer_host/resource_dispatcher_host.h

Issue 460108: Implement ResourceQueue, an object that makes it easy to delay starting (Closed)
Patch Set: nitfixing Created 11 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/resource_dispatcher_host.h
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h
index a48cebe4667b0b1851ef49751141739c07103bcd..3dba76761fec295fd10f3f197fddfe0b6cd251d6 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.h
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.h
@@ -23,6 +23,7 @@
#include "base/timer.h"
#include "chrome/common/child_process_info.h"
#include "chrome/browser/privacy_blacklist/blocked_response.h"
+#include "chrome/browser/renderer_host/resource_queue.h"
#include "ipc/ipc_message.h"
#include "net/url_request/url_request.h"
#include "webkit/glue/resource_type.h"
@@ -41,6 +42,7 @@ class SSLClientAuthHandler;
class UserScriptListener;
class URLRequestContext;
class WebKitThread;
+struct GlobalRequestID;
struct ViewHostMsg_Resource_Request;
struct ViewMsg_ClosePage_Params;
@@ -86,25 +88,6 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
const GURL& new_url) = 0;
};
- // Uniquely identifies a URLRequest.
- struct GlobalRequestID {
- GlobalRequestID() : child_id(-1), request_id(-1) {
- }
- GlobalRequestID(int child_id, int request_id)
- : child_id(child_id),
- request_id(request_id) {
- }
-
- int child_id;
- int request_id;
-
- bool operator<(const GlobalRequestID& other) const {
- if (child_id == other.child_id)
- return request_id < other.request_id;
- return child_id < other.child_id;
- }
- };
-
ResourceDispatcherHost();
~ResourceDispatcherHost();
@@ -249,7 +232,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
void RemoveObserver(Observer* obs);
// Retrieves a URLRequest. Must be called from the IO thread.
- URLRequest* GetURLRequest(GlobalRequestID request_id) const;
+ URLRequest* GetURLRequest(const GlobalRequestID& request_id) const;
// Notifies our observers that a request has been cancelled.
void NotifyResponseCompleted(URLRequest* request, int process_unique_id);
@@ -414,6 +397,9 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
// is not empty.
base::RepeatingTimer<ResourceDispatcherHost> update_load_states_timer_;
+ // Handles the resource requests from the moment we want to start them.
+ ResourceQueue resource_queue_;
+
// We own the download file writing thread and manager
scoped_refptr<DownloadFileManager> download_file_manager_;
« no previous file with comments | « chrome/browser/renderer_host/global_request_id.h ('k') | chrome/browser/renderer_host/resource_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698