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

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

Issue 1074683002: [bindings] Use Local<> instead of Handle<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp » ('j') | 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) 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 { 113 {
114 // FIXME: handle sequences based on ES6 @@iterator, see http://crbug.com/393 866 114 // FIXME: handle sequences based on ES6 @@iterator, see http://crbug.com/393 866
115 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(blobParts); 115 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(blobParts);
116 uint32_t length = v8::Local<v8::Array>::Cast(blobParts)->Length(); 116 uint32_t length = v8::Local<v8::Array>::Cast(blobParts)->Length();
117 for (uint32_t i = 0; i < length; ++i) { 117 for (uint32_t i = 0; i < length; ++i) {
118 v8::Local<v8::Value> item = array->Get(i); 118 v8::Local<v8::Value> item = array->Get(i);
119 if (item.IsEmpty()) 119 if (item.IsEmpty())
120 return false; 120 return false;
121 121
122 if (V8ArrayBuffer::hasInstance(item, isolate)) { 122 if (V8ArrayBuffer::hasInstance(item, isolate)) {
123 DOMArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(v8::Handle<v8::O bject>::Cast(item)); 123 DOMArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(v8::Local<v8::Ob ject>::Cast(item));
124 ASSERT(arrayBuffer); 124 ASSERT(arrayBuffer);
125 blobData.appendBytes(arrayBuffer->data(), arrayBuffer->byteLength()) ; 125 blobData.appendBytes(arrayBuffer->data(), arrayBuffer->byteLength()) ;
126 } else if (V8ArrayBufferView::hasInstance(item, isolate)) { 126 } else if (V8ArrayBufferView::hasInstance(item, isolate)) {
127 DOMArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(v8:: Handle<v8::Object>::Cast(item)); 127 DOMArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(v8:: Local<v8::Object>::Cast(item));
128 ASSERT(arrayBufferView); 128 ASSERT(arrayBufferView);
129 blobData.appendBytes(arrayBufferView->baseAddress(), arrayBufferView ->byteLength()); 129 blobData.appendBytes(arrayBufferView->baseAddress(), arrayBufferView ->byteLength());
130 } else if (V8Blob::hasInstance(item, isolate)) { 130 } else if (V8Blob::hasInstance(item, isolate)) {
131 Blob* blob = V8Blob::toImpl(v8::Handle<v8::Object>::Cast(item)); 131 Blob* blob = V8Blob::toImpl(v8::Local<v8::Object>::Cast(item));
132 ASSERT(blob); 132 ASSERT(blob);
133 blob->appendTo(blobData); 133 blob->appendTo(blobData);
134 } else { 134 } else {
135 TOSTRING_DEFAULT(V8StringResource<>, stringValue, item, false); 135 TOSTRING_DEFAULT(V8StringResource<>, stringValue, item, false);
136 blobData.appendText(stringValue, normalizeLineEndingsToNative); 136 blobData.appendText(stringValue, normalizeLineEndingsToNative);
137 } 137 }
138 } 138 }
139 return true; 139 return true;
140 } 140 }
141 141
142 } // namespace V8BlobCustomHelpers 142 } // namespace V8BlobCustomHelpers
143 143
144 } // namespace blink 144 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698