OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3846 matching lines...) Loading... |
3857 * restore the connection between a global object and a context | 3857 * restore the connection between a global object and a context |
3858 * after DetachGlobal has been called. | 3858 * after DetachGlobal has been called. |
3859 * | 3859 * |
3860 * \param global_object The global object to reattach to the | 3860 * \param global_object The global object to reattach to the |
3861 * context. For this to work, the global object must be the global | 3861 * context. For this to work, the global object must be the global |
3862 * object that was associated with this context before a call to | 3862 * object that was associated with this context before a call to |
3863 * DetachGlobal. | 3863 * DetachGlobal. |
3864 */ | 3864 */ |
3865 void ReattachGlobal(Handle<Object> global_object); | 3865 void ReattachGlobal(Handle<Object> global_object); |
3866 | 3866 |
3867 /** Creates a new context. | 3867 /** |
| 3868 * Creates a new context and returns a handle to the newly allocated |
| 3869 * context. |
3868 * | 3870 * |
3869 * Returns a persistent handle to the newly allocated context. This | 3871 * \param isolate The isolate in which to create the context. |
3870 * persistent handle has to be disposed when the context is no | |
3871 * longer used so the context can be garbage collected. | |
3872 * | 3872 * |
3873 * \param extensions An optional extension configuration containing | 3873 * \param extensions An optional extension configuration containing |
3874 * the extensions to be installed in the newly created context. | 3874 * the extensions to be installed in the newly created context. |
3875 * | 3875 * |
3876 * \param global_template An optional object template from which the | 3876 * \param global_template An optional object template from which the |
3877 * global object for the newly created context will be created. | 3877 * global object for the newly created context will be created. |
3878 * | 3878 * |
3879 * \param global_object An optional global object to be reused for | 3879 * \param global_object An optional global object to be reused for |
3880 * the newly created context. This global object must have been | 3880 * the newly created context. This global object must have been |
3881 * created by a previous call to Context::New with the same global | 3881 * created by a previous call to Context::New with the same global |
3882 * template. The state of the global object will be completely reset | 3882 * template. The state of the global object will be completely reset |
3883 * and only object identify will remain. | 3883 * and only object identify will remain. |
3884 */ | 3884 */ |
| 3885 static Local<Context> New( |
| 3886 Isolate* isolate, |
| 3887 ExtensionConfiguration* extensions = NULL, |
| 3888 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(), |
| 3889 Handle<Value> global_object = Handle<Value>()); |
| 3890 |
| 3891 /** Deprecated. Use Isolate version instead. */ |
| 3892 // TODO(mstarzinger): Put this behind the V8_DEPRECATED guard. |
3885 static Persistent<Context> New( | 3893 static Persistent<Context> New( |
3886 ExtensionConfiguration* extensions = NULL, | 3894 ExtensionConfiguration* extensions = NULL, |
3887 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(), | 3895 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(), |
3888 Handle<Value> global_object = Handle<Value>()); | 3896 Handle<Value> global_object = Handle<Value>()); |
3889 | 3897 |
3890 /** Returns the last entered context. */ | 3898 /** Returns the last entered context. */ |
3891 static Local<Context> GetEntered(); | 3899 static Local<Context> GetEntered(); |
3892 | 3900 |
3893 /** Returns the context that is on the top of the stack. */ | 3901 /** Returns the context that is on the top of the stack. */ |
3894 static Local<Context> GetCurrent(); | 3902 static Local<Context> GetCurrent(); |
(...skipping 1144 matching lines...) Loading... |
5039 | 5047 |
5040 | 5048 |
5041 } // namespace v8 | 5049 } // namespace v8 |
5042 | 5050 |
5043 | 5051 |
5044 #undef V8EXPORT | 5052 #undef V8EXPORT |
5045 #undef TYPE_CHECK | 5053 #undef TYPE_CHECK |
5046 | 5054 |
5047 | 5055 |
5048 #endif // V8_H_ | 5056 #endif // V8_H_ |
OLD | NEW |