Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(225)

Issue 1276042: Refactor ImageRewriter as HttpResponseRewriter (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 10 months ago by johnfargo
Modified:
15 years, 10 months ago
Reviewers:
Paul Lindner, zhoresh, shindig.remailer, jtarrio
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

Introduces new interface HttpResponseRewriter, and for the moment - as a proof-of-concept and for functional backward compatibility - implements only BasicImageRewriter in terms of this interface. HttpResponseRewriter's API parallels that of GadgetRewriter: void rewrite(ContextObject in, MutableContent out); Specifically: void rewrite(HttpRequest in, HttpResponseBuilder out); This change thus utilizes the HttpResponseBuilder-as-MutableContent CL submitted a few weeks ago. Additional notes: * [Basic]ImageRewriter simply modifies an HttpResponse. Its implementation is updated in this CL to reflect the same. * HttpResponseRegistry is introduced, with default binding to BasicImageRewriter. The registry's rewriters are executed at the same place as ImageRewriter previously was - in DefaultRequestPipeline, after fetch and before caching. * HttpResponseBuilder optimization implemented to return the "source" HttpResponse object from which it was created when no changes were made to its data. This avoids pointless object creation and data copying, maintaining ImageRewriter's performance in such cases. This CL is transitional, as its goals are to move to the following: * Ability to perform image rewriting steps independently, in separate rewriting passes (resizing, optimization, downsampling, format conversion, and so on). * Situation in which all RequestRewriters are made into ResponseRewriters, removing one Rewriter type. * Ability to precisely define the caching characteristics of [Response]Rewriters, of any type.

Patch Set 1 #

Total comments: 1

Patch Set 2 : Adding UPGRADING notes. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+382 lines, -171 lines) Patch
UPGRADING View 1 chunk +12 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/DefaultRequestPipeline.java View 4 chunks +11 lines, -5 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponseBuilder.java View 9 chunks +59 lines, -18 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/DefaultResponseRewriterRegistry.java View 1 1 chunk +61 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ResponseRewriter.java View 1 chunk +25 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ResponseRewriterRegistry.java View 1 chunk +40 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java View 2 chunks +8 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/BMPOptimizer.java View 2 chunks +3 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/BaseOptimizer.java View 5 chunks +11 lines, -13 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/BasicImageRewriter.java View 14 chunks +47 lines, -68 lines 1 comment Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/GIFOptimizer.java View 2 chunks +3 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/JPEGOptimizer.java View 3 chunks +4 lines, -4 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/PNGOptimizer.java View 2 chunks +3 lines, -3 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/AbstractHttpCacheTest.java View 1 chunk +0 lines, -1 line 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/AbstractHttpFetcherTest.java View 4 chunks +4 lines, -4 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/DefaultInvalidationServiceTest.java View 2 chunks +4 lines, -3 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/DefaultRequestPipelineTest.java View 3 chunks +3 lines, -3 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/HttpResponseBuilderTest.java View 1 chunk +28 lines, -1 line 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/BMPOptimizerTest.java View 2 chunks +4 lines, -1 line 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/GIFOptimizerTest.java View 2 chunks +4 lines, -1 line 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/ImageRewriterTest.java View 6 chunks +40 lines, -38 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/JPEGOptimizerTest.java View 2 chunks +4 lines, -1 line 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/PNGOptimizerTest.java View 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 8
johnfargo
15 years, 10 months ago (2010-05-24 23:56:00 UTC) #1
Paul Lindner
eyeball insepction seems fine. might be worthwhile adding docs to UPGRADING for the few people ...
15 years, 10 months ago (2010-05-25 10:46:27 UTC) #2
johnfargo
Adding UPGRADING notes.
15 years, 10 months ago (2010-05-25 16:33:17 UTC) #3
zhoresh
LGTM My only concern with the ResponseRewritters, is that the cache store data after rewrite, ...
15 years, 10 months ago (2010-05-25 17:17:31 UTC) #4
jtarrio
http://codereview.appspot.com/1276042/diff/1/12 File java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponseBuilder.java (right): http://codereview.appspot.com/1276042/diff/1/12#newcode157 java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponseBuilder.java:157: headers.clear(); Doesn't this need a call to incrementNumChanges() too? ...
15 years, 10 months ago (2010-05-25 17:20:42 UTC) #5
fargo
On Tue, May 25, 2010 at 10:17 AM, <zhoresh@gmail.com> wrote: > LGTM > > My ...
15 years, 10 months ago (2010-05-25 17:20:44 UTC) #6
johnfargo
On Tue, May 25, 2010 at 10:20 AM, <jtarrio@gmail.com> wrote: > > http://codereview.appspot.com/1276042/diff/1/12 > File ...
15 years, 10 months ago (2010-05-25 17:44:35 UTC) #7
jtarrio
15 years, 10 months ago (2010-05-25 17:47:11 UTC) #8
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b