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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 #include "content/public/browser/download_manager.h" | 47 #include "content/public/browser/download_manager.h" |
48 #include "content/public/browser/download_url_parameters.h" | 48 #include "content/public/browser/download_url_parameters.h" |
49 #include "content/public/browser/invalidate_type.h" | 49 #include "content/public/browser/invalidate_type.h" |
50 #include "content/public/browser/javascript_dialogs.h" | 50 #include "content/public/browser/javascript_dialogs.h" |
51 #include "content/public/browser/load_from_memory_cache_details.h" | 51 #include "content/public/browser/load_from_memory_cache_details.h" |
52 #include "content/public/browser/load_notification_details.h" | 52 #include "content/public/browser/load_notification_details.h" |
53 #include "content/public/browser/navigation_details.h" | 53 #include "content/public/browser/navigation_details.h" |
54 #include "content/public/browser/notification_details.h" | 54 #include "content/public/browser/notification_details.h" |
55 #include "content/public/browser/notification_service.h" | 55 #include "content/public/browser/notification_service.h" |
56 #include "content/public/browser/resource_request_details.h" | 56 #include "content/public/browser/resource_request_details.h" |
57 #include "content/public/browser/storage_partition.h" | |
57 #include "content/public/browser/user_metrics.h" | 58 #include "content/public/browser/user_metrics.h" |
58 #include "content/public/browser/web_contents_delegate.h" | 59 #include "content/public/browser/web_contents_delegate.h" |
59 #include "content/public/browser/web_contents_observer.h" | 60 #include "content/public/browser/web_contents_observer.h" |
60 #include "content/public/browser/web_contents_view.h" | 61 #include "content/public/browser/web_contents_view.h" |
61 #include "content/public/browser/web_ui_controller_factory.h" | 62 #include "content/public/browser/web_ui_controller_factory.h" |
62 #include "content/public/common/bindings_policy.h" | 63 #include "content/public/common/bindings_policy.h" |
63 #include "content/public/common/content_constants.h" | 64 #include "content/public/common/content_constants.h" |
64 #include "content/public/common/content_restriction.h" | 65 #include "content/public/common/content_restriction.h" |
65 #include "content/public/common/content_switches.h" | 66 #include "content/public/common/content_switches.h" |
66 #include "content/public/common/url_constants.h" | 67 #include "content/public/common/url_constants.h" |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1226 // WebContentsView. In the future, we may want to create the view separately. | 1227 // WebContentsView. In the future, we may want to create the view separately. |
1227 WebContentsImpl* new_contents = | 1228 WebContentsImpl* new_contents = |
1228 new WebContentsImpl(GetBrowserContext(), | 1229 new WebContentsImpl(GetBrowserContext(), |
1229 params.opener_suppressed ? NULL : this); | 1230 params.opener_suppressed ? NULL : this); |
1230 | 1231 |
1231 // We must assign the SessionStorageNamespace before calling Init(). | 1232 // We must assign the SessionStorageNamespace before calling Init(). |
1232 const std::string& partition_id = | 1233 const std::string& partition_id = |
1233 content::GetContentClient()->browser()-> | 1234 content::GetContentClient()->browser()-> |
1234 GetStoragePartitionIdForSiteInstance(GetBrowserContext(), | 1235 GetStoragePartitionIdForSiteInstance(GetBrowserContext(), |
1235 site_instance); | 1236 site_instance); |
1237 content::StoragePartition* partition = | |
1238 BrowserContext::GetStoragePartition(GetBrowserContext(), | |
Charlie Reis
2012/08/14 18:50:12
I guess this is another case where it would be use
awong
2012/08/14 19:12:47
Shorter name is better. :) But decided to punt on
| |
1239 site_instance); | |
1236 DOMStorageContextImpl* dom_storage_context = | 1240 DOMStorageContextImpl* dom_storage_context = |
1237 static_cast<DOMStorageContextImpl*>( | 1241 static_cast<DOMStorageContextImpl*>(partition->GetDOMStorageContext()); |
1238 BrowserContext::GetDOMStorageContextByPartitionId( | |
1239 GetBrowserContext(), partition_id)); | |
1240 SessionStorageNamespaceImpl* session_storage_namespace_impl = | 1242 SessionStorageNamespaceImpl* session_storage_namespace_impl = |
1241 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); | 1243 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); |
1242 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); | 1244 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); |
1243 new_contents->GetController().SetSessionStorageNamespace( | 1245 new_contents->GetController().SetSessionStorageNamespace( |
1244 partition_id, | 1246 partition_id, |
1245 session_storage_namespace); | 1247 session_storage_namespace); |
1246 new_contents->Init(GetBrowserContext(), site_instance, route_id, this); | 1248 new_contents->Init(GetBrowserContext(), site_instance, route_id, this); |
1247 | 1249 |
1248 new_contents->set_opener_web_ui_type(GetWebUITypeForCurrentState()); | 1250 new_contents->set_opener_web_ui_type(GetWebUITypeForCurrentState()); |
1249 | 1251 |
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3184 old_browser_plugin_host()->embedder_render_process_host(); | 3186 old_browser_plugin_host()->embedder_render_process_host(); |
3185 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3187 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
3186 int embedder_process_id = | 3188 int embedder_process_id = |
3187 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3189 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3188 if (embedder_process_id != -1) { | 3190 if (embedder_process_id != -1) { |
3189 *embedder_channel_name = | 3191 *embedder_channel_name = |
3190 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3192 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3191 embedder_process_id); | 3193 embedder_process_id); |
3192 } | 3194 } |
3193 } | 3195 } |
OLD | NEW |