| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 // later. | 2124 // later. |
| 2125 VLOG(1) << "Blocked URL " << url->spec(); | 2125 VLOG(1) << "Blocked URL " << url->spec(); |
| 2126 *url = GURL(url::kAboutBlankURL); | 2126 *url = GURL(url::kAboutBlankURL); |
| 2127 } | 2127 } |
| 2128 } | 2128 } |
| 2129 | 2129 |
| 2130 // static | 2130 // static |
| 2131 bool RenderProcessHostImpl::IsSuitableHost(RenderProcessHost* host, | 2131 bool RenderProcessHostImpl::IsSuitableHost(RenderProcessHost* host, |
| 2132 BrowserContext* browser_context, | 2132 BrowserContext* browser_context, |
| 2133 const GURL& site_url) { | 2133 const GURL& site_url) { |
| 2134 if (run_renderer_in_process()) | 2134 if (run_renderer_in_process()) { |
| 2135 DCHECK_EQ(host->GetBrowserContext(), browser_context) |
| 2136 << " Single-process mode does not support multiple browser contexts."; |
| 2135 return true; | 2137 return true; |
| 2138 } |
| 2136 | 2139 |
| 2137 if (host->GetBrowserContext() != browser_context) | 2140 if (host->GetBrowserContext() != browser_context) |
| 2138 return false; | 2141 return false; |
| 2139 | 2142 |
| 2140 // Do not allow sharing of guest hosts. This is to prevent bugs where guest | 2143 // Do not allow sharing of guest hosts. This is to prevent bugs where guest |
| 2141 // and non-guest storage gets mixed. In the future, we might consider enabling | 2144 // and non-guest storage gets mixed. In the future, we might consider enabling |
| 2142 // the sharing of guests, in this case this check should be removed and | 2145 // the sharing of guests, in this case this check should be removed and |
| 2143 // InSameStoragePartition should handle the possible sharing. | 2146 // InSameStoragePartition should handle the possible sharing. |
| 2144 if (host->IsForGuestsOnly()) | 2147 if (host->IsForGuestsOnly()) |
| 2145 return false; | 2148 return false; |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2779 | 2782 |
| 2780 // Skip widgets in other processes. | 2783 // Skip widgets in other processes. |
| 2781 if (rvh->GetProcess()->GetID() != GetID()) | 2784 if (rvh->GetProcess()->GetID() != GetID()) |
| 2782 continue; | 2785 continue; |
| 2783 | 2786 |
| 2784 rvh->OnWebkitPreferencesChanged(); | 2787 rvh->OnWebkitPreferencesChanged(); |
| 2785 } | 2788 } |
| 2786 } | 2789 } |
| 2787 | 2790 |
| 2788 } // namespace content | 2791 } // namespace content |
| OLD | NEW |