| 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" | |
| 18 #include "content/child/database_util.h" | 17 #include "content/child/database_util.h" |
| 19 #include "content/child/file_info_util.h" | 18 #include "content/child/file_info_util.h" |
| 20 #include "content/child/fileapi/webfilesystem_impl.h" | 19 #include "content/child/fileapi/webfilesystem_impl.h" |
| 21 #include "content/child/indexed_db/webidbfactory_impl.h" | 20 #include "content/child/indexed_db/webidbfactory_impl.h" |
| 22 #include "content/child/npapi/npobject_util.h" | 21 #include "content/child/npapi/npobject_util.h" |
| 23 #include "content/child/quota_dispatcher.h" | 22 #include "content/child/quota_dispatcher.h" |
| 24 #include "content/child/quota_message_filter.h" | 23 #include "content/child/quota_message_filter.h" |
| 25 #include "content/child/simple_webmimeregistry_impl.h" | 24 #include "content/child/simple_webmimeregistry_impl.h" |
| 26 #include "content/child/thread_safe_sender.h" | 25 #include "content/child/thread_safe_sender.h" |
| 27 #include "content/child/web_database_observer_impl.h" | 26 #include "content/child/web_database_observer_impl.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( | 229 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( |
| 231 RendererScheduler* renderer_scheduler) | 230 RendererScheduler* renderer_scheduler) |
| 232 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), | 231 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), |
| 233 web_scheduler_(new WebSchedulerImpl(renderer_scheduler)), | 232 web_scheduler_(new WebSchedulerImpl(renderer_scheduler)), |
| 234 clipboard_delegate_(new RendererClipboardDelegate), | 233 clipboard_delegate_(new RendererClipboardDelegate), |
| 235 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), | 234 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), |
| 236 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), | 235 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), |
| 237 sudden_termination_disables_(0), | 236 sudden_termination_disables_(0), |
| 238 plugin_refresh_allowed_(true), | 237 plugin_refresh_allowed_(true), |
| 239 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), | 238 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), |
| 240 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), | 239 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl) { |
| 241 bluetooth_(new WebBluetoothImpl) { | |
| 242 if (g_sandbox_enabled && sandboxEnabled()) { | 240 if (g_sandbox_enabled && sandboxEnabled()) { |
| 243 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); | 241 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); |
| 244 } else { | 242 } else { |
| 245 DVLOG(1) << "Disabling sandbox support for testing."; | 243 DVLOG(1) << "Disabling sandbox support for testing."; |
| 246 } | 244 } |
| 247 | 245 |
| 248 // ChildThread may not exist in some tests. | 246 // ChildThread may not exist in some tests. |
| 249 if (ChildThread::current()) { | 247 if (ChildThread::current()) { |
| 250 sync_message_filter_ = ChildThread::current()->sync_message_filter(); | 248 sync_message_filter_ = ChildThread::current()->sync_message_filter(); |
| 251 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); | 249 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 QuotaDispatcher::ThreadSpecificInstance(thread_safe_sender_.get(), | 1203 QuotaDispatcher::ThreadSpecificInstance(thread_safe_sender_.get(), |
| 1206 quota_message_filter_.get()) | 1204 quota_message_filter_.get()) |
| 1207 ->QueryStorageUsageAndQuota( | 1205 ->QueryStorageUsageAndQuota( |
| 1208 storage_partition, | 1206 storage_partition, |
| 1209 static_cast<storage::StorageType>(type), | 1207 static_cast<storage::StorageType>(type), |
| 1210 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1208 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 1211 } | 1209 } |
| 1212 | 1210 |
| 1213 //------------------------------------------------------------------------------ | 1211 //------------------------------------------------------------------------------ |
| 1214 | 1212 |
| 1215 blink::WebBluetooth* RendererBlinkPlatformImpl::bluetooth() { | |
| 1216 return bluetooth_.get(); | |
| 1217 } | |
| 1218 | |
| 1219 //------------------------------------------------------------------------------ | |
| 1220 | |
| 1221 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1213 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
| 1222 const blink::WebBatteryStatus& status) { | 1214 const blink::WebBatteryStatus& status) { |
| 1223 if (!g_test_battery_status_listener) | 1215 if (!g_test_battery_status_listener) |
| 1224 return; | 1216 return; |
| 1225 g_test_battery_status_listener->updateBatteryStatus(status); | 1217 g_test_battery_status_listener->updateBatteryStatus(status); |
| 1226 } | 1218 } |
| 1227 | 1219 |
| 1228 } // namespace content | 1220 } // namespace content |
| OLD | NEW |