OLD | NEW |
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 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 render_view_host)); | 2172 render_view_host)); |
2173 } | 2173 } |
2174 } | 2174 } |
2175 | 2175 |
2176 void WebContentsImpl::DidRedirectProvisionalLoad( | 2176 void WebContentsImpl::DidRedirectProvisionalLoad( |
2177 RenderViewHost* render_view_host, | 2177 RenderViewHost* render_view_host, |
2178 int32 page_id, | 2178 int32 page_id, |
2179 const GURL& source_url, | 2179 const GURL& source_url, |
2180 const GURL& target_url) { | 2180 const GURL& target_url) { |
2181 // TODO(creis): Remove this method and have the pre-rendering code listen to | 2181 // TODO(creis): Remove this method and have the pre-rendering code listen to |
2182 // the ResourceDispatcherHost's RESOURCE_RECEIVED_REDIRECT notification | 2182 // WebContentsObserver::DidGetRedirectForResourceRequest instead. |
2183 // instead. See http://crbug.com/78512. | 2183 // See http://crbug.com/78512. |
2184 GURL validated_source_url(source_url); | 2184 GURL validated_source_url(source_url); |
2185 GURL validated_target_url(target_url); | 2185 GURL validated_target_url(target_url); |
2186 RenderProcessHost* render_process_host = | 2186 RenderProcessHost* render_process_host = |
2187 render_view_host->GetProcess(); | 2187 render_view_host->GetProcess(); |
2188 RenderViewHost::FilterURL(render_process_host, false, &validated_source_url); | 2188 RenderViewHost::FilterURL(render_process_host, false, &validated_source_url); |
2189 RenderViewHost::FilterURL(render_process_host, false, &validated_target_url); | 2189 RenderViewHost::FilterURL(render_process_host, false, &validated_target_url); |
2190 NavigationEntry* entry; | 2190 NavigationEntry* entry; |
2191 if (page_id == -1) { | 2191 if (page_id == -1) { |
2192 entry = controller_.GetPendingEntry(); | 2192 entry = controller_.GetPendingEntry(); |
2193 } else { | 2193 } else { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 int cert_id = 0; | 2272 int cert_id = 0; |
2273 net::CertStatus cert_status = 0; | 2273 net::CertStatus cert_status = 0; |
2274 int security_bits = -1; | 2274 int security_bits = -1; |
2275 int connection_status = 0; | 2275 int connection_status = 0; |
2276 DeserializeSecurityInfo(security_info, &cert_id, &cert_status, | 2276 DeserializeSecurityInfo(security_info, &cert_id, &cert_status, |
2277 &security_bits, &connection_status); | 2277 &security_bits, &connection_status); |
2278 LoadFromMemoryCacheDetails details( | 2278 LoadFromMemoryCacheDetails details( |
2279 url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method, | 2279 url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method, |
2280 mime_type, resource_type); | 2280 mime_type, resource_type); |
2281 | 2281 |
| 2282 controller_.ssl_manager()->DidLoadFromMemoryCache(details); |
| 2283 |
| 2284 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2285 DidLoadResourceFromMemoryCache(details)); |
| 2286 |
| 2287 // TODO(avi): Remove. http://crbug.com/170921 |
2282 NotificationService::current()->Notify( | 2288 NotificationService::current()->Notify( |
2283 NOTIFICATION_LOAD_FROM_MEMORY_CACHE, | 2289 NOTIFICATION_LOAD_FROM_MEMORY_CACHE, |
2284 Source<NavigationController>(&controller_), | 2290 Source<NavigationController>(&controller_), |
2285 Details<LoadFromMemoryCacheDetails>(&details)); | 2291 Details<LoadFromMemoryCacheDetails>(&details)); |
2286 } | 2292 } |
2287 | 2293 |
2288 void WebContentsImpl::OnDidDisplayInsecureContent() { | 2294 void WebContentsImpl::OnDidDisplayInsecureContent() { |
2289 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); | 2295 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); |
2290 displayed_insecure_content_ = true; | 2296 displayed_insecure_content_ = true; |
2291 SSLManager::NotifySSLInternalStateChanged( | 2297 SSLManager::NotifySSLInternalStateChanged( |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2932 observers_, | 2938 observers_, |
2933 RenderProcessGone(GetCrashedStatus())); | 2939 RenderProcessGone(GetCrashedStatus())); |
2934 } | 2940 } |
2935 | 2941 |
2936 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { | 2942 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { |
2937 ClearPowerSaveBlockers(rvh); | 2943 ClearPowerSaveBlockers(rvh); |
2938 render_manager_.RenderViewDeleted(rvh); | 2944 render_manager_.RenderViewDeleted(rvh); |
2939 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); | 2945 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); |
2940 } | 2946 } |
2941 | 2947 |
| 2948 void WebContentsImpl::DidGetResourceResponseStart( |
| 2949 const ResourceRequestDetails& details) { |
| 2950 controller_.ssl_manager()->DidStartResourceResponse(details); |
| 2951 |
| 2952 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2953 DidGetResourceResponseStart(details)); |
| 2954 |
| 2955 // TODO(avi): Remove. http://crbug.com/170921 |
| 2956 NotificationService::current()->Notify( |
| 2957 NOTIFICATION_RESOURCE_RESPONSE_STARTED, |
| 2958 Source<WebContents>(this), |
| 2959 Details<const ResourceRequestDetails>(&details)); |
| 2960 } |
| 2961 |
| 2962 void WebContentsImpl::DidGetRedirectForResourceRequest( |
| 2963 const ResourceRedirectDetails& details) { |
| 2964 controller_.ssl_manager()->DidReceiveResourceRedirect(details); |
| 2965 |
| 2966 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2967 DidGetRedirectForResourceRequest(details)); |
| 2968 |
| 2969 // TODO(avi): Remove. http://crbug.com/170921 |
| 2970 NotificationService::current()->Notify( |
| 2971 NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, |
| 2972 Source<WebContents>(this), |
| 2973 Details<const ResourceRedirectDetails>(&details)); |
| 2974 } |
| 2975 |
2942 void WebContentsImpl::DidNavigate( | 2976 void WebContentsImpl::DidNavigate( |
2943 RenderViewHost* rvh, | 2977 RenderViewHost* rvh, |
2944 const ViewHostMsg_FrameNavigate_Params& params) { | 2978 const ViewHostMsg_FrameNavigate_Params& params) { |
2945 // If we don't have a frame tree root yet, this is the first navigation in | 2979 // If we don't have a frame tree root yet, this is the first navigation in |
2946 // using the current RenderViewHost, so we need to create it with the proper | 2980 // using the current RenderViewHost, so we need to create it with the proper |
2947 // frame id. | 2981 // frame id. |
2948 if (!frame_tree_root_.get()) { | 2982 if (!frame_tree_root_.get()) { |
2949 DCHECK(PageTransitionIsMainFrame(params.transition)); | 2983 DCHECK(PageTransitionIsMainFrame(params.transition)); |
2950 frame_tree_root_.reset(new FrameTreeNode(params.frame_id, std::string())); | 2984 frame_tree_root_.reset(new FrameTreeNode(params.frame_id, std::string())); |
2951 } | 2985 } |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3754 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { | 3788 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { |
3755 gfx::Size size; | 3789 gfx::Size size; |
3756 if (delegate_) | 3790 if (delegate_) |
3757 size = delegate_->GetSizeForNewRenderView(this); | 3791 size = delegate_->GetSizeForNewRenderView(this); |
3758 if (size.IsEmpty()) | 3792 if (size.IsEmpty()) |
3759 size = view_->GetContainerSize(); | 3793 size = view_->GetContainerSize(); |
3760 return size; | 3794 return size; |
3761 } | 3795 } |
3762 | 3796 |
3763 } // namespace content | 3797 } // namespace content |
OLD | NEW |