*/
void SetEventLogger(LogEventCallback that);
+ /**
+ * Adds a callback to notify the host application when a script finished
+ * running. If a script re-enters the runtime during executing, the
+ * CallCompletedCallback is only invoked when the outer-most script
+ * execution ends. Executing scripts inside the callback do not trigger
+ * further callbacks.
+ */
+ void AddCallCompletedCallback(CallCompletedCallback callback);
+
+ /**
+ * Removes callback that was installed by AddCallCompletedCallback.
+ */
+ void RemoveCallCompletedCallback(CallCompletedCallback callback);
+
private:
template<class K, class V, class Traits> friend class PersistentValueMap;
* CallCompletedCallback is only invoked when the outer-most script
* execution ends. Executing scripts inside the callback do not trigger
* further callbacks.
+ *
+ * Will be deprecated soon. Use Isolate::AddCallCompletedCallback.
*/
static void AddCallCompletedCallback(CallCompletedCallback callback);
/**
* Removes callback that was installed by AddCallCompletedCallback.
+ *
+ * Will be deprecated soon. Use Isolate::RemoveCallCompletedCallback.
*/
static void RemoveCallCompletedCallback(CallCompletedCallback callback);
isolate->set_event_logger(that);
}
+
+void Isolate::AddCallCompletedCallback(CallCompletedCallback callback) {
+ if (callback == NULL) return;
+ // TODO(jochen): Make this per isolate.
+ i::V8::AddCallCompletedCallback(callback);
+}
+
+
+void Isolate::RemoveCallCompletedCallback(CallCompletedCallback callback) {
+ // TODO(jochen): Make this per isolate.
+ i::V8::RemoveCallCompletedCallback(callback);
+}
+
+
String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj)
: str_(NULL), length_(0) {
i::Isolate* isolate = i::Isolate::Current();