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

Side by Side Diff: Source/bindings/v8/V8Utilities.cpp

Issue 68533014: Improve Blob constructor error messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « Source/bindings/v8/V8Binding.h ('k') | Source/bindings/v8/custom/V8BlobCustom.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) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (isUndefinedOrNull(value)) { 69 if (isUndefinedOrNull(value)) {
70 ports.resize(0); 70 ports.resize(0);
71 arrayBuffers.resize(0); 71 arrayBuffers.resize(0);
72 return true; 72 return true;
73 } 73 }
74 74
75 uint32_t length = 0; 75 uint32_t length = 0;
76 if (value->IsArray()) { 76 if (value->IsArray()) {
77 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value); 77 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value);
78 length = array->Length(); 78 length = array->Length();
79 } else { 79 } else if (toV8Sequence(value, length, isolate).IsEmpty()) {
80 if (toV8Sequence(value, length, notASequence, isolate).IsEmpty()) 80 notASequence = true;
81 return false; 81 return false;
82 } 82 }
83 83
84 v8::Local<v8::Object> transferrables = v8::Local<v8::Object>::Cast(value); 84 v8::Local<v8::Object> transferrables = v8::Local<v8::Object>::Cast(value);
85 85
86 // Validate the passed array of transferrables. 86 // Validate the passed array of transferrables.
87 for (unsigned int i = 0; i < length; ++i) { 87 for (unsigned int i = 0; i < length; ++i) {
88 v8::Local<v8::Value> transferrable = transferrables->Get(i); 88 v8::Local<v8::Value> transferrable = transferrables->Get(i);
89 // Validation of non-null objects, per HTML5 spec 10.3.3. 89 // Validation of non-null objects, per HTML5 spec 10.3.3.
90 if (isUndefinedOrNull(transferrable)) { 90 if (isUndefinedOrNull(transferrable)) {
91 setDOMException(DataCloneError, isolate); 91 setDOMException(DataCloneError, isolate);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 ExecutionContext* getExecutionContext() 173 ExecutionContext* getExecutionContext()
174 { 174 {
175 if (WorkerScriptController* controller = WorkerScriptController::controllerF orContext()) 175 if (WorkerScriptController* controller = WorkerScriptController::controllerF orContext())
176 return &controller->workerGlobalScope(); 176 return &controller->workerGlobalScope();
177 177
178 return currentDocument(); 178 return currentDocument();
179 } 179 }
180 180
181 } // namespace WebCore 181 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | Source/bindings/v8/custom/V8BlobCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698