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

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

Issue 1283793004: [tracing] Add WebCache memory usage in Blink to chrome://tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unregister. Created 5 years, 4 months 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
« content/child/DEPS ('K') | « content/child/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17 matching lines...) Expand all
28 #include "base/thread_task_runner_handle.h" 28 #include "base/thread_task_runner_handle.h"
29 #include "base/threading/platform_thread.h" 29 #include "base/threading/platform_thread.h"
30 #include "base/time/time.h" 30 #include "base/time/time.h"
31 #include "base/trace_event/memory_allocator_dump_guid.h" 31 #include "base/trace_event/memory_allocator_dump_guid.h"
32 #include "base/trace_event/memory_dump_manager.h" 32 #include "base/trace_event/memory_dump_manager.h"
33 #include "base/trace_event/trace_event.h" 33 #include "base/trace_event/trace_event.h"
34 #include "blink/public/resources/grit/blink_image_resources.h" 34 #include "blink/public/resources/grit/blink_image_resources.h"
35 #include "blink/public/resources/grit/blink_resources.h" 35 #include "blink/public/resources/grit/blink_resources.h"
36 #include "components/mime_util/mime_util.h" 36 #include "components/mime_util/mime_util.h"
37 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" 37 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h"
38 #include "components/web_cache/renderer/web_cache_memory_dump_provider.h"
38 #include "content/app/resources/grit/content_resources.h" 39 #include "content/app/resources/grit/content_resources.h"
39 #include "content/app/strings/grit/content_strings.h" 40 #include "content/app/strings/grit/content_strings.h"
40 #include "content/child/background_sync/background_sync_provider.h" 41 #include "content/child/background_sync/background_sync_provider.h"
41 #include "content/child/background_sync/background_sync_provider_thread_proxy.h" 42 #include "content/child/background_sync/background_sync_provider_thread_proxy.h"
42 #include "content/child/child_thread_impl.h" 43 #include "content/child/child_thread_impl.h"
43 #include "content/child/content_child_helpers.h" 44 #include "content/child/content_child_helpers.h"
44 #include "content/child/geofencing/web_geofencing_provider_impl.h" 45 #include "content/child/geofencing/web_geofencing_provider_impl.h"
45 #include "content/child/navigator_connect/service_port_provider.h" 46 #include "content/child/navigator_connect/service_port_provider.h"
46 #include "content/child/notifications/notification_dispatcher.h" 47 #include "content/child/notifications/notification_dispatcher.h"
47 #include "content/child/notifications/notification_manager.h" 48 #include "content/child/notifications/notification_manager.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 geofencing_provider_.reset(new WebGeofencingProviderImpl( 455 geofencing_provider_.reset(new WebGeofencingProviderImpl(
455 ChildThreadImpl::current()->thread_safe_sender())); 456 ChildThreadImpl::current()->thread_safe_sender()));
456 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); 457 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender();
457 notification_dispatcher_ = 458 notification_dispatcher_ =
458 ChildThreadImpl::current()->notification_dispatcher(); 459 ChildThreadImpl::current()->notification_dispatcher();
459 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); 460 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher();
460 permission_client_.reset(new PermissionDispatcher( 461 permission_client_.reset(new PermissionDispatcher(
461 ChildThreadImpl::current()->service_registry())); 462 ChildThreadImpl::current()->service_registry()));
462 sync_provider_.reset(new BackgroundSyncProvider( 463 sync_provider_.reset(new BackgroundSyncProvider(
463 ChildThreadImpl::current()->service_registry())); 464 ChildThreadImpl::current()->service_registry()));
465
466 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
467 web_cache::WebCacheMemoryDumpProvider::GetInstance(),
468 main_thread_task_runner_);
464 } 469 }
465 } 470 }
466 471
467 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { 472 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) {
468 DCHECK(!current_thread_slot_.Get()); 473 DCHECK(!current_thread_slot_.Get());
469 current_thread_slot_.Set(thread); 474 current_thread_slot_.Set(thread);
470 } 475 }
471 476
472 BlinkPlatformImpl::~BlinkPlatformImpl() { 477 BlinkPlatformImpl::~BlinkPlatformImpl() {
478 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
479 web_cache::WebCacheMemoryDumpProvider::GetInstance());
473 } 480 }
474 481
475 WebURLLoader* BlinkPlatformImpl::createURLLoader() { 482 WebURLLoader* BlinkPlatformImpl::createURLLoader() {
476 ChildThreadImpl* child_thread = ChildThreadImpl::current(); 483 ChildThreadImpl* child_thread = ChildThreadImpl::current();
477 // There may be no child thread in RenderViewTests. These tests can still use 484 // There may be no child thread in RenderViewTests. These tests can still use
478 // data URLs to bypass the ResourceDispatcher. 485 // data URLs to bypass the ResourceDispatcher.
479 return new WebURLLoaderImpl( 486 return new WebURLLoaderImpl(
480 child_thread ? child_thread->resource_dispatcher() : NULL, 487 child_thread ? child_thread->resource_dispatcher() : NULL,
481 MainTaskRunnerForCurrentThread()); 488 MainTaskRunnerForCurrentThread());
482 } 489 }
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 1371 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
1365 static_cast<ui::DomCode>(dom_code))); 1372 static_cast<ui::DomCode>(dom_code)));
1366 } 1373 }
1367 1374
1368 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 1375 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
1369 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 1376 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
1370 code.utf8().data())); 1377 code.utf8().data()));
1371 } 1378 }
1372 1379
1373 } // namespace content 1380 } // namespace content
OLDNEW
« content/child/DEPS ('K') | « content/child/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698