diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 16:16:08 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 16:16:08 +0000 |
commit | 40e2a2826cf480dfc41368be8be9287a5151e09a (patch) | |
tree | 9d7cedc978cf4ce9425bf47da29ae973e6438563 /net | |
parent | 5333388fea438aaa9a797548f6e26c5105009b5a (diff) | |
download | chromium_src-40e2a2826cf480dfc41368be8be9287a5151e09a.zip chromium_src-40e2a2826cf480dfc41368be8be9287a5151e09a.tar.gz chromium_src-40e2a2826cf480dfc41368be8be9287a5151e09a.tar.bz2 |
Improve logging of webRequest API in NetLog
This CL creates the following types of entries in the NetLog:
+URL_REQUEST_BLOCKED_ON_DELEGATE [dt= 59]
CHROME_EXTENSION_MODIFIED_HEADERS
--> deleted_headers = ["User-Agent"]
--> extension_id = "jclggdidhhmidgnnpcjjeggphijcajeg"
--> modified_headers = ["Foo: Bar"]
-URL_REQUEST_BLOCKED_ON_DELEGATE
+URL_REQUEST_BLOCKED_ON_DELEGATE [dt= 8]
CHROME_EXTENSION_ABORTED_REQUEST
--> extension_id = "jclggdidhhmidgnnpcjjeggphijcajeg"
-URL_REQUEST_BLOCKED_ON_DELEGATE
+URL_REQUEST_BLOCKED_ON_DELEGATE [dt=11]
CHROME_EXTENSION_REDIRECTED_REQUEST
--> extension_id = "mnadcejkmhgmdndhmplcebaplgddbhdi"
-URL_REQUEST_BLOCKED_ON_DELEGATE
BUG=no
TEST=no
Review URL: http://codereview.chromium.org/7497033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/net_log_event_type_list.h | 39 | ||||
-rw-r--r-- | net/url_request/url_request.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_http_job.cc | 2 |
3 files changed, 39 insertions, 4 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index 8f8141c..0035d14 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -1132,3 +1132,42 @@ EVENT_TYPE(ASYNC_HOST_RESOLVER_CREATE_DNS_TRANSACTION) // This event is logged when a request is handled by a cache entry. EVENT_TYPE(ASYNC_HOST_RESOLVER_CACHE_HIT) + +// ------------------------------------------------------------------------ +// ChromeExtension +// ------------------------------------------------------------------------ + +// TODO(eroman): This is a layering violation. Fix this in the context +// of http://crbug.com/90674. + +// This event is created when a Chrome extension aborts a request. +// +// { +// "extension_id": <Extension ID that caused the abortion> +// } +EVENT_TYPE(CHROME_EXTENSION_ABORTED_REQUEST) + +// This event is created when a Chrome extension redirects a request. +// +// { +// "extension_id": <Extension ID that caused the redirection> +// } +EVENT_TYPE(CHROME_EXTENSION_REDIRECTED_REQUEST) + +// This event is created when a Chrome extension modifieds the headers of a +// request. +// +// { +// "extension_id": <Extension ID that caused the modification>, +// "modified_headers": [ "<header>: <value>", ... ], +// "deleted_headers": [ "<header>", ... ] +// } +EVENT_TYPE(CHROME_EXTENSION_MODIFIED_HEADERS) + +// This event is created when a Chrome extension tried to modify a request +// but was ignored due to a conflict. +// +// { +// "extension_id": <Extension ID that was ignored> +// } +EVENT_TYPE(CHROME_EXTENSION_IGNORED_DUE_TO_CONFLICT) diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index fe936a44..07af22f 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -415,8 +415,6 @@ void URLRequest::BeforeRequestComplete(int error) { net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); if (error != OK) { - // TODO(battre): Allow passing information of the extension that canceled - // the event. net_log_.AddEvent(NetLog::TYPE_CANCELLED, make_scoped_refptr(new NetLogStringParameter("source", "delegate"))); StartJob(new URLRequestErrorJob(this, error)); diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index 11ea297..af6c9c0 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -366,8 +366,6 @@ void URLRequestHttpJob::NotifyBeforeSendHeadersCallback(int result) { if (result == OK) { StartTransactionInternal(); } else { - // TODO(battre): Allow passing information of the extension that canceled - // the event. request_->net_log().AddEvent(NetLog::TYPE_CANCELLED, make_scoped_refptr(new NetLogStringParameter("source", "delegate"))); NotifyCanceled(); |