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

Side by Side Diff: WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp

Issue 9572031: Don't be so CRASH happy in the bindings layer. (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 years, 9 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return true; 63 return true;
64 64
65 v8::Context::Scope scope(v8Context); 65 v8::Context::Scope scope(v8Context);
66 66
67 v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size()); 67 v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size());
68 for (size_t i = 0; i < mutations->size(); ++i) 68 for (size_t i = 0; i < mutations->size(); ++i)
69 mutationsArray->Set(v8::Integer::New(i), toV8(mutations->at(i).get())); 69 mutationsArray->Set(v8::Integer::New(i), toV8(mutations->at(i).get()));
70 70
71 v8::Handle<v8::Value> observerHandle = toV8(observer); 71 v8::Handle<v8::Value> observerHandle = toV8(observer);
72 if (observerHandle.IsEmpty()) { 72 if (observerHandle.IsEmpty()) {
73 CRASH(); 73 if (!isScriptControllerTerminating())
74 CRASH();
74 return true; 75 return true;
75 } 76 }
76 77
77 v8::Handle<v8::Value> argv[] = { 78 v8::Handle<v8::Value> argv[] = {
78 mutationsArray, 79 mutationsArray,
79 observerHandle 80 observerHandle
80 }; 81 };
81 82
82 bool callbackReturnValue = false; 83 bool callbackReturnValue = false;
83 return !invokeCallback(m_callback, 2, argv, callbackReturnValue, scriptExecu tionContext()); 84 return !invokeCallback(m_callback, 2, argv, callbackReturnValue, scriptExecu tionContext());
84 } 85 }
85 86
86 } // namespace WebCore 87 } // namespace WebCore
87 88
88 #endif // ENABLE(MUTATION_OBSERVERS) 89 #endif // ENABLE(MUTATION_OBSERVERS)
OLDNEW
« no previous file with comments | « WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp ('k') | WebCore/dom/ScriptExecutionContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698