diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 02:35:04 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 02:35:04 +0000 |
commit | fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3 (patch) | |
tree | ca9186ed7ddbeb19604b495430d9c9814df57471 /chrome_frame/test | |
parent | cfc076ec466fc48e91c309448c4e5be3467b42c7 (diff) | |
download | chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.zip chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.tar.gz chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.tar.bz2 |
Basic wiring to enable downloads for CF's host browser network stack. A notable change here is that url automation job id's no longer exist and instead a request id is used. There's a 1 to 1 relation between a job and a request so this is more convenient.
Review URL: http://codereview.chromium.org/355036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r-- | chrome_frame/test/net/test_automation_provider.cc | 8 | ||||
-rw-r--r-- | chrome_frame/test/net/test_automation_resource_message_filter.cc | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/chrome_frame/test/net/test_automation_provider.cc b/chrome_frame/test/net/test_automation_provider.cc index 3a56aa4..f1a3b13 100644 --- a/chrome_frame/test/net/test_automation_provider.cc +++ b/chrome_frame/test/net/test_automation_provider.cc @@ -69,8 +69,14 @@ URLRequestJob* TestAutomationProvider::MaybeIntercept(URLRequest* request) { // and only intercept requests that belong to that thread. if (request->GetUserData(NULL) == NULL) { DCHECK(tab_handle_ != -1); + // We generate our own request id which is also what + // ResourceDispatcherHost does (well, the id is actually generated by + // ResourceDispatcher). Since these requests are divided into with + // and without userdata, we're OK. However, just to make debugging + // a little easier, we have a significantly higher start value. + static int new_id = 0x00100000; URLRequestAutomationJob* job = new URLRequestAutomationJob(request, - tab_handle_, filter_); + tab_handle_, new_id++, filter_); return job; } } diff --git a/chrome_frame/test/net/test_automation_resource_message_filter.cc b/chrome_frame/test/net/test_automation_resource_message_filter.cc index 32ef532..f7f00bc 100644 --- a/chrome_frame/test/net/test_automation_resource_message_filter.cc +++ b/chrome_frame/test/net/test_automation_resource_message_filter.cc @@ -25,8 +25,8 @@ bool TestAutomationResourceMessageFilter::OnMessageReceived( // for filter messages, send the message to the correct thread // for URL requests. bool handled = false; - int request_id = URLRequestAutomationJob::MayFilterMessage(message); - if (request_id) { + int request_id; + if (URLRequestAutomationJob::MayFilterMessage(message, &request_id)) { RequestMap::iterator it = requests_.find(request_id); if (it != requests_.end()) { handled = true; |