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

Side by Side Diff: src/d8.cc

Issue 1214803004: Fix cluster-fuzz found regression in d8 Workers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: assertThrows Created 5 years, 6 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 | test/mjsunit/regress/regress-crbug-504729.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 697
698 { 698 {
699 base::LockGuard<base::Mutex> lock_guard(&workers_mutex_); 699 base::LockGuard<base::Mutex> lock_guard(&workers_mutex_);
700 if (!allow_new_workers_) return; 700 if (!allow_new_workers_) return;
701 701
702 Worker* worker = new Worker; 702 Worker* worker = new Worker;
703 args.This()->SetInternalField(0, External::New(isolate, worker)); 703 args.This()->SetInternalField(0, External::New(isolate, worker));
704 workers_.Add(worker); 704 workers_.Add(worker);
705 705
706 String::Utf8Value function_string(args[0]->ToString()); 706 String::Utf8Value function_string(args[0]->ToString());
707 if (!*function_string) {
708 Throw(args.GetIsolate(), "Function.prototype.toString failed");
709 return;
710 }
707 worker->StartExecuteInThread(isolate, *function_string); 711 worker->StartExecuteInThread(isolate, *function_string);
708 } 712 }
709 } 713 }
710 714
711 715
712 void Shell::WorkerPostMessage(const v8::FunctionCallbackInfo<v8::Value>& args) { 716 void Shell::WorkerPostMessage(const v8::FunctionCallbackInfo<v8::Value>& args) {
713 Isolate* isolate = args.GetIsolate(); 717 Isolate* isolate = args.GetIsolate();
714 HandleScope handle_scope(isolate); 718 HandleScope handle_scope(isolate);
715 Local<Context> context = isolate->GetCurrentContext(); 719 Local<Context> context = isolate->GetCurrentContext();
716 720
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 } 2432 }
2429 2433
2430 } // namespace v8 2434 } // namespace v8
2431 2435
2432 2436
2433 #ifndef GOOGLE3 2437 #ifndef GOOGLE3
2434 int main(int argc, char* argv[]) { 2438 int main(int argc, char* argv[]) {
2435 return v8::Shell::Main(argc, argv); 2439 return v8::Shell::Main(argc, argv);
2436 } 2440 }
2437 #endif 2441 #endif
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-504729.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698