OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/blink/web_layer_impl.h" | 5 #include "cc/blink/web_layer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event_impl.h" | 8 #include "base/debug/trace_event_impl.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 436 |
437 void WebLayerImpl::setWebLayerClient(blink::WebLayerClient* client) { | 437 void WebLayerImpl::setWebLayerClient(blink::WebLayerClient* client) { |
438 web_layer_client_ = client; | 438 web_layer_client_ = client; |
439 } | 439 } |
440 | 440 |
441 class TracedDebugInfo : public base::debug::ConvertableToTraceFormat { | 441 class TracedDebugInfo : public base::debug::ConvertableToTraceFormat { |
442 public: | 442 public: |
443 // This object takes ownership of the debug_info object. | 443 // This object takes ownership of the debug_info object. |
444 explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info) | 444 explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info) |
445 : debug_info_(debug_info) {} | 445 : debug_info_(debug_info) {} |
446 virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE { | 446 virtual void AppendAsTraceFormat(std::string* out) const override { |
447 DCHECK(thread_checker_.CalledOnValidThread()); | 447 DCHECK(thread_checker_.CalledOnValidThread()); |
448 blink::WebString web_string; | 448 blink::WebString web_string; |
449 debug_info_->appendAsTraceFormat(&web_string); | 449 debug_info_->appendAsTraceFormat(&web_string); |
450 out->append(web_string.utf8()); | 450 out->append(web_string.utf8()); |
451 } | 451 } |
452 | 452 |
453 private: | 453 private: |
454 virtual ~TracedDebugInfo() {} | 454 virtual ~TracedDebugInfo() {} |
455 scoped_ptr<blink::WebGraphicsLayerDebugInfo> debug_info_; | 455 scoped_ptr<blink::WebGraphicsLayerDebugInfo> debug_info_; |
456 base::ThreadChecker thread_checker_; | 456 base::ThreadChecker thread_checker_; |
(...skipping 24 matching lines...) Expand all Loading... |
481 if (parent) | 481 if (parent) |
482 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 482 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
483 layer_->SetClipParent(clip_parent); | 483 layer_->SetClipParent(clip_parent); |
484 } | 484 } |
485 | 485 |
486 Layer* WebLayerImpl::layer() const { | 486 Layer* WebLayerImpl::layer() const { |
487 return layer_.get(); | 487 return layer_.get(); |
488 } | 488 } |
489 | 489 |
490 } // namespace cc_blink | 490 } // namespace cc_blink |
OLD | NEW |