Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 1406213005: [tracing] Add names to memory-infra dumpers for debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@memory-infra-runtime
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 const unsigned char* category_group_enabled, 698 const unsigned char* category_group_enabled,
699 const char* name, 699 const char* name,
700 TraceEventHandle handle) { 700 TraceEventHandle handle) {
701 base::trace_event::TraceEventHandle traceEventHandle; 701 base::trace_event::TraceEventHandle traceEventHandle;
702 memcpy(&traceEventHandle, &handle, sizeof(handle)); 702 memcpy(&traceEventHandle, &handle, sizeof(handle));
703 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( 703 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
704 category_group_enabled, name, traceEventHandle); 704 category_group_enabled, name, traceEventHandle);
705 } 705 }
706 706
707 void BlinkPlatformImpl::registerMemoryDumpProvider( 707 void BlinkPlatformImpl::registerMemoryDumpProvider(
708 blink::WebMemoryDumpProvider* wmdp) { 708 blink::WebMemoryDumpProvider* wmdp, const char* name) {
709 WebMemoryDumpProviderAdapter* wmdp_adapter = 709 WebMemoryDumpProviderAdapter* wmdp_adapter =
710 new WebMemoryDumpProviderAdapter(wmdp); 710 new WebMemoryDumpProviderAdapter(wmdp);
711 bool did_insert = 711 bool did_insert =
712 memory_dump_providers_.add(wmdp, make_scoped_ptr(wmdp_adapter)).second; 712 memory_dump_providers_.add(wmdp, make_scoped_ptr(wmdp_adapter)).second;
713 if (!did_insert) 713 if (!did_insert)
714 return; 714 return;
715 wmdp_adapter->set_is_registered(true); 715 wmdp_adapter->set_is_registered(true);
716 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 716 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
717 wmdp_adapter, base::ThreadTaskRunnerHandle::Get()); 717 wmdp_adapter, name, base::ThreadTaskRunnerHandle::Get());
718 } 718 }
719 719
720 void BlinkPlatformImpl::unregisterMemoryDumpProvider( 720 void BlinkPlatformImpl::unregisterMemoryDumpProvider(
721 blink::WebMemoryDumpProvider* wmdp) { 721 blink::WebMemoryDumpProvider* wmdp) {
722 scoped_ptr<WebMemoryDumpProviderAdapter> wmdp_adapter = 722 scoped_ptr<WebMemoryDumpProviderAdapter> wmdp_adapter =
723 memory_dump_providers_.take_and_erase(wmdp); 723 memory_dump_providers_.take_and_erase(wmdp);
724 if (!wmdp_adapter) 724 if (!wmdp_adapter)
725 return; 725 return;
726 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 726 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
727 wmdp_adapter.get()); 727 wmdp_adapter.get());
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( 1320 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
1321 static_cast<ui::DomKey>(dom_key))); 1321 static_cast<ui::DomKey>(dom_key)));
1322 } 1322 }
1323 1323
1324 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { 1324 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) {
1325 return static_cast<int>( 1325 return static_cast<int>(
1326 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); 1326 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8()));
1327 } 1327 }
1328 1328
1329 } // namespace content 1329 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698