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

Side by Side Diff: webkit/port/bindings/v8/v8_proxy.cpp

Issue 8838: Change the fatal error handler to no longer return to V8. It will now crash... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // 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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 { 781 {
782 // Do not report error if the access type is HAS. 782 // Do not report error if the access type is HAS.
783 if (type == v8::ACCESS_HAS) 783 if (type == v8::ACCESS_HAS)
784 return; 784 return;
785 785
786 Frame* target = V8Custom::GetTargetFrame(host, data); 786 Frame* target = V8Custom::GetTargetFrame(host, data);
787 if (target) 787 if (target)
788 ReportUnsafeAccessTo(target, REPORT_LATER); 788 ReportUnsafeAccessTo(target, REPORT_LATER);
789 } 789 }
790 790
791 static void ReportFatalErrorInV8(const char* location, const char* message)
792 {
793 // V8 is shutdown, we cannot use V8 api.
794 // The only thing we can do is to disable JavaScript.
795 // TODO: clean up V8Proxy and disable JavaScript.
796 printf("V8 error: %s (%s)\n", message, location);
797 }
798
799 static void HandleFatalErrorInV8() 791 static void HandleFatalErrorInV8()
800 { 792 {
801 // TODO: We temporarily deal with V8 internal error situations 793 // TODO: We temporarily deal with V8 internal error situations
802 // such as out-of-memory by crashing the renderer. 794 // such as out-of-memory by crashing the renderer.
803 CRASH(); 795 CRASH();
804 } 796 }
805 797
798 static void ReportFatalErrorInV8(const char* location, const char* message)
799 {
800 // V8 is shutdown, we cannot use V8 api.
801 // The only thing we can do is to disable JavaScript.
802 // TODO: clean up V8Proxy and disable JavaScript.
803 printf("V8 error: %s (%s)\n", message, location);
804 HandleFatalErrorInV8();
805 }
806 806
807 V8Proxy::~V8Proxy() 807 V8Proxy::~V8Proxy()
808 { 808 {
809 clearForClose(); 809 clearForClose();
810 DestroyGlobal(); 810 DestroyGlobal();
811 } 811 }
812 812
813 void V8Proxy::DestroyGlobal() 813 void V8Proxy::DestroyGlobal()
814 { 814 {
815 if (!m_global.IsEmpty()) { 815 if (!m_global.IsEmpty()) {
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
2840 v8::Handle<v8::Object> global = context->Global(); 2840 v8::Handle<v8::Object> global = context->Global();
2841 global->Set(v8::String::New(name), instance); 2841 global->Set(v8::String::New(name), instance);
2842 } 2842 }
2843 2843
2844 void V8Proxy::ProcessConsoleMessages() 2844 void V8Proxy::ProcessConsoleMessages()
2845 { 2845 {
2846 ConsoleMessageManager::ProcessDelayedMessages(); 2846 ConsoleMessageManager::ProcessDelayedMessages();
2847 } 2847 }
2848 2848
2849 } // namespace WebCore 2849 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698