OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |