summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorcreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 20:17:19 +0000
committercreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 20:17:19 +0000
commit2ee3da9d6c75aa8633fa2458891eeb91d1632db3 (patch)
treeff85013149ac4cfd6b86580e3f5470e1af1b42d7 /chrome
parent467c84d36d90b6328a13c6757ff336e1936773f4 (diff)
downloadchromium_src-2ee3da9d6c75aa8633fa2458891eeb91d1632db3.zip
chromium_src-2ee3da9d6c75aa8633fa2458891eeb91d1632db3.tar.gz
chromium_src-2ee3da9d6c75aa8633fa2458891eeb91d1632db3.tar.bz2
Restore previous null checks to ChromeContentBrowserClient.
BUG=164223 TEST=Start Chrome with --site-per-process or --enable-strict-site-isolation Review URL: https://chromiumcodereview.appspot.com/11441004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171294 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_content_browser_client.cc8
-rw-r--r--chrome/browser/chrome_content_browser_client_browsertest.cc19
2 files changed, 23 insertions, 4 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index eadba8b..a188c1c 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -635,7 +635,7 @@ GURL ChromeContentBrowserClient::GetEffectiveURL(
// installed app, the effective URL is an extension URL with the ID of that
// extension as the host. This has the effect of grouping apps together in
// a common SiteInstance.
- ExtensionService* extension_service =
+ ExtensionService* extension_service = !profile ? NULL :
extensions::ExtensionSystem::Get(profile)->extension_service();
if (!extension_service)
return url;
@@ -664,7 +664,7 @@ bool ChromeContentBrowserClient::ShouldUseProcessPerSite(
return false;
Profile* profile = Profile::FromBrowserContext(browser_context);
- ExtensionService* extension_service =
+ ExtensionService* extension_service = !profile ? NULL :
extensions::ExtensionSystem::Get(profile)->extension_service();
if (!extension_service)
return false;
@@ -736,7 +736,7 @@ bool ChromeContentBrowserClient::ShouldTryToUseExistingProcessHost(
return false;
Profile* profile = Profile::FromBrowserContext(browser_context);
- ExtensionService* service =
+ ExtensionService* service = !profile ? NULL :
extensions::ExtensionSystem::Get(profile)->extension_service();
if (!service)
return false;
@@ -1789,7 +1789,7 @@ bool ChromeContentBrowserClient::AllowPepperSocketAPI(
Profile* profile = Profile::FromBrowserContext(browser_context);
const Extension* extension = NULL;
- ExtensionService* extension_service =
+ ExtensionService* extension_service = !profile ? NULL :
extensions::ExtensionSystem::Get(profile)->extension_service();
if (extension_service) {
extension = extension_service->extensions()->
diff --git a/chrome/browser/chrome_content_browser_client_browsertest.cc b/chrome/browser/chrome_content_browser_client_browsertest.cc
index 4a4f230..3af0126 100644
--- a/chrome/browser/chrome_content_browser_client_browsertest.cc
+++ b/chrome/browser/chrome_content_browser_client_browsertest.cc
@@ -4,6 +4,7 @@
#include <string>
+#include "base/command_line.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -12,6 +13,7 @@
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_switches.h"
#include "googleurl/src/gurl.h"
namespace content {
@@ -64,4 +66,21 @@ IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest,
EXPECT_EQ(url, entry->GetVirtualURL());
}
+// Test that a basic navigation works in --site-per-process mode. This prevents
+// regressions when that mode calls out into the ChromeContentBrowserClient,
+// such as http://crbug.com/164223.
+IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest,
+ SitePerProcessNavigation) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kSitePerProcess);
+ const GURL url(std::string("chrome://chrome/"));
+
+ ui_test_utils::NavigateToURL(browser(), url);
+ NavigationEntry* entry = GetLastCommittedEntry();
+
+ ASSERT_TRUE(entry != NULL);
+ EXPECT_EQ(url, entry->GetURL());
+ EXPECT_EQ(url, entry->GetVirtualURL());
+}
+
} // namespace content