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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/layers/LayerTreeModel.js

Issue 2453673002: [DevTools] Scope common protocol infrastructure under Protocol namespace in a separate module. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 * @override 430 * @override
431 * @param {function(!Array.<string>)} callback 431 * @param {function(!Array.<string>)} callback
432 */ 432 */
433 requestCompositingReasons: function(callback) 433 requestCompositingReasons: function(callback)
434 { 434 {
435 if (!this._target) { 435 if (!this._target) {
436 callback([]); 436 callback([]);
437 return; 437 return;
438 } 438 }
439 439
440 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.reasonsForCompositingLayer(): ", undefined, []); 440 var wrappedCallback = Protocol.wrapClientCallback(callback, "LayerTreeAg ent.reasonsForCompositingLayer(): ", undefined, []);
441 this._target.layerTreeAgent().compositingReasons(this.id(), wrappedCallb ack); 441 this._target.layerTreeAgent().compositingReasons(this.id(), wrappedCallb ack);
442 }, 442 },
443 443
444 /** 444 /**
445 * @override 445 * @override
446 * @return {boolean} 446 * @return {boolean}
447 */ 447 */
448 drawsContent: function() 448 drawsContent: function()
449 { 449 {
450 return this._layerPayload.drawsContent; 450 return this._layerPayload.drawsContent;
(...skipping 15 matching lines...) Expand all
466 /** 466 /**
467 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback 467 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback
468 */ 468 */
469 requestSnapshot: function(callback) 469 requestSnapshot: function(callback)
470 { 470 {
471 if (!this._target) { 471 if (!this._target) {
472 callback(); 472 callback();
473 return; 473 return;
474 } 474 }
475 475
476 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, thi s._target)); 476 var wrappedCallback = Protocol.wrapClientCallback(callback, "LayerTreeAg ent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, this._targe t));
477 this._target.layerTreeAgent().makeSnapshot(this.id(), wrappedCallback); 477 this._target.layerTreeAgent().makeSnapshot(this.id(), wrappedCallback);
478 }, 478 },
479 479
480 /** 480 /**
481 * @param {!DOMAgent.Rect} rect 481 * @param {!DOMAgent.Rect} rect
482 */ 482 */
483 _didPaint: function(rect) 483 _didPaint: function(rect)
484 { 484 {
485 this._lastPaintRect = rect; 485 this._lastPaintRect = rect;
486 this._paintCount = this.paintCount() + 1; 486 this._paintCount = this.paintCount() + 1;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 WebInspector.LayerTreeModel.fromTarget = function(target) 603 WebInspector.LayerTreeModel.fromTarget = function(target)
604 { 604 {
605 if (!target.hasDOMCapability()) 605 if (!target.hasDOMCapability())
606 return null; 606 return null;
607 607
608 var model = /** @type {?WebInspector.LayerTreeModel} */ (target.model(WebIns pector.LayerTreeModel)); 608 var model = /** @type {?WebInspector.LayerTreeModel} */ (target.model(WebIns pector.LayerTreeModel));
609 if (!model) 609 if (!model)
610 model = new WebInspector.LayerTreeModel(target); 610 model = new WebInspector.LayerTreeModel(target);
611 return model; 611 return model;
612 }; 612 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698