OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/worker/worker_webkitplatformsupport_impl.h" | 5 #include "content/worker/worker_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/common/database_util.h" | 10 #include "content/common/database_util.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 std::string mime_type; | 255 std::string mime_type; |
256 net::GetWellKnownMimeTypeFromExtension( | 256 net::GetWellKnownMimeTypeFromExtension( |
257 webkit_base::WebStringToFilePathString(file_extension), &mime_type); | 257 webkit_base::WebStringToFilePathString(file_extension), &mime_type); |
258 return ASCIIToUTF16(mime_type); | 258 return ASCIIToUTF16(mime_type); |
259 } | 259 } |
260 | 260 |
261 WebString WorkerWebKitPlatformSupportImpl::mimeTypeFromFile( | 261 WebString WorkerWebKitPlatformSupportImpl::mimeTypeFromFile( |
262 const WebString& file_path) { | 262 const WebString& file_path) { |
263 std::string mime_type; | 263 std::string mime_type; |
264 SendSyncMessageFromAnyThread(new MimeRegistryMsg_GetMimeTypeFromFile( | 264 SendSyncMessageFromAnyThread(new MimeRegistryMsg_GetMimeTypeFromFile( |
265 FilePath(webkit_base::WebStringToFilePathString(file_path)), | 265 base::FilePath(webkit_base::WebStringToFilePathString(file_path)), |
266 &mime_type)); | 266 &mime_type)); |
267 return ASCIIToUTF16(mime_type); | 267 return ASCIIToUTF16(mime_type); |
268 } | 268 } |
269 | 269 |
270 WebString WorkerWebKitPlatformSupportImpl::preferredExtensionForMIMEType( | 270 WebString WorkerWebKitPlatformSupportImpl::preferredExtensionForMIMEType( |
271 const WebString& mime_type) { | 271 const WebString& mime_type) { |
272 FilePath::StringType file_extension; | 272 base::FilePath::StringType file_extension; |
273 SendSyncMessageFromAnyThread( | 273 SendSyncMessageFromAnyThread( |
274 new MimeRegistryMsg_GetPreferredExtensionForMimeType( | 274 new MimeRegistryMsg_GetPreferredExtensionForMimeType( |
275 UTF16ToASCII(mime_type), &file_extension)); | 275 UTF16ToASCII(mime_type), &file_extension)); |
276 return webkit_base::FilePathStringToWebString(file_extension); | 276 return webkit_base::FilePathStringToWebString(file_extension); |
277 } | 277 } |
278 | 278 |
279 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { | 279 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { |
280 if (!blob_registry_.get()) | 280 if (!blob_registry_.get()) |
281 blob_registry_.reset(new WebBlobRegistryImpl(WorkerThread::current())); | 281 blob_registry_.reset(new WebBlobRegistryImpl(WorkerThread::current())); |
282 return blob_registry_.get(); | 282 return blob_registry_.get(); |
283 } | 283 } |
284 | 284 |
285 } // namespace content | 285 } // namespace content |
OLD | NEW |