| OLD | NEW |
| 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 "extensions/renderer/scripts_run_info.h" | 5 #include "extensions/renderer/scripts_run_info.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "content/public/renderer/render_view.h" | 8 #include "content/public/renderer/render_view.h" |
| 9 #include "extensions/common/extension_messages.h" | 9 #include "extensions/common/extension_messages.h" |
| 10 #include "extensions/renderer/script_context.h" | 10 #include "extensions/renderer/script_context.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectEnd_ScriptCount", num_js); | 41 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectEnd_ScriptCount", num_js); |
| 42 if (num_js) | 42 if (num_js) |
| 43 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed()); | 43 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed()); |
| 44 break; | 44 break; |
| 45 case UserScript::DOCUMENT_IDLE: | 45 case UserScript::DOCUMENT_IDLE: |
| 46 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_js); | 46 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_js); |
| 47 if (num_js) | 47 if (num_js) |
| 48 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); | 48 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); |
| 49 break; | 49 break; |
| 50 case UserScript::RUN_DEFERRED: | 50 case UserScript::RUN_DEFERRED: |
| 51 case UserScript::BROWSER_DRIVEN: |
| 51 // TODO(rdevlin.cronin): Add histograms. | 52 // TODO(rdevlin.cronin): Add histograms. |
| 52 break; | 53 break; |
| 53 case UserScript::UNDEFINED: | 54 case UserScript::UNDEFINED: |
| 54 case UserScript::RUN_LOCATION_LAST: | 55 case UserScript::RUN_LOCATION_LAST: |
| 55 NOTREACHED(); | 56 NOTREACHED(); |
| 56 } | 57 } |
| 57 } | 58 } |
| 58 | 59 |
| 59 } // namespace extensions | 60 } // namespace extensions |
| OLD | NEW |