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

Side by Side Diff: content/browser/site_instance_impl.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
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/site_instance_impl.h" 5 #include "content/browser/site_instance_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/browsing_instance.h" 8 #include "content/browser/browsing_instance.h"
9 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/browser/renderer_host/render_process_host_impl.h" 10 #include "content/browser/renderer_host/render_process_host_impl.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { 189 bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
190 return browsing_instance_->HasSiteInstance(url); 190 return browsing_instance_->HasSiteInstance(url);
191 } 191 }
192 192
193 SiteInstance* SiteInstanceImpl::GetRelatedSiteInstance(const GURL& url) { 193 SiteInstance* SiteInstanceImpl::GetRelatedSiteInstance(const GURL& url) {
194 return browsing_instance_->GetSiteInstanceForURL(url); 194 return browsing_instance_->GetSiteInstanceForURL(url);
195 } 195 }
196 196
197 bool SiteInstanceImpl::IsRelatedSiteInstance(const SiteInstance* instance) { 197 bool SiteInstanceImpl::IsRelatedSiteInstance(const SiteInstance* instance) {
198 return browsing_instance_ == 198 return browsing_instance_.get() == static_cast<const SiteInstanceImpl*>(
199 static_cast<const SiteInstanceImpl*>(instance)->browsing_instance_; 199 instance)->browsing_instance_.get();
200 } 200 }
201 201
202 bool SiteInstanceImpl::HasWrongProcessForURL(const GURL& url) { 202 bool SiteInstanceImpl::HasWrongProcessForURL(const GURL& url) {
203 // Having no process isn't a problem, since we'll assign it correctly. 203 // Having no process isn't a problem, since we'll assign it correctly.
204 // Note that HasProcess() may return true if process_ is null, in 204 // Note that HasProcess() may return true if process_ is null, in
205 // process-per-site cases where there's an existing process available. 205 // process-per-site cases where there's an existing process available.
206 // We want to use such a process in the IsSuitableHost check, so we 206 // We want to use such a process in the IsSuitableHost check, so we
207 // may end up assigning process_ in the GetProcess() call below. 207 // may end up assigning process_ in the GetProcess() call below.
208 if (!HasProcess()) 208 if (!HasProcess())
209 return false; 209 return false;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 335 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
336 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || 336 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) ||
337 command_line.HasSwitch(switches::kSitePerProcess)) { 337 command_line.HasSwitch(switches::kSitePerProcess)) {
338 ChildProcessSecurityPolicyImpl* policy = 338 ChildProcessSecurityPolicyImpl* policy =
339 ChildProcessSecurityPolicyImpl::GetInstance(); 339 ChildProcessSecurityPolicyImpl::GetInstance();
340 policy->LockToOrigin(process_->GetID(), site_); 340 policy->LockToOrigin(process_->GetID(), site_);
341 } 341 }
342 } 342 }
343 343
344 } // namespace content 344 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/resolve_proxy_msg_helper.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698