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

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: Added new enum to WebConsoleMessage to mirror MessageSource and more. 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 webCoreMessageLevel = WarningMessageLevel; 762 webCoreMessageLevel = WarningMessageLevel;
763 break; 763 break;
764 case WebConsoleMessage::LevelError: 764 case WebConsoleMessage::LevelError:
765 webCoreMessageLevel = ErrorMessageLevel; 765 webCoreMessageLevel = ErrorMessageLevel;
766 break; 766 break;
767 default: 767 default:
768 NOTREACHED(); 768 NOTREACHED();
769 return; 769 return;
770 } 770 }
771 771
772 frame()->document()->addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, webCoreMessageLevel, message.text, message.url, message.lineNumber, messag e.columnNumber)); 772 MessageSource webCoreMessageSource;
773 switch (message.source) {
774 case WebConsoleMessage::SourceXML:
dcheng 2016/04/14 17:29:11 FWIW, the usual idiom is to make the core and web
carlosk 2016/04/15 09:42:43 Static casting was I wanted to do initially but ag
775 webCoreMessageSource = XMLMessageSource;
776 break;
777 case WebConsoleMessage::SourceJS:
778 webCoreMessageSource = JSMessageSource;
779 break;
780 case WebConsoleMessage::SourceNetwork:
781 webCoreMessageSource = NetworkMessageSource;
782 break;
783 case WebConsoleMessage::SourceConsoleAPI:
784 webCoreMessageSource = ConsoleAPIMessageSource;
785 break;
786 case WebConsoleMessage::SourceStorage:
787 webCoreMessageSource = StorageMessageSource;
788 break;
789 case WebConsoleMessage::SourceAppCache:
790 webCoreMessageSource = AppCacheMessageSource;
791 break;
792 case WebConsoleMessage::SourceRendering:
793 webCoreMessageSource = RenderingMessageSource;
794 break;
795 case WebConsoleMessage::SourceSecurity:
796 webCoreMessageSource = SecurityMessageSource;
797 break;
798 case WebConsoleMessage::SourceOther:
799 webCoreMessageSource = OtherMessageSource;
800 break;
801 case WebConsoleMessage::SourceDeprecation:
802 webCoreMessageSource = DeprecationMessageSource;
803 break;
804 default:
dcheng 2016/04/14 17:29:11 That being said, if you keep the switch (though it
carlosk 2016/04/15 09:42:43 My rule of thumb is to create a central, shared me
805 NOTREACHED();
806 return;
807 }
808
809 frame()->document()->addConsoleMessage(ConsoleMessage::create(webCoreMessage Source, webCoreMessageLevel, message.text, message.url, message.lineNumber, mess age.columnNumber));
773 } 810 }
774 811
775 void WebLocalFrameImpl::collectGarbage() 812 void WebLocalFrameImpl::collectGarbage()
776 { 813 {
777 if (!frame()) 814 if (!frame())
778 return; 815 return;
779 if (!frame()->settings()->scriptEnabled()) 816 if (!frame()->settings()->scriptEnabled())
780 return; 817 return;
781 V8GCController::collectGarbage(v8::Isolate::GetCurrent()); 818 V8GCController::collectGarbage(v8::Isolate::GetCurrent());
782 } 819 }
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 return WebSandboxFlags::None; 2167 return WebSandboxFlags::None;
2131 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2168 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2132 } 2169 }
2133 2170
2134 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2171 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2135 { 2172 {
2136 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2173 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2137 } 2174 }
2138 2175
2139 } // namespace blink 2176 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698