OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 #include "webkit/appcache/appcache_interceptor.h" | 79 #include "webkit/appcache/appcache_interceptor.h" |
80 #include "webkit/appcache/appcache_interfaces.h" | 80 #include "webkit/appcache/appcache_interfaces.h" |
81 #include "webkit/blob/blob_storage_controller.h" | 81 #include "webkit/blob/blob_storage_controller.h" |
82 #include "webkit/blob/deletable_file_reference.h" | 82 #include "webkit/blob/deletable_file_reference.h" |
83 | 83 |
84 using base::Time; | 84 using base::Time; |
85 using base::TimeDelta; | 85 using base::TimeDelta; |
86 using base::TimeTicks; | 86 using base::TimeTicks; |
87 using content::BrowserThread; | 87 using content::BrowserThread; |
88 using content::ResourceResponse; | 88 using content::ResourceResponse; |
| 89 using content::WebContents; |
89 using webkit_blob::DeletableFileReference; | 90 using webkit_blob::DeletableFileReference; |
90 | 91 |
91 // ---------------------------------------------------------------------------- | 92 // ---------------------------------------------------------------------------- |
92 | 93 |
93 namespace { | 94 namespace { |
94 | 95 |
95 // The interval for calls to ResourceDispatcherHost::UpdateLoadStates | 96 // The interval for calls to ResourceDispatcherHost::UpdateLoadStates |
96 const int kUpdateLoadStatesIntervalMsec = 100; | 97 const int kUpdateLoadStatesIntervalMsec = 100; |
97 | 98 |
98 // Maximum number of pending data messages sent to the renderer at any | 99 // Maximum number of pending data messages sent to the renderer at any |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1980 template <class T> | 1981 template <class T> |
1981 void ResourceDispatcherHost::NotifyOnUI(int type, | 1982 void ResourceDispatcherHost::NotifyOnUI(int type, |
1982 int render_process_id, | 1983 int render_process_id, |
1983 int render_view_id, | 1984 int render_view_id, |
1984 T* detail) { | 1985 T* detail) { |
1985 RenderViewHost* rvh = | 1986 RenderViewHost* rvh = |
1986 RenderViewHost::FromID(render_process_id, render_view_id); | 1987 RenderViewHost::FromID(render_process_id, render_view_id); |
1987 if (rvh) { | 1988 if (rvh) { |
1988 RenderViewHostDelegate* rvhd = rvh->delegate(); | 1989 RenderViewHostDelegate* rvhd = rvh->delegate(); |
1989 content::NotificationService::current()->Notify( | 1990 content::NotificationService::current()->Notify( |
1990 type, content::Source<RenderViewHostDelegate>(rvhd), | 1991 type, content::Source<WebContents>(rvhd->GetAsWebContents()), |
1991 content::Details<T>(detail)); | 1992 content::Details<T>(detail)); |
1992 } | 1993 } |
1993 delete detail; | 1994 delete detail; |
1994 } | 1995 } |
1995 | 1996 |
1996 namespace { | 1997 namespace { |
1997 | 1998 |
1998 // This function attempts to return the "more interesting" load state of |a| | 1999 // This function attempts to return the "more interesting" load state of |a| |
1999 // and |b|. We don't have temporal information about these load states | 2000 // and |b|. We don't have temporal information about these load states |
2000 // (meaning we don't know when we transitioned into these states), so we just | 2001 // (meaning we don't know when we transitioned into these states), so we just |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2233 | 2234 |
2234 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { | 2235 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { |
2235 allow_cross_origin_auth_prompt_ = value; | 2236 allow_cross_origin_auth_prompt_ = value; |
2236 } | 2237 } |
2237 | 2238 |
2238 void ResourceDispatcherHost::MarkAsTransferredNavigation( | 2239 void ResourceDispatcherHost::MarkAsTransferredNavigation( |
2239 const GlobalRequestID& transferred_request_id, | 2240 const GlobalRequestID& transferred_request_id, |
2240 net::URLRequest* ransferred_request) { | 2241 net::URLRequest* ransferred_request) { |
2241 transferred_navigations_[transferred_request_id] = ransferred_request; | 2242 transferred_navigations_[transferred_request_id] = ransferred_request; |
2242 } | 2243 } |
OLD | NEW |