| 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_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_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/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
| 12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/numerics/safe_conversions.h" | 14 #include "base/numerics/safe_conversions.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/bluetooth/web_bluetooth_impl.h" |
| 17 #include "content/child/database_util.h" | 18 #include "content/child/database_util.h" |
| 18 #include "content/child/file_info_util.h" | 19 #include "content/child/file_info_util.h" |
| 19 #include "content/child/fileapi/webfilesystem_impl.h" | 20 #include "content/child/fileapi/webfilesystem_impl.h" |
| 20 #include "content/child/indexed_db/webidbfactory_impl.h" | 21 #include "content/child/indexed_db/webidbfactory_impl.h" |
| 21 #include "content/child/npapi/npobject_util.h" | 22 #include "content/child/npapi/npobject_util.h" |
| 22 #include "content/child/quota_dispatcher.h" | 23 #include "content/child/quota_dispatcher.h" |
| 23 #include "content/child/quota_message_filter.h" | 24 #include "content/child/quota_message_filter.h" |
| 24 #include "content/child/simple_webmimeregistry_impl.h" | 25 #include "content/child/simple_webmimeregistry_impl.h" |
| 25 #include "content/child/thread_safe_sender.h" | 26 #include "content/child/thread_safe_sender.h" |
| 26 #include "content/child/web_database_observer_impl.h" | 27 #include "content/child/web_database_observer_impl.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 225 |
| 225 //------------------------------------------------------------------------------ | 226 //------------------------------------------------------------------------------ |
| 226 | 227 |
| 227 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl() | 228 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl() |
| 228 : clipboard_client_(new RendererClipboardClient), | 229 : clipboard_client_(new RendererClipboardClient), |
| 229 clipboard_(new WebClipboardImpl(clipboard_client_.get())), | 230 clipboard_(new WebClipboardImpl(clipboard_client_.get())), |
| 230 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), | 231 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), |
| 231 sudden_termination_disables_(0), | 232 sudden_termination_disables_(0), |
| 232 plugin_refresh_allowed_(true), | 233 plugin_refresh_allowed_(true), |
| 233 child_thread_loop_(base::MessageLoopProxy::current()), | 234 child_thread_loop_(base::MessageLoopProxy::current()), |
| 234 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl) { | 235 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), |
| 236 bluetooth_(new WebBluetoothImpl) { |
| 235 if (g_sandbox_enabled && sandboxEnabled()) { | 237 if (g_sandbox_enabled && sandboxEnabled()) { |
| 236 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); | 238 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); |
| 237 } else { | 239 } else { |
| 238 DVLOG(1) << "Disabling sandbox support for testing."; | 240 DVLOG(1) << "Disabling sandbox support for testing."; |
| 239 } | 241 } |
| 240 | 242 |
| 241 // ChildThread may not exist in some tests. | 243 // ChildThread may not exist in some tests. |
| 242 if (ChildThread::current()) { | 244 if (ChildThread::current()) { |
| 243 sync_message_filter_ = ChildThread::current()->sync_message_filter(); | 245 sync_message_filter_ = ChildThread::current()->sync_message_filter(); |
| 244 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); | 246 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 QuotaDispatcher::ThreadSpecificInstance(thread_safe_sender_.get(), | 1196 QuotaDispatcher::ThreadSpecificInstance(thread_safe_sender_.get(), |
| 1195 quota_message_filter_.get()) | 1197 quota_message_filter_.get()) |
| 1196 ->QueryStorageUsageAndQuota( | 1198 ->QueryStorageUsageAndQuota( |
| 1197 storage_partition, | 1199 storage_partition, |
| 1198 static_cast<storage::StorageType>(type), | 1200 static_cast<storage::StorageType>(type), |
| 1199 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1201 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 1200 } | 1202 } |
| 1201 | 1203 |
| 1202 //------------------------------------------------------------------------------ | 1204 //------------------------------------------------------------------------------ |
| 1203 | 1205 |
| 1206 blink::WebBluetooth* RendererBlinkPlatformImpl::bluetooth() { |
| 1207 return bluetooth_.get(); |
| 1208 } |
| 1209 |
| 1210 //------------------------------------------------------------------------------ |
| 1211 |
| 1204 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1212 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
| 1205 const blink::WebBatteryStatus& status) { | 1213 const blink::WebBatteryStatus& status) { |
| 1206 if (!g_test_battery_status_listener) | 1214 if (!g_test_battery_status_listener) |
| 1207 return; | 1215 return; |
| 1208 g_test_battery_status_listener->updateBatteryStatus(status); | 1216 g_test_battery_status_listener->updateBatteryStatus(status); |
| 1209 } | 1217 } |
| 1210 | 1218 |
| 1211 } // namespace content | 1219 } // namespace content |
| OLD | NEW |