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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2687583002: Add support for single sample metrics. (Closed)
Patch Set: Use thread local storage. Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "cc/base/switches.h" 44 #include "cc/base/switches.h"
45 #include "cc/blink/web_layer_impl.h" 45 #include "cc/blink/web_layer_impl.h"
46 #include "cc/output/buffer_to_texture_target_map.h" 46 #include "cc/output/buffer_to_texture_target_map.h"
47 #include "cc/output/compositor_frame_sink.h" 47 #include "cc/output/compositor_frame_sink.h"
48 #include "cc/output/copy_output_request.h" 48 #include "cc/output/copy_output_request.h"
49 #include "cc/output/vulkan_in_process_context_provider.h" 49 #include "cc/output/vulkan_in_process_context_provider.h"
50 #include "cc/raster/task_graph_runner.h" 50 #include "cc/raster/task_graph_runner.h"
51 #include "cc/trees/layer_tree_host_common.h" 51 #include "cc/trees/layer_tree_host_common.h"
52 #include "cc/trees/layer_tree_settings.h" 52 #include "cc/trees/layer_tree_settings.h"
53 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h" 53 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h"
54 #include "components/metrics/public/interfaces/single_value_histograms.mojom.h"
55 #include "components/metrics/single_value_histograms_factory_impl.h"
54 #include "content/child/appcache/appcache_dispatcher.h" 56 #include "content/child/appcache/appcache_dispatcher.h"
55 #include "content/child/appcache/appcache_frontend_impl.h" 57 #include "content/child/appcache/appcache_frontend_impl.h"
56 #include "content/child/blob_storage/blob_message_filter.h" 58 #include "content/child/blob_storage/blob_message_filter.h"
57 #include "content/child/child_histogram_message_filter.h" 59 #include "content/child/child_histogram_message_filter.h"
58 #include "content/child/child_resource_message_filter.h" 60 #include "content/child/child_resource_message_filter.h"
59 #include "content/child/content_child_helpers.h" 61 #include "content/child/content_child_helpers.h"
60 #include "content/child/db_message_filter.h" 62 #include "content/child/db_message_filter.h"
61 #include "content/child/indexed_db/indexed_db_dispatcher.h" 63 #include "content/child/indexed_db/indexed_db_dispatcher.h"
62 #include "content/child/memory/child_memory_coordinator_impl.h" 64 #include "content/child/memory/child_memory_coordinator_impl.h"
63 #include "content/child/resource_dispatcher.h" 65 #include "content/child/resource_dispatcher.h"
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 606 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
605 // On Mac and Android Java UI, the select popups are rendered by the browser. 607 // On Mac and Android Java UI, the select popups are rendered by the browser.
606 blink::WebView::SetUseExternalPopupMenus(true); 608 blink::WebView::SetUseExternalPopupMenus(true);
607 #endif 609 #endif
608 610
609 lazy_tls.Pointer()->Set(this); 611 lazy_tls.Pointer()->Set(this);
610 612
611 // Register this object as the main thread. 613 // Register this object as the main thread.
612 ChildProcess::current()->set_main_thread(this); 614 ChildProcess::current()->set_main_thread(this);
613 615
616 // In single process mode we may already have a factory set.
617 if (!base::SingleValueHistogramsFactory::Get()) {
618 base::SingleValueHistogramsFactory::SetFactory(
619 new metrics::SingleValueHistogramsFactoryImpl(
620 GetConnector(), base::ThreadTaskRunnerHandle::Get()));
621 }
622
614 gpu_ = ui::Gpu::Create( 623 gpu_ = ui::Gpu::Create(
615 GetConnector(), 624 GetConnector(),
616 IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName, 625 IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName,
617 GetIOTaskRunner()); 626 GetIOTaskRunner());
618 627
619 cc::mojom::SharedBitmapManagerAssociatedPtr shared_bitmap_manager_ptr; 628 cc::mojom::SharedBitmapManagerAssociatedPtr shared_bitmap_manager_ptr;
620 render_message_filter()->GetSharedBitmapManager( 629 render_message_filter()->GetSharedBitmapManager(
621 mojo::MakeRequest(&shared_bitmap_manager_ptr)); 630 mojo::MakeRequest(&shared_bitmap_manager_ptr));
622 shared_bitmap_manager_.reset(new ui::ChildSharedBitmapManager( 631 shared_bitmap_manager_.reset(new ui::ChildSharedBitmapManager(
623 cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr::Create( 632 cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr::Create(
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2452 } 2461 }
2453 } 2462 }
2454 2463
2455 void RenderThreadImpl::OnRendererInterfaceRequest( 2464 void RenderThreadImpl::OnRendererInterfaceRequest(
2456 mojom::RendererAssociatedRequest request) { 2465 mojom::RendererAssociatedRequest request) {
2457 DCHECK(!renderer_binding_.is_bound()); 2466 DCHECK(!renderer_binding_.is_bound());
2458 renderer_binding_.Bind(std::move(request)); 2467 renderer_binding_.Bind(std::move(request));
2459 } 2468 }
2460 2469
2461 } // namespace content 2470 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698