OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/worker/worker_webkitclient_impl.h" | 5 #include "chrome/worker/worker_webkitclient_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/common/database_util.h" | 9 #include "chrome/common/database_util.h" |
10 #include "chrome/common/file_system/webfilesystem_impl.h" | 10 #include "chrome/common/file_system/webfilesystem_impl.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 virtual bool getFileSize(const WebKit::WebString& path, long long& result); | 41 virtual bool getFileSize(const WebKit::WebString& path, long long& result); |
42 virtual bool getFileModificationTime(const WebKit::WebString& path, | 42 virtual bool getFileModificationTime(const WebKit::WebString& path, |
43 double& result); | 43 double& result); |
44 }; | 44 }; |
45 | 45 |
46 static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) { | 46 static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) { |
47 WorkerThread* worker_thread = WorkerThread::current(); | 47 WorkerThread* worker_thread = WorkerThread::current(); |
48 if (worker_thread) | 48 if (worker_thread) |
49 return worker_thread->Send(msg); | 49 return worker_thread->Send(msg); |
50 | 50 |
51 scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter = | 51 scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter( |
52 ChildThread::current()->sync_message_filter(); | 52 ChildThread::current()->sync_message_filter()); |
53 return sync_msg_filter->Send(msg); | 53 return sync_msg_filter->Send(msg); |
54 } | 54 } |
55 | 55 |
56 bool WorkerWebKitClientImpl::FileUtilities::getFileSize(const WebString& path, | 56 bool WorkerWebKitClientImpl::FileUtilities::getFileSize(const WebString& path, |
57 long long& result) { | 57 long long& result) { |
58 if (SendSyncMessageFromAnyThread(new ViewHostMsg_GetFileSize( | 58 if (SendSyncMessageFromAnyThread(new ViewHostMsg_GetFileSize( |
59 webkit_glue::WebStringToFilePath(path), | 59 webkit_glue::WebStringToFilePath(path), |
60 reinterpret_cast<int64*>(&result)))) { | 60 reinterpret_cast<int64*>(&result)))) { |
61 return result >= 0; | 61 return result >= 0; |
62 } | 62 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 new ViewHostMsg_GetPreferredExtensionForMimeType(UTF16ToASCII(mime_type), | 249 new ViewHostMsg_GetPreferredExtensionForMimeType(UTF16ToASCII(mime_type), |
250 &file_extension)); | 250 &file_extension)); |
251 return webkit_glue::FilePathStringToWebString(file_extension); | 251 return webkit_glue::FilePathStringToWebString(file_extension); |
252 } | 252 } |
253 | 253 |
254 WebBlobRegistry* WorkerWebKitClientImpl::blobRegistry() { | 254 WebBlobRegistry* WorkerWebKitClientImpl::blobRegistry() { |
255 if (!blob_registry_.get()) | 255 if (!blob_registry_.get()) |
256 blob_registry_.reset(new WebBlobRegistryImpl(WorkerThread::current())); | 256 blob_registry_.reset(new WebBlobRegistryImpl(WorkerThread::current())); |
257 return blob_registry_.get(); | 257 return blob_registry_.get(); |
258 } | 258 } |
OLD | NEW |