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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2913423003: Refactor recording of the Startup.FirstWebContents.RenderProcessHostInit.ToNonEmptyPaint metric
Patch Set: Created 3 years, 6 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "base/sys_info.h" 47 #include "base/sys_info.h"
48 #include "base/threading/thread.h" 48 #include "base/threading/thread.h"
49 #include "base/threading/thread_restrictions.h" 49 #include "base/threading/thread_restrictions.h"
50 #include "base/threading/thread_task_runner_handle.h" 50 #include "base/threading/thread_task_runner_handle.h"
51 #include "base/trace_event/trace_event.h" 51 #include "base/trace_event/trace_event.h"
52 #include "base/tracked_objects.h" 52 #include "base/tracked_objects.h"
53 #include "build/build_config.h" 53 #include "build/build_config.h"
54 #include "cc/base/switches.h" 54 #include "cc/base/switches.h"
55 #include "cc/output/buffer_to_texture_target_map.h" 55 #include "cc/output/buffer_to_texture_target_map.h"
56 #include "components/metrics/single_sample_metrics.h" 56 #include "components/metrics/single_sample_metrics.h"
57 #include "components/startup_metric_utils/browser/startup_metric_utils.h"
57 #include "components/tracing/common/tracing_switches.h" 58 #include "components/tracing/common/tracing_switches.h"
58 #include "content/browser/appcache/appcache_dispatcher_host.h" 59 #include "content/browser/appcache/appcache_dispatcher_host.h"
59 #include "content/browser/appcache/chrome_appcache_service.h" 60 #include "content/browser/appcache/chrome_appcache_service.h"
60 #include "content/browser/background_fetch/background_fetch_service_impl.h" 61 #include "content/browser/background_fetch/background_fetch_service_impl.h"
61 #include "content/browser/background_sync/background_sync_service_impl.h" 62 #include "content/browser/background_sync/background_sync_service_impl.h"
62 #include "content/browser/bad_message.h" 63 #include "content/browser/bad_message.h"
63 #include "content/browser/blob_storage/blob_dispatcher_host.h" 64 #include "content/browser/blob_storage/blob_dispatcher_host.h"
64 #include "content/browser/blob_storage/chrome_blob_storage_context.h" 65 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
65 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" 66 #include "content/browser/broadcast_channel/broadcast_channel_provider.h"
66 #include "content/browser/browser_child_process_host_impl.h" 67 #include "content/browser/browser_child_process_host_impl.h"
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 fast_shutdown_started_ = false; 1166 fast_shutdown_started_ = false;
1166 } 1167 }
1167 1168
1168 if (!gpu_observer_registered_) { 1169 if (!gpu_observer_registered_) {
1169 gpu_observer_registered_ = true; 1170 gpu_observer_registered_ = true;
1170 ui::GpuSwitchingManager::GetInstance()->AddObserver(this); 1171 ui::GpuSwitchingManager::GetInstance()->AddObserver(this);
1171 } 1172 }
1172 1173
1173 is_initialized_ = true; 1174 is_initialized_ = true;
1174 init_time_ = base::TimeTicks::Now(); 1175 init_time_ = base::TimeTicks::Now();
1176
1177 static bool is_first_call = true;
1178 if (is_first_call) {
1179 is_first_call = false;
1180 startup_metric_utils::RecordFirstRenderProcessHostInit(init_time_);
1181 }
1182
1175 return true; 1183 return true;
1176 } 1184 }
1177 1185
1178 void RenderProcessHostImpl::EnableSendQueue() { 1186 void RenderProcessHostImpl::EnableSendQueue() {
1179 if (!channel_) 1187 if (!channel_)
1180 InitializeChannelProxy(); 1188 InitializeChannelProxy();
1181 } 1189 }
1182 1190
1183 void RenderProcessHostImpl::InitializeChannelProxy() { 1191 void RenderProcessHostImpl::InitializeChannelProxy() {
1184 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = 1192 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner =
(...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after
3573 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3581 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3574 3582
3575 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3583 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3576 // Capture the error message in a crash key value. 3584 // Capture the error message in a crash key value.
3577 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3585 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3578 bad_message::ReceivedBadMessage(render_process_id, 3586 bad_message::ReceivedBadMessage(render_process_id,
3579 bad_message::RPH_MOJO_PROCESS_ERROR); 3587 bad_message::RPH_MOJO_PROCESS_ERROR);
3580 } 3588 }
3581 3589
3582 } // namespace content 3590 } // namespace content
OLDNEW
« components/startup_metric_utils/browser/startup_metric_utils.cc ('K') | « content/browser/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698