| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  179     BrowserContext* browser_context, |  179     BrowserContext* browser_context, | 
|  180     const GURL& effective_site_url) { |  180     const GURL& effective_site_url) { | 
|  181   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |  181   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 
|  182   if (!command_line->HasSwitch(switches::kIsolateSitesForTesting)) |  182   if (!command_line->HasSwitch(switches::kIsolateSitesForTesting)) | 
|  183     return false; |  183     return false; | 
|  184   std::string pattern = |  184   std::string pattern = | 
|  185       command_line->GetSwitchValueASCII(switches::kIsolateSitesForTesting); |  185       command_line->GetSwitchValueASCII(switches::kIsolateSitesForTesting); | 
|  186  |  186  | 
|  187   url::Origin origin(effective_site_url); |  187   url::Origin origin(effective_site_url); | 
|  188  |  188  | 
|  189   if (!origin.unique()) { |  189   if (!origin.opaque()) { | 
|  190     // Schemes like blob or filesystem, which have an embedded origin, should |  190     // Schemes like blob or filesystem, which have an embedded origin, should | 
|  191     // already have been canonicalized to the origin site. |  191     // already have been canonicalized to the origin site. | 
|  192     CHECK_EQ(origin.scheme(), effective_site_url.scheme()) |  192     CHECK_EQ(origin.scheme(), effective_site_url.scheme()) | 
|  193         << "a site url should have the same scheme as its origin."; |  193         << "a site url should have the same scheme as its origin."; | 
|  194   } |  194   } | 
|  195  |  195  | 
|  196   // Practically |origin.Serialize()| is the same as |  196   // Practically |origin.Serialize()| is the same as | 
|  197   // |effective_site_url.spec()|, except Origin serialization strips the |  197   // |effective_site_url.spec()|, except Origin serialization strips the | 
|  198   // trailing "/", which makes for cleaner wildcard patterns. |  198   // trailing "/", which makes for cleaner wildcard patterns. | 
|  199   return base::MatchPattern(origin.Serialize(), pattern); |  199   return base::MatchPattern(origin.Serialize(), pattern); | 
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  408 ShellBrowserContext* ShellContentBrowserClient::browser_context() { |  408 ShellBrowserContext* ShellContentBrowserClient::browser_context() { | 
|  409   return shell_browser_main_parts_->browser_context(); |  409   return shell_browser_main_parts_->browser_context(); | 
|  410 } |  410 } | 
|  411  |  411  | 
|  412 ShellBrowserContext* |  412 ShellBrowserContext* | 
|  413     ShellContentBrowserClient::off_the_record_browser_context() { |  413     ShellContentBrowserClient::off_the_record_browser_context() { | 
|  414   return shell_browser_main_parts_->off_the_record_browser_context(); |  414   return shell_browser_main_parts_->off_the_record_browser_context(); | 
|  415 } |  415 } | 
|  416  |  416  | 
|  417 }  // namespace content |  417 }  // namespace content | 
| OLD | NEW |