|
|
Corrections after the second round of code review.
o Weak typing of the cache key generation.
o Coding style corrections.
o Reverted unjustified variable name and comment changes.
Reinforce the image rewriter tests.
o Adds a test image.
o Now checks the image dimensions.
Improved parameter processing.
o Corrected the parameter reading.
o Ignore the unusable parameters.
Applies the advice from the code review.
The old behavior of AbstractHttpCache.getOwnerId() was to return
ownerId as-is. Since ownerId may be null, this amounted to inserting
a literal "null" in the cache key. As we probably don't want that
(it's colliding with the owner id which in fact is "null"), the
getOwnerId(HttpRequest) now returns an empty string literal for a null
owner ID.
Removed the text fixture that depends on the used JVM. The
checksum-based tests turned out not to be portable across JVMs, so I
had to exclude them, until I get a better idea on how to test the
resize, without duplicating the actual resizing code.
Changes Copyright (c) 2009 Google
The code and cleanup to support proxied image resizing.
Based on the initial work of Paul Lindner of Hi5. His work in turn is
based on further contributions, but I don't know at present which ones.
New contributions are Copyright (c) 2009 Google. Rest by Paul Lindner.
o Reorganized the image rewriter implementation from Paul, and corrected
a few bugs in the image dimensions computation.
o A few readability changes.
o Verified new behavior and added the tests to guard against accidental
further behavior changes.
o Modified the caching policy to take into account the resizing URL
arguments required for resizing to work.
o Factored the cache key building into a builder class that ensures
backward compatibility of the generated cache keys, and makes building
cache keys easier in general.
o Added the tests to guard against accidental behavior changes in the
cache key builder.
o Fitted all the pieces back together again.
|