| Index: Source/modules/compositorworker/CompositorWorkerManager.h
 | 
| diff --git a/Source/modules/compositorworker/CompositorWorkerManager.h b/Source/modules/compositorworker/CompositorWorkerManager.h
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..23cb64edae8d4e1ed1e26757ee5f9f1c7ed11462
 | 
| --- /dev/null
 | 
| +++ b/Source/modules/compositorworker/CompositorWorkerManager.h
 | 
| @@ -0,0 +1,53 @@
 | 
| +// Copyright 2015 The Chromium Authors. All rights reserved.
 | 
| +// Use of this source code is governed by a BSD-style license that can be
 | 
| +// found in the LICENSE file.
 | 
| +
 | 
| +#ifndef CompositorWorkerManager_h
 | 
| +#define CompositorWorkerManager_h
 | 
| +
 | 
| +#include "core/workers/WorkerIsolateWrapper.h"
 | 
| +#include "modules/ModulesExport.h"
 | 
| +#include "wtf/OwnPtr.h"
 | 
| +#include "wtf/PassOwnPtr.h"
 | 
| +#include "wtf/ThreadingPrimitives.h"
 | 
| +#include <v8.h>
 | 
| +
 | 
| +namespace blink {
 | 
| +
 | 
| +class WebThreadSupportingGC;
 | 
| +
 | 
| +class MODULES_EXPORT CompositorWorkerManager final {
 | 
| +public:
 | 
| +    static void initialize();
 | 
| +    static void shutdown();
 | 
| +
 | 
| +    static CompositorWorkerManager* instance();
 | 
| +
 | 
| +    // Returns the thread used for compositor workers. This creates a new thread if a
 | 
| +    // thread doesn't already exist.
 | 
| +    WebThreadSupportingGC& compositorWorkerThread();
 | 
| +
 | 
| +    // Attempts to initialize/shutdown a thread if necessary. Does nothing if the thread
 | 
| +    // is already initialized, or if the thread has more than one active workers at the
 | 
| +    // time of shutdown.
 | 
| +    void initializeBackingThread();
 | 
| +    void shutdownBackingThread();
 | 
| +
 | 
| +    PassOwnPtr<WorkerIsolateWrapper> createIsolate();
 | 
| +    void willDestroyIsolate();
 | 
| +    void destroyIsolate();
 | 
| +    void terminateIsolate();
 | 
| +
 | 
| +private:
 | 
| +    CompositorWorkerManager();
 | 
| +    ~CompositorWorkerManager();
 | 
| +
 | 
| +    Mutex m_mutex;
 | 
| +    OwnPtr<WebThreadSupportingGC> m_thread;
 | 
| +    int m_workerCount = 0;
 | 
| +    OwnPtr<WorkerIsolateWrapper> m_isolate;
 | 
| +};
 | 
| +
 | 
| +} // namespace blink
 | 
| +
 | 
| +#endif // CompositorWorkerManager_h
 | 
| 
 |