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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1890513004: Remove dependency on the DevTools agent for console logs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 void WebLocalFrameImpl::setIsolatedWorldHumanReadableName(int worldID, const Web String& humanReadableName) 743 void WebLocalFrameImpl::setIsolatedWorldHumanReadableName(int worldID, const Web String& humanReadableName)
744 { 744 {
745 DCHECK(frame()); 745 DCHECK(frame());
746 DOMWrapperWorld::setIsolatedWorldHumanReadableName(worldID, humanReadableNam e); 746 DOMWrapperWorld::setIsolatedWorldHumanReadableName(worldID, humanReadableNam e);
747 } 747 }
748 748
749 void WebLocalFrameImpl::addMessageToConsole(const WebConsoleMessage& message) 749 void WebLocalFrameImpl::addMessageToConsole(const WebConsoleMessage& message)
750 { 750 {
751 DCHECK(frame()); 751 DCHECK(frame());
752 752
753 MessageLevel webCoreMessageLevel; 753 MessageSource webCoreMessageSource = OtherMessageSource;
pfeldman 2016/04/21 21:48:30 You have static assert, you should be fine casting
carlosk 2016/04/22 14:33:55 This code was fully removed.
754 switch (message.source) {
755 case WebConsoleMessage::Source::XML:
756 webCoreMessageSource = XMLMessageSource;
757 break;
758 case WebConsoleMessage::Source::JS:
759 webCoreMessageSource = JSMessageSource;
760 break;
761 case WebConsoleMessage::Source::Network:
762 webCoreMessageSource = NetworkMessageSource;
763 break;
764 case WebConsoleMessage::Source::ConsoleAPI:
765 webCoreMessageSource = ConsoleAPIMessageSource;
766 break;
767 case WebConsoleMessage::Source::Storage:
768 webCoreMessageSource = StorageMessageSource;
769 break;
770 case WebConsoleMessage::Source::AppCache:
771 webCoreMessageSource = AppCacheMessageSource;
772 break;
773 case WebConsoleMessage::Source::Rendering:
774 webCoreMessageSource = RenderingMessageSource;
775 break;
776 case WebConsoleMessage::Source::Security:
777 webCoreMessageSource = SecurityMessageSource;
778 break;
779 case WebConsoleMessage::Source::Other:
780 webCoreMessageSource = OtherMessageSource;
781 break;
782 case WebConsoleMessage::Source::Deprecation:
783 webCoreMessageSource = DeprecationMessageSource;
784 break;
785 }
786
787 MessageLevel webCoreMessageLevel = LogMessageLevel;
754 switch (message.level) { 788 switch (message.level) {
755 case WebConsoleMessage::LevelDebug: 789 case WebConsoleMessage::LevelDebug:
756 webCoreMessageLevel = DebugMessageLevel; 790 webCoreMessageLevel = DebugMessageLevel;
757 break; 791 break;
758 case WebConsoleMessage::LevelLog: 792 case WebConsoleMessage::LevelLog:
759 webCoreMessageLevel = LogMessageLevel; 793 webCoreMessageLevel = LogMessageLevel;
760 break; 794 break;
761 case WebConsoleMessage::LevelWarning: 795 case WebConsoleMessage::LevelWarning:
762 webCoreMessageLevel = WarningMessageLevel; 796 webCoreMessageLevel = WarningMessageLevel;
763 break; 797 break;
764 case WebConsoleMessage::LevelError: 798 case WebConsoleMessage::LevelError:
765 webCoreMessageLevel = ErrorMessageLevel; 799 webCoreMessageLevel = ErrorMessageLevel;
766 break; 800 break;
767 default: 801 // Unsupported values.
768 NOTREACHED(); 802 case WebConsoleMessage::LevelInfo:
769 return; 803 case WebConsoleMessage::LevelRevokedError:
804 break;
770 } 805 }
771 806
772 frame()->document()->addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, webCoreMessageLevel, message.text, message.url, message.lineNumber, messag e.columnNumber)); 807 frame()->document()->addConsoleMessage(ConsoleMessage::create(webCoreMessage Source, webCoreMessageLevel, message.text, message.url, message.lineNumber, mess age.columnNumber));
773 } 808 }
774 809
775 void WebLocalFrameImpl::collectGarbage() 810 void WebLocalFrameImpl::collectGarbage()
776 { 811 {
777 if (!frame()) 812 if (!frame())
778 return; 813 return;
779 if (!frame()->settings()->scriptEnabled()) 814 if (!frame()->settings()->scriptEnabled())
780 return; 815 return;
781 V8GCController::collectGarbage(v8::Isolate::GetCurrent()); 816 V8GCController::collectGarbage(v8::Isolate::GetCurrent());
782 } 817 }
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 return WebSandboxFlags::None; 2164 return WebSandboxFlags::None;
2130 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2165 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2131 } 2166 }
2132 2167
2133 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2168 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2134 { 2169 {
2135 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2170 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2136 } 2171 }
2137 2172
2138 } // namespace blink 2173 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698