| 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "content/browser/browser_plugin/old/browser_plugin_host.h" | 17 #include "content/browser/browser_plugin/old/browser_plugin_host.h" |
| 18 #include "content/browser/child_process_security_policy_impl.h" | 18 #include "content/browser/child_process_security_policy_impl.h" |
| 19 #include "content/browser/debugger/devtools_manager_impl.h" | 19 #include "content/browser/debugger/devtools_manager_impl.h" |
| 20 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 20 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 21 #include "content/browser/download/download_stats.h" | 21 #include "content/browser/download/download_stats.h" |
| 22 #include "content/browser/download/mhtml_generation_manager.h" | 22 #include "content/browser/download/mhtml_generation_manager.h" |
| 23 #include "content/browser/download/save_package.h" | 23 #include "content/browser/download/save_package.h" |
| 24 #include "content/browser/gpu/gpu_data_manager_impl.h" | 24 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 25 #include "content/browser/gpu/gpu_process_host.h" | 25 #include "content/browser/gpu/gpu_process_host.h" |
| 26 #include "content/browser/host_zoom_map_impl.h" | 26 #include "content/browser/host_zoom_map_impl.h" |
| 27 #include "content/browser/intents/web_intents_dispatcher_impl.h" | 27 #include "content/browser/intents/web_intents_dispatcher_impl.h" |
| 28 #include "content/browser/load_from_memory_cache_details.h" | |
| 29 #include "content/browser/renderer_host/render_process_host_impl.h" | 28 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 30 #include "content/browser/renderer_host/render_view_host_impl.h" | 29 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 31 #include "content/browser/renderer_host/render_widget_host_impl.h" | 30 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 32 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 31 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
| 33 #include "content/browser/site_instance_impl.h" | 32 #include "content/browser/site_instance_impl.h" |
| 34 #include "content/browser/web_contents/interstitial_page_impl.h" | 33 #include "content/browser/web_contents/interstitial_page_impl.h" |
| 35 #include "content/browser/web_contents/navigation_entry_impl.h" | 34 #include "content/browser/web_contents/navigation_entry_impl.h" |
| 36 #include "content/browser/webui/web_ui_impl.h" | 35 #include "content/browser/webui/web_ui_impl.h" |
| 37 #include "content/common/intents_messages.h" | 36 #include "content/common/intents_messages.h" |
| 38 #include "content/common/ssl_status_serialization.h" | 37 #include "content/common/ssl_status_serialization.h" |
| 39 #include "content/common/view_messages.h" | 38 #include "content/common/view_messages.h" |
| 40 #include "content/port/browser/render_view_host_delegate_view.h" | 39 #include "content/port/browser/render_view_host_delegate_view.h" |
| 41 #include "content/port/browser/render_widget_host_view_port.h" | 40 #include "content/port/browser/render_widget_host_view_port.h" |
| 42 #include "content/public/browser/browser_context.h" | 41 #include "content/public/browser/browser_context.h" |
| 43 #include "content/public/browser/color_chooser.h" | 42 #include "content/public/browser/color_chooser.h" |
| 44 #include "content/public/browser/content_browser_client.h" | 43 #include "content/public/browser/content_browser_client.h" |
| 45 #include "content/public/browser/devtools_agent_host_registry.h" | 44 #include "content/public/browser/devtools_agent_host_registry.h" |
| 46 #include "content/public/browser/download_manager.h" | 45 #include "content/public/browser/download_manager.h" |
| 47 #include "content/public/browser/download_url_parameters.h" | 46 #include "content/public/browser/download_url_parameters.h" |
| 48 #include "content/public/browser/invalidate_type.h" | 47 #include "content/public/browser/invalidate_type.h" |
| 49 #include "content/public/browser/javascript_dialogs.h" | 48 #include "content/public/browser/javascript_dialogs.h" |
| 49 #include "content/public/browser/load_from_memory_cache_details.h" |
| 50 #include "content/public/browser/load_notification_details.h" | 50 #include "content/public/browser/load_notification_details.h" |
| 51 #include "content/public/browser/navigation_details.h" | 51 #include "content/public/browser/navigation_details.h" |
| 52 #include "content/public/browser/notification_details.h" | 52 #include "content/public/browser/notification_details.h" |
| 53 #include "content/public/browser/notification_service.h" | 53 #include "content/public/browser/notification_service.h" |
| 54 #include "content/public/browser/resource_request_details.h" | 54 #include "content/public/browser/resource_request_details.h" |
| 55 #include "content/public/browser/user_metrics.h" | 55 #include "content/public/browser/user_metrics.h" |
| 56 #include "content/public/browser/web_contents_delegate.h" | 56 #include "content/public/browser/web_contents_delegate.h" |
| 57 #include "content/public/browser/web_contents_observer.h" | 57 #include "content/public/browser/web_contents_observer.h" |
| 58 #include "content/public/browser/web_contents_view.h" | 58 #include "content/public/browser/web_contents_view.h" |
| 59 #include "content/public/browser/web_ui_controller_factory.h" | 59 #include "content/public/browser/web_ui_controller_factory.h" |
| (...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 base::StatsCounter cache("WebKit.CacheHit"); | 1927 base::StatsCounter cache("WebKit.CacheHit"); |
| 1928 cache.Increment(); | 1928 cache.Increment(); |
| 1929 | 1929 |
| 1930 // Send out a notification that we loaded a resource from our memory cache. | 1930 // Send out a notification that we loaded a resource from our memory cache. |
| 1931 int cert_id = 0; | 1931 int cert_id = 0; |
| 1932 net::CertStatus cert_status = 0; | 1932 net::CertStatus cert_status = 0; |
| 1933 int security_bits = -1; | 1933 int security_bits = -1; |
| 1934 int connection_status = 0; | 1934 int connection_status = 0; |
| 1935 content::DeserializeSecurityInfo(security_info, &cert_id, &cert_status, | 1935 content::DeserializeSecurityInfo(security_info, &cert_id, &cert_status, |
| 1936 &security_bits, &connection_status); | 1936 &security_bits, &connection_status); |
| 1937 LoadFromMemoryCacheDetails details(url, GetRenderProcessHost()->GetID(), | 1937 content::LoadFromMemoryCacheDetails details( |
| 1938 cert_id, cert_status, http_method, | 1938 url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method, |
| 1939 mime_type, resource_type); | 1939 mime_type, resource_type); |
| 1940 | 1940 |
| 1941 content::NotificationService::current()->Notify( | 1941 content::NotificationService::current()->Notify( |
| 1942 content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, | 1942 content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, |
| 1943 content::Source<NavigationController>(&controller_), | 1943 content::Source<NavigationController>(&controller_), |
| 1944 content::Details<LoadFromMemoryCacheDetails>(&details)); | 1944 content::Details<content::LoadFromMemoryCacheDetails>(&details)); |
| 1945 } | 1945 } |
| 1946 | 1946 |
| 1947 void WebContentsImpl::OnDidDisplayInsecureContent() { | 1947 void WebContentsImpl::OnDidDisplayInsecureContent() { |
| 1948 content::RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); | 1948 content::RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); |
| 1949 displayed_insecure_content_ = true; | 1949 displayed_insecure_content_ = true; |
| 1950 SSLManager::NotifySSLInternalStateChanged(&GetControllerImpl()); | 1950 SSLManager::NotifySSLInternalStateChanged(&GetControllerImpl()); |
| 1951 } | 1951 } |
| 1952 | 1952 |
| 1953 void WebContentsImpl::OnDidRunInsecureContent( | 1953 void WebContentsImpl::OnDidRunInsecureContent( |
| 1954 const std::string& security_origin, const GURL& target_url) { | 1954 const std::string& security_origin, const GURL& target_url) { |
| (...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3088 browser_plugin_host()->embedder_render_process_host(); | 3088 browser_plugin_host()->embedder_render_process_host(); |
| 3089 *embedder_container_id = browser_plugin_host()->instance_id(); | 3089 *embedder_container_id = browser_plugin_host()->instance_id(); |
| 3090 int embedder_process_id = | 3090 int embedder_process_id = |
| 3091 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3091 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
| 3092 if (embedder_process_id != -1) { | 3092 if (embedder_process_id != -1) { |
| 3093 *embedder_channel_name = | 3093 *embedder_channel_name = |
| 3094 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3094 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
| 3095 embedder_process_id); | 3095 embedder_process_id); |
| 3096 } | 3096 } |
| 3097 } | 3097 } |
| OLD | NEW |