Reviewers: Sven Panne,

Message:
I'll remove the deprecated version once this has rolled and I've updated Blink
to use the new function.

PTAL.

Description:
Add isolate parameter to SetResourceConstraints, and deprecate version which
depends on current isolate.

BUG=None

Please review this at https://codereview.chromium.org/38993005/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+15, -2 lines):
  M include/v8.h
  M src/api.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 44a74ed5fea97282ce307cafd3d88df161da1adc..1d432b28704759e180bfbc7c4b8b3dbaac642da3 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3788,10 +3788,16 @@ class V8_EXPORT ResourceConstraints {
 };


+V8_DEPRECATED(
+    "Use SetResourceConstraints(constraints, isolate) instead",
+ bool V8_EXPORT SetResourceConstraints(ResourceConstraints* constraints));
+
+
 /**
- * Sets the given ResourceConstraints on the current isolate.
+ * Sets the given ResourceConstraints on the given Isolate.
  */
-bool V8_EXPORT SetResourceConstraints(ResourceConstraints* constraints);
+bool V8_EXPORT SetResourceConstraints(ResourceConstraints* constraints,
+                                      Isolate* isolate);


 // --- Exceptions ---
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 0bb374f2dc69bea8e712d4962363e835bfbb80bc..72e1252866d16b0414b8e08d1f9a28deb78a2451 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -568,7 +568,14 @@ ResourceConstraints::ResourceConstraints()

 bool SetResourceConstraints(ResourceConstraints* constraints) {
   i::Isolate* isolate = EnterIsolateIfNeeded();
+  return SetResourceConstraints(constraints,
+                                reinterpret_cast<Isolate*>(isolate));
+}
+

+bool SetResourceConstraints(ResourceConstraints* constraints,
+                            Isolate* v8_isolate) {
+  i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
   int young_space_size = constraints->max_young_space_size();
   int old_gen_size = constraints->max_old_space_size();
   int max_executable_size = constraints->max_executable_size();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to