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

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

Issue 2771233002: Remove the wrapper functions content::RecordAction et al (Closed)
Patch Set: Rebased Created 3 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/memory/singleton.h" 12 #include "base/memory/singleton.h"
13 #include "base/metrics/histogram_macros.h" 13 #include "base/metrics/histogram_macros.h"
14 #include "base/metrics/sparse_histogram.h" 14 #include "base/metrics/sparse_histogram.h"
15 #include "base/metrics/user_metrics.h"
15 #include "base/synchronization/lock.h" 16 #include "base/synchronization/lock.h"
16 #include "content/public/browser/notification_source.h" 17 #include "content/public/browser/notification_source.h"
17 #include "content/public/browser/notification_types.h" 18 #include "content/public/browser/notification_types.h"
18 #include "content/public/browser/render_frame_host.h" 19 #include "content/public/browser/render_frame_host.h"
19 #include "content/public/browser/user_metrics.h"
20 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
21 #include "content/public/browser/web_contents_observer.h" 21 #include "content/public/browser/web_contents_observer.h"
22 #include "extensions/browser/bad_message.h" 22 #include "extensions/browser/bad_message.h"
23 #include "extensions/browser/extension_function_dispatcher.h" 23 #include "extensions/browser/extension_function_dispatcher.h"
24 #include "extensions/browser/extension_message_filter.h" 24 #include "extensions/browser/extension_message_filter.h"
25 #include "extensions/browser/extensions_browser_client.h" 25 #include "extensions/browser/extensions_browser_client.h"
26 #include "extensions/browser/io_thread_extension_message_filter.h" 26 #include "extensions/browser/io_thread_extension_message_filter.h"
27 #include "extensions/common/error_utils.h" 27 #include "extensions/common/error_utils.h"
28 #include "extensions/common/extension_api.h" 28 #include "extensions/common/extension_api.h"
29 #include "extensions/common/extension_messages.h" 29 #include "extensions/common/extension_messages.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } else { 73 } else {
74 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.Functions.FailedTime.Over10ms", 74 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.Functions.FailedTime.Over10ms",
75 histogram_value); 75 histogram_value);
76 } 76 }
77 UMA_HISTOGRAM_TIMES("Extensions.Functions.FailedTotalExecutionTime", 77 UMA_HISTOGRAM_TIMES("Extensions.Functions.FailedTotalExecutionTime",
78 elapsed_time); 78 elapsed_time);
79 } 79 }
80 } 80 }
81 81
82 void LogBadMessage(extensions::functions::HistogramValue histogram_value) { 82 void LogBadMessage(extensions::functions::HistogramValue histogram_value) {
83 content::RecordAction(base::UserMetricsAction("BadMessageTerminate_EFD")); 83 base::RecordAction(base::UserMetricsAction("BadMessageTerminate_EFD"));
84 // Track the specific function's |histogram_value|, as this may indicate a 84 // Track the specific function's |histogram_value|, as this may indicate a
85 // bug in that API's implementation. 85 // bug in that API's implementation.
86 UMA_HISTOGRAM_ENUMERATION("Extensions.BadMessageFunctionName", 86 UMA_HISTOGRAM_ENUMERATION("Extensions.BadMessageFunctionName",
87 histogram_value, 87 histogram_value,
88 extensions::functions::ENUM_BOUNDARY); 88 extensions::functions::ENUM_BOUNDARY);
89 } 89 }
90 90
91 template <class T> 91 template <class T>
92 void ReceivedBadMessage(T* bad_message_sender, 92 void ReceivedBadMessage(T* bad_message_sender,
93 extensions::bad_message::BadMessageReason reason, 93 extensions::bad_message::BadMessageReason reason,
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 void AsyncExtensionFunction::SendResponse(bool success) { 678 void AsyncExtensionFunction::SendResponse(bool success) {
679 ResponseValue response; 679 ResponseValue response;
680 if (success) { 680 if (success) {
681 response = ArgumentList(std::move(results_)); 681 response = ArgumentList(std::move(results_));
682 } else { 682 } else {
683 response = results_ ? ErrorWithArguments(std::move(results_), error_) 683 response = results_ ? ErrorWithArguments(std::move(results_), error_)
684 : Error(error_); 684 : Error(error_);
685 } 685 }
686 Respond(std::move(response)); 686 Respond(std::move(response));
687 } 687 }
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/web_request_api.cc ('k') | extensions/browser/guest_view/web_view/web_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698