| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 return true; | 907 return true; |
| 908 } | 908 } |
| 909 | 909 |
| 910 class LayerDebugInfo : public base::trace_event::ConvertableToTraceFormat { | 910 class LayerDebugInfo : public base::trace_event::ConvertableToTraceFormat { |
| 911 public: | 911 public: |
| 912 explicit LayerDebugInfo(const std::string& name) : name_(name) {} | 912 explicit LayerDebugInfo(const std::string& name) : name_(name) {} |
| 913 ~LayerDebugInfo() override {} | 913 ~LayerDebugInfo() override {} |
| 914 void AppendAsTraceFormat(std::string* out) const override { | 914 void AppendAsTraceFormat(std::string* out) const override { |
| 915 base::DictionaryValue dictionary; | 915 base::DictionaryValue dictionary; |
| 916 dictionary.SetString("layer_name", name_); | 916 dictionary.SetString("layer_name", name_); |
| 917 base::JSONWriter::Write(dictionary, out); | 917 std::string tmp; |
| 918 base::JSONWriter::Write(dictionary, &tmp); |
| 919 out->append(tmp); |
| 918 } | 920 } |
| 919 | 921 |
| 920 private: | 922 private: |
| 921 std::string name_; | 923 std::string name_; |
| 922 }; | 924 }; |
| 923 | 925 |
| 924 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 926 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| 925 Layer::TakeDebugInfo(cc::Layer* layer) { | 927 Layer::TakeDebugInfo(cc::Layer* layer) { |
| 926 return base::WrapUnique(new LayerDebugInfo(name_)); | 928 return base::WrapUnique(new LayerDebugInfo(name_)); |
| 927 } | 929 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), | 1175 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), |
| 1174 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { | 1176 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { |
| 1175 return mirror_ptr.get() == mirror; | 1177 return mirror_ptr.get() == mirror; |
| 1176 }); | 1178 }); |
| 1177 | 1179 |
| 1178 DCHECK(it != mirrors_.end()); | 1180 DCHECK(it != mirrors_.end()); |
| 1179 mirrors_.erase(it); | 1181 mirrors_.erase(it); |
| 1180 } | 1182 } |
| 1181 | 1183 |
| 1182 } // namespace ui | 1184 } // namespace ui |
| OLD | NEW |