| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #ifndef CHROME_COMMON_RESOURCE_DISPATCHER_H__ | 7 #ifndef CHROME_COMMON_RESOURCE_DISPATCHER_H__ |
| 8 #define CHROME_COMMON_RESOURCE_DISPATCHER_H__ | 8 #define CHROME_COMMON_RESOURCE_DISPATCHER_H__ |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // the child process. It can be used from any child process. | 25 // the child process. It can be used from any child process. |
| 26 class ResourceDispatcher { | 26 class ResourceDispatcher { |
| 27 public: | 27 public: |
| 28 explicit ResourceDispatcher(IPC::Message::Sender* sender); | 28 explicit ResourceDispatcher(IPC::Message::Sender* sender); |
| 29 ~ResourceDispatcher(); | 29 ~ResourceDispatcher(); |
| 30 | 30 |
| 31 // Called to possibly handle the incoming IPC message. Returns true if | 31 // Called to possibly handle the incoming IPC message. Returns true if |
| 32 // handled, else false. | 32 // handled, else false. |
| 33 bool OnMessageReceived(const IPC::Message& message); | 33 bool OnMessageReceived(const IPC::Message& message); |
| 34 | 34 |
| 35 // creates a ResourceLoaderBridge for this type of dispatcher, this is so | 35 // Creates a ResourceLoaderBridge for this type of dispatcher, this is so |
| 36 // this can be tested regardless of the ResourceLoaderBridge::Create | 36 // this can be tested regardless of the ResourceLoaderBridge::Create |
| 37 // implementation. | 37 // implementation. |
| 38 webkit_glue::ResourceLoaderBridge* CreateBridge(const std::string& method, | 38 webkit_glue::ResourceLoaderBridge* CreateBridge(const std::string& method, |
| 39 const GURL& url, | 39 const GURL& url, |
| 40 const GURL& policy_url, | 40 const GURL& policy_url, |
| 41 const GURL& referrer, | 41 const GURL& referrer, |
| 42 const std::string& frame_origin, | 42 const std::string& frame_origin, |
| 43 const std::string& main_frame_origin, | 43 const std::string& main_frame_origin, |
| 44 const std::string& headers, | 44 const std::string& headers, |
| 45 const std::string& default_mime_type, | 45 const std::string& default_mime_type, |
| 46 int load_flags, | 46 int load_flags, |
| 47 int origin_pid, | 47 int origin_pid, |
| 48 ResourceType::Type resource_type, | 48 ResourceType::Type resource_type, |
| 49 uint32 request_context /* used for plugin->browser requests */, | 49 uint32 request_context /* used for plugin->browser requests */, |
| 50 int app_cache_context_id, |
| 50 int route_id); | 51 int route_id); |
| 51 | 52 |
| 52 // Adds a request from the pending_requests_ list, returning the new | 53 // Adds a request from the pending_requests_ list, returning the new |
| 53 // requests' ID | 54 // requests' ID |
| 54 int AddPendingRequest(webkit_glue::ResourceLoaderBridge::Peer* callback, | 55 int AddPendingRequest(webkit_glue::ResourceLoaderBridge::Peer* callback, |
| 55 ResourceType::Type resource_type); | 56 ResourceType::Type resource_type); |
| 56 | 57 |
| 57 // Removes a request from the pending_requests_ list, returning true if the | 58 // Removes a request from the pending_requests_ list, returning true if the |
| 58 // request was found and removed. | 59 // request was found and removed. |
| 59 bool RemovePendingRequest(int request_id); | 60 bool RemovePendingRequest(int request_id); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 119 |
| 119 // All pending requests issued to the host | 120 // All pending requests issued to the host |
| 120 PendingRequestList pending_requests_; | 121 PendingRequestList pending_requests_; |
| 121 | 122 |
| 122 ScopedRunnableMethodFactory<ResourceDispatcher> method_factory_; | 123 ScopedRunnableMethodFactory<ResourceDispatcher> method_factory_; |
| 123 | 124 |
| 124 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcher); | 125 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcher); |
| 125 }; | 126 }; |
| 126 | 127 |
| 127 #endif // CHROME_COMMON_RESOURCE_DISPATCHER_H__ | 128 #endif // CHROME_COMMON_RESOURCE_DISPATCHER_H__ |
| OLD | NEW |