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

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

Issue 12387070: content: Move more constants from url_constants.h into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 11 matching lines...) Expand all
22 22
23 static bool IsURLSameAsAnySiteInstance(const GURL& url) { 23 static bool IsURLSameAsAnySiteInstance(const GURL& url) {
24 if (!url.is_valid()) 24 if (!url.is_valid())
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(kChromeUICrashURL) ||
33 url == GURL(chrome::kChromeUIKillURL) || 33 url == GURL(kChromeUIKillURL) ||
34 url == GURL(chrome::kChromeUIHangURL) || 34 url == GURL(kChromeUIHangURL) ||
35 url == GURL(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),
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 327 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
328 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || 328 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) ||
329 command_line.HasSwitch(switches::kSitePerProcess)) { 329 command_line.HasSwitch(switches::kSitePerProcess)) {
330 ChildProcessSecurityPolicyImpl* policy = 330 ChildProcessSecurityPolicyImpl* policy =
331 ChildProcessSecurityPolicyImpl::GetInstance(); 331 ChildProcessSecurityPolicyImpl::GetInstance();
332 policy->LockToOrigin(process_->GetID(), site_); 332 policy->LockToOrigin(process_->GetID(), site_);
333 } 333 }
334 } 334 }
335 335
336 } // namespace content 336 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698