| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 157 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 158 DCHECK(command_line->HasSwitch(switches::kIsolateSitesForTesting)); | 158 DCHECK(command_line->HasSwitch(switches::kIsolateSitesForTesting)); |
| 159 std::string pattern = | 159 std::string pattern = |
| 160 command_line->GetSwitchValueASCII(switches::kIsolateSitesForTesting); | 160 command_line->GetSwitchValueASCII(switches::kIsolateSitesForTesting); |
| 161 | 161 |
| 162 url::Origin origin(effective_site_url); | 162 url::Origin origin(effective_site_url); |
| 163 | 163 |
| 164 if (!origin.unique()) { | 164 if (!origin.unique()) { |
| 165 // Schemes like blob or filesystem, which have an embedded origin, should | 165 // Schemes like blob or filesystem, which have an embedded origin, should |
| 166 // already have been canonicalized to the origin site. | 166 // already have been canonicalized to the origin site. |
| 167 CHECK_EQ(origin.scheme(), effective_site_url.scheme()) | 167 // a site url should have the same scheme as its origin. |
| 168 << "a site url should have the same scheme as its origin."; | 168 CHECK_EQ(origin.scheme(), effective_site_url.scheme()); |
| 169 } | 169 } |
| 170 | 170 |
| 171 // Practically |origin.Serialize()| is the same as | 171 // Practically |origin.Serialize()| is the same as |
| 172 // |effective_site_url.spec()|, except Origin serialization strips the | 172 // |effective_site_url.spec()|, except Origin serialization strips the |
| 173 // trailing "/", which makes for cleaner wildcard patterns. | 173 // trailing "/", which makes for cleaner wildcard patterns. |
| 174 return base::MatchPattern(origin.Serialize(), pattern); | 174 return base::MatchPattern(origin.Serialize(), pattern); |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { | 177 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { |
| 178 if (!url.is_valid()) | 178 if (!url.is_valid()) |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 ShellBrowserContext* ShellContentBrowserClient::browser_context() { | 388 ShellBrowserContext* ShellContentBrowserClient::browser_context() { |
| 389 return shell_browser_main_parts_->browser_context(); | 389 return shell_browser_main_parts_->browser_context(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 ShellBrowserContext* | 392 ShellBrowserContext* |
| 393 ShellContentBrowserClient::off_the_record_browser_context() { | 393 ShellContentBrowserClient::off_the_record_browser_context() { |
| 394 return shell_browser_main_parts_->off_the_record_browser_context(); | 394 return shell_browser_main_parts_->off_the_record_browser_context(); |
| 395 } | 395 } |
| 396 | 396 |
| 397 } // namespace content | 397 } // namespace content |
| OLD | NEW |