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

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: Rebase + fix android 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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 const unsigned char* category_group_enabled, 703 const unsigned char* category_group_enabled,
704 const char* name, 704 const char* name,
705 TraceEventHandle handle) { 705 TraceEventHandle handle) {
706 base::trace_event::TraceEventHandle traceEventHandle; 706 base::trace_event::TraceEventHandle traceEventHandle;
707 memcpy(&traceEventHandle, &handle, sizeof(handle)); 707 memcpy(&traceEventHandle, &handle, sizeof(handle));
708 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( 708 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
709 category_group_enabled, name, traceEventHandle); 709 category_group_enabled, name, traceEventHandle);
710 } 710 }
711 711
712 void BlinkPlatformImpl::registerMemoryDumpProvider( 712 void BlinkPlatformImpl::registerMemoryDumpProvider(
713 blink::WebMemoryDumpProvider* wmdp) { 713 blink::WebMemoryDumpProvider* wmdp, const char* name) {
714 WebMemoryDumpProviderAdapter* wmdp_adapter = 714 WebMemoryDumpProviderAdapter* wmdp_adapter =
715 new WebMemoryDumpProviderAdapter(wmdp); 715 new WebMemoryDumpProviderAdapter(wmdp);
716 bool did_insert = 716 bool did_insert =
717 memory_dump_providers_.add(wmdp, make_scoped_ptr(wmdp_adapter)).second; 717 memory_dump_providers_.add(wmdp, make_scoped_ptr(wmdp_adapter)).second;
718 if (!did_insert) 718 if (!did_insert)
719 return; 719 return;
720 wmdp_adapter->set_is_registered(true); 720 wmdp_adapter->set_is_registered(true);
721 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 721 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
722 wmdp_adapter, base::ThreadTaskRunnerHandle::Get()); 722 wmdp_adapter, name, base::ThreadTaskRunnerHandle::Get());
723 } 723 }
724 724
725 void BlinkPlatformImpl::unregisterMemoryDumpProvider( 725 void BlinkPlatformImpl::unregisterMemoryDumpProvider(
726 blink::WebMemoryDumpProvider* wmdp) { 726 blink::WebMemoryDumpProvider* wmdp) {
727 scoped_ptr<WebMemoryDumpProviderAdapter> wmdp_adapter = 727 scoped_ptr<WebMemoryDumpProviderAdapter> wmdp_adapter =
728 memory_dump_providers_.take_and_erase(wmdp); 728 memory_dump_providers_.take_and_erase(wmdp);
729 if (!wmdp_adapter) 729 if (!wmdp_adapter)
730 return; 730 return;
731 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 731 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
732 wmdp_adapter.get()); 732 wmdp_adapter.get());
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( 1325 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
1326 static_cast<ui::DomKey>(dom_key))); 1326 static_cast<ui::DomKey>(dom_key)));
1327 } 1327 }
1328 1328
1329 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { 1329 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) {
1330 return static_cast<int>( 1330 return static_cast<int>(
1331 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); 1331 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8()));
1332 } 1332 }
1333 1333
1334 } // namespace content 1334 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/child/child_discardable_shared_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698