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

Side by Side Diff: Source/core/workers/WorkerThread.cpp

Issue 1257723002: Simplify ownership of a ThreadState's interruptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 backingThread().shutdown(); 432 backingThread().shutdown();
433 } 433 }
434 434
435 v8::Isolate* WorkerThread::initializeIsolate() 435 v8::Isolate* WorkerThread::initializeIsolate()
436 { 436 {
437 ASSERT(isCurrentThread()); 437 ASSERT(isCurrentThread());
438 ASSERT(!m_isolate); 438 ASSERT(!m_isolate);
439 v8::Isolate* isolate = V8PerIsolateData::initialize(); 439 v8::Isolate* isolate = V8PerIsolateData::initialize();
440 V8Initializer::initializeWorker(isolate); 440 V8Initializer::initializeWorker(isolate);
441 441
442 m_interruptor = adoptPtr(new V8IsolateInterruptor(isolate)); 442 ThreadState::current()->addInterruptor(new V8IsolateInterruptor(isolate));
443 ThreadState::current()->addInterruptor(m_interruptor.get());
444 ThreadState::current()->registerTraceDOMWrappers(isolate, V8GCController::tr aceDOMWrappers); 443 ThreadState::current()->registerTraceDOMWrappers(isolate, V8GCController::tr aceDOMWrappers);
445 444
446 return isolate; 445 return isolate;
447 } 446 }
448 447
449 void WorkerThread::willDestroyIsolate() 448 void WorkerThread::willDestroyIsolate()
450 { 449 {
451 ASSERT(isCurrentThread()); 450 ASSERT(isCurrentThread());
452 ASSERT(m_isolate); 451 ASSERT(m_isolate);
453 V8PerIsolateData::willBeDestroyed(m_isolate); 452 V8PerIsolateData::willBeDestroyed(m_isolate);
454 ThreadState::current()->removeInterruptor(m_interruptor.get());
455 } 453 }
456 454
457 void WorkerThread::destroyIsolate() 455 void WorkerThread::destroyIsolate()
458 { 456 {
459 ASSERT(isCurrentThread()); 457 ASSERT(isCurrentThread());
460 V8PerIsolateData::destroy(m_isolate); 458 V8PerIsolateData::destroy(m_isolate);
461 } 459 }
462 460
463 void WorkerThread::terminateV8Execution() 461 void WorkerThread::terminateV8Execution()
464 { 462 {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); 506 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get());
509 } 507 }
510 508
511 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) 509 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController)
512 { 510 {
513 MutexLocker locker(m_workerInspectorControllerMutex); 511 MutexLocker locker(m_workerInspectorControllerMutex);
514 m_workerInspectorController = workerInspectorController; 512 m_workerInspectorController = workerInspectorController;
515 } 513 }
516 514
517 } // namespace blink 515 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698