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

Side by Side Diff: include/v8.h

Issue 24345003: remove Isolate::GetCurrent from Context api functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | samples/lineprocessor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4000 matching lines...) Expand 10 before | Expand all | Expand 10 after
4011 */ 4011 */
4012 HeapProfiler* GetHeapProfiler(); 4012 HeapProfiler* GetHeapProfiler();
4013 4013
4014 /** 4014 /**
4015 * Returns CPU profiler for this isolate. Will return NULL unless the isolate 4015 * Returns CPU profiler for this isolate. Will return NULL unless the isolate
4016 * is initialized. It is the embedder's responsibility to stop all CPU 4016 * is initialized. It is the embedder's responsibility to stop all CPU
4017 * profiling activities if it has started any. 4017 * profiling activities if it has started any.
4018 */ 4018 */
4019 CpuProfiler* GetCpuProfiler(); 4019 CpuProfiler* GetCpuProfiler();
4020 4020
4021 /** Returns true if this isolate has a current context. */
4022 bool InContext();
4023
4021 /** Returns the context that is on the top of the stack. */ 4024 /** Returns the context that is on the top of the stack. */
4022 Local<Context> GetCurrentContext(); 4025 Local<Context> GetCurrentContext();
4023 4026
4024 /** 4027 /**
4028 * Returns the context of the calling JavaScript code. That is the
4029 * context of the top-most JavaScript frame. If there are no
4030 * JavaScript frames an empty handle is returned.
4031 */
4032 Local<Context> GetCallingContext();
4033
4034 /** Returns the last entered context. */
4035 Local<Context> GetEnteredContext();
4036
4037 /**
4025 * Allows the host application to group objects together. If one 4038 * Allows the host application to group objects together. If one
4026 * object in the group is alive, all objects in the group are alive. 4039 * object in the group is alive, all objects in the group are alive.
4027 * After each garbage collection, object groups are removed. It is 4040 * After each garbage collection, object groups are removed. It is
4028 * intended to be used in the before-garbage-collection callback 4041 * intended to be used in the before-garbage-collection callback
4029 * function, for instance to simulate DOM tree connections among JS 4042 * function, for instance to simulate DOM tree connections among JS
4030 * wrapper objects. Object groups for all dependent handles need to 4043 * wrapper objects. Object groups for all dependent handles need to
4031 * be provided for kGCTypeMarkSweepCompact collections, for all other 4044 * be provided for kGCTypeMarkSweepCompact collections, for all other
4032 * garbage collection types it is sufficient to provide object groups 4045 * garbage collection types it is sufficient to provide object groups
4033 * for partially dependent handles only. 4046 * for partially dependent handles only.
4034 */ 4047 */
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
4916 * created by a previous call to Context::New with the same global 4929 * created by a previous call to Context::New with the same global
4917 * template. The state of the global object will be completely reset 4930 * template. The state of the global object will be completely reset
4918 * and only object identify will remain. 4931 * and only object identify will remain.
4919 */ 4932 */
4920 static Local<Context> New( 4933 static Local<Context> New(
4921 Isolate* isolate, 4934 Isolate* isolate,
4922 ExtensionConfiguration* extensions = NULL, 4935 ExtensionConfiguration* extensions = NULL,
4923 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(), 4936 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(),
4924 Handle<Value> global_object = Handle<Value>()); 4937 Handle<Value> global_object = Handle<Value>());
4925 4938
4926 /** Deprecated. Use Isolate version instead. */ 4939 // TODO(dcarney): Remove this function.
4927 V8_DEPRECATED(static Persistent<Context> New( 4940 /** Deprecated. Use Isolate::GetEnteredContext */
4928 ExtensionConfiguration* extensions = NULL,
4929 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(),
4930 Handle<Value> global_object = Handle<Value>()));
4931
4932 /** Returns the last entered context. */
4933 static Local<Context> GetEntered(); 4941 static Local<Context> GetEntered();
4934 4942
4935 // TODO(svenpanne) Actually deprecate this. 4943 // TODO(dcarney) Remove this function.
4936 /** Deprecated. Use Isolate::GetCurrentContext instead. */ 4944 /** Deprecated. Use Isolate::GetCurrentContext instead. */
4937 static Local<Context> GetCurrent(); 4945 static Local<Context> GetCurrent();
4938 4946
4939 /** 4947 // TODO(dcarney) Remove this function.
4940 * Returns the context of the calling JavaScript code. That is the 4948 /** Deprecated. Use Isolate::GetCallingContext instead. */
4941 * context of the top-most JavaScript frame. If there are no
4942 * JavaScript frames an empty handle is returned.
4943 */
4944 static Local<Context> GetCalling(); 4949 static Local<Context> GetCalling();
4945 4950
4946 /** 4951 /**
4947 * Sets the security token for the context. To access an object in 4952 * Sets the security token for the context. To access an object in
4948 * another context, the security tokens must match. 4953 * another context, the security tokens must match.
4949 */ 4954 */
4950 void SetSecurityToken(Handle<Value> token); 4955 void SetSecurityToken(Handle<Value> token);
4951 4956
4952 /** Restores the security token to the default value. */ 4957 /** Restores the security token to the default value. */
4953 void UseDefaultSecurityToken(); 4958 void UseDefaultSecurityToken();
(...skipping 11 matching lines...) Expand all
4965 4970
4966 /** 4971 /**
4967 * Exit this context. Exiting the current context restores the 4972 * Exit this context. Exiting the current context restores the
4968 * context that was in place when entering the current context. 4973 * context that was in place when entering the current context.
4969 */ 4974 */
4970 void Exit(); 4975 void Exit();
4971 4976
4972 /** Returns true if the context has experienced an out of memory situation. */ 4977 /** Returns true if the context has experienced an out of memory situation. */
4973 bool HasOutOfMemoryException(); 4978 bool HasOutOfMemoryException();
4974 4979
4975 /** Returns true if V8 has a current context. */ 4980 // TODO(dcarney) Remove this function.
4981 /** Deprecated. Use Isolate::InContext instead. */
4976 static bool InContext(); 4982 static bool InContext();
4977 4983
4978 /** Returns an isolate associated with a current context. */ 4984 /** Returns an isolate associated with a current context. */
4979 v8::Isolate* GetIsolate(); 4985 v8::Isolate* GetIsolate();
4980 4986
4981 /** 4987 /**
4982 * Gets the embedder data with the given index, which must have been set by a 4988 * Gets the embedder data with the given index, which must have been set by a
4983 * previous call to SetEmbedderData with the same index. Note that index 0 4989 * previous call to SetEmbedderData with the same index. Note that index 0
4984 * currently has a special meaning for Chrome's debugger. 4990 * currently has a special meaning for Chrome's debugger.
4985 */ 4991 */
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
6455 */ 6461 */
6456 6462
6457 6463
6458 } // namespace v8 6464 } // namespace v8
6459 6465
6460 6466
6461 #undef TYPE_CHECK 6467 #undef TYPE_CHECK
6462 6468
6463 6469
6464 #endif // V8_H_ 6470 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | samples/lineprocessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698