From 1087a763ae4366d681d176e101d9cf029e63e0be Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Mon, 11 Apr 2011 08:06:02 +0000 Subject: Unremoving the timeStamp property from webNavigation and webRequest extension APIs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Reverts r79631: "Remove the timeStamp property from the webNavigation extension API." * Reverts r79314: "Remove the timeStamp property from webRequest extension events." * Adds the `timeStamp` property to WebRequest's `onBeforeSendHeaders` event. * Updates documentation to note that the timestamps are only _internally_ consistent. Comparing timestamps to the extension's clock might result in Unexpected Events From The Futureā„¢. BUG=60101 TEST=browser_tests Review URL: http://codereview.chromium.org/6812047 Patch from Mike West . git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81076 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/api/extension_api.json | 39 +- .../docs/experimental.webNavigation.html | 445 +++++++++++++++++- .../extensions/docs/experimental.webRequest.html | 512 ++++++++++++++++++++- .../docs/static/experimental.webNavigation.html | 23 + .../docs/static/experimental.webRequest.html | 22 + 5 files changed, 1014 insertions(+), 27 deletions(-) create mode 100644 chrome/common/extensions/docs/static/experimental.webNavigation.html create mode 100644 chrome/common/extensions/docs/static/experimental.webRequest.html (limited to 'chrome/common') diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index b504ff7..eabdda5 100644 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -3420,7 +3420,8 @@ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation is about to occur."}, "url": {"type": "string"}, "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; positive value indicates navigation in a subframe. Frame IDs are unique within a tab."}, - "requestId": {"type": "string", "description": "The ID of the request to retrieve the document of this navigation. Note that this event is fired prior to the corresponding chrome.experimental.webRequest.onBeforeRequest."} + "requestId": {"type": "string", "description": "The ID of the request to retrieve the document of this navigation. Note that this event is fired prior to the corresponding chrome.experimental.webRequest.onBeforeRequest."}, + "timeStamp": {"type": "number", "description": "The time when the browser was about to start the navigation, in milliseconds since the epoch."} } } ] @@ -3438,7 +3439,8 @@ "url": {"type": "string"}, "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; positive value indicates navigation in a subframe."}, "transitionType": {"type": "string", "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"], "description": "Cause of the navigation. The same transition types as defined in the history API are used."}, - "transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items:": {"type": "string", "enum": ["client_redirect", "server_redirect", "forward_back"]}} + "transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items:": {"type": "string", "enum": ["client_redirect", "server_redirect", "forward_back"]}}, + "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."} } } ] @@ -3454,7 +3456,8 @@ "properties": { "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."}, "url": {"type": "string"}, - "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; positive value indicates navigation in a subframe."} + "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; positive value indicates navigation in a subframe."}, + "timeStamp": {"type": "number", "description": "The time when the page's DOM was fully constructed, in milliseconds since the epoch."} } } ] @@ -3470,7 +3473,8 @@ "properties": { "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."}, "url": {"type": "string"}, - "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; positive value indicates navigation in a subframe."} + "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; positive value indicates navigation in a subframe."}, + "timeStamp": {"type": "number", "description": "The time when the document finished loading, in milliseconds since the epoch."} } } ] @@ -3487,7 +3491,8 @@ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."}, "url": {"type": "string"}, "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; positive value indicates navigation in a subframe."}, - "error": {"type": "string", "description": "The error description."} + "error": {"type": "string", "description": "The error description."}, + "timeStamp": {"type": "number", "description": "The time when the error occurred, in milliseconds since the epoch."} } } ] @@ -3503,7 +3508,8 @@ "properties": { "sourceTabId": {"type": "integer", "description": "The ID of the tab in which the navigation is triggered."}, "sourceUrl": {"type": "string", "description": "The URL of the document that is opening the new window."}, - "url": {"type": "string", "description": "The URL to be opened in the new window."} + "url": {"type": "string", "description": "The URL to be opened in the new window."}, + "timeStamp": {"type": "number", "description": "The time when the browser was about to create a new view, in milliseconds since the epoch."} } } ] @@ -3597,7 +3603,8 @@ "url": {"type": "string"}, "method": {"type": "string", "description": "Standard HTTP method."}, "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", "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."} } } ] @@ -3612,7 +3619,8 @@ "name": "details", "properties": { "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."}, - "url": {"type": "string"} + "url": {"type": "string"}, + "timeStamp": {"type": "number", "description": "The time when the browser was about to send headers, in milliseconds since the epoch."} } } ] @@ -3628,7 +3636,8 @@ "properties": { "requestId": {"type": "string", "description": "The ID of the request."}, "url": {"type": "string"}, - "ip": {"type": "string", "description": "The server IP address that is actually connected to. Note that it may be a literal IPv6 address."} + "ip": {"type": "string", "description": "The server IP address that is actually connected to. Note that it may be a literal IPv6 address."}, + "timeStamp": {"type": "number", "description": "The time when the browser finished sending the request, in milliseconds since the epoch."} } } ] @@ -3644,7 +3653,8 @@ "properties": { "requestId": {"type": "string", "description": "The ID of the request."}, "url": {"type": "string"}, - "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."} + "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}, + "timeStamp": {"type": "number", "description": "The time when the status line and response headers were received, in milliseconds since the epoch."} } } ] @@ -3661,7 +3671,8 @@ "requestId": {"type": "string", "description": "The ID of the request."}, "url": {"type": "string", "description": "The URL of the current request."}, "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}, - "redirectUrl": {"type": "string", "description": "The new URL."} + "redirectUrl": {"type": "string", "description": "The new URL."}, + "timeStamp": {"type": "number", "description": "The time when the browser was about to make the redirect, in milliseconds since the epoch."} } } ] @@ -3677,7 +3688,8 @@ "properties": { "requestId": {"type": "string", "description": "The ID of the request."}, "url": {"type": "string", "description": "The URL of the current request."}, - "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."} + "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}, + "timeStamp": {"type": "number", "description": "The time when the response was received completely, in milliseconds since the epoch."} } } ] @@ -3693,7 +3705,8 @@ "properties": { "requestId": {"type": "string", "description": "The ID of the request."}, "url": {"type": "string", "description": "The URL of the current request."}, - "error": {"type": "string", "description": "The error description."} + "error": {"type": "string", "description": "The error description."}, + "timeStamp": {"type": "number", "description": "The time when the error occurred, in milliseconds since the epoch."} } } ] diff --git a/chrome/common/extensions/docs/experimental.webNavigation.html b/chrome/common/extensions/docs/experimental.webNavigation.html index 31ed43d..c3041ff 100644 --- a/chrome/common/extensions/docs/experimental.webNavigation.html +++ b/chrome/common/extensions/docs/experimental.webNavigation.html @@ -16,7 +16,7 @@ - chrome.experimental.webNavigation - Google Chrome Extensions - Google Code + WebNavigation API - Google Chrome Extensions - Google Code
You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files. @@ -251,16 +251,16 @@
-

chrome.experimental.webNavigation

+

WebNavigation API

Contents

    -
  1. - h2Name +
  2. + A note about timestamps
      -
    1. +
    2. h3Name
    @@ -317,12 +317,35 @@ -

    +

    -
    +
    WebNavigation API
    + + +

    +Use the chrome.experimental.webNavigation module to recieve +notifications about the status of navigations requests in-flight. This +module is still very much experimental. For information on how to use +experimental APIs, see the chrome.experimental.* +APIs page. +

    + +

    A note about timestamps

    +

    +It's important to note that some technical oddities in the OS's handling +of distinct Chrome processes can cause the clock to be skewed between the +browser itself and extension processes. That means that WebNavigation's events' +timeStamp property is only guaranteed to be internally +consistent. Comparing one event to another event will give you the correct +offset between them, but comparing them to the current time inside the +extension (via (new Date()).getTime(), for instance) might give +unexpected results. +

    + +
    @@ -766,6 +789,74 @@
    +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the browser was about to start the navigation, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -1059,6 +1150,74 @@
+
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the browser was about to create a new view, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -1490,6 +1649,74 @@
+
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the navigation was committed, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -1785,6 +2012,74 @@ +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the document finished loading, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -2080,6 +2375,74 @@ +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the page's DOM was fully constructed, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -2443,6 +2806,74 @@ +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the error occurred, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
diff --git a/chrome/common/extensions/docs/experimental.webRequest.html b/chrome/common/extensions/docs/experimental.webRequest.html index 233f35f..859d2ba 100644 --- a/chrome/common/extensions/docs/experimental.webRequest.html +++ b/chrome/common/extensions/docs/experimental.webRequest.html @@ -16,7 +16,7 @@ - chrome.experimental.webRequest - Google Chrome Extensions - Google Code + WebRequest API - Google Chrome Extensions - Google Code
You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files. @@ -251,16 +251,16 @@
-

chrome.experimental.webRequest

+

WebRequest API

Contents

    -
  1. - h2Name +
  2. + A note about timestamps
      -
    1. +
    2. h3Name
    @@ -321,12 +321,34 @@ -

    +

    -
    +
    WebRequest API
    + + +

    +Use the chrome.experimental.webRequest module to intercept, block, +or modify requests in-flight. This module is still very much experimental. For +information on how to use experimental APIs, see the +chrome.experimental.* APIs page. +

    + +

    A note about timestamps

    +

    +It's important to note that some technical oddities in the OS's handling +of distinct Chrome processes can cause the clock to be skewed between the +browser itself and extension processes. That means that WebRequest's events' +timeStamp property is only guaranteed to be internally +consistent. Comparing one event to another event will give you the correct +offset between them, but comparing them to the current time inside the +extension (via (new Date()).getTime(), for instance) might give +unexpected results. +

    + +
    @@ -834,6 +856,74 @@
    +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the browser was about to make the redirect, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -1265,6 +1355,74 @@
+
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the browser was about to make the request, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -1492,6 +1650,74 @@
+
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the browser was about to send headers, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -1785,6 +2011,74 @@ +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the response was received completely, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -2078,6 +2372,74 @@ +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the error occurred, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -2373,6 +2735,74 @@ +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the status line and response headers were received, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
@@ -2668,6 +3098,74 @@ +
+
+
+ timeStamp + + + +
+ ( + + + + + Type + + + + array of + + number + + + + ) +
+ +
+
+ +
The time when the browser finished sending the request, in milliseconds since the epoch.
+
+ This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
diff --git a/chrome/common/extensions/docs/static/experimental.webNavigation.html b/chrome/common/extensions/docs/static/experimental.webNavigation.html new file mode 100644 index 0000000..3f214ad --- /dev/null +++ b/chrome/common/extensions/docs/static/experimental.webNavigation.html @@ -0,0 +1,23 @@ +
WebNavigation API
+ + +

+Use the chrome.experimental.webNavigation module to recieve +notifications about the status of navigations requests in-flight. This +module is still very much experimental. For information on how to use +experimental APIs, see the chrome.experimental.* +APIs page. +

+ +

A note about timestamps

+

+It's important to note that some technical oddities in the OS's handling +of distinct Chrome processes can cause the clock to be skewed between the +browser itself and extension processes. That means that WebNavigation's events' +timeStamp property is only guaranteed to be internally +consistent. Comparing one event to another event will give you the correct +offset between them, but comparing them to the current time inside the +extension (via (new Date()).getTime(), for instance) might give +unexpected results. +

+ diff --git a/chrome/common/extensions/docs/static/experimental.webRequest.html b/chrome/common/extensions/docs/static/experimental.webRequest.html new file mode 100644 index 0000000..43cb6b1 --- /dev/null +++ b/chrome/common/extensions/docs/static/experimental.webRequest.html @@ -0,0 +1,22 @@ +
WebRequest API
+ + +

+Use the chrome.experimental.webRequest module to intercept, block, +or modify requests in-flight. This module is still very much experimental. For +information on how to use experimental APIs, see the +chrome.experimental.* APIs page. +

+ +

A note about timestamps

+

+It's important to note that some technical oddities in the OS's handling +of distinct Chrome processes can cause the clock to be skewed between the +browser itself and extension processes. That means that WebRequest's events' +timeStamp property is only guaranteed to be internally +consistent. Comparing one event to another event will give you the correct +offset between them, but comparing them to the current time inside the +extension (via (new Date()).getTime(), for instance) might give +unexpected results. +

+ -- cgit v1.1