| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/user_script_slave.h" | 5 #include "chrome/renderer/user_script_slave.h" |
| 6 | 6 |
| 7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/perftimer.h" | 9 #include "base/perftimer.h" |
| 10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 inject.append(script_contents_[*script].as_string()); | 105 inject.append(script_contents_[*script].as_string()); |
| 106 inject.append(kUserScriptTail); | 106 inject.append(kUserScriptTail); |
| 107 frame->ExecuteJavaScript(inject, | 107 frame->ExecuteJavaScript(inject, |
| 108 GURL((*script)->url().spec()), | 108 GURL((*script)->url().spec()), |
| 109 -user_script_start_line_); | 109 -user_script_start_line_); |
| 110 ++num_matched; | 110 ++num_matched; |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 if (location == UserScript::DOCUMENT_START) { | 114 if (location == UserScript::DOCUMENT_START) { |
| 115 HISTOGRAM_COUNTS_100(L"UserScripts:DocStart:Count", num_matched); | 115 HISTOGRAM_COUNTS_100("UserScripts:DocStart:Count", num_matched); |
| 116 HISTOGRAM_TIMES(L"UserScripts:DocStart:Time", timer.Elapsed()); | 116 HISTOGRAM_TIMES("UserScripts:DocStart:Time", timer.Elapsed()); |
| 117 } else { | 117 } else { |
| 118 HISTOGRAM_COUNTS_100(L"UserScripts:DocEnd:Count", num_matched); | 118 HISTOGRAM_COUNTS_100("UserScripts:DocEnd:Count", num_matched); |
| 119 HISTOGRAM_TIMES(L"UserScripts:DocEnd:Time", timer.Elapsed()); | 119 HISTOGRAM_TIMES("UserScripts:DocEnd:Time", timer.Elapsed()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 return true; | 122 return true; |
| 123 } | 123 } |
| OLD | NEW |