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

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

Issue 125043004: Remove world type from hasInstance() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return true; 107 return true;
108 } 108 }
109 109
110 bool processBlobParts(v8::Local<v8::Object> blobParts, uint32_t blobPartsLength, bool normalizeLineEndingsToNative, BlobData& blobData, v8::Isolate* isolate) 110 bool processBlobParts(v8::Local<v8::Object> blobParts, uint32_t blobPartsLength, bool normalizeLineEndingsToNative, BlobData& blobData, v8::Isolate* isolate)
111 { 111 {
112 for (uint32_t i = 0; i < blobPartsLength; ++i) { 112 for (uint32_t i = 0; i < blobPartsLength; ++i) {
113 v8::Local<v8::Value> item = blobParts->Get(v8::Uint32::New(isolate, i)); 113 v8::Local<v8::Value> item = blobParts->Get(v8::Uint32::New(isolate, i));
114 if (item.IsEmpty()) 114 if (item.IsEmpty())
115 return false; 115 return false;
116 116
117 if (V8ArrayBuffer::hasInstance(item, isolate, worldType(isolate))) { 117 if (V8ArrayBuffer::hasInstance(item, isolate)) {
118 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(v8::Handle<v8::Ob ject>::Cast(item)); 118 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(v8::Handle<v8::Ob ject>::Cast(item));
119 ASSERT(arrayBuffer); 119 ASSERT(arrayBuffer);
120 blobData.appendArrayBuffer(arrayBuffer); 120 blobData.appendArrayBuffer(arrayBuffer);
121 } else if (V8ArrayBufferView::hasInstance(item, isolate, worldType(isola te))) { 121 } else if (V8ArrayBufferView::hasInstance(item, isolate)) {
122 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::H andle<v8::Object>::Cast(item)); 122 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::H andle<v8::Object>::Cast(item));
123 ASSERT(arrayBufferView); 123 ASSERT(arrayBufferView);
124 blobData.appendArrayBufferView(arrayBufferView); 124 blobData.appendArrayBufferView(arrayBufferView);
125 } else if (V8Blob::hasInstance(item, isolate, worldType(isolate))) { 125 } else if (V8Blob::hasInstance(item, isolate)) {
126 Blob* blob = V8Blob::toNative(v8::Handle<v8::Object>::Cast(item)); 126 Blob* blob = V8Blob::toNative(v8::Handle<v8::Object>::Cast(item));
127 ASSERT(blob); 127 ASSERT(blob);
128 blob->appendTo(blobData); 128 blob->appendTo(blobData);
129 } else { 129 } else {
130 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringVal ue, item, false); 130 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringVal ue, item, false);
131 blobData.appendText(stringValue, normalizeLineEndingsToNative); 131 blobData.appendText(stringValue, normalizeLineEndingsToNative);
132 } 132 }
133 } 133 }
134 return true; 134 return true;
135 } 135 }
136 136
137 } // namespace V8BlobCustomHelpers 137 } // namespace V8BlobCustomHelpers
138 138
139 } // namespace WebCore 139 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8ArrayBufferViewCustom.h ('k') | Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698