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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 | 1465 |
1466 scoped_refptr<SiteInstance> site_instance = | 1466 scoped_refptr<SiteInstance> site_instance = |
1467 params.opener_suppressed && !is_guest ? | 1467 params.opener_suppressed && !is_guest ? |
1468 SiteInstance::CreateForURL(GetBrowserContext(), params.target_url) : | 1468 SiteInstance::CreateForURL(GetBrowserContext(), params.target_url) : |
1469 GetSiteInstance(); | 1469 GetSiteInstance(); |
1470 | 1470 |
1471 // A message to create a new window can only come from the active process for | 1471 // A message to create a new window can only come from the active process for |
1472 // this WebContentsImpl instance. If any other process sends the request, | 1472 // this WebContentsImpl instance. If any other process sends the request, |
1473 // it is invalid and the process must be terminated. | 1473 // it is invalid and the process must be terminated. |
1474 if (GetRenderProcessHost()->GetID() != render_process_id) { | 1474 if (GetRenderProcessHost()->GetID() != render_process_id) { |
1475 base::ProcessHandle process_handle = | 1475 RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id); |
1476 RenderProcessHost::FromID(render_process_id)->GetHandle(); | 1476 base::ProcessHandle process_handle = rph->GetHandle(); |
1477 if (process_handle != base::kNullProcessHandle) { | 1477 if (process_handle != base::kNullProcessHandle) { |
1478 RecordAction( | 1478 RecordAction( |
1479 base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWindow")); | 1479 base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWindow")); |
1480 base::KillProcess(process_handle, RESULT_CODE_KILLED, false); | 1480 rph->Shutdown(RESULT_CODE_KILLED, false); |
1481 } | 1481 } |
1482 return; | 1482 return; |
1483 } | 1483 } |
1484 | 1484 |
1485 // We must assign the SessionStorageNamespace before calling Init(). | 1485 // We must assign the SessionStorageNamespace before calling Init(). |
1486 // | 1486 // |
1487 // http://crbug.com/142685 | 1487 // http://crbug.com/142685 |
1488 const std::string& partition_id = | 1488 const std::string& partition_id = |
1489 GetContentClient()->browser()-> | 1489 GetContentClient()->browser()-> |
1490 GetStoragePartitionIdForSite(GetBrowserContext(), | 1490 GetStoragePartitionIdForSite(GetBrowserContext(), |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 | 1599 |
1600 void WebContentsImpl::CreateNewWidget(int render_process_id, | 1600 void WebContentsImpl::CreateNewWidget(int render_process_id, |
1601 int route_id, | 1601 int route_id, |
1602 bool is_fullscreen, | 1602 bool is_fullscreen, |
1603 blink::WebPopupType popup_type) { | 1603 blink::WebPopupType popup_type) { |
1604 RenderProcessHost* process = GetRenderProcessHost(); | 1604 RenderProcessHost* process = GetRenderProcessHost(); |
1605 // A message to create a new widget can only come from the active process for | 1605 // A message to create a new widget can only come from the active process for |
1606 // this WebContentsImpl instance. If any other process sends the request, | 1606 // this WebContentsImpl instance. If any other process sends the request, |
1607 // it is invalid and the process must be terminated. | 1607 // it is invalid and the process must be terminated. |
1608 if (process->GetID() != render_process_id) { | 1608 if (process->GetID() != render_process_id) { |
1609 base::ProcessHandle process_handle = | 1609 RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id); |
1610 RenderProcessHost::FromID(render_process_id)->GetHandle(); | 1610 base::ProcessHandle process_handle = rph->GetHandle(); |
1611 if (process_handle != base::kNullProcessHandle) { | 1611 if (process_handle != base::kNullProcessHandle) { |
1612 RecordAction( | 1612 RecordAction( |
1613 base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget")); | 1613 base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget")); |
1614 base::KillProcess(process_handle, RESULT_CODE_KILLED, false); | 1614 rph->Shutdown(RESULT_CODE_KILLED, false); |
1615 } | 1615 } |
1616 return; | 1616 return; |
1617 } | 1617 } |
1618 | 1618 |
1619 RenderWidgetHostImpl* widget_host = | 1619 RenderWidgetHostImpl* widget_host = |
1620 new RenderWidgetHostImpl(this, process, route_id, IsHidden()); | 1620 new RenderWidgetHostImpl(this, process, route_id, IsHidden()); |
1621 created_widgets_.insert(widget_host); | 1621 created_widgets_.insert(widget_host); |
1622 | 1622 |
1623 RenderWidgetHostViewBase* widget_view = | 1623 RenderWidgetHostViewBase* widget_view = |
1624 static_cast<RenderWidgetHostViewBase*>( | 1624 static_cast<RenderWidgetHostViewBase*>( |
(...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4356 node->render_manager()->ResumeResponseDeferredAtStart(); | 4356 node->render_manager()->ResumeResponseDeferredAtStart(); |
4357 } | 4357 } |
4358 | 4358 |
4359 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4359 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4360 force_disable_overscroll_content_ = force_disable; | 4360 force_disable_overscroll_content_ = force_disable; |
4361 if (view_) | 4361 if (view_) |
4362 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4362 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4363 } | 4363 } |
4364 | 4364 |
4365 } // namespace content | 4365 } // namespace content |
OLD | NEW |