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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 return; | 1578 return; |
1579 } | 1579 } |
1580 | 1580 |
1581 if (url->SchemeIs(kAboutScheme)) { | 1581 if (url->SchemeIs(kAboutScheme)) { |
1582 // The renderer treats all URLs in the about: scheme as being about:blank. | 1582 // The renderer treats all URLs in the about: scheme as being about:blank. |
1583 // Canonicalize about: URLs to about:blank. | 1583 // Canonicalize about: URLs to about:blank. |
1584 *url = GURL(kAboutBlankURL); | 1584 *url = GURL(kAboutBlankURL); |
1585 RecordAction(base::UserMetricsAction("FilterURLTermiate_About")); | 1585 RecordAction(base::UserMetricsAction("FilterURLTermiate_About")); |
1586 } | 1586 } |
1587 | 1587 |
1588 // Do not allow browser plugin guests to navigate to non-web URLs, since they | 1588 if (!policy->CanRequestURL(rph->GetID(), *url)) { |
1589 // cannot swap processes or grant bindings. | |
1590 bool non_web_url_in_guest = rph->IsGuest() && | |
1591 !(url->is_valid() && policy->IsWebSafeScheme(url->scheme())); | |
1592 | |
1593 if (non_web_url_in_guest || !policy->CanRequestURL(rph->GetID(), *url)) { | |
1594 // If this renderer is not permitted to request this URL, we invalidate the | 1589 // If this renderer is not permitted to request this URL, we invalidate the |
1595 // URL. This prevents us from storing the blocked URL and becoming confused | 1590 // URL. This prevents us from storing the blocked URL and becoming confused |
1596 // later. | 1591 // later. |
1597 VLOG(1) << "Blocked URL " << url->spec(); | 1592 VLOG(1) << "Blocked URL " << url->spec(); |
1598 *url = GURL(kAboutBlankURL); | 1593 *url = GURL(kAboutBlankURL); |
1599 RecordAction(base::UserMetricsAction("FilterURLTermiate_Blocked")); | 1594 RecordAction(base::UserMetricsAction("FilterURLTermiate_Blocked")); |
1600 } | 1595 } |
1601 } | 1596 } |
1602 | 1597 |
1603 // static | 1598 // static |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 mojo::ScopedMessagePipeHandle handle) { | 2070 mojo::ScopedMessagePipeHandle handle) { |
2076 mojo_activation_required_ = true; | 2071 mojo_activation_required_ = true; |
2077 MaybeActivateMojo(); | 2072 MaybeActivateMojo(); |
2078 | 2073 |
2079 mojo::AllocationScope scope; | 2074 mojo::AllocationScope scope; |
2080 mojo_application_host_->shell_client()->AcceptConnection(service_name, | 2075 mojo_application_host_->shell_client()->AcceptConnection(service_name, |
2081 handle.Pass()); | 2076 handle.Pass()); |
2082 } | 2077 } |
2083 | 2078 |
2084 } // namespace content | 2079 } // namespace content |
OLD | NEW |