Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(728)

Unified Diff: webkit/renderer/compositor_bindings/web_layer_impl.cc

Issue 61883006: Compositor thread plumbing for layout rectangle debug info. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODO, fixed nits. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/renderer/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/renderer/compositor_bindings/web_layer_impl.cc
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.cc b/webkit/renderer/compositor_bindings/web_layer_impl.cc
index 950f76e93a3e441b73ec5637a8c943ea2cdc44ab..fdf719ea7cd96b34637f618dd08658347a99c4fb 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl.cc
+++ b/webkit/renderer/compositor_bindings/web_layer_impl.cc
@@ -5,7 +5,9 @@
#include "webkit/renderer/compositor_bindings/web_layer_impl.h"
#include "base/bind.h"
+#include "base/debug/trace_event_impl.h"
#include "base/strings/string_util.h"
+#include "base/threading/thread_checker.h"
#include "cc/animation/animation.h"
#include "cc/base/region.h"
#include "cc/layers/layer.h"
@@ -13,6 +15,7 @@
#include "third_party/WebKit/public/platform/WebCompositingReasons.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/public/platform/WebFloatRect.h"
+#include "third_party/WebKit/public/platform/WebGraphicsLayerDebugInfo.h"
#include "third_party/WebKit/public/platform/WebLayerClient.h"
#include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h"
#include "third_party/WebKit/public/platform/WebLayerScrollClient.h"
@@ -372,6 +375,37 @@ void WebLayerImpl::setWebLayerClient(blink::WebLayerClient* client) {
web_layer_client_ = client;
}
+// TODO(chrishtr): move DebugName into this class.
+class TracedDebugInfo : public base::debug::ConvertableToTraceFormat {
+ public:
+ // This object takes ownership of the debug_info object.
+ explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info) :
+ debug_info_(debug_info) {}
+ virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ blink::WebString web_string;
+ debug_info_->appendAsTraceFormat(&web_string);
+ out->append(web_string.utf8());
+ }
+ private:
+ virtual ~TracedDebugInfo() {}
+ scoped_ptr<blink::WebGraphicsLayerDebugInfo> debug_info_;
+ base::ThreadChecker thread_checker_;
+};
+
+scoped_refptr<base::debug::ConvertableToTraceFormat>
+ WebLayerImpl::TakeDebugInfo() {
+ if (!web_layer_client_)
+ return NULL;
+ blink::WebGraphicsLayerDebugInfo* debug_info =
+ web_layer_client_->takeDebugInfo();
+
+ if (debug_info)
+ return new TracedDebugInfo(debug_info);
+ else
+ return NULL;
+}
+
std::string WebLayerImpl::DebugName() {
if (!web_layer_client_)
return std::string();
« no previous file with comments | « webkit/renderer/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698