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/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/numerics/safe_conversions.h" |
13 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
14 #include "base/safe_numerics.h" | |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "content/child/database_util.h" | 17 #include "content/child/database_util.h" |
18 #include "content/child/fileapi/webfilesystem_impl.h" | 18 #include "content/child/fileapi/webfilesystem_impl.h" |
19 #include "content/child/indexed_db/webidbfactory_impl.h" | 19 #include "content/child/indexed_db/webidbfactory_impl.h" |
20 #include "content/child/npapi/npobject_util.h" | 20 #include "content/child/npapi/npobject_util.h" |
21 #include "content/child/quota_dispatcher.h" | 21 #include "content/child/quota_dispatcher.h" |
22 #include "content/child/quota_message_filter.h" | 22 #include "content/child/quota_message_filter.h" |
23 #include "content/child/thread_safe_sender.h" | 23 #include "content/child/thread_safe_sender.h" |
24 #include "content/child/web_database_observer_impl.h" | 24 #include "content/child/web_database_observer_impl.h" |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 if (!web_crypto_) | 1050 if (!web_crypto_) |
1051 web_crypto_.reset(new WebCryptoImpl()); | 1051 web_crypto_.reset(new WebCryptoImpl()); |
1052 return web_crypto_.get(); | 1052 return web_crypto_.get(); |
1053 | 1053 |
1054 } | 1054 } |
1055 | 1055 |
1056 //------------------------------------------------------------------------------ | 1056 //------------------------------------------------------------------------------ |
1057 | 1057 |
1058 void RendererWebKitPlatformSupportImpl::vibrate(unsigned int milliseconds) { | 1058 void RendererWebKitPlatformSupportImpl::vibrate(unsigned int milliseconds) { |
1059 RenderThread::Get()->Send( | 1059 RenderThread::Get()->Send( |
1060 new ViewHostMsg_Vibrate(base::checked_numeric_cast<int64>(milliseconds))); | 1060 new ViewHostMsg_Vibrate(base::checked_cast<int64>(milliseconds))); |
1061 } | 1061 } |
1062 | 1062 |
1063 void RendererWebKitPlatformSupportImpl::cancelVibration() { | 1063 void RendererWebKitPlatformSupportImpl::cancelVibration() { |
1064 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); | 1064 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); |
1065 } | 1065 } |
1066 | 1066 |
1067 //------------------------------------------------------------------------------ | 1067 //------------------------------------------------------------------------------ |
1068 | 1068 |
1069 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( | 1069 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( |
1070 const blink::WebURL& storage_partition, | 1070 const blink::WebURL& storage_partition, |
1071 blink::WebStorageQuotaType type, | 1071 blink::WebStorageQuotaType type, |
1072 blink::WebStorageQuotaCallbacks* callbacks) { | 1072 blink::WebStorageQuotaCallbacks* callbacks) { |
1073 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) | 1073 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) |
1074 return; | 1074 return; |
1075 QuotaDispatcher::ThreadSpecificInstance( | 1075 QuotaDispatcher::ThreadSpecificInstance( |
1076 thread_safe_sender_.get(), | 1076 thread_safe_sender_.get(), |
1077 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1077 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
1078 storage_partition, | 1078 storage_partition, |
1079 static_cast<quota::StorageType>(type), | 1079 static_cast<quota::StorageType>(type), |
1080 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1080 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
1081 } | 1081 } |
1082 | 1082 |
1083 } // namespace content | 1083 } // namespace content |
OLD | NEW |