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

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

Issue 1683583002: Report user actions when gesture starts and stops in user_model. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not register action callback in single process. Created 4 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
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 728
729 InitSkiaEventTracer(); 729 InitSkiaEventTracer();
730 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 730 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
731 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); 731 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr);
732 732
733 const base::CommandLine& command_line = 733 const base::CommandLine& command_line =
734 *base::CommandLine::ForCurrentProcess(); 734 *base::CommandLine::ForCurrentProcess();
735 735
736 cc::SetClientNameForMetrics("Renderer"); 736 cc::SetClientNameForMetrics("Renderer");
737 737
738 if (!command_line.HasSwitch(switches::kSingleProcess)) {
739 action_callback_ = base::Bind(&RenderThreadImpl::RecordComputedAction,
740 base::Unretained(this));
741 base::AddActionCallback(action_callback_);
742 }
743
738 is_threaded_animation_enabled_ = 744 is_threaded_animation_enabled_ =
739 !command_line.HasSwitch(cc::switches::kDisableThreadedAnimation); 745 !command_line.HasSwitch(cc::switches::kDisableThreadedAnimation);
740 746
741 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy); 747 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy);
742 is_partial_raster_enabled_ = 748 is_partial_raster_enabled_ =
743 !command_line.HasSwitch(switches::kDisablePartialRaster); 749 !command_line.HasSwitch(switches::kDisablePartialRaster);
744 is_gpu_memory_buffer_compositor_resources_enabled_ = command_line.HasSwitch( 750 is_gpu_memory_buffer_compositor_resources_enabled_ = command_line.HasSwitch(
745 switches::kEnableGpuMemoryBufferCompositorResources); 751 switches::kEnableGpuMemoryBufferCompositorResources);
746 752
747 #if defined(OS_MACOSX) 753 #if defined(OS_MACOSX)
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 mojo::GetProxy(&storage_partition_service_)); 855 mojo::GetProxy(&storage_partition_service_));
850 } 856 }
851 857
852 RenderThreadImpl::~RenderThreadImpl() { 858 RenderThreadImpl::~RenderThreadImpl() {
853 } 859 }
854 860
855 void RenderThreadImpl::Shutdown() { 861 void RenderThreadImpl::Shutdown() {
856 FOR_EACH_OBSERVER( 862 FOR_EACH_OBSERVER(
857 RenderProcessObserver, observers_, OnRenderProcessShutdown()); 863 RenderProcessObserver, observers_, OnRenderProcessShutdown());
858 864
865 if (!action_callback_.is_null())
866 base::RemoveActionCallback(action_callback_);
867
859 if (memory_observer_) { 868 if (memory_observer_) {
860 message_loop()->RemoveTaskObserver(memory_observer_.get()); 869 message_loop()->RemoveTaskObserver(memory_observer_.get());
861 memory_observer_.reset(); 870 memory_observer_.reset();
862 } 871 }
863 872
864 // Wait for all databases to be closed. 873 // Wait for all databases to be closed.
865 if (blink_platform_impl_) { 874 if (blink_platform_impl_) {
866 // Crash the process if they fail to close after a generous amount of time. 875 // Crash the process if they fail to close after a generous amount of time.
867 bool all_closed = blink_platform_impl_->web_database_observer_impl() 876 bool all_closed = blink_platform_impl_->web_database_observer_impl()
868 ->WaitForAllDatabasesToClose(base::TimeDelta::FromSeconds(60)); 877 ->WaitForAllDatabasesToClose(base::TimeDelta::FromSeconds(60));
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 } 2183 }
2175 2184
2176 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { 2185 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() {
2177 size_t erased = 2186 size_t erased =
2178 RenderThreadImpl::current()->pending_render_frame_connects_.erase( 2187 RenderThreadImpl::current()->pending_render_frame_connects_.erase(
2179 routing_id_); 2188 routing_id_);
2180 DCHECK_EQ(1u, erased); 2189 DCHECK_EQ(1u, erased);
2181 } 2190 }
2182 2191
2183 } // namespace content 2192 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698