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

Issue 9283015: Introduce readbinary function in d8 to read binary files. (Closed)

Created:
8 years, 11 months ago by Yang
Modified:
8 years, 11 months ago
Reviewers:
Jakob Kummerow
CC:
v8-dev
Visibility:
Public.

Description

Introduce readbinary function in d8 to read binary files. Committed: https://code.google.com/p/v8/source/detail?r=10486

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -0 lines) Patch
M src/d8.h View 2 chunks +22 lines, -0 lines 2 comments Download
M src/d8.cc View 2 chunks +15 lines, -0 lines 2 comments Download

Messages

Total messages: 2 (0 generated)
Yang
PTAL.
8 years, 11 months ago (2012-01-24 10:56:00 UTC) #1
Jakob Kummerow
8 years, 11 months ago (2012-01-24 11:30:20 UTC) #2
LGTM with comments.

http://codereview.chromium.org/9283015/diff/1/src/d8.cc
File src/d8.cc (right):

http://codereview.chromium.org/9283015/diff/1/src/d8.cc#newcode1026
src/d8.cc:1026: Handle<Value> Shell::ReadBinary(const Arguments& args) {
Wouldn't it make more sense to call this ReadExternalString or even
ReadIntoExternalString? I don't see what this has to do with binary files.

http://codereview.chromium.org/9283015/diff/1/src/d8.cc#newcode1027
src/d8.cc:1027: String::Utf8Value filename(args[0]);
What happens when the file doesn't exist? Maybe add:
  if (*filename == NULL) {
    return ThrowException(String::New("Error reading file"));
  }

http://codereview.chromium.org/9283015/diff/1/src/d8.h
File src/d8.h (right):

http://codereview.chromium.org/9283015/diff/1/src/d8.h#newcode200
src/d8.h:200: explicit BinaryResource(const char* string, int length)
nit: "explicit" is unnecessary.

http://codereview.chromium.org/9283015/diff/1/src/d8.h#newcode205
src/d8.h:205: delete data_;
shouldn't this be "delete[] data_"?

Powered by Google App Engine
This is Rietveld 408576698