Index: src/preparse-data.h |
diff --git a/src/preparse-data.h b/src/preparse-data.h |
index e216cffd8268224d3c192b2101e03ffcf167d5c5..d78c3ed8dcef6af98a1989279f5f831773ecc5ab 100644 |
--- a/src/preparse-data.h |
+++ b/src/preparse-data.h |
@@ -13,8 +13,37 @@ |
namespace v8 { |
namespace internal { |
-class ScriptData; |
+class ScriptData { |
+ public: |
+ ScriptData(const byte* data, int length); |
+ ~ScriptData() { |
+ if (owns_data_) DeleteArray(data_); |
+ } |
+ |
+ const byte* data() const { return data_; } |
+ int length() const { return length_; } |
+ bool rejected() const { return rejected_; } |
+ |
+ void Reject() { rejected_ = true; } |
+ |
+ void AcquireDataOwnership() { |
+ DCHECK(!owns_data_); |
+ owns_data_ = true; |
+ } |
+ void ReleaseDataOwnership() { |
+ DCHECK(owns_data_); |
+ owns_data_ = false; |
+ } |
+ |
+ private: |
+ bool owns_data_ : 1; |
+ bool rejected_ : 1; |
+ const byte* data_; |
+ int length_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ScriptData); |
+}; |
// Abstract interface for preparse data recorder. |
class ParserRecorder { |