summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-09 13:50:15 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-09 13:50:15 +0000
commit4c2fd5ecf2f761523f704bf05549ed180bad90d1 (patch)
tree922726e70c0904f343d0e33dd2426eb010aedb7a
parent72f87aa0eeacf98ced1a9f2da86fe6c7065a3a7c (diff)
downloadchromium_src-4c2fd5ecf2f761523f704bf05549ed180bad90d1.zip
chromium_src-4c2fd5ecf2f761523f704bf05549ed180bad90d1.tar.gz
chromium_src-4c2fd5ecf2f761523f704bf05549ed180bad90d1.tar.bz2
Revert 95986 - Add support for XMLHttpRequests to the webRequest API
BUG=80230 TEST=api tests Review URL: http://codereview.chromium.org/7583026 TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/7528025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95989 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_webrequest_api.cc2
-rw-r--r--chrome/common/extensions/api/extension_api.json4
-rw-r--r--chrome/common/extensions/docs/experimental.webRequest.html4
-rw-r--r--chrome/test/data/extensions/api_test/webrequest/events/test.html100
-rw-r--r--chrome/test/data/extensions/api_test/webrequest/events/xhr/a.html12
-rw-r--r--chrome/test/data/extensions/api_test/webrequest/events/xhr/data.json1
6 files changed, 4 insertions, 119 deletions
diff --git a/chrome/browser/extensions/extension_webrequest_api.cc b/chrome/browser/extensions/extension_webrequest_api.cc
index 26ea90a..bc978a7 100644
--- a/chrome/browser/extensions/extension_webrequest_api.cc
+++ b/chrome/browser/extensions/extension_webrequest_api.cc
@@ -57,7 +57,6 @@ static const char* kResourceTypeStrings[] = {
"script",
"image",
"object",
- "xmlhttprequest",
"other",
};
@@ -68,7 +67,6 @@ static ResourceType::Type kResourceTypeValues[] = {
ResourceType::SCRIPT,
ResourceType::IMAGE,
ResourceType::OBJECT,
- ResourceType::XHR,
ResourceType::LAST_TYPE, // represents "other"
};
diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json
index e70687f..e45d1b1 100644
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -4664,7 +4664,7 @@
"type": "array",
"optional": true,
"description": "A list of request types. Requests that cannot match any of the types will be filtered out.",
- "items": { "type": "string", "enum": ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"] }
+ "items": { "type": "string", "enum": ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "other"] }
},
"tabId": { "type": "integer", "optional": true },
"windowId": { "type": "integer", "optional": true }
@@ -4765,7 +4765,7 @@
"method": {"type": "string", "description": "Standard HTTP method."},
"frameId": {"type": "integer", "description": "0 indicates the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to null if the request isn't related to a tab."},
- "type": {"type": "string", "enum": ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"], "description": "How the requested resource will be used."},
+ "type": {"type": "string", "enum": ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "other"], "description": "How the requested resource will be used."},
"timeStamp": {"type": "number", "description": "The time when the browser was about to make the request, in milliseconds since the epoch."}
}
}
diff --git a/chrome/common/extensions/docs/experimental.webRequest.html b/chrome/common/extensions/docs/experimental.webRequest.html
index 0755a22..410c3c4 100644
--- a/chrome/common/extensions/docs/experimental.webRequest.html
+++ b/chrome/common/extensions/docs/experimental.webRequest.html
@@ -2906,7 +2906,7 @@ chrome.windows.onRemoved.addListener(
array of <span><span></span></span>
</span>
<span>string</span>
- <span>["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]</span>
+ <span>["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "other"]</span>
</span>
</span>
)
@@ -6736,7 +6736,7 @@ chrome.windows.onRemoved.addListener(
array of <span><span></span></span>
</span>
<span>string</span>
- <span>["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]</span>
+ <span>["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "other"]</span>
</span>
</span></span>
</span>
diff --git a/chrome/test/data/extensions/api_test/webrequest/events/test.html b/chrome/test/data/extensions/api_test/webrequest/events/test.html
index c692844..e7fcb96 100644
--- a/chrome/test/data/extensions/api_test/webrequest/events/test.html
+++ b/chrome/test/data/extensions/api_test/webrequest/events/test.html
@@ -16,10 +16,6 @@ var URL_ECHO_USER_AGENT =
'http://www.a.com:PORT/echoheader?User-Agent';
var URL_AUTH_REQUIRED =
'http://www.a.com:PORT/auth-basic';
-var URL_HTTP_XHR =
- 'http://www.a.com:PORT/files/extensions/api_test/webrequest/events/xhr/a.html';
-var URL_HTTP_XHR_DATA =
- 'http://www.a.com:PORT/files/extensions/api_test/webrequest/events/xhr/data.json';
function runTests(tests) {
chrome.tabs.getSelected(null, function(tab) {
@@ -32,8 +28,6 @@ function runTests(tests) {
URL_HTTP_SIMPLE_LOAD_REDIRECT = fixPort(URL_HTTP_SIMPLE_LOAD_REDIRECT);
URL_ECHO_USER_AGENT = fixPort(URL_ECHO_USER_AGENT);
URL_AUTH_REQUIRED = fixPort(URL_AUTH_REQUIRED);
- URL_HTTP_XHR = fixPort(URL_HTTP_XHR);
- URL_HTTP_XHR_DATA = fixPort(URL_HTTP_XHR_DATA);
chrome.test.runTests(tests);
});
@@ -388,100 +382,6 @@ runTests([
navigateAndWait(URL_HTTP_SIMPLE_LOAD_REDIRECT);
},
- // Navigates to a page to generates an XHR.
- function xhrLoad() {
- expect(
- [ // events
- { label: "onBeforeRequest-1",
- event: "onBeforeRequest",
- details: {
- method: "GET",
- tabId: tabId,
- type: "main_frame",
- url: URL_HTTP_XHR,
- frameUrl: URL_HTTP_XHR
- }
- },
- { label: "onBeforeSendHeaders-1",
- event: "onBeforeSendHeaders",
- details: {
- url: URL_HTTP_XHR,
- }
- },
- { label: "onSendHeaders-1",
- event: "onSendHeaders",
- details: {
- url: URL_HTTP_XHR,
- }
- },
- { label: "onResponseStarted-1",
- event: "onResponseStarted",
- details: {
- url: URL_HTTP_XHR,
- statusCode: 200,
- ip: "127.0.0.1",
- fromCache: false,
- }
- },
- { label: "onCompleted-1",
- event: "onCompleted",
- details: {
- url: URL_HTTP_XHR,
- statusCode: 200,
- ip: "127.0.0.1",
- fromCache: false,
- }
- },
- { label: "onBeforeRequest-2",
- event: "onBeforeRequest",
- details: {
- method: "GET",
- tabId: tabId,
- type: "xmlhttprequest",
- url: URL_HTTP_XHR_DATA,
- frameUrl: URL_HTTP_XHR
- }
- },
- { label: "onBeforeSendHeaders-2",
- event: "onBeforeSendHeaders",
- details: {
- url: URL_HTTP_XHR_DATA,
- }
- },
- { label: "onSendHeaders-2",
- event: "onSendHeaders",
- details: {
- url: URL_HTTP_XHR_DATA,
- }
- },
- { label: "onResponseStarted-2",
- event: "onResponseStarted",
- details: {
- url: URL_HTTP_XHR_DATA,
- statusCode: 200,
- ip: "127.0.0.1",
- fromCache: false,
- }
- },
- { label: "onCompleted-2",
- event: "onCompleted",
- details: {
- url: URL_HTTP_XHR_DATA,
- statusCode: 200,
- ip: "127.0.0.1",
- fromCache: false,
- }
- }
- ],
- [ // event order
- ["onBeforeRequest-1", "onBeforeSendHeaders-1", "onSendHeaders-1",
- "onResponseStarted-1", "onCompleted-1",
- "onBeforeRequest-2", "onBeforeSendHeaders-2", "onSendHeaders-2",
- "onResponseStarted-2", "onCompleted-2"] ],
- {}, []);
- navigateAndWait(URL_HTTP_XHR);
- },
-
// Navigates to a page with subresources.
// TODO(mpcomplete): add multiple subresources; requires support for
// recognizing partial ordering.
diff --git a/chrome/test/data/extensions/api_test/webrequest/events/xhr/a.html b/chrome/test/data/extensions/api_test/webrequest/events/xhr/a.html
deleted file mode 100644
index 0f780e7..0000000
--- a/chrome/test/data/extensions/api_test/webrequest/events/xhr/a.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<html>
-<head>
-<script>
-function sendXHR() {
- var req = new XMLHttpRequest();
- req.open("GET", "data.json", true);
- req.send(null);
-}
-</script>
-</head>
-<body onload="sendXHR()"></body>
-</html>
diff --git a/chrome/test/data/extensions/api_test/webrequest/events/xhr/data.json b/chrome/test/data/extensions/api_test/webrequest/events/xhr/data.json
deleted file mode 100644
index 0967ef4..0000000
--- a/chrome/test/data/extensions/api_test/webrequest/events/xhr/data.json
+++ /dev/null
@@ -1 +0,0 @@
-{}