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

Side by Side Diff: Source/bindings/core/v8/custom/V8BlobCustomHelpers.cpp

Issue 537403002: bindings: Renames from/toInternalPointer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 3 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
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 { 110 {
111 // FIXME: handle sequences based on ES6 @@iterator, see http://crbug.com/393 866 111 // FIXME: handle sequences based on ES6 @@iterator, see http://crbug.com/393 866
112 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(blobParts); 112 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(blobParts);
113 uint32_t length = v8::Local<v8::Array>::Cast(blobParts)->Length(); 113 uint32_t length = v8::Local<v8::Array>::Cast(blobParts)->Length();
114 for (uint32_t i = 0; i < length; ++i) { 114 for (uint32_t i = 0; i < length; ++i) {
115 v8::Local<v8::Value> item = array->Get(i); 115 v8::Local<v8::Value> item = array->Get(i);
116 if (item.IsEmpty()) 116 if (item.IsEmpty())
117 return false; 117 return false;
118 118
119 if (V8ArrayBuffer::hasInstance(item, isolate)) { 119 if (V8ArrayBuffer::hasInstance(item, isolate)) {
120 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(v8::Handle<v8::Ob ject>::Cast(item)); 120 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(v8::Handle<v8::Obje ct>::Cast(item));
121 ASSERT(arrayBuffer); 121 ASSERT(arrayBuffer);
122 blobData.appendArrayBuffer(arrayBuffer); 122 blobData.appendArrayBuffer(arrayBuffer);
123 } else if (V8ArrayBufferView::hasInstance(item, isolate)) { 123 } else if (V8ArrayBufferView::hasInstance(item, isolate)) {
124 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::H andle<v8::Object>::Cast(item)); 124 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(v8::Han dle<v8::Object>::Cast(item));
125 ASSERT(arrayBufferView); 125 ASSERT(arrayBufferView);
126 blobData.appendArrayBufferView(arrayBufferView); 126 blobData.appendArrayBufferView(arrayBufferView);
127 } else if (V8Blob::hasInstance(item, isolate)) { 127 } else if (V8Blob::hasInstance(item, isolate)) {
128 Blob* blob = V8Blob::toNative(v8::Handle<v8::Object>::Cast(item)); 128 Blob* blob = V8Blob::toImpl(v8::Handle<v8::Object>::Cast(item));
129 ASSERT(blob); 129 ASSERT(blob);
130 blob->appendTo(blobData); 130 blob->appendTo(blobData);
131 } else { 131 } else {
132 TOSTRING_DEFAULT(V8StringResource<>, stringValue, item, false); 132 TOSTRING_DEFAULT(V8StringResource<>, stringValue, item, false);
133 blobData.appendText(stringValue, normalizeLineEndingsToNative); 133 blobData.appendText(stringValue, normalizeLineEndingsToNative);
134 } 134 }
135 } 135 }
136 return true; 136 return true;
137 } 137 }
138 138
139 } // namespace V8BlobCustomHelpers 139 } // namespace V8BlobCustomHelpers
140 140
141 } // namespace blink 141 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698