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 #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 14 matching lines...) Expand all Loading... |
25 return false; | 25 return false; |
26 | 26 |
27 // We treat javascript: as the same site as any URL since it is actually | 27 // We treat javascript: as the same site as any URL since it is actually |
28 // a modifier on existing pages. | 28 // a modifier on existing pages. |
29 if (url.SchemeIs(chrome::kJavaScriptScheme)) | 29 if (url.SchemeIs(chrome::kJavaScriptScheme)) |
30 return true; | 30 return true; |
31 | 31 |
32 return url == GURL(chrome::kChromeUICrashURL) || | 32 return url == GURL(chrome::kChromeUICrashURL) || |
33 url == GURL(chrome::kChromeUIKillURL) || | 33 url == GURL(chrome::kChromeUIKillURL) || |
34 url == GURL(chrome::kChromeUIHangURL) || | 34 url == GURL(chrome::kChromeUIHangURL) || |
35 url == GURL(chrome::kChromeUIShorthangURL); | 35 url == GURL(kChromeUIShorthangURL); |
36 } | 36 } |
37 | 37 |
38 int32 SiteInstanceImpl::next_site_instance_id_ = 1; | 38 int32 SiteInstanceImpl::next_site_instance_id_ = 1; |
39 | 39 |
40 SiteInstanceImpl::SiteInstanceImpl(BrowsingInstance* browsing_instance) | 40 SiteInstanceImpl::SiteInstanceImpl(BrowsingInstance* browsing_instance) |
41 : id_(next_site_instance_id_++), | 41 : id_(next_site_instance_id_++), |
42 browsing_instance_(browsing_instance), | 42 browsing_instance_(browsing_instance), |
43 render_process_host_factory_(NULL), | 43 render_process_host_factory_(NULL), |
44 process_(NULL), | 44 process_(NULL), |
45 has_site_(false) { | 45 has_site_(false) { |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 void SiteInstanceImpl::LockToOrigin() { | 320 void SiteInstanceImpl::LockToOrigin() { |
321 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 321 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
322 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { | 322 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { |
323 ChildProcessSecurityPolicyImpl* policy = | 323 ChildProcessSecurityPolicyImpl* policy = |
324 ChildProcessSecurityPolicyImpl::GetInstance(); | 324 ChildProcessSecurityPolicyImpl::GetInstance(); |
325 policy->LockToOrigin(process_->GetID(), site_); | 325 policy->LockToOrigin(process_->GetID(), site_); |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 } // namespace content | 329 } // namespace content |
OLD | NEW |