summaryrefslogtreecommitdiffstats
path: root/chromium/content/browser/vibration/vibration_message_filter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/vibration/vibration_message_filter.cc')
-rw-r--r--chromium/content/browser/vibration/vibration_message_filter.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/chromium/content/browser/vibration/vibration_message_filter.cc b/chromium/content/browser/vibration/vibration_message_filter.cc
index 9a6ed0cb2c0..fbc9041c71f 100644
--- a/chromium/content/browser/vibration/vibration_message_filter.cc
+++ b/chromium/content/browser/vibration/vibration_message_filter.cc
@@ -6,10 +6,10 @@
#include <algorithm>
-#include "base/safe_numerics.h"
+#include "base/numerics/safe_conversions.h"
#include "content/common/view_messages.h"
-#include "content/port/browser/vibration_provider.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/browser/vibration_provider.h"
#include "content/public/common/content_client.h"
#include "third_party/WebKit/public/platform/WebVibration.h"
@@ -18,7 +18,8 @@ namespace content {
// Minimum duration of a vibration is 1 millisecond.
const int64 kMinimumVibrationDurationMs = 1;
-VibrationMessageFilter::VibrationMessageFilter() {
+VibrationMessageFilter::VibrationMessageFilter()
+ : BrowserMessageFilter(ViewMsgStart) {
provider_.reset(GetContentClient()->browser()->OverrideVibrationProvider());
if (!provider_.get())
provider_.reset(CreateProvider());
@@ -28,16 +29,13 @@ VibrationMessageFilter::~VibrationMessageFilter() {
}
bool VibrationMessageFilter::OnMessageReceived(
- const IPC::Message& message,
- bool* message_was_ok) {
+ const IPC::Message& message) {
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP_EX(VibrationMessageFilter,
- message,
- *message_was_ok)
+ IPC_BEGIN_MESSAGE_MAP(VibrationMessageFilter, message)
IPC_MESSAGE_HANDLER(ViewHostMsg_Vibrate, OnVibrate)
IPC_MESSAGE_HANDLER(ViewHostMsg_CancelVibration, OnCancelVibration)
IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP_EX()
+ IPC_END_MESSAGE_MAP()
return handled;
}
@@ -48,7 +46,7 @@ void VibrationMessageFilter::OnVibrate(int64 milliseconds) {
// Though the Blink implementation already sanitizes vibration times, don't
// trust any values passed from the renderer.
milliseconds = std::max(kMinimumVibrationDurationMs, std::min(milliseconds,
- base::checked_numeric_cast<int64>(blink::kVibrationDurationMax)));
+ base::checked_cast<int64>(blink::kVibrationDurationMax)));
provider_->Vibrate(milliseconds);
}