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 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 if (!url->is_valid()) { | 1602 if (!url->is_valid()) { |
1603 // Have to use about:blank for the denied case, instead of an empty GURL. | 1603 // Have to use about:blank for the denied case, instead of an empty GURL. |
1604 // This is because the browser treats navigation to an empty GURL as a | 1604 // This is because the browser treats navigation to an empty GURL as a |
1605 // navigation to the home page. This is often a privileged page | 1605 // navigation to the home page. This is often a privileged page |
1606 // (chrome://newtab/) which is exactly what we don't want. | 1606 // (chrome://newtab/) which is exactly what we don't want. |
1607 *url = GURL(kAboutBlankURL); | 1607 *url = GURL(kAboutBlankURL); |
1608 RecordAction(base::UserMetricsAction("FilterURLTermiate_Invalid")); | 1608 RecordAction(base::UserMetricsAction("FilterURLTermiate_Invalid")); |
1609 return; | 1609 return; |
1610 } | 1610 } |
1611 | 1611 |
1612 if (url->SchemeIs(chrome::kAboutScheme)) { | 1612 if (url->SchemeIs(kAboutScheme)) { |
1613 // The renderer treats all URLs in the about: scheme as being about:blank. | 1613 // The renderer treats all URLs in the about: scheme as being about:blank. |
1614 // Canonicalize about: URLs to about:blank. | 1614 // Canonicalize about: URLs to about:blank. |
1615 *url = GURL(kAboutBlankURL); | 1615 *url = GURL(kAboutBlankURL); |
1616 RecordAction(base::UserMetricsAction("FilterURLTermiate_About")); | 1616 RecordAction(base::UserMetricsAction("FilterURLTermiate_About")); |
1617 } | 1617 } |
1618 | 1618 |
1619 // Do not allow browser plugin guests to navigate to non-web URLs, since they | 1619 // Do not allow browser plugin guests to navigate to non-web URLs, since they |
1620 // cannot swap processes or grant bindings. | 1620 // cannot swap processes or grant bindings. |
1621 bool non_web_url_in_guest = rph->IsGuest() && | 1621 bool non_web_url_in_guest = rph->IsGuest() && |
1622 !(url->is_valid() && policy->IsWebSafeScheme(url->scheme())); | 1622 !(url->is_valid() && policy->IsWebSafeScheme(url->scheme())); |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 | 2090 |
2091 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2091 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
2093 DCHECK_GT(worker_ref_count_, 0); | 2093 DCHECK_GT(worker_ref_count_, 0); |
2094 --worker_ref_count_; | 2094 --worker_ref_count_; |
2095 if (worker_ref_count_ == 0) | 2095 if (worker_ref_count_ == 0) |
2096 Cleanup(); | 2096 Cleanup(); |
2097 } | 2097 } |
2098 | 2098 |
2099 } // namespace content | 2099 } // namespace content |
OLD | NEW |