OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 length = v8::Local<v8::Array>::Cast(info[0])->Length(); | 58 length = v8::Local<v8::Array>::Cast(info[0])->Length(); |
59 } else { | 59 } else { |
60 const int sequenceArgumentIndex = 0; | 60 const int sequenceArgumentIndex = 0; |
61 if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate())
.IsEmpty()) { | 61 if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate())
.IsEmpty()) { |
62 exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgum
entOrValue(sequenceArgumentIndex + 1)); | 62 exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgum
entOrValue(sequenceArgumentIndex + 1)); |
63 exceptionState.throwIfNeeded(); | 63 exceptionState.throwIfNeeded(); |
64 return; | 64 return; |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, fileName, info[1]); | 68 V8STRINGRESOURCE_PREPARE_VOID(V8StringResource<>, fileName, info[1]); |
69 | 69 |
70 V8BlobCustomHelpers::ParsedProperties properties(true); | 70 V8BlobCustomHelpers::ParsedProperties properties(true); |
71 if (info.Length() > 2) { | 71 if (info.Length() > 2) { |
72 if (!info[2]->IsObject()) { | 72 if (!info[2]->IsObject()) { |
73 exceptionState.throwTypeError("The 3rd argument is not of type Objec
t."); | 73 exceptionState.throwTypeError("The 3rd argument is not of type Objec
t."); |
74 exceptionState.throwIfNeeded(); | 74 exceptionState.throwIfNeeded(); |
75 return; | 75 return; |
76 } | 76 } |
77 | 77 |
78 if (!properties.parseBlobPropertyBag(info[2], "File", exceptionState, in
fo.GetIsolate())) { | 78 if (!properties.parseBlobPropertyBag(info[2], "File", exceptionState, in
fo.GetIsolate())) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 double lastModified = file->lastModifiedDate(); | 117 double lastModified = file->lastModifiedDate(); |
118 if (!isValidFileTime(lastModified)) | 118 if (!isValidFileTime(lastModified)) |
119 lastModified = currentTimeMS(); | 119 lastModified = currentTimeMS(); |
120 | 120 |
121 // lastModified returns a number, not a Date instance. | 121 // lastModified returns a number, not a Date instance. |
122 // http://dev.w3.org/2006/webapi/FileAPI/#file-attrs | 122 // http://dev.w3.org/2006/webapi/FileAPI/#file-attrs |
123 v8SetReturnValue(info, floor(lastModified)); | 123 v8SetReturnValue(info, floor(lastModified)); |
124 } | 124 } |
125 | 125 |
126 } // namespace WebCore | 126 } // namespace WebCore |
OLD | NEW |