Commit 88235582 authored by kalman@chromium.org's avatar kalman@chromium.org

Revert 195187 "Revert 195143 "Prevent chrome.app JSON schema fro..."

Last revert failed. Who knows why.

> Revert 195143 "Prevent chrome.app JSON schema from loading on ev..."
> 
> Small perf regression.
> 
> > Prevent chrome.app JSON schema from loading on every page
> > 
> > The app API along with app.window and app.runtime have been converted to use
> > the feature system. Bindings are not added to the chrome object for unavailable
> > APIs that are children of available APIs. For example, if chrome.app is
> > available, we will not add lazy bindings to chrome for app.window and
> > app.runtime. This eliminates the need to load the app schema, because we no
> > longer need to get chrome.app to add the app.runtime and app.window bindings.
> > 
> > BUG=55316
> > 
> > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=194837
> > 
> > Review URL: https://chromiumcodereview.appspot.com/13604005
> 
> TBR=cduvall@chromium.org
> 
> Review URL: https://codereview.chromium.org/14241030

TBR=kalman@chromium.org

Review URL: https://codereview.chromium.org/14328045

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195199 0039d316-1c4b-4281-b951-d872f2087c98
parent f887493a
...@@ -3,6 +3,26 @@ ...@@ -3,6 +3,26 @@
// found in the LICENSE file. // found in the LICENSE file.
{ {
"app": {
"channel": "stable",
"extension_types": ["hosted_app", "extension"],
"contexts": [
"blessed_extension", "unblessed_extension", "content_script", "web_page"
],
"matches": [
"http://*/*", "https://*/*", "chrome-extension://*/*", "file://*/*"
]
},
"app.runtime": {
"channel": "stable",
"contexts": ["blessed_extension"],
"dependencies": ["permission:app.runtime"]
},
"app.window": {
"channel": "stable",
"contexts": ["blessed_extension"],
"dependencies": ["permission:app.window"]
},
"app.currentWindowInternal": { "app.currentWindowInternal": {
"internal": true, "internal": true,
"channel": "stable", "channel": "stable",
...@@ -21,7 +41,9 @@ ...@@ -21,7 +41,9 @@
"events": { "events": {
"internal": true, "internal": true,
"channel": "stable", "channel": "stable",
"contexts": ["blessed_extension", "unblessed_extension", "content_script", "web_page"], "contexts": [
"blessed_extension", "unblessed_extension", "content_script", "web_page"
],
"matches": ["<all_urls>"] "matches": ["<all_urls>"]
}, },
"fileBrowserHandlerInternal": { "fileBrowserHandlerInternal": {
...@@ -40,6 +62,6 @@ ...@@ -40,6 +62,6 @@
"extension_types": ["hosted_app"], "extension_types": ["hosted_app"],
"contexts": ["blessed_extension", "web_page"], "contexts": ["blessed_extension", "web_page"],
// Any webpage can use the webstore API. // Any webpage can use the webstore API.
"matches": [ "http://*/*", "https://*/*" ] "matches": ["http://*/*", "https://*/*"]
} }
} }
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
{ {
"namespace": "app", "namespace": "app",
"nodoc": true, "nodoc": true,
"unprivileged": true,
"matches": [ "<all_urls>" ],
"types": [ "types": [
{ {
"id": "Details", "id": "Details",
......
...@@ -172,10 +172,14 @@ TEST(ExtensionAPI, APIFeatures) { ...@@ -172,10 +172,14 @@ TEST(ExtensionAPI, APIFeatures) {
{ "test2.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() }, { "test2.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() },
{ "test3", false, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") }, { "test3", false, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") },
{ "test3.foo", true, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") }, { "test3.foo", true, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") },
{ "test3.foo", true, Feature::BLESSED_EXTENSION_CONTEXT, GURL() }, { "test3.foo", true, Feature::BLESSED_EXTENSION_CONTEXT,
{ "test4", true, Feature::BLESSED_EXTENSION_CONTEXT, GURL() }, GURL("http://bad.com") },
{ "test4.foo", false, Feature::BLESSED_EXTENSION_CONTEXT, GURL() }, { "test4", true, Feature::BLESSED_EXTENSION_CONTEXT,
{ "test4.foo", false, Feature::UNBLESSED_EXTENSION_CONTEXT, GURL() }, GURL("http://bad.com") },
{ "test4.foo", false, Feature::BLESSED_EXTENSION_CONTEXT,
GURL("http://bad.com") },
{ "test4.foo", false, Feature::UNBLESSED_EXTENSION_CONTEXT,
GURL("http://bad.com") },
{ "test4.foo.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() }, { "test4.foo.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() },
{ "test5", true, Feature::WEB_PAGE_CONTEXT, GURL("http://foo.com") }, { "test5", true, Feature::WEB_PAGE_CONTEXT, GURL("http://foo.com") },
{ "test5", false, Feature::WEB_PAGE_CONTEXT, GURL("http://bar.com") }, { "test5", false, Feature::WEB_PAGE_CONTEXT, GURL("http://bar.com") },
...@@ -380,11 +384,12 @@ TEST_F(ExtensionAPITest, URLMatching) { ...@@ -380,11 +384,12 @@ TEST_F(ExtensionAPITest, URLMatching) {
EXPECT_TRUE(MatchesURL(api.get(), "app", "https://blah.net")); EXPECT_TRUE(MatchesURL(api.get(), "app", "https://blah.net"));
EXPECT_TRUE(MatchesURL(api.get(), "app", "file://somefile.html")); EXPECT_TRUE(MatchesURL(api.get(), "app", "file://somefile.html"));
// But not internal URLs (for chrome-extension:// the app API is injected by // But not internal URLs.
// GetSchemasForExtension).
EXPECT_FALSE(MatchesURL(api.get(), "app", "about:flags")); EXPECT_FALSE(MatchesURL(api.get(), "app", "about:flags"));
EXPECT_FALSE(MatchesURL(api.get(), "app", "chrome://flags")); EXPECT_FALSE(MatchesURL(api.get(), "app", "chrome://flags"));
EXPECT_FALSE(MatchesURL(api.get(), "app",
// "app" should be available to chrome-extension URLs.
EXPECT_TRUE(MatchesURL(api.get(), "app",
"chrome-extension://fakeextension")); "chrome-extension://fakeextension"));
// "storage" API (for example) isn't available to any URLs. // "storage" API (for example) isn't available to any URLs.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment