Don't consider a Bluetooth adapter present until it has an address.
[chromium-blink-merge.git] / cc / TreeSynchronizer.h
blob5c59e5bfc05e1ae56508b6c62d1608694b159fa2
1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef TreeSynchronizer_h
6 #define TreeSynchronizer_h
8 #include <wtf/HashMap.h>
9 #include <wtf/Noncopyable.h>
10 #include <wtf/OwnPtr.h>
11 #include <wtf/PassOwnPtr.h>
13 namespace WebCore {
15 class CCLayerImpl;
16 class CCLayerTreeHostImpl;
17 class LayerChromium;
19 class TreeSynchronizer {
20 WTF_MAKE_NONCOPYABLE(TreeSynchronizer);
21 public:
22 // Accepts a LayerChromium tree and returns a reference to a CCLayerImpl tree that duplicates the structure
23 // of the LayerChromium tree, reusing the CCLayerImpls in the tree provided by oldCCLayerImplRoot if possible.
24 static PassOwnPtr<CCLayerImpl> synchronizeTrees(LayerChromium* layerRoot, PassOwnPtr<CCLayerImpl> oldCCLayerImplRoot, CCLayerTreeHostImpl*);
26 private:
27 TreeSynchronizer(); // Not instantiable.
29 typedef HashMap<int, OwnPtr<CCLayerImpl> > OwnPtrCCLayerImplMap;
30 typedef HashMap<int, CCLayerImpl*> RawPtrCCLayerImplMap;
32 // Declared as static member functions so they can access functions on LayerChromium as a friend class.
33 static PassOwnPtr<CCLayerImpl> reuseOrCreateCCLayerImpl(RawPtrCCLayerImplMap& newLayers, OwnPtrCCLayerImplMap& oldLayers, LayerChromium*);
34 static void collectExistingCCLayerImplRecursive(OwnPtrCCLayerImplMap& oldLayers, PassOwnPtr<CCLayerImpl>);
35 static PassOwnPtr<CCLayerImpl> synchronizeTreeRecursive(RawPtrCCLayerImplMap& newLayers, OwnPtrCCLayerImplMap& oldLayers, LayerChromium*, CCLayerTreeHostImpl*);
36 static void updateScrollbarLayerPointersRecursive(const RawPtrCCLayerImplMap& newLayers, LayerChromium*);
39 } // namespace WebCore
41 #endif // TreeSynchronizer_h