| 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" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/metrics/stats_counters.h" | 14 #include "base/metrics/stats_counters.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "cc/base/switches.h" | 21 #include "cc/base/switches.h" |
| 22 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 22 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 23 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 23 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 24 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" | 24 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" |
| 25 #include "content/browser/child_process_security_policy_impl.h" | 25 #include "content/browser/child_process_security_policy_impl.h" |
| 26 #include "content/browser/devtools/devtools_manager_impl.h" | 26 #include "content/browser/devtools/devtools_manager_impl.h" |
| 27 #include "content/browser/dom_storage/dom_storage_context_impl.h" | 27 #include "content/browser/dom_storage/dom_storage_context_proxy.h" |
| 28 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 28 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 29 #include "content/browser/download/download_stats.h" | 29 #include "content/browser/download/download_stats.h" |
| 30 #include "content/browser/download/mhtml_generation_manager.h" | 30 #include "content/browser/download/mhtml_generation_manager.h" |
| 31 #include "content/browser/download/save_package.h" | 31 #include "content/browser/download/save_package.h" |
| 32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 32 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 33 #include "content/browser/gpu/gpu_process_host.h" | 33 #include "content/browser/gpu/gpu_process_host.h" |
| 34 #include "content/browser/host_zoom_map_impl.h" | 34 #include "content/browser/host_zoom_map_impl.h" |
| 35 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 35 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 36 #include "content/browser/power_save_blocker_impl.h" | 36 #include "content/browser/power_save_blocker_impl.h" |
| 37 #include "content/browser/renderer_host/render_process_host_impl.h" | 37 #include "content/browser/renderer_host/render_process_host_impl.h" |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 | 1458 |
| 1459 // We must assign the SessionStorageNamespace before calling Init(). | 1459 // We must assign the SessionStorageNamespace before calling Init(). |
| 1460 // | 1460 // |
| 1461 // http://crbug.com/142685 | 1461 // http://crbug.com/142685 |
| 1462 const std::string& partition_id = | 1462 const std::string& partition_id = |
| 1463 GetContentClient()->browser()-> | 1463 GetContentClient()->browser()-> |
| 1464 GetStoragePartitionIdForSite(GetBrowserContext(), | 1464 GetStoragePartitionIdForSite(GetBrowserContext(), |
| 1465 site_instance->GetSiteURL()); | 1465 site_instance->GetSiteURL()); |
| 1466 StoragePartition* partition = BrowserContext::GetStoragePartition( | 1466 StoragePartition* partition = BrowserContext::GetStoragePartition( |
| 1467 GetBrowserContext(), site_instance.get()); | 1467 GetBrowserContext(), site_instance.get()); |
| 1468 DOMStorageContextImpl* dom_storage_context = | 1468 DOMStorageContextProxy* dom_storage_context = |
| 1469 static_cast<DOMStorageContextImpl*>(partition->GetDOMStorageContext()); | 1469 static_cast<DOMStorageContextProxy*>(partition->GetDOMStorageContext()); |
| 1470 SessionStorageNamespaceImpl* session_storage_namespace_impl = | 1470 SessionStorageNamespaceImpl* session_storage_namespace_impl = |
| 1471 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); | 1471 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); |
| 1472 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); | 1472 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); |
| 1473 new_contents->GetController().SetSessionStorageNamespace( | 1473 new_contents->GetController().SetSessionStorageNamespace( |
| 1474 partition_id, | 1474 partition_id, |
| 1475 session_storage_namespace); | 1475 session_storage_namespace); |
| 1476 CreateParams create_params(GetBrowserContext(), site_instance.get()); | 1476 CreateParams create_params(GetBrowserContext(), site_instance.get()); |
| 1477 create_params.routing_id = route_id; | 1477 create_params.routing_id = route_id; |
| 1478 create_params.main_frame_routing_id = main_frame_route_id; | 1478 create_params.main_frame_routing_id = main_frame_route_id; |
| 1479 if (!is_guest) { | 1479 if (!is_guest) { |
| (...skipping 2237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3717 } | 3717 } |
| 3718 | 3718 |
| 3719 void WebContentsImpl::ClearAllPowerSaveBlockers() { | 3719 void WebContentsImpl::ClearAllPowerSaveBlockers() { |
| 3720 for (PowerSaveBlockerMap::iterator i(power_save_blockers_.begin()); | 3720 for (PowerSaveBlockerMap::iterator i(power_save_blockers_.begin()); |
| 3721 i != power_save_blockers_.end(); ++i) | 3721 i != power_save_blockers_.end(); ++i) |
| 3722 STLDeleteValues(&power_save_blockers_[i->first]); | 3722 STLDeleteValues(&power_save_blockers_[i->first]); |
| 3723 power_save_blockers_.clear(); | 3723 power_save_blockers_.clear(); |
| 3724 } | 3724 } |
| 3725 | 3725 |
| 3726 } // namespace content | 3726 } // namespace content |
| OLD | NEW |