| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell/browser/shell_content_browser_client.h" | 5 #include "content/shell/browser/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 bool ShellContentBrowserClient::DoesSiteRequireDedicatedProcess( | 155 bool ShellContentBrowserClient::DoesSiteRequireDedicatedProcess( |
| 156 BrowserContext* browser_context, | 156 BrowserContext* browser_context, |
| 157 const GURL& effective_site_url) { | 157 const GURL& effective_site_url) { |
| 158 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 158 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 159 DCHECK(command_line->HasSwitch(switches::kIsolateSitesForTesting)); | 159 DCHECK(command_line->HasSwitch(switches::kIsolateSitesForTesting)); |
| 160 std::string pattern = | 160 std::string pattern = |
| 161 command_line->GetSwitchValueASCII(switches::kIsolateSitesForTesting); | 161 command_line->GetSwitchValueASCII(switches::kIsolateSitesForTesting); |
| 162 | 162 |
| 163 url::Origin origin(effective_site_url); | 163 url::Origin origin(effective_site_url); |
| 164 | 164 |
| 165 if (!origin.unique()) { | 165 if (!origin.opaque()) { |
| 166 // Schemes like blob or filesystem, which have an embedded origin, should | 166 // Schemes like blob or filesystem, which have an embedded origin, should |
| 167 // already have been canonicalized to the origin site. | 167 // already have been canonicalized to the origin site. |
| 168 CHECK_EQ(origin.scheme(), effective_site_url.scheme()) | 168 CHECK_EQ(origin.scheme(), effective_site_url.scheme()) |
| 169 << "a site url should have the same scheme as its origin."; | 169 << "a site url should have the same scheme as its origin."; |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Practically |origin.Serialize()| is the same as | 172 // Practically |origin.Serialize()| is the same as |
| 173 // |effective_site_url.spec()|, except Origin serialization strips the | 173 // |effective_site_url.spec()|, except Origin serialization strips the |
| 174 // trailing "/", which makes for cleaner wildcard patterns. | 174 // trailing "/", which makes for cleaner wildcard patterns. |
| 175 return base::MatchPattern(origin.Serialize(), pattern); | 175 return base::MatchPattern(origin.Serialize(), pattern); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 ShellBrowserContext* ShellContentBrowserClient::browser_context() { | 380 ShellBrowserContext* ShellContentBrowserClient::browser_context() { |
| 381 return shell_browser_main_parts_->browser_context(); | 381 return shell_browser_main_parts_->browser_context(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 ShellBrowserContext* | 384 ShellBrowserContext* |
| 385 ShellContentBrowserClient::off_the_record_browser_context() { | 385 ShellContentBrowserClient::off_the_record_browser_context() { |
| 386 return shell_browser_main_parts_->off_the_record_browser_context(); | 386 return shell_browser_main_parts_->off_the_record_browser_context(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace content | 389 } // namespace content |
| OLD | NEW |