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

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: Switch addInterruptor() to take a PassOwnPtr<> 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 OwnPtr<V8IsolateInterruptor> interruptor = adoptPtr(new V8IsolateInterruptor (isolate));
443 ThreadState::current()->addInterruptor(m_interruptor.get()); 443 ThreadState::current()->addInterruptor(interruptor.release());
444 ThreadState::current()->registerTraceDOMWrappers(isolate, V8GCController::tr aceDOMWrappers); 444 ThreadState::current()->registerTraceDOMWrappers(isolate, V8GCController::tr aceDOMWrappers);
445 445
446 return isolate; 446 return isolate;
447 } 447 }
448 448
449 void WorkerThread::willDestroyIsolate() 449 void WorkerThread::willDestroyIsolate()
450 { 450 {
451 ASSERT(isCurrentThread()); 451 ASSERT(isCurrentThread());
452 ASSERT(m_isolate); 452 ASSERT(m_isolate);
453 V8PerIsolateData::willBeDestroyed(m_isolate); 453 V8PerIsolateData::willBeDestroyed(m_isolate);
454 ThreadState::current()->removeInterruptor(m_interruptor.get());
455 } 454 }
456 455
457 void WorkerThread::destroyIsolate() 456 void WorkerThread::destroyIsolate()
458 { 457 {
459 ASSERT(isCurrentThread()); 458 ASSERT(isCurrentThread());
460 V8PerIsolateData::destroy(m_isolate); 459 V8PerIsolateData::destroy(m_isolate);
461 } 460 }
462 461
463 void WorkerThread::terminateV8Execution() 462 void WorkerThread::terminateV8Execution()
464 { 463 {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); 507 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get());
509 } 508 }
510 509
511 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) 510 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController)
512 { 511 {
513 MutexLocker locker(m_workerInspectorControllerMutex); 512 MutexLocker locker(m_workerInspectorControllerMutex);
514 m_workerInspectorController = workerInspectorController; 513 m_workerInspectorController = workerInspectorController;
515 } 514 }
516 515
517 } // namespace blink 516 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerThread.h ('k') | Source/modules/compositorworker/CompositorWorkerManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698