Chromium Code Reviews
Help | Chromium Project | Sign in
(4)

Issue 2987001: Implement HTTP headers sniffing in the ProtocolSinkWrap, instead of relying o... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 10 months ago by stoyan
Modified:
4 years ago
Reviewers:
amit, tommi
CC:
chromium-reviews, amit
Visibility:
Public.

Description

Implement HTTP headers sniffing in the ProtocolSinkWrap, instead of relying on IHttpNegotiate patch. Moved some code based on over-conservative assumptions to execute earlier in pipeline. Will prevent BUG=38480 to manifest itself. BUG=47879 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=52337

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 12

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -39 lines) Patch
M chrome_frame/http_negotiate.cc View 1 chunk +14 lines, -10 lines 0 comments Download
M chrome_frame/protocol_sink_wrap.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome_frame/protocol_sink_wrap.cc View 1 2 3 4 6 chunks +56 lines, -27 lines 0 comments Download
Commit: CQ not working?

Messages

Total messages: 6 (0 generated)
stoyan
4 years, 10 months ago (2010-07-12 21:34:06 UTC) #1
stoyan
4 years, 10 months ago (2010-07-12 21:36:53 UTC) #2
stoyan
4 years, 10 months ago (2010-07-12 21:44:43 UTC) #3
tommi
lgtm. http://codereview.chromium.org/2987001/diff/16001/17002 File chrome_frame/protocol_sink_wrap.cc (right): http://codereview.chromium.org/2987001/diff/16001/17002#newcode199 chrome_frame/protocol_sink_wrap.cc:199: char buffer[32] = "x-ua-compatible"; use the kUACompatibleHttpHeader constant ...
4 years, 10 months ago (2010-07-12 21:58:40 UTC) #4
amit
This is nice because it will avoid crash 38480! lgtm with what Tommi said. http://codereview.chromium.org/2987001/diff/16001/17002 ...
4 years, 10 months ago (2010-07-12 22:27:07 UTC) #5
stoyan
4 years, 10 months ago (2010-07-12 22:58:57 UTC) #6
http://codereview.chromium.org/2987001/diff/16001/17002
File chrome_frame/protocol_sink_wrap.cc (right):

http://codereview.chromium.org/2987001/diff/16001/17002#newcode199
chrome_frame/protocol_sink_wrap.cc:199: char buffer[32] = "x-ua-compatible";
kUACompatibleHttpHeader is wchar.
Additionally if constant is used then it's not easy to pick the buffer size.

http://codereview.chromium.org/2987001/diff/16001/17002#newcode200
chrome_frame/protocol_sink_wrap.cc:200: DWORD len = 32;
On 2010/07/12 21:58:41, tommi wrote:
> sizeof(buffer)?

Done.

http://codereview.chromium.org/2987001/diff/16001/17002#newcode314
chrome_frame/protocol_sink_wrap.cc:314: renderer_type_ =
DetermineRendererTypeFromMetaData(suggested_mime_type_,
If we don't get IWinInetHttpInfo, we still can have metatag inside the content,
so we hold reporting MIME type until we fetch enough data.
I'm going to fix the TODO in ShouldWrapCallback() anyway, so we care only for
HTTP/HTTPS requests, where IWinInetHttpInfo should be available.

http://codereview.chromium.org/2987001/diff/16001/17002#newcode316
chrome_frame/protocol_sink_wrap.cc:316: if (renderer_type_ == UNDETERMINED)
On 2010/07/12 22:27:07, amit wrote:
> On 2010/07/12 21:58:41, tommi wrote:
> > two of these return statements aren't necessary and you could omit the
> > UNDETERMINED check.
> > 
> > could be as simple as:
> > 
> > if (render_type_ == CHROME) {
> >  DLOG(INFO) << "Forwarding BINDSTATUS_MIMETYPEAVAILABLE "
> >             << kChromeMimeType;
> >   delegate->ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE, kChromeMimeType)
> > } else if (render_type_ == OTHER) {
> >   FireSugestedMimeType(delegate);
> > }
> > 
> > return S_OK;
> I would personally prefer a switch. But anyway you do it, a comment explaining
> each choice and what needs to happen will help a lot.
> 

Done.

http://codereview.chromium.org/2987001/diff/16001/17002#newcode366
chrome_frame/protocol_sink_wrap.cc:366: // This is the first data notification
we forward, since up to now we hold.
On 2010/07/12 21:58:41, tommi wrote:
> "since up to now we hold" ... seems to be something missing from that
sentence.

Done.
Sign in to reply to this message.

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