| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 43 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
| 44 #include "content/child/navigator_connect/service_port_provider.h" | 44 #include "content/child/navigator_connect/service_port_provider.h" |
| 45 #include "content/child/notifications/notification_dispatcher.h" | 45 #include "content/child/notifications/notification_dispatcher.h" |
| 46 #include "content/child/notifications/notification_manager.h" | 46 #include "content/child/notifications/notification_manager.h" |
| 47 #include "content/child/permissions/permission_dispatcher.h" | 47 #include "content/child/permissions/permission_dispatcher.h" |
| 48 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" | 48 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" |
| 49 #include "content/child/push_messaging/push_dispatcher.h" | 49 #include "content/child/push_messaging/push_dispatcher.h" |
| 50 #include "content/child/push_messaging/push_provider.h" | 50 #include "content/child/push_messaging/push_provider.h" |
| 51 #include "content/child/thread_safe_sender.h" | 51 #include "content/child/thread_safe_sender.h" |
| 52 #include "content/child/web_discardable_memory_impl.h" | 52 #include "content/child/web_discardable_memory_impl.h" |
| 53 #include "content/child/web_memory_dump_provider_adapter.h" | |
| 54 #include "content/child/web_process_memory_dump_impl.h" | |
| 55 #include "content/child/web_url_loader_impl.h" | 53 #include "content/child/web_url_loader_impl.h" |
| 56 #include "content/child/web_url_request_util.h" | 54 #include "content/child/web_url_request_util.h" |
| 57 #include "content/child/websocket_bridge.h" | 55 #include "content/child/websocket_bridge.h" |
| 58 #include "content/child/worker_thread_registry.h" | 56 #include "content/child/worker_thread_registry.h" |
| 59 #include "content/public/common/content_client.h" | 57 #include "content/public/common/content_client.h" |
| 60 #include "net/base/data_url.h" | 58 #include "net/base/data_url.h" |
| 61 #include "net/base/ip_address_number.h" | 59 #include "net/base/ip_address_number.h" |
| 62 #include "net/base/net_errors.h" | 60 #include "net/base/net_errors.h" |
| 63 #include "net/base/port_util.h" | 61 #include "net/base/port_util.h" |
| 64 #include "third_party/WebKit/public/platform/WebData.h" | 62 #include "third_party/WebKit/public/platform/WebData.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 scheduler::WebThreadBase* compositor_thread) { | 478 scheduler::WebThreadBase* compositor_thread) { |
| 481 compositor_thread_ = compositor_thread; | 479 compositor_thread_ = compositor_thread; |
| 482 if (compositor_thread_) | 480 if (compositor_thread_) |
| 483 WaitUntilWebThreadTLSUpdate(compositor_thread_); | 481 WaitUntilWebThreadTLSUpdate(compositor_thread_); |
| 484 } | 482 } |
| 485 | 483 |
| 486 blink::WebThread* BlinkPlatformImpl::currentThread() { | 484 blink::WebThread* BlinkPlatformImpl::currentThread() { |
| 487 return static_cast<blink::WebThread*>(current_thread_slot_.Get()); | 485 return static_cast<blink::WebThread*>(current_thread_slot_.Get()); |
| 488 } | 486 } |
| 489 | 487 |
| 490 void BlinkPlatformImpl::registerMemoryDumpProvider( | |
| 491 blink::WebMemoryDumpProvider* wmdp, const char* name) { | |
| 492 WebMemoryDumpProviderAdapter* wmdp_adapter = | |
| 493 new WebMemoryDumpProviderAdapter(wmdp); | |
| 494 bool did_insert = | |
| 495 memory_dump_providers_.add(wmdp, make_scoped_ptr(wmdp_adapter)).second; | |
| 496 if (!did_insert) | |
| 497 return; | |
| 498 wmdp_adapter->set_is_registered(true); | |
| 499 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | |
| 500 wmdp_adapter, name, base::ThreadTaskRunnerHandle::Get()); | |
| 501 } | |
| 502 | |
| 503 void BlinkPlatformImpl::unregisterMemoryDumpProvider( | |
| 504 blink::WebMemoryDumpProvider* wmdp) { | |
| 505 scoped_ptr<WebMemoryDumpProviderAdapter> wmdp_adapter = | |
| 506 memory_dump_providers_.take_and_erase(wmdp); | |
| 507 if (!wmdp_adapter) | |
| 508 return; | |
| 509 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( | |
| 510 wmdp_adapter.get()); | |
| 511 wmdp_adapter->set_is_registered(false); | |
| 512 } | |
| 513 | |
| 514 blink::WebProcessMemoryDump* BlinkPlatformImpl::createProcessMemoryDump() { | |
| 515 return new WebProcessMemoryDumpImpl(); | |
| 516 } | |
| 517 | |
| 518 blink::Platform::WebMemoryAllocatorDumpGuid | 488 blink::Platform::WebMemoryAllocatorDumpGuid |
| 519 BlinkPlatformImpl::createWebMemoryAllocatorDumpGuid( | 489 BlinkPlatformImpl::createWebMemoryAllocatorDumpGuid( |
| 520 const blink::WebString& guidStr) { | 490 const blink::WebString& guidStr) { |
| 521 return base::trace_event::MemoryAllocatorDumpGuid(guidStr.utf8()).ToUint64(); | 491 return base::trace_event::MemoryAllocatorDumpGuid(guidStr.utf8()).ToUint64(); |
| 522 } | 492 } |
| 523 | 493 |
| 524 void BlinkPlatformImpl::addTraceLogEnabledStateObserver( | 494 void BlinkPlatformImpl::addTraceLogEnabledStateObserver( |
| 525 TraceLogEnabledStateObserver* observer) { | 495 TraceLogEnabledStateObserver* observer) { |
| 526 TraceLogObserverAdapter* adapter = new TraceLogObserverAdapter(observer); | 496 TraceLogObserverAdapter* adapter = new TraceLogObserverAdapter(observer); |
| 527 bool did_insert = | 497 bool did_insert = |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 1011 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 1042 static_cast<ui::DomKey>(dom_key))); | 1012 static_cast<ui::DomKey>(dom_key))); |
| 1043 } | 1013 } |
| 1044 | 1014 |
| 1045 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 1015 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 1046 return static_cast<int>( | 1016 return static_cast<int>( |
| 1047 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 1017 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 1048 } | 1018 } |
| 1049 | 1019 |
| 1050 } // namespace content | 1020 } // namespace content |
| OLD | NEW |