| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/child/blink_platform_impl.h" | 5 #include "content/child/blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/allocator/allocator_extension.h" | 11 #include "base/allocator/allocator_extension.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/metrics/sparse_histogram.h" | 17 #include "base/metrics/sparse_histogram.h" |
| 18 #include "base/process/process_metrics.h" | 18 #include "base/process/process_metrics.h" |
| 19 #include "base/rand_util.h" | 19 #include "base/rand_util.h" |
| 20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
| 24 #include "base/synchronization/waitable_event.h" | 24 #include "base/synchronization/waitable_event.h" |
| 25 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
| 26 #include "base/threading/platform_thread.h" | 26 #include "base/threading/platform_thread.h" |
| 27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
| 28 #include "blink/public/resources/grit/blink_image_resources.h" | 28 #include "blink/public/resources/grit/blink_image_resources.h" |
| 29 #include "blink/public/resources/grit/blink_resources.h" | 29 #include "blink/public/resources/grit/blink_resources.h" |
| 30 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" |
| 30 #include "content/app/resources/grit/content_resources.h" | 31 #include "content/app/resources/grit/content_resources.h" |
| 31 #include "content/app/strings/grit/content_strings.h" | 32 #include "content/app/strings/grit/content_strings.h" |
| 32 #include "content/child/bluetooth/web_bluetooth_impl.h" | 33 #include "content/child/bluetooth/web_bluetooth_impl.h" |
| 33 #include "content/child/child_thread_impl.h" | 34 #include "content/child/child_thread_impl.h" |
| 34 #include "content/child/content_child_helpers.h" | 35 #include "content/child/content_child_helpers.h" |
| 35 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 36 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
| 36 #include "content/child/navigator_connect/navigator_connect_provider.h" | 37 #include "content/child/navigator_connect/navigator_connect_provider.h" |
| 37 #include "content/child/notifications/notification_dispatcher.h" | 38 #include "content/child/notifications/notification_dispatcher.h" |
| 38 #include "content/child/notifications/notification_manager.h" | 39 #include "content/child/notifications/notification_manager.h" |
| 39 #include "content/child/permissions/permission_dispatcher.h" | 40 #include "content/child/permissions/permission_dispatcher.h" |
| 40 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" | 41 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" |
| 41 #include "content/child/push_messaging/push_dispatcher.h" | 42 #include "content/child/push_messaging/push_dispatcher.h" |
| 42 #include "content/child/push_messaging/push_provider.h" | 43 #include "content/child/push_messaging/push_provider.h" |
| 43 #include "content/child/scheduler/webthread_impl_for_worker_scheduler.h" | |
| 44 #include "content/child/thread_safe_sender.h" | 44 #include "content/child/thread_safe_sender.h" |
| 45 #include "content/child/web_discardable_memory_impl.h" | 45 #include "content/child/web_discardable_memory_impl.h" |
| 46 #include "content/child/web_url_loader_impl.h" | 46 #include "content/child/web_url_loader_impl.h" |
| 47 #include "content/child/web_url_request_util.h" | 47 #include "content/child/web_url_request_util.h" |
| 48 #include "content/child/websocket_bridge.h" | 48 #include "content/child/websocket_bridge.h" |
| 49 #include "content/child/worker_task_runner.h" | 49 #include "content/child/worker_task_runner.h" |
| 50 #include "content/public/common/content_client.h" | 50 #include "content/public/common/content_client.h" |
| 51 #include "net/base/data_url.h" | 51 #include "net/base/data_url.h" |
| 52 #include "net/base/mime_util.h" | 52 #include "net/base/mime_util.h" |
| 53 #include "net/base/net_errors.h" | 53 #include "net/base/net_errors.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 return true; | 512 return true; |
| 513 int port = gurl.IntPort(); | 513 int port = gurl.IntPort(); |
| 514 if (net::IsPortAllowedByOverride(port)) | 514 if (net::IsPortAllowedByOverride(port)) |
| 515 return true; | 515 return true; |
| 516 if (gurl.SchemeIs("ftp")) | 516 if (gurl.SchemeIs("ftp")) |
| 517 return net::IsPortAllowedByFtp(port); | 517 return net::IsPortAllowedByFtp(port); |
| 518 return net::IsPortAllowedByDefault(port); | 518 return net::IsPortAllowedByDefault(port); |
| 519 } | 519 } |
| 520 | 520 |
| 521 blink::WebThread* BlinkPlatformImpl::createThread(const char* name) { | 521 blink::WebThread* BlinkPlatformImpl::createThread(const char* name) { |
| 522 WebThreadImplForWorkerScheduler* thread = | 522 scheduler::WebThreadImplForWorkerScheduler* thread = |
| 523 new WebThreadImplForWorkerScheduler(name); | 523 new scheduler::WebThreadImplForWorkerScheduler(name); |
| 524 thread->TaskRunner()->PostTask( | 524 thread->TaskRunner()->PostTask( |
| 525 FROM_HERE, base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, | 525 FROM_HERE, base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, |
| 526 base::Unretained(this), thread)); | 526 base::Unretained(this), thread)); |
| 527 return thread; | 527 return thread; |
| 528 } | 528 } |
| 529 | 529 |
| 530 blink::WebThread* BlinkPlatformImpl::currentThread() { | 530 blink::WebThread* BlinkPlatformImpl::currentThread() { |
| 531 return static_cast<blink::WebThread*>(current_thread_slot_.Get()); | 531 return static_cast<blink::WebThread*>(current_thread_slot_.Get()); |
| 532 } | 532 } |
| 533 | 533 |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( | 1332 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
| 1333 static_cast<ui::DomCode>(dom_code))); | 1333 static_cast<ui::DomCode>(dom_code))); |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { | 1336 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { |
| 1337 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( | 1337 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
| 1338 code.utf8().data())); | 1338 code.utf8().data())); |
| 1339 } | 1339 } |
| 1340 | 1340 |
| 1341 } // namespace content | 1341 } // namespace content |
| OLD | NEW |