Chromium Code Reviews| Index: src/d8.h |
| diff --git a/src/d8.h b/src/d8.h |
| index 60a8c1bf760b722b880fdea52e73d3589615996a..7f3e31bfb0d2e96365d95b26ec8ab74e2b12c3ed 100644 |
| --- a/src/d8.h |
| +++ b/src/d8.h |
| @@ -195,6 +195,27 @@ class SourceGroup { |
| }; |
| +class BinaryResource : public v8::String::ExternalAsciiStringResource { |
| + public: |
| + explicit BinaryResource(const char* string, int length) |
|
Jakob Kummerow
2012/01/24 11:30:20
nit: "explicit" is unnecessary.
|
| + : data_(string), |
| + length_(length) { } |
| + |
| + ~BinaryResource() { |
| + delete data_; |
|
Jakob Kummerow
2012/01/24 11:30:20
shouldn't this be "delete[] data_"?
|
| + data_ = NULL; |
| + length_ = 0; |
| + } |
| + |
| + virtual const char* data() const { return data_; } |
| + virtual size_t length() const { return length_; } |
| + |
| + private: |
| + const char* data_; |
| + size_t length_; |
| +}; |
| + |
| + |
| class ShellOptions { |
| public: |
| ShellOptions() : |
| @@ -286,6 +307,7 @@ class Shell : public i::AllStatic { |
| static Handle<Value> EnableProfiler(const Arguments& args); |
| static Handle<Value> DisableProfiler(const Arguments& args); |
| static Handle<Value> Read(const Arguments& args); |
| + static Handle<Value> ReadBinary(const Arguments& args); |
| static Handle<String> ReadFromStdin(); |
| static Handle<Value> ReadLine(const Arguments& args) { |
| return ReadFromStdin(); |