diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 00:13:14 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 00:13:14 +0000 |
commit | 952ec4b4ac9a7a92fd3014f782ce0a0ba0ef7b83 (patch) | |
tree | abd46f9c1a7da6a877b04872a345984e93c0b5b5 /chrome/worker | |
parent | f2870a91d57f0af4e5dc4315e451b6fd00cff42d (diff) | |
download | chromium_src-952ec4b4ac9a7a92fd3014f782ce0a0ba0ef7b83.zip chromium_src-952ec4b4ac9a7a92fd3014f782ce0a0ba0ef7b83.tar.gz chromium_src-952ec4b4ac9a7a92fd3014f782ce0a0ba0ef7b83.tar.bz2 |
WorkerWebKitClientImpl::mimeTypeForExtension should not use WorkerThread::current
Currently FileEntry.file() or FileEntrySync.file() calls File::create() on the (WebKit's) worker thread but on chromium we use WorkerThread::current() (which assumes WebKit's main thread in the worker process) to process the mime request initiated by File::create().
File::create() needs to be called on the main thread (this is related to webkit.org/b/47700) or WorkerWebKitClientImpl::mimeTypeForExtension should not use WorkerThread::current() to process the request.
BUG=60081
TEST=no crash in fast/filesystem/workers/file-from-file-entry.html
Review URL: http://codereview.chromium.org/4012002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/worker_webkitclient_impl.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc index 1f74232..1755002 100644 --- a/chrome/worker/worker_webkitclient_impl.cc +++ b/chrome/worker/worker_webkitclient_impl.cc @@ -228,7 +228,7 @@ WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsNonImageMIMEType( WebString WorkerWebKitClientImpl::mimeTypeForExtension( const WebString& file_extension) { std::string mime_type; - WorkerThread::current()->Send(new ViewHostMsg_GetMimeTypeFromExtension( + SendSyncMessageFromAnyThread(new ViewHostMsg_GetMimeTypeFromExtension( webkit_glue::WebStringToFilePathString(file_extension), &mime_type)); return ASCIIToUTF16(mime_type); } @@ -236,7 +236,7 @@ WebString WorkerWebKitClientImpl::mimeTypeForExtension( WebString WorkerWebKitClientImpl::mimeTypeFromFile( const WebString& file_path) { std::string mime_type; - WorkerThread::current()->Send(new ViewHostMsg_GetMimeTypeFromFile( + SendSyncMessageFromAnyThread(new ViewHostMsg_GetMimeTypeFromFile( FilePath(webkit_glue::WebStringToFilePathString(file_path)), &mime_type)); return ASCIIToUTF16(mime_type); @@ -245,7 +245,7 @@ WebString WorkerWebKitClientImpl::mimeTypeFromFile( WebString WorkerWebKitClientImpl::preferredExtensionForMIMEType( const WebString& mime_type) { FilePath::StringType file_extension; - WorkerThread::current()->Send( + SendSyncMessageFromAnyThread( new ViewHostMsg_GetPreferredExtensionForMimeType(UTF16ToASCII(mime_type), &file_extension)); return webkit_glue::FilePathStringToWebString(file_extension); |