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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 217183004: Migrate addMessageToConsole API to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + fix the test_runner Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 #else 1619 #else
1620 return NULL; 1620 return NULL;
1621 #endif 1621 #endif
1622 } 1622 }
1623 1623
1624 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace() { 1624 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace() {
1625 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); 1625 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId);
1626 return new WebStorageNamespaceImpl(session_storage_namespace_id_); 1626 return new WebStorageNamespaceImpl(session_storage_namespace_id_);
1627 } 1627 }
1628 1628
1629 bool RenderViewImpl::shouldReportDetailedMessageForSource(
1630 const WebString& source) {
1631 return GetContentClient()->renderer()->ShouldReportDetailedMessageForSource(
1632 source);
1633 }
1634
1635 void RenderViewImpl::didAddMessageToConsole(
1636 const WebConsoleMessage& message, const WebString& source_name,
1637 unsigned source_line, const WebString& stack_trace) {
1638 logging::LogSeverity log_severity = logging::LOG_VERBOSE;
1639 switch (message.level) {
1640 case WebConsoleMessage::LevelDebug:
1641 log_severity = logging::LOG_VERBOSE;
1642 break;
1643 case WebConsoleMessage::LevelLog:
1644 case WebConsoleMessage::LevelInfo:
1645 log_severity = logging::LOG_INFO;
1646 break;
1647 case WebConsoleMessage::LevelWarning:
1648 log_severity = logging::LOG_WARNING;
1649 break;
1650 case WebConsoleMessage::LevelError:
1651 log_severity = logging::LOG_ERROR;
1652 break;
1653 default:
1654 NOTREACHED();
1655 }
1656
1657 if (shouldReportDetailedMessageForSource(source_name)) {
1658 FOR_EACH_OBSERVER(
1659 RenderViewObserver,
1660 observers_,
1661 DetailedConsoleMessageAdded(message.text,
1662 source_name,
1663 stack_trace,
1664 source_line,
1665 static_cast<int32>(log_severity)));
1666 }
1667
1668 Send(new ViewHostMsg_AddMessageToConsole(routing_id_,
1669 static_cast<int32>(log_severity),
1670 message.text,
1671 static_cast<int32>(source_line),
1672 source_name));
1673 }
1674
1675 void RenderViewImpl::printPage(WebFrame* frame) { 1629 void RenderViewImpl::printPage(WebFrame* frame) {
1676 FOR_EACH_OBSERVER(RenderViewObserver, observers_, 1630 FOR_EACH_OBSERVER(RenderViewObserver, observers_,
1677 PrintPage(frame, handling_input_event_)); 1631 PrintPage(frame, handling_input_event_));
1678 } 1632 }
1679 1633
1680 blink::WebNotificationPresenter* RenderViewImpl::notificationPresenter() { 1634 blink::WebNotificationPresenter* RenderViewImpl::notificationPresenter() {
1681 return notification_provider_; 1635 return notification_provider_;
1682 } 1636 }
1683 1637
1684 bool RenderViewImpl::enumerateChosenDirectory( 1638 bool RenderViewImpl::enumerateChosenDirectory(
(...skipping 3142 matching lines...) Expand 10 before | Expand all | Expand 10 after
4827 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); 4781 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size());
4828 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4782 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4829 if (!url.isEmpty()) 4783 if (!url.isEmpty())
4830 urls.push_back( 4784 urls.push_back(
4831 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4785 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4832 } 4786 }
4833 SendUpdateFaviconURL(urls); 4787 SendUpdateFaviconURL(urls);
4834 } 4788 }
4835 4789
4836 } // namespace content 4790 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/shell/renderer/test_runner/WebFrameTestProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698