code: function(extent, res) {
          var upperLeft = new OpenLayers.Geometry.Point(extent.left, extent.top);
          var bottomRight = new OpenLayers.Geometry.Point(extent.right, extent.bottom);
          var start = this.getContainingTileCoords(upperLeft, res);
          var end = this.getContainingTileCoords(bottomRight, res);
          var lod = {
              resolution: res,
              startTileCol: start.x,
              startTileRow: start.y,
              endTileCol: end.x,
              endTileRow: end.y
          };
          return this.calculateMaxExtentWithLOD(lod);
     }
docs: Method: calculateMaxExtentWithExtent
  Given a 'suggested' max extent from the server, this function uses
  information about the actual tile sizes to determine the actual
  extent of the layer.
  
  Parameters:
  extent - {<OpenLayers.Bounds>} The 'suggested' extent for the layer
  res - {Float} The resolution for which to compute the extent.
  
  Returns:
  {<OpenLayers.Bounds>} The actual extent of the tiles for the given zoom level