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

Side by Side Diff: Source/bindings/core/dart/V8Converter.cpp

Issue 1385363002: convert TypedData to ArrayBufferView, not ArrayBuffer (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return v8::Handle<v8::Value>(); 133 return v8::Handle<v8::Value>();
134 } 134 }
135 135
136 v8::Handle<v8::Value> V8Converter::toV8IfBrowserNative(DartDOMData* domData, Dar t_Handle value, Dart_Handle& exception) 136 v8::Handle<v8::Value> V8Converter::toV8IfBrowserNative(DartDOMData* domData, Dar t_Handle value, Dart_Handle& exception)
137 { 137 {
138 if (Dart_IsByteBuffer(value)) { 138 if (Dart_IsByteBuffer(value)) {
139 Dart_Handle data = Dart_GetDataFromByteBuffer(value); 139 Dart_Handle data = Dart_GetDataFromByteBuffer(value);
140 return arrayBufferToV8(data, exception); 140 return arrayBufferToV8(data, exception);
141 } 141 }
142 if (Dart_IsTypedData(value)) 142 if (Dart_IsTypedData(value))
143 return arrayBufferToV8(value, exception); 143 return arrayBufferViewToV8(value, exception);
144 // TODO(terry): Using JS Interop only arrays are converted. 144 // TODO(terry): Using JS Interop only arrays are converted.
145 /* 145 /*
146 if (DartDOMWrapper::subtypeOf(value, DartBlob::dartClassId)) 146 if (DartDOMWrapper::subtypeOf(value, DartBlob::dartClassId))
147 return blobToV8(value, exception); 147 return blobToV8(value, exception);
148 if (DartDOMWrapper::subtypeOf(value, DartImageData::dartClassId)) 148 if (DartDOMWrapper::subtypeOf(value, DartImageData::dartClassId))
149 return imageDataToV8(value, exception); 149 return imageDataToV8(value, exception);
150 if (DartDOMWrapper::subtypeOf(value, DartIDBKeyRange::dartClassId)) 150 if (DartDOMWrapper::subtypeOf(value, DartIDBKeyRange::dartClassId))
151 return idbKeyRangeToV8(value, exception); 151 return idbKeyRangeToV8(value, exception);
152 if (DartDOMWrapper::subtypeOf(value, DartDOMStringList::dartClassId)) 152 if (DartDOMWrapper::subtypeOf(value, DartDOMStringList::dartClassId))
153 return domStringListToV8(value, exception); 153 return domStringListToV8(value, exception);
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 } 548 }
549 } 549 }
550 550
551 Dart_Handle V8Converter::arrayBufferViewToDart(v8::Handle<v8::Object> object, Da rt_Handle& exception) 551 Dart_Handle V8Converter::arrayBufferViewToDart(v8::Handle<v8::Object> object, Da rt_Handle& exception)
552 { 552 {
553 RefPtr<ArrayBufferView> view = V8ArrayBufferView::toImpl(object); 553 RefPtr<ArrayBufferView> view = V8ArrayBufferView::toImpl(object);
554 return DartUtilities::arrayBufferViewToDart(view.get()); 554 return DartUtilities::arrayBufferViewToDart(view.get());
555 } 555 }
556 556
557 } // namespace blink 557 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698