summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/appcache/appcache_dispatcher_host.cc2
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc35
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest_manager.cc6
-rw-r--r--content/browser/dom_storage/dom_storage_message_filter.cc4
-rw-r--r--content/browser/fileapi/fileapi_message_filter.cc6
-rw-r--r--content/browser/frame_host/navigation_controller_impl.cc2
-rw-r--r--content/browser/frame_host/render_frame_host_impl.cc2
-rw-r--r--content/browser/frame_host/render_frame_host_manager.cc3
-rw-r--r--content/browser/indexed_db/indexed_db_dispatcher_host.cc4
-rw-r--r--content/browser/loader/resource_dispatcher_host_impl.cc4
-rw-r--r--content/browser/renderer_host/database_message_filter.cc8
-rw-r--r--content/browser/renderer_host/media/midi_host.cc2
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc11
-rw-r--r--content/browser/renderer_host/render_view_host_impl.cc9
-rw-r--r--content/browser/renderer_host/render_widget_host_impl.cc30
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc8
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.mm2
-rw-r--r--content/browser/renderer_host/software_frame_manager.cc6
-rw-r--r--content/browser/user_metrics.cc47
-rw-r--r--content/browser/web_contents/web_contents_impl.cc12
-rw-r--r--content/browser/worker_host/worker_process_host.cc4
-rw-r--r--content/content_common.gypi1
-rw-r--r--content/public/browser/browser_message_filter.cc3
-rw-r--r--content/public/browser/user_metrics.h45
-rw-r--r--content/public/common/user_metrics_action.h29
-rw-r--r--content/public/renderer/render_thread.h14
-rw-r--r--content/public/test/mock_render_thread.cc2
-rw-r--r--content/public/test/mock_render_thread.h2
-rw-r--r--content/renderer/npapi/webplugin_impl.cc3
-rw-r--r--content/renderer/render_thread_impl.cc2
-rw-r--r--content/renderer/render_thread_impl.h3
31 files changed, 118 insertions, 193 deletions
diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc
index 25e33cf..2ce0d83 100644
--- a/content/browser/appcache/appcache_dispatcher_host.cc
+++ b/content/browser/appcache/appcache_dispatcher_host.cc
@@ -63,7 +63,7 @@ bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& message,
AppCacheDispatcherHost::~AppCacheDispatcherHost() {}
void AppCacheDispatcherHost::BadMessageReceived() {
- RecordAction(UserMetricsAction("BadMessageTerminate_ACDH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_ACDH"));
BrowserMessageFilter::BadMessageReceived();
}
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 716c2b7..03f7b18 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -69,7 +69,8 @@ class BrowserPluginGuest::PermissionRequest :
}
protected:
PermissionRequest() {
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.PermissionRequest"));
+ RecordAction(
+ base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest"));
}
virtual ~PermissionRequest() {}
// Friend RefCounted so that the dtor can be non-public.
@@ -81,7 +82,7 @@ class BrowserPluginGuest::DownloadRequest : public PermissionRequest {
explicit DownloadRequest(base::Callback<void(bool)> callback)
: callback_(callback) {
RecordAction(
- UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Download"));
+ base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Download"));
}
virtual void Respond(bool should_allow,
const std::string& user_input) OVERRIDE {
@@ -102,7 +103,7 @@ class BrowserPluginGuest::GeolocationRequest : public PermissionRequest {
bridge_id_(bridge_id),
weak_ptr_factory_(weak_ptr_factory) {
RecordAction(
- UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Geolocation"));
+ base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Geolocation"));
}
virtual void Respond(bool should_allow,
@@ -156,7 +157,7 @@ class BrowserPluginGuest::MediaRequest : public PermissionRequest {
callback_(callback),
guest_(guest) {
RecordAction(
- UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Media"));
+ base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Media"));
}
virtual void Respond(bool should_allow,
@@ -185,7 +186,7 @@ class BrowserPluginGuest::NewWindowRequest : public PermissionRequest {
: instance_id_(instance_id),
guest_(guest) {
RecordAction(
- UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.NewWindow"));
+ base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.NewWindow"));
}
virtual void Respond(bool should_allow,
@@ -216,7 +217,7 @@ class BrowserPluginGuest::JavaScriptDialogRequest : public PermissionRequest {
JavaScriptDialogRequest(const DialogClosedCallback& callback)
: callback_(callback) {
RecordAction(
- UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.JSDialog"));
+ base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.JSDialog"));
}
virtual void Respond(bool should_allow,
@@ -234,7 +235,7 @@ class BrowserPluginGuest::PointerLockRequest : public PermissionRequest {
PointerLockRequest(BrowserPluginGuest* guest)
: guest_(guest) {
RecordAction(
- UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.PointerLock"));
+ base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.PointerLock"));
}
virtual void Respond(bool should_allow,
@@ -653,7 +654,7 @@ BrowserPluginGuest* BrowserPluginGuest::Create(
SiteInstance* guest_site_instance,
WebContentsImpl* web_contents,
scoped_ptr<base::DictionaryValue> extra_params) {
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.Create"));
+ RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Create"));
BrowserPluginGuest* guest = NULL;
if (factory_) {
guest = factory_->CreateBrowserPluginGuest(instance_id, web_contents);
@@ -839,14 +840,14 @@ void BrowserPluginGuest::WebContentsCreated(WebContents* source_contents,
}
void BrowserPluginGuest::RendererUnresponsive(WebContents* source) {
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.Hung"));
+ RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Hung"));
if (!delegate_)
return;
delegate_->RendererUnresponsive();
}
void BrowserPluginGuest::RendererResponsive(WebContents* source) {
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.Responsive"));
+ RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Responsive"));
if (!delegate_)
return;
delegate_->RendererResponsive();
@@ -1065,7 +1066,7 @@ void BrowserPluginGuest::DidCommitProvisionalLoadForFrame(
const GURL& url,
PageTransition transition_type,
RenderViewHost* render_view_host) {
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate"));
+ RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate"));
}
void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) {
@@ -1106,13 +1107,14 @@ void BrowserPluginGuest::RenderProcessGone(base::TerminationStatus status) {
SendMessageToEmbedder(new BrowserPluginMsg_GuestGone(instance_id()));
switch (status) {
case base::TERMINATION_STATUS_PROCESS_WAS_KILLED:
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.Killed"));
+ RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Killed"));
break;
case base::TERMINATION_STATUS_PROCESS_CRASHED:
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.Crashed"));
+ RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Crashed"));
break;
case base::TERMINATION_STATUS_ABNORMAL_TERMINATION:
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.AbnormalDeath"));
+ RecordAction(
+ base::UserMetricsAction("BrowserPlugin.Guest.AbnormalDeath"));
break;
default:
break;
@@ -1253,7 +1255,7 @@ void BrowserPluginGuest::Attach(
SendQueuedMessages();
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.Attached"));
+ RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached"));
}
void BrowserPluginGuest::OnCompositorFrameSwappedACK(
@@ -1527,7 +1529,8 @@ void BrowserPluginGuest::OnSetSize(
if (auto_size_enabled_ && (!old_auto_size_enabled ||
(old_max_size != max_auto_size_) ||
(old_min_size != min_auto_size_))) {
- RecordAction(UserMetricsAction("BrowserPlugin.Guest.EnableAutoResize"));
+ RecordAction(
+ base::UserMetricsAction("BrowserPlugin.Guest.EnableAutoResize"));
GetWebContents()->GetRenderViewHost()->EnableAutoResize(
min_auto_size_, max_auto_size_);
// TODO(fsamuel): If we're changing autosize parameters, then we force
diff --git a/content/browser/browser_plugin/browser_plugin_guest_manager.cc b/content/browser/browser_plugin/browser_plugin_guest_manager.cc
index 2b4935c..405a233 100644
--- a/content/browser/browser_plugin/browser_plugin_guest_manager.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest_manager.cc
@@ -49,7 +49,8 @@ BrowserPluginGuest* BrowserPluginGuestManager::CreateGuest(
// creation. If the validation fails, treat it as a bad message and kill the
// renderer process.
if (!IsStringUTF8(params.storage_partition_id)) {
- content::RecordAction(UserMetricsAction("BadMessageTerminate_BPGM"));
+ content::RecordAction(
+ base::UserMetricsAction("BadMessageTerminate_BPGM"));
base::KillProcess(
embedder_process_host->GetHandle(),
content::RESULT_CODE_KILLED_BAD_MESSAGE, false);
@@ -129,7 +130,8 @@ bool BrowserPluginGuestManager::CanEmbedderAccessInstanceIDMaybeKill(
int instance_id) const {
if (!CanEmbedderAccessInstanceID(embedder_render_process_id, instance_id)) {
// The embedder process is trying to access a guest it does not own.
- content::RecordAction(UserMetricsAction("BadMessageTerminate_BPGM"));
+ content::RecordAction(
+ base::UserMetricsAction("BadMessageTerminate_BPGM"));
base::KillProcess(
RenderProcessHost::FromID(embedder_render_process_id)->GetHandle(),
content::RESULT_CODE_KILLED_BAD_MESSAGE, false);
diff --git a/content/browser/dom_storage/dom_storage_message_filter.cc b/content/browser/dom_storage/dom_storage_message_filter.cc
index fbc3880..204aa8c 100644
--- a/content/browser/dom_storage/dom_storage_message_filter.cc
+++ b/content/browser/dom_storage/dom_storage_message_filter.cc
@@ -94,7 +94,7 @@ void DOMStorageMessageFilter::OnOpenStorageArea(int connection_id,
const GURL& origin) {
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!host_->OpenStorageArea(connection_id, namespace_id, origin)) {
- RecordAction(UserMetricsAction("BadMessageTerminate_DSMF_1"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_DSMF_1"));
BadMessageReceived();
}
}
@@ -109,7 +109,7 @@ void DOMStorageMessageFilter::OnLoadStorageArea(int connection_id,
bool* send_log_get_messages) {
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!host_->ExtractAreaValues(connection_id, map, send_log_get_messages)) {
- RecordAction(UserMetricsAction("BadMessageTerminate_DSMF_2"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_DSMF_2"));
BadMessageReceived();
}
Send(new DOMStorageMsg_AsyncOperationComplete(true));
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
index b6b89fb..6d015b8 100644
--- a/content/browser/fileapi/fileapi_message_filter.cc
+++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -192,7 +192,7 @@ bool FileAPIMessageFilter::OnMessageReceived(
FileAPIMessageFilter::~FileAPIMessageFilter() {}
void FileAPIMessageFilter::BadMessageReceived() {
- RecordAction(UserMetricsAction("BadMessageTerminate_FAMF"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_FAMF"));
BrowserMessageFilter::BadMessageReceived();
}
@@ -201,9 +201,9 @@ void FileAPIMessageFilter::OnOpenFileSystem(int request_id,
fileapi::FileSystemType type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (type == fileapi::kFileSystemTypeTemporary) {
- RecordAction(UserMetricsAction("OpenFileSystemTemporary"));
+ RecordAction(base::UserMetricsAction("OpenFileSystemTemporary"));
} else if (type == fileapi::kFileSystemTypePersistent) {
- RecordAction(UserMetricsAction("OpenFileSystemPersistent"));
+ RecordAction(base::UserMetricsAction("OpenFileSystemPersistent"));
}
fileapi::OpenFileSystemMode mode =
fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT;
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 5b08aa1a..0526f69 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -902,7 +902,7 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
// Because the unknown entry has committed, we risk showing the wrong URL in
// release builds. Instead, we'll kill the renderer process to be safe.
LOG(ERROR) << "terminating renderer for bad navigation: " << params.url;
- RecordAction(UserMetricsAction("BadMessageTerminate_NC"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_NC"));
// Temporary code so we can get more information. Format:
// http://url/foo.html#page1#max3#frame1#ids:2_Nx,1_1x,3_2
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 6c81e0d..a41c051 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -125,7 +125,7 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
if (!msg_is_ok) {
// The message had a handler, but its de-serialization failed.
// Kill the renderer.
- RecordAction(UserMetricsAction("BadMessageTerminate_RFH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RFH"));
GetProcess()->ReceivedBadMessage();
}
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 136908b..3452682 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -150,7 +150,8 @@ void RenderFrameHostManager::SetPendingWebUI(const NavigationEntryImpl& entry) {
if (pending_web_ui_.get() &&
entry.bindings() != NavigationEntryImpl::kInvalidBindings &&
pending_web_ui_->GetBindings() != entry.bindings()) {
- RecordAction(UserMetricsAction("ProcessSwapBindingsMismatch_RVHM"));
+ RecordAction(
+ base::UserMetricsAction("ProcessSwapBindingsMismatch_RVHM"));
pending_web_ui_.reset();
}
}
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index 37ab771..969e359 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -305,7 +305,7 @@ ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess(
if (!return_object) {
NOTREACHED() << "Uh oh, couldn't find object with id "
<< ipc_return_object_id;
- RecordAction(UserMetricsAction("BadMessageTerminate_IDBMF"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_IDBMF"));
BadMessageReceived();
}
return return_object;
@@ -320,7 +320,7 @@ ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess(
if (!return_object) {
NOTREACHED() << "Uh oh, couldn't find object with id "
<< ipc_return_object_id;
- RecordAction(UserMetricsAction("BadMessageTerminate_IDBMF"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_IDBMF"));
BadMessageReceived();
}
return return_object;
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 4fa3fb9..d80710c 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -958,7 +958,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
// Reject invalid priority.
if (request_data.priority < net::MINIMUM_PRIORITY ||
request_data.priority > net::MAXIMUM_PRIORITY) {
- RecordAction(UserMetricsAction("BadMessageTerminate_RDH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RDH"));
filter_->BadMessageReceived();
return;
}
@@ -986,7 +986,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
deferred_loader->CompleteTransfer();
} else {
- RecordAction(UserMetricsAction("BadMessageTerminate_RDH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RDH"));
filter_->BadMessageReceived();
}
return;
diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc
index 720cf20..4cb73a4 100644
--- a/content/browser/renderer_host/database_message_filter.cc
+++ b/content/browser/renderer_host/database_message_filter.cc
@@ -287,7 +287,7 @@ void DatabaseMessageFilter::OnDatabaseOpened(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!DatabaseUtil::IsValidOriginIdentifier(origin_identifier)) {
- RecordAction(UserMetricsAction("BadMessageTerminate_DBMF"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF"));
BadMessageReceived();
return;
}
@@ -306,7 +306,7 @@ void DatabaseMessageFilter::OnDatabaseModified(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!database_connections_.IsDatabaseOpened(
origin_identifier, database_name)) {
- RecordAction(UserMetricsAction("BadMessageTerminate_DBMF"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF"));
BadMessageReceived();
return;
}
@@ -320,7 +320,7 @@ void DatabaseMessageFilter::OnDatabaseClosed(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!database_connections_.IsDatabaseOpened(
origin_identifier, database_name)) {
- RecordAction(UserMetricsAction("BadMessageTerminate_DBMF"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF"));
BadMessageReceived();
return;
}
@@ -335,7 +335,7 @@ void DatabaseMessageFilter::OnHandleSqliteError(
int error) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!DatabaseUtil::IsValidOriginIdentifier(origin_identifier)) {
- RecordAction(UserMetricsAction("BadMessageTerminate_DBMF"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF"));
BadMessageReceived();
return;
}
diff --git a/content/browser/renderer_host/media/midi_host.cc b/content/browser/renderer_host/media/midi_host.cc
index d6781f6..2eb5ec6 100644
--- a/content/browser/renderer_host/media/midi_host.cc
+++ b/content/browser/renderer_host/media/midi_host.cc
@@ -120,7 +120,7 @@ void MIDIHost::OnSendData(uint32 port,
// happens here in the browser process.
if (!has_sys_ex_permission_ &&
(std::find(data.begin(), data.end(), kSysExMessage) != data.end())) {
- RecordAction(UserMetricsAction("BadMessageTerminate_MIDI"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_MIDI"));
BadMessageReceived();
return;
}
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index d795a6e..072998b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1368,7 +1368,7 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
// The message had a handler, but its de-serialization failed.
// We consider this a capital crime. Kill the renderer if we have one.
LOG(ERROR) << "bad message " << msg.type() << " terminating renderer.";
- RecordAction(UserMetricsAction("BadMessageTerminate_BRPH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_BRPH"));
ReceivedBadMessage();
}
return true;
@@ -1591,7 +1591,7 @@ void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph,
// navigation to the home page. This is often a privileged page
// (chrome://newtab/) which is exactly what we don't want.
*url = GURL(kAboutBlankURL);
- RecordAction(UserMetricsAction("FilterURLTermiate_Invalid"));
+ RecordAction(base::UserMetricsAction("FilterURLTermiate_Invalid"));
return;
}
@@ -1599,7 +1599,7 @@ void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph,
// The renderer treats all URLs in the about: scheme as being about:blank.
// Canonicalize about: URLs to about:blank.
*url = GURL(kAboutBlankURL);
- RecordAction(UserMetricsAction("FilterURLTermiate_About"));
+ RecordAction(base::UserMetricsAction("FilterURLTermiate_About"));
}
// Do not allow browser plugin guests to navigate to non-web URLs, since they
@@ -1613,7 +1613,7 @@ void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph,
// later.
VLOG(1) << "Blocked URL " << url->spec();
*url = GURL(kAboutBlankURL);
- RecordAction(UserMetricsAction("FilterURLTermiate_Blocked"));
+ RecordAction(base::UserMetricsAction("FilterURLTermiate_Blocked"));
}
}
@@ -1789,7 +1789,8 @@ RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite(
if (host && !IsSuitableHost(host, browser_context, url)) {
// The registered process does not have an appropriate set of bindings for
// the url. Remove it from the map so we can register a better one.
- RecordAction(UserMetricsAction("BindingsMismatch_GetProcessHostPerSite"));
+ RecordAction(
+ base::UserMetricsAction("BindingsMismatch_GetProcessHostPerSite"));
map->RemoveProcess(host);
host = NULL;
}
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 89fce50..650972a 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -1103,7 +1103,8 @@ void RenderViewHostImpl::SetWebUIProperty(const std::string& name,
if (enabled_bindings_ & BINDINGS_POLICY_WEB_UI) {
Send(new ViewMsg_SetWebUIProperty(GetRoutingID(), name, value));
} else {
- RecordAction(UserMetricsAction("BindingsMismatchTerminate_RVH_WebUI"));
+ RecordAction(
+ base::UserMetricsAction("BindingsMismatchTerminate_RVH_WebUI"));
base::KillProcess(
GetProcess()->GetHandle(), content::RESULT_CODE_KILLED, false);
}
@@ -1290,7 +1291,7 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
if (!msg_is_ok) {
// The message had a handler, but its de-serialization failed.
// Kill the renderer.
- RecordAction(UserMetricsAction("BadMessageTerminate_RVH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RVH"));
GetProcess()->ReceivedBadMessage();
}
@@ -1377,7 +1378,7 @@ void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) {
run_modal_reply_msg_ = reply_msg;
run_modal_opener_id_ = opener_id;
- RecordAction(UserMetricsAction("ShowModalDialog"));
+ RecordAction(base::UserMetricsAction("ShowModalDialog"));
RenderViewHostImpl* opener =
RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_);
@@ -1486,7 +1487,7 @@ void RenderViewHostImpl::OnNavigate(const IPC::Message& msg) {
if (!CanCommitURL(validated_params.url)) {
VLOG(1) << "Blocked URL " << validated_params.url.spec();
validated_params.url = GURL(kAboutBlankURL);
- RecordAction(UserMetricsAction("CanCommitURL_BlockedAndKilled"));
+ RecordAction(base::UserMetricsAction("CanCommitURL_BlockedAndKilled"));
// Kills the process.
process->ReceivedBadMessage();
}
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index a5894b2..93d865b 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -512,7 +512,7 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
if (!msg_is_ok) {
// The message de-serialization failed. Kill the renderer process.
- RecordAction(UserMetricsAction("BadMessageTerminate_RWH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH"));
GetProcess()->ReceivedBadMessage();
}
return handled;
@@ -1581,7 +1581,7 @@ void RenderWidgetHostImpl::OnUpdateRect(
const size_t size = pixel_size.height() * pixel_size.width() * 4;
if (dib->size() < size) {
DLOG(WARNING) << "Transport DIB too small for given rectangle";
- RecordAction(UserMetricsAction("BadMessageTerminate_RWH1"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH1"));
GetProcess()->ReceivedBadMessage();
} else {
// Scroll the backing store.
@@ -1712,13 +1712,13 @@ void RenderWidgetHostImpl::OnQueueSyntheticGesture(
void RenderWidgetHostImpl::OnFocus() {
// Only RenderViewHost can deal with that message.
- RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH4"));
GetProcess()->ReceivedBadMessage();
}
void RenderWidgetHostImpl::OnBlur() {
// Only RenderViewHost can deal with that message.
- RecordAction(UserMetricsAction("BadMessageTerminate_RWH5"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH5"));
GetProcess()->ReceivedBadMessage();
}
@@ -2062,7 +2062,7 @@ void RenderWidgetHostImpl::OnTouchEventAck(
void RenderWidgetHostImpl::OnUnexpectedEventAck(UnexpectedEventAckType type) {
if (type == BAD_ACK_MESSAGE) {
- RecordAction(UserMetricsAction("BadMessageTerminate_RWH2"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH2"));
process_->ReceivedBadMessage();
} else if (type == UNEXPECTED_EVENT_TYPE) {
suppress_next_char_events_ = false;
@@ -2167,55 +2167,55 @@ void RenderWidgetHostImpl::MoveCaret(const gfx::Point& point) {
void RenderWidgetHostImpl::Undo() {
Send(new InputMsg_Undo(GetRoutingID()));
- RecordAction(UserMetricsAction("Undo"));
+ RecordAction(base::UserMetricsAction("Undo"));
}
void RenderWidgetHostImpl::Redo() {
Send(new InputMsg_Redo(GetRoutingID()));
- RecordAction(UserMetricsAction("Redo"));
+ RecordAction(base::UserMetricsAction("Redo"));
}
void RenderWidgetHostImpl::Cut() {
Send(new InputMsg_Cut(GetRoutingID()));
- RecordAction(UserMetricsAction("Cut"));
+ RecordAction(base::UserMetricsAction("Cut"));
}
void RenderWidgetHostImpl::Copy() {
Send(new InputMsg_Copy(GetRoutingID()));
- RecordAction(UserMetricsAction("Copy"));
+ RecordAction(base::UserMetricsAction("Copy"));
}
void RenderWidgetHostImpl::CopyToFindPboard() {
#if defined(OS_MACOSX)
// Windows/Linux don't have the concept of a find pasteboard.
Send(new InputMsg_CopyToFindPboard(GetRoutingID()));
- RecordAction(UserMetricsAction("CopyToFindPboard"));
+ RecordAction(base::UserMetricsAction("CopyToFindPboard"));
#endif
}
void RenderWidgetHostImpl::Paste() {
Send(new InputMsg_Paste(GetRoutingID()));
- RecordAction(UserMetricsAction("Paste"));
+ RecordAction(base::UserMetricsAction("Paste"));
}
void RenderWidgetHostImpl::PasteAndMatchStyle() {
Send(new InputMsg_PasteAndMatchStyle(GetRoutingID()));
- RecordAction(UserMetricsAction("PasteAndMatchStyle"));
+ RecordAction(base::UserMetricsAction("PasteAndMatchStyle"));
}
void RenderWidgetHostImpl::Delete() {
Send(new InputMsg_Delete(GetRoutingID()));
- RecordAction(UserMetricsAction("DeleteSelection"));
+ RecordAction(base::UserMetricsAction("DeleteSelection"));
}
void RenderWidgetHostImpl::SelectAll() {
Send(new InputMsg_SelectAll(GetRoutingID()));
- RecordAction(UserMetricsAction("SelectAll"));
+ RecordAction(base::UserMetricsAction("SelectAll"));
}
void RenderWidgetHostImpl::Unselect() {
Send(new InputMsg_Unselect(GetRoutingID()));
- RecordAction(UserMetricsAction("Unselect"));
+ RecordAction(base::UserMetricsAction("Unselect"));
}
bool RenderWidgetHostImpl::GotResponseToLockMouseRequest(bool allowed) {
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index a584cf6..3e4d6e7 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2912,14 +2912,14 @@ void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) {
blink::WebMouseWheelEvent mouse_wheel_event =
MakeWebMouseWheelEvent(event);
host_->ForwardWheelEvent(mouse_wheel_event);
- RecordAction(UserMetricsAction("TrackpadScroll"));
+ RecordAction(base::UserMetricsAction("TrackpadScroll"));
} else if (event->type() == ui::ET_SCROLL_FLING_START ||
event->type() == ui::ET_SCROLL_FLING_CANCEL) {
blink::WebGestureEvent gesture_event =
MakeWebGestureEvent(event);
host_->ForwardGestureEvent(gesture_event);
if (event->type() == ui::ET_SCROLL_FLING_START)
- RecordAction(UserMetricsAction("TrackpadScrollFling"));
+ RecordAction(base::UserMetricsAction("TrackpadScrollFling"));
}
event->SetHandled();
@@ -2988,9 +2988,9 @@ void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
event->type() == ui::ET_GESTURE_SCROLL_END) {
- RecordAction(UserMetricsAction("TouchscreenScroll"));
+ RecordAction(base::UserMetricsAction("TouchscreenScroll"));
} else if (event->type() == ui::ET_SCROLL_FLING_START) {
- RecordAction(UserMetricsAction("TouchscreenScrollFling"));
+ RecordAction(base::UserMetricsAction("TouchscreenScrollFling"));
}
}
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 43b0086..c1c4e2c 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1673,7 +1673,7 @@ void RenderWidgetHostViewMac::OnSwapCompositorFrame(
if (!frame->software_frame_data) {
DLOG(ERROR) << "Received unexpected frame type.";
RecordAction(
- UserMetricsAction("BadMessageTerminate_UnexpectedFrameType"));
+ base::UserMetricsAction("BadMessageTerminate_UnexpectedFrameType"));
render_widget_host_->GetProcess()->ReceivedBadMessage();
return;
}
diff --git a/content/browser/renderer_host/software_frame_manager.cc b/content/browser/renderer_host/software_frame_manager.cc
index ce5909e..cff9434 100644
--- a/content/browser/renderer_host/software_frame_manager.cc
+++ b/content/browser/renderer_host/software_frame_manager.cc
@@ -101,21 +101,21 @@ bool SoftwareFrameManager::SwapToNewFrame(
if (!shared_memory->Map(0)) {
DLOG(ERROR) << "Unable to map renderer memory.";
RecordAction(
- UserMetricsAction("BadMessageTerminate_SharedMemoryManager1"));
+ base::UserMetricsAction("BadMessageTerminate_SharedMemoryManager1"));
return false;
}
if (shared_memory->mapped_size() < size_in_bytes) {
DLOG(ERROR) << "Shared memory too small for given rectangle";
RecordAction(
- UserMetricsAction("BadMessageTerminate_SharedMemoryManager2"));
+ base::UserMetricsAction("BadMessageTerminate_SharedMemoryManager2"));
return false;
}
#else
if (!shared_memory->Map(size_in_bytes)) {
DLOG(ERROR) << "Unable to map renderer memory.";
RecordAction(
- UserMetricsAction("BadMessageTerminate_SharedMemoryManager1"));
+ base::UserMetricsAction("BadMessageTerminate_SharedMemoryManager1"));
return false;
}
#endif
diff --git a/content/browser/user_metrics.cc b/content/browser/user_metrics.cc
index a1c7819..200c851 100644
--- a/content/browser/user_metrics.cc
+++ b/content/browser/user_metrics.cc
@@ -7,56 +7,33 @@
#include <vector>
#include "base/bind.h"
-#include "base/lazy_instance.h"
+#include "base/metrics/user_metrics.h"
#include "content/public/browser/browser_thread.h"
namespace content {
-namespace {
-base::LazyInstance<std::vector<ActionCallback> > g_action_callbacks =
- LAZY_INSTANCE_INITIALIZER;
-
-// Forward declare because of circular dependency.
-void CallRecordOnUI(const std::string& action);
-
-void Record(const char *action) {
+void RecordAction(const base::UserMetricsAction& action) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
- base::Bind(&CallRecordOnUI, action));
+ base::Bind(&RecordAction, action));
return;
}
- for (size_t i = 0; i < g_action_callbacks.Get().size(); i++)
- g_action_callbacks.Get()[i].Run(action);
-}
-
-void CallRecordOnUI(const std::string& action) {
- Record(action.c_str());
-}
-
-} // namespace
-
-void RecordAction(const UserMetricsAction& action) {
- Record(action.str_);
+ base::RecordAction(action);
}
void RecordComputedAction(const std::string& action) {
- Record(action.c_str());
-}
-
-void AddActionCallback(const ActionCallback& callback) {
- g_action_callbacks.Get().push_back(callback);
-}
-
-void RemoveActionCallback(const ActionCallback& callback) {
- for (size_t i = 0; i < g_action_callbacks.Get().size(); i++) {
- if (g_action_callbacks.Get()[i].Equals(callback)) {
- g_action_callbacks.Get().erase(g_action_callbacks.Get().begin() + i);
- return;
- }
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&RecordComputedAction, action));
+ return;
}
+
+ base::RecordComputedAction(action);
}
} // namespace content
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 9c088ea..125276b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -582,7 +582,7 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
render_view_message_source_ = NULL;
if (!message_is_ok) {
- RecordAction(UserMetricsAction("BadMessageTerminate_RVD"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_RVD"));
GetRenderProcessHost()->ReceivedBadMessage();
}
@@ -1339,7 +1339,7 @@ void WebContentsImpl::CreateNewWindow(
RenderProcessHost::FromID(render_process_id)->GetHandle();
if (process_handle != base::kNullProcessHandle) {
RecordAction(
- UserMetricsAction("Terminate_ProcessMismatch_CreateNewWindow"));
+ base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWindow"));
base::KillProcess(process_handle, content::RESULT_CODE_KILLED, false);
}
return;
@@ -1479,7 +1479,7 @@ void WebContentsImpl::CreateNewWidget(int render_process_id,
RenderProcessHost::FromID(render_process_id)->GetHandle();
if (process_handle != base::kNullProcessHandle) {
RecordAction(
- UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget"));
+ base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget"));
base::KillProcess(process_handle, content::RESULT_CODE_KILLED, false);
}
return;
@@ -2262,7 +2262,7 @@ void WebContentsImpl::OnDidLoadResourceFromMemoryCache(
}
void WebContentsImpl::OnDidDisplayInsecureContent() {
- RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent"));
+ RecordAction(base::UserMetricsAction("SSL.DisplayedInsecureContent"));
displayed_insecure_content_ = true;
SSLManager::NotifySSLInternalStateChanged(
GetController().GetBrowserContext());
@@ -2272,9 +2272,9 @@ void WebContentsImpl::OnDidRunInsecureContent(
const std::string& security_origin, const GURL& target_url) {
LOG(WARNING) << security_origin << " ran insecure content from "
<< target_url.possibly_invalid_spec();
- RecordAction(UserMetricsAction("SSL.RanInsecureContent"));
+ RecordAction(base::UserMetricsAction("SSL.RanInsecureContent"));
if (EndsWith(security_origin, kDotGoogleDotCom, false))
- RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle"));
+ RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle"));
controller_.ssl_manager()->DidRunInsecureContent(security_origin);
displayed_insecure_content_ = true;
SSLManager::NotifySSLInternalStateChanged(
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc
index 9b95d4d..35e2444 100644
--- a/content/browser/worker_host/worker_process_host.cc
+++ b/content/browser/worker_host/worker_process_host.cc
@@ -336,7 +336,7 @@ bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
if (!msg_is_ok) {
NOTREACHED();
- RecordAction(UserMetricsAction("BadMessageTerminate_WPH"));
+ RecordAction(base::UserMetricsAction("BadMessageTerminate_WPH"));
base::KillProcess(
process_->GetData().handle, RESULT_CODE_KILLED_BAD_MESSAGE, false);
}
@@ -407,7 +407,7 @@ void WorkerProcessHost::OnForceKillWorkerProcess() {
base::KillProcess(
process_->GetData().handle, RESULT_CODE_NORMAL_EXIT, false);
else
- RecordAction(UserMetricsAction("WorkerProcess_BadProcessToKill"));
+ RecordAction(base::UserMetricsAction("WorkerProcess_BadProcessToKill"));
}
void WorkerProcessHost::RelayMessage(
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 4e75a72..9b7a32d 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -101,7 +101,6 @@
'public/common/url_fetcher.h',
'public/common/url_utils.cc',
'public/common/url_utils.h',
- 'public/common/user_metrics_action.h',
'public/common/webplugininfo.cc',
'public/common/webplugininfo.h',
'public/common/zygote_fork_delegate_linux.h',
diff --git a/content/public/browser/browser_message_filter.cc b/content/public/browser/browser_message_filter.cc
index cca9d30..e72a484 100644
--- a/content/public/browser/browser_message_filter.cc
+++ b/content/public/browser/browser_message_filter.cc
@@ -83,7 +83,8 @@ class BrowserMessageFilter::Internal : public IPC::ChannelProxy::MessageFilter {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO) || rv) <<
"Must handle messages that were dispatched to another thread!";
if (!message_was_ok) {
- content::RecordAction(UserMetricsAction("BadMessageTerminate_BMF"));
+ content::RecordAction(
+ base::UserMetricsAction("BadMessageTerminate_BMF"));
filter_->BadMessageReceived();
}
diff --git a/content/public/browser/user_metrics.h b/content/public/browser/user_metrics.h
index e9480ac..118d8a9 100644
--- a/content/public/browser/user_metrics.h
+++ b/content/public/browser/user_metrics.h
@@ -8,50 +8,17 @@
#include <string>
#include "base/callback.h"
+#include "base/metrics/user_metrics_action.h"
#include "content/common/content_export.h"
-#include "content/public/common/user_metrics_action.h"
namespace content {
-// This module provides some helper functions for logging actions tracked by
-// the user metrics system.
-
-// Record that the user performed an action.
-// "Action" here means a user-generated event:
-// good: "Reload", "CloseTab", and "IMEInvoked"
-// not good: "SSLDialogShown", "PageLoaded", "DiskFull"
-// We use this to gather anonymized information about how users are
-// interacting with the browser.
-// WARNING: In calls to this function, UserMetricsAction and a
-// string literal parameter must be on the same line, e.g.
-// content::RecordAction(
-// content::UserMetricsAction("my extremely long action name"));
-// This ensures that our processing scripts can associate this action's hash
-// with its metric name. Therefore, it will be possible to retrieve the metric
-// name from the hash later on.
-//
-// Once a new recorded action is added, run
-// tools/metrics/actions/extract_actions.py --hash
-// to generate a new mapping of [action hashes -> metric names] and send it
-// out for review to be updated.
-//
-// For more complicated situations (like when there are many different
-// possible actions), see RecordComputedAction.
-CONTENT_EXPORT void RecordAction(const UserMetricsAction& action);
-
-// This function has identical input and behavior to RecordAction, but is
-// not automatically found by the action-processing scripts. It can be used
-// when it's a pain to enumerate all possible actions, but if you use this
-// you need to also update the rules for extracting known actions in
-// tools/metrics/actions/extract_actions.py.
-CONTENT_EXPORT void RecordComputedAction(const std::string& action);
-
-// Called with the action string.
-typedef base::Callback<void(const std::string&)> ActionCallback;
+// Wrappers around functions defined in base/metrics/user_metrics.h, refer to
+// that header for full documentation. These wrappers can be called from any
+// thread (they will post back to the UI thread to do the recording).
-// Add/remove action callbacks (see above).
-CONTENT_EXPORT void AddActionCallback(const ActionCallback& callback);
-CONTENT_EXPORT void RemoveActionCallback(const ActionCallback& callback);
+CONTENT_EXPORT void RecordAction(const base::UserMetricsAction& action);
+CONTENT_EXPORT void RecordComputedAction(const std::string& action);
} // namespace content
diff --git a/content/public/common/user_metrics_action.h b/content/public/common/user_metrics_action.h
deleted file mode 100644
index 3b604ef..0000000
--- a/content/public/common/user_metrics_action.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_PUBLIC_COMMON_USER_METRICS_ACTION_H_
-#define CONTENT_PUBLIC_COMMON_USER_METRICS_ACTION_H_
-
-namespace content {
-
-// UserMetricsAction exists purely to standardize on the parameters passed to
-// UserMetrics. That way, our toolset can scan the source code reliable for
-// constructors and extract the associated string constants.
-// WARNING: When using UserMetricsAction, UserMetricsAction and a string literal
-// parameter must be on the same line, e.g.
-// RecordAction(
-// UserMetricsAction("my extremely long action name"));
-// or
-// RenderThread::Get()->RecordAction(
-// UserMetricsAction("my extremely long action name"));
-// because otherwise our processing scripts won't pick up on new actions.
-// Please see tools/metrics/actions/extract_actions.py for details.
-struct UserMetricsAction {
- const char* str_;
- explicit UserMetricsAction(const char* str) : str_(str) {}
-};
-
-} // namespace content
-
-#endif // CONTENT_PUBLIC_COMMON_USER_METRICS_ACTION_H_
diff --git a/content/public/renderer/render_thread.h b/content/public/renderer/render_thread.h
index 6af4ed8..184da1e 100644
--- a/content/public/renderer/render_thread.h
+++ b/content/public/renderer/render_thread.h
@@ -8,8 +8,8 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/shared_memory.h"
+#include "base/metrics/user_metrics_action.h"
#include "content/common/content_export.h"
-#include "content/public/common/user_metrics_action.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sender.h"
@@ -75,17 +75,17 @@ class CONTENT_EXPORT RenderThread : public IPC::Sender {
// initialization.
virtual void EnsureWebKitInitialized() = 0;
- // Sends over a UserMetricsAction to be recorded by user metrics as an action.
- // Once a new user metric is added, run
+ // Sends over a base::UserMetricsAction to be recorded by user metrics as
+ // an action. Once a new user metric is added, run
// tools/metrics/actions/extract_actions.py --hash
// to generate a new mapping of [action hashes -> metric names] and send it
// out for review to be updated.
- // WARNING: When using UserMetricsAction, UserMetricsAction and a string
- // literal parameter must be on the same line, e.g.
+ // WARNING: When using base::UserMetricsAction, base::UserMetricsAction
+ // and a string literal parameter must be on the same line, e.g.
// RenderThread::Get()->RecordAction(
- // UserMetricsAction("my extremely long action name"));
+ // base::UserMetricsAction("my extremely long action name"));
// because otherwise our processing scripts won't pick up on new actions.
- virtual void RecordAction(const UserMetricsAction& action) = 0;
+ virtual void RecordAction(const base::UserMetricsAction& action) = 0;
// Sends over a string to be recorded by user metrics as a computed action.
// When you use this you need to also update the rules for extracting known
diff --git a/content/public/test/mock_render_thread.cc b/content/public/test/mock_render_thread.cc
index 51882d9..ec7ead8 100644
--- a/content/public/test/mock_render_thread.cc
+++ b/content/public/test/mock_render_thread.cc
@@ -133,7 +133,7 @@ void MockRenderThread::SetResourceDispatcherDelegate(
void MockRenderThread::EnsureWebKitInitialized() {
}
-void MockRenderThread::RecordAction(const UserMetricsAction& action) {
+void MockRenderThread::RecordAction(const base::UserMetricsAction& action) {
}
void MockRenderThread::RecordComputedAction(const std::string& action) {
diff --git a/content/public/test/mock_render_thread.h b/content/public/test/mock_render_thread.h
index 0431c74..76809a5 100644
--- a/content/public/test/mock_render_thread.h
+++ b/content/public/test/mock_render_thread.h
@@ -56,7 +56,7 @@ class MockRenderThread : public RenderThread {
virtual void SetResourceDispatcherDelegate(
ResourceDispatcherDelegate* delegate) OVERRIDE;
virtual void EnsureWebKitInitialized() OVERRIDE;
- virtual void RecordAction(const UserMetricsAction& action) OVERRIDE;
+ virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE;
virtual void RecordComputedAction(const std::string& action) OVERRIDE;
virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer(
size_t buffer_size) OVERRIDE;
diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc
index 9f6129b..c8db6d5 100644
--- a/content/renderer/npapi/webplugin_impl.cc
+++ b/content/renderer/npapi/webplugin_impl.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/memory/linked_ptr.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/user_metrics_action.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -955,7 +956,7 @@ void WebPluginImpl::didReceiveResponse(WebURLLoader* loader,
&instance_size);
} else if (response.httpStatusCode() == kHttpResponseSuccessStatusCode) {
RenderThreadImpl::current()->RecordAction(
- UserMetricsAction("Plugin_200ForByteRange"));
+ base::UserMetricsAction("Plugin_200ForByteRange"));
// If the client issued a byte range request and the server responds with
// HTTP 200 OK, it indicates that the server does not support byte range
// requests.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 50beaca..28a4621 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -736,7 +736,7 @@ void RenderThreadImpl::RegisterSchemes() {
WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme);
}
-void RenderThreadImpl::RecordAction(const UserMetricsAction& action) {
+void RenderThreadImpl::RecordAction(const base::UserMetricsAction& action) {
Send(new ViewHostMsg_UserMetricsRecordAction(action.str_));
}
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index 6e77c99..16d2cb4 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/memory/memory_pressure_listener.h"
+#include "base/metrics/user_metrics_action.h"
#include "base/observer_list.h"
#include "base/process/process_handle.h"
#include "base/strings/string16.h"
@@ -133,7 +134,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread,
virtual void SetResourceDispatcherDelegate(
ResourceDispatcherDelegate* delegate) OVERRIDE;
virtual void EnsureWebKitInitialized() OVERRIDE;
- virtual void RecordAction(const UserMetricsAction& action) OVERRIDE;
+ virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE;
virtual void RecordComputedAction(const std::string& action) OVERRIDE;
virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer(
size_t buffer_size) OVERRIDE;