Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1595 NOTREACHED() << "Received script response for unknown request"; | 1595 NOTREACHED() << "Received script response for unknown request"; |
| 1596 } | 1596 } |
| 1597 } | 1597 } |
| 1598 | 1598 |
| 1599 void RenderFrameHostImpl::OnRunJavaScriptMessage( | 1599 void RenderFrameHostImpl::OnRunJavaScriptMessage( |
| 1600 const base::string16& message, | 1600 const base::string16& message, |
| 1601 const base::string16& default_prompt, | 1601 const base::string16& default_prompt, |
| 1602 const GURL& frame_url, | 1602 const GURL& frame_url, |
| 1603 JavaScriptMessageType type, | 1603 JavaScriptMessageType type, |
| 1604 IPC::Message* reply_msg) { | 1604 IPC::Message* reply_msg) { |
| 1605 int32_t message_length = static_cast<int32_t>(message.length()); | |
|
dominickn
2016/09/20 07:22:09
Nit: size_t? Or uint32_t?
Avi (use Gerrit)
2016/09/20 14:18:49
I stole this from earlier UMA code I wrote, and it
| |
| 1606 if (GetParent()) { | |
| 1607 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.Subframe", message_length); | |
| 1608 } else { | |
| 1609 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.MainFrame", message_length); | |
| 1610 } | |
| 1611 | |
| 1605 // While a JS message dialog is showing, tabs in the same process shouldn't | 1612 // While a JS message dialog is showing, tabs in the same process shouldn't |
| 1606 // process input events. | 1613 // process input events. |
| 1607 GetProcess()->SetIgnoreInputEvents(true); | 1614 GetProcess()->SetIgnoreInputEvents(true); |
| 1608 render_view_host_->GetWidget()->StopHangMonitorTimeout(); | 1615 render_view_host_->GetWidget()->StopHangMonitorTimeout(); |
| 1609 delegate_->RunJavaScriptMessage(this, message, default_prompt, | 1616 delegate_->RunJavaScriptMessage(this, message, default_prompt, |
| 1610 frame_url, type, reply_msg); | 1617 frame_url, type, reply_msg); |
| 1611 } | 1618 } |
| 1612 | 1619 |
| 1613 void RenderFrameHostImpl::OnRunBeforeUnloadConfirm( | 1620 void RenderFrameHostImpl::OnRunBeforeUnloadConfirm( |
| 1614 const GURL& frame_url, | 1621 const GURL& frame_url, |
| (...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3092 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3099 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 3093 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3100 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 3094 return web_bluetooth_service_.get(); | 3101 return web_bluetooth_service_.get(); |
| 3095 } | 3102 } |
| 3096 | 3103 |
| 3097 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3104 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 3098 web_bluetooth_service_.reset(); | 3105 web_bluetooth_service_.reset(); |
| 3099 } | 3106 } |
| 3100 | 3107 |
| 3101 } // namespace content | 3108 } // namespace content |
| OLD | NEW |