summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 06:10:17 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 06:10:17 +0000
commit55e57d4d2326bd98d6e14c92ba055754ef77b0e6 (patch)
tree29f456dcb43fd5754104fe4e302df13532262c83 /chrome/browser/renderer_host
parentf78d965fa1ef193595740604508d7d94fde0ef84 (diff)
downloadchromium_src-55e57d4d2326bd98d6e14c92ba055754ef77b0e6.zip
chromium_src-55e57d4d2326bd98d6e14c92ba055754ef77b0e6.tar.gz
chromium_src-55e57d4d2326bd98d6e14c92ba055754ef77b0e6.tar.bz2
Initial support for Renderer Side Histograms
Patch contributed by Raman Tenneti see also patch number 21038 Review URL: http://codereview.chromium.org/27034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc23
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h4
2 files changed, 19 insertions, 8 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index e4ca158..ffded3e 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -139,7 +139,7 @@ ResourceMessageFilter::~ResourceMessageFilter() {
void ResourceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
channel_ = channel;
- // Add the observers to intercept
+ // Add the observers to intercept.
NotificationService::current()->AddObserver(
this,
NotificationType::SPELLCHECKER_REINITIALIZED,
@@ -197,6 +197,8 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& message) {
OnOpenChannelToPlugin)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_SpellCheck, OnSpellCheck)
IPC_MESSAGE_HANDLER(ViewHostMsg_DnsPrefetch, OnDnsPrefetch)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RendererHistograms,
+ OnRendererHistograms)
IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_PaintRect,
render_widget_helper_->DidReceivePaintMsg(message))
IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardWriteObjectsAsync,
@@ -412,7 +414,7 @@ void ResourceMessageFilter::OnPluginSyncMessage(const FilePath& plugin_path,
}
}
-#if defined(OS_WIN) // This hack is Windows-specific.
+#if defined(OS_WIN) // This hack is Windows-specific.
void ResourceMessageFilter::OnLoadFont(LOGFONT font) {
// If renderer is running in a sandbox, GetTextMetrics
// can sometimes fail. If a font has not been loaded
@@ -500,7 +502,7 @@ void ResourceMessageFilter::OnClipboardWriteObjects(
// on the UI thread. We'll copy the relevant data and get a handle to any
// shared memory so it doesn't go away when we resume the renderer, and post
// a task to perform the write on the UI thread.
- Clipboard::ObjectMap* long_living_objects = new Clipboard::ObjectMap(objects);
+ Clipboard::ObjectMap* long_living_objects = new Clipboard::ObjectMap(objects);
// We pass the render_handle_ to assist the clipboard with using shared
// memory objects. render_handle_ is a handle to the process that would
@@ -639,7 +641,7 @@ void ResourceMessageFilter::OnResourceTypeStats(
}
void ResourceMessageFilter::OnResolveProxy(const GURL& url,
- IPC::Message* reply_msg) {
+ IPC::Message* reply_msg) {
resolve_proxy_msg_helper_.Start(url, reply_msg);
}
@@ -764,7 +766,7 @@ ClipboardService* ResourceMessageFilter::GetClipboardService() {
// the spellcheck dictionaries into the browser process, and all renderers ask
// the browsers to do SpellChecking.
//
-// This filter should not try to initialize the spellchecker. It is up to the
+// This filter should not try to initialize the spellchecker. It is up to the
// profile to initialize it when required, and send it here. If |spellchecker_|
// is made NULL, it corresponds to spellchecker turned off - i.e., all
// spellings are correct.
@@ -787,7 +789,7 @@ void ResourceMessageFilter::OnSpellCheck(const std::wstring& word,
return;
}
-void ResourceMessageFilter::Observe(NotificationType type,
+void ResourceMessageFilter::Observe(NotificationType type,
const NotificationSource &source,
const NotificationDetails &details) {
if (type == NotificationType::SPELLCHECKER_REINITIALIZED) {
@@ -801,9 +803,14 @@ void ResourceMessageFilter::OnDnsPrefetch(
chrome_browser_net::DnsPrefetchList(hostnames);
}
+void ResourceMessageFilter::OnRendererHistograms(
+ const std::vector<std::string>& histograms) {
+ Histogram::DeserializeHistogramList(histograms);
+}
+
void ResourceMessageFilter::OnCreateAudioStream(
- const IPC::Message& msg, int stream_id,
- const ViewHostMsg_Audio_CreateStream& params) {
+ const IPC::Message& msg, int stream_id,
+ const ViewHostMsg_Audio_CreateStream& params) {
// TODO(hclam): call to AudioRendererHost::CreateStream and send a message to
// renderer to notify the result.
}
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index 4121a50..ab60be0 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -5,6 +5,9 @@
#ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_MSG_FILTER_H_
#define CHROME_BROWSER_RENDERER_HOST_RESOURCE_MSG_FILTER_H_
+#include <string>
+#include <vector>
+
#include "base/clipboard.h"
#include "base/file_path.h"
#include "base/gfx/rect.h"
@@ -146,6 +149,7 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
void OnSpellCheck(const std::wstring& word,
IPC::Message* reply_msg);
void OnDnsPrefetch(const std::vector<std::string>& hostnames);
+ void OnRendererHistograms(const std::vector<std::string>& histogram_info);
void OnReceiveContextMenuMsg(const IPC::Message& msg);
// Clipboard messages
void OnClipboardWriteObjects(const Clipboard::ObjectMap& objects);