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

Side by Side Diff: extensions/browser/extension_function.cc

Issue 234523002: Record extension function call histograms for synchronous functions too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | extensions/browser/extension_function_dispatcher.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/extension_function.h" 5 #include "extensions/browser/extension_function.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/sparse_histogram.h"
9 #include "content/public/browser/notification_source.h" 8 #include "content/public/browser/notification_source.h"
10 #include "content/public/browser/notification_types.h" 9 #include "content/public/browser/notification_types.h"
11 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
12 #include "content/public/browser/render_view_host.h" 11 #include "content/public/browser/render_view_host.h"
13 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
14 #include "content/public/browser/web_contents_observer.h" 13 #include "content/public/browser/web_contents_observer.h"
15 #include "extensions/browser/extension_function_dispatcher.h" 14 #include "extensions/browser/extension_function_dispatcher.h"
16 #include "extensions/browser/extension_message_filter.h" 15 #include "extensions/browser/extension_message_filter.h"
17 #include "extensions/common/extension_api.h" 16 #include "extensions/common/extension_api.h"
18 #include "extensions/common/extension_messages.h" 17 #include "extensions/common/extension_messages.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 118
120 const std::string ExtensionFunction::GetError() { 119 const std::string ExtensionFunction::GetError() {
121 return error_; 120 return error_;
122 } 121 }
123 122
124 void ExtensionFunction::SetError(const std::string& error) { 123 void ExtensionFunction::SetError(const std::string& error) {
125 error_ = error; 124 error_ = error;
126 } 125 }
127 126
128 void ExtensionFunction::Run() { 127 void ExtensionFunction::Run() {
129 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls", histogram_value());
130
131 if (!RunImpl()) 128 if (!RunImpl())
132 SendResponse(false); 129 SendResponse(false);
133 } 130 }
134 131
135 bool ExtensionFunction::ShouldSkipQuotaLimiting() const { 132 bool ExtensionFunction::ShouldSkipQuotaLimiting() const {
136 return false; 133 return false;
137 } 134 }
138 135
139 bool ExtensionFunction::HasOptionalArgument(size_t index) { 136 bool ExtensionFunction::HasOptionalArgument(size_t index) {
140 base::Value* value; 137 base::Value* value;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 258
262 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { 259 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() {
263 } 260 }
264 261
265 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { 262 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() {
266 } 263 }
267 264
268 void SyncIOThreadExtensionFunction::Run() { 265 void SyncIOThreadExtensionFunction::Run() {
269 SendResponse(RunImpl()); 266 SendResponse(RunImpl());
270 } 267 }
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698