Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5917)

Unified Diff: chrome_frame/urlmon_url_request.cc

Issue 1186002: Adding support for HEAD requests.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/url_request_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/urlmon_url_request.cc
===================================================================
--- chrome_frame/urlmon_url_request.cc (revision 42349)
+++ chrome_frame/urlmon_url_request.cc (working copy)
@@ -146,6 +146,8 @@
void UrlmonUrlRequest::StealMoniker(IMoniker** moniker) {
// Could be called in any thread. There should be no race
// since moniker_ is not released while we are in manager's request map.
+ DLOG(INFO) << __FUNCTION__ << " id: " << id();
+ DLOG_IF(WARNING, moniker == NULL) << __FUNCTION__ << " no moniker";
*moniker = moniker_.Detach();
}
@@ -311,6 +313,12 @@
} else if (LowerCaseEqualsASCII(method(), "put")) {
bind_info->dwBindVerb = BINDVERB_PUT;
upload_data = true;
+ } else if (LowerCaseEqualsASCII(method(), "head")) {
+ std::wstring verb(ASCIIToWide(StringToUpperASCII(method())));
+ bind_info->dwBindVerb = BINDVERB_CUSTOM;
+ bind_info->szCustomVerb = reinterpret_cast<wchar_t*>(
+ ::CoTaskMemAlloc((verb.length() + 1) * sizeof(wchar_t)));
+ lstrcpyW(bind_info->szCustomVerb, verb.c_str());
} else {
NOTREACHED() << "Unknown HTTP method.";
status_.set_result(URLRequestStatus::FAILED, net::ERR_METHOD_NOT_SUPPORTED);
@@ -914,14 +922,14 @@
}
void UrlmonUrlRequestManager::ReadRequest(int request_id, int bytes_to_read) {
- DLOG(INFO) << __FUNCTION__;
+ DLOG(INFO) << __FUNCTION__ << " id: " << request_id;
ExecuteInWorkerThread(FROM_HERE, NewRunnableMethod(this,
&UrlmonUrlRequestManager::ReadRequestWorker, request_id, bytes_to_read));
}
void UrlmonUrlRequestManager::ReadRequestWorker(int request_id,
int bytes_to_read) {
- DLOG(INFO) << __FUNCTION__;
+ DLOG(INFO) << __FUNCTION__ << " id: " << request_id;
DCHECK_EQ(worker_thread_.thread_id(), PlatformThread::CurrentId());
scoped_refptr<UrlmonUrlRequest> request = LookupRequest(request_id);
// if zero, it may just have had network error.
@@ -931,13 +939,13 @@
}
void UrlmonUrlRequestManager::EndRequest(int request_id) {
- DLOG(INFO) << __FUNCTION__;
+ DLOG(INFO) << __FUNCTION__ << " id: " << request_id;
ExecuteInWorkerThread(FROM_HERE, NewRunnableMethod(this,
&UrlmonUrlRequestManager::EndRequestWorker, request_id));
}
void UrlmonUrlRequestManager::EndRequestWorker(int request_id) {
- DLOG(INFO) << __FUNCTION__;
+ DLOG(INFO) << __FUNCTION__ << " id: " << request_id;
DCHECK_EQ(worker_thread_.thread_id(), PlatformThread::CurrentId());
scoped_refptr<UrlmonUrlRequest> request = LookupRequest(request_id);
if (request) {
@@ -1070,7 +1078,11 @@
if (request) {
request->StealMoniker(moniker);
request->Stop();
+ } else {
+ DLOG(INFO) << __FUNCTION__ << " request not found.";
}
+ } else {
+ DLOG(INFO) << __FUNCTION__ << " request stopping.";
}
done->Signal();
« no previous file with comments | « chrome_frame/test/url_request_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698