Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 1943403003: Add DCHECK to detect when a RPH is reused with a different context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698