/** This is called when the native library are ready. */
  public void onNativeLibraryReady(
      WindowAndroid windowAndroid, TabContentManager tabContentManager) {
    assert mLayerTitleCache == null : "Should be called once";

    if (DeviceClassManager.enableLayerDecorationCache()) {
      mLayerTitleCache = new LayerTitleCache(getContext());
    }

    mCompositorView.initNativeCompositor(
        SysUtils.isLowEndDevice(), windowAndroid, mLayerTitleCache, tabContentManager);

    if (mLayerTitleCache != null) {
      mLayerTitleCache.setResourceManager(getResourceManager());
    }

    if (mControlContainer != null) {
      mCompositorView
          .getResourceManager()
          .getDynamicResourceLoader()
          .registerResource(R.id.control_container, mControlContainer.getToolbarResourceAdapter());

      ViewResourceAdapter progressAdapter = mControlContainer.getProgressResourceAdapter();
      if (progressAdapter != null) {
        mCompositorView
            .getResourceManager()
            .getDynamicResourceLoader()
            .registerResource(R.id.progress, progressAdapter);
      }
    }
  }
 /** Should be called for cleanup when the CompositorView instance is no longer used. */
 public void shutDown() {
   setTab(null);
   if (mLayerTitleCache != null) mLayerTitleCache.shutDown();
   mCompositorView.shutDown();
 }