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

Issue 7922023: Remove webkit_glue::BuildUserAgent(), remove windows spoofing (Closed)

Created:
9 years, 3 months ago by Dirk Pranke
Modified:
9 years, 3 months ago
CC:
darin (slow to review), chromium-reviews, amit, dpranke+watch-content_chromium.org, jam, joi+watch-content_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., pam+watch_chromium.org
Visibility:
Public.

Description

Remove webkit_glue::BuildUserAgent(), change the contract in webkit_glue so that SetUserAgent() must be called before GetUserAgent(). This was causing a dependency inversion between webkit_support and its clients, and was needed for the content component build. For content users, calling SetContentClient() will automatically initialize the user agent (retrieved from client->GetUserAgent()). As a bonus, fixing this allowed me to re-test the "mimic_windows" code path and it looks like we no longer need it. R=jam@chromium.org,tony@chromium.org BUG=11136, 90442 TEST=visit yahoo! mail using Chromium on Linux, ensure that we don't get an "unsupported browser" warning. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=102336

Patch Set 1 #

Patch Set 2 : change invariant on Set(), make sure TestShell, content_shell initialize user agent correctly #

Patch Set 3 : fix browser_init #

Patch Set 4 : really fix browser_init #

Patch Set 5 : fix chrome_frame compile failure, disable test, add a default user agent #

Patch Set 6 : make setuseragent() required, add call to more embedders #

Patch Set 7 : set user agent from in_process_browser_test #

Patch Set 8 : add setuseragent to render_view_test #

Patch Set 9 : try adding wrappers for user agents to clean things up #

Patch Set 10 : merge patchset 9 to r102124 #

Patch Set 11 : fix GetUserAgent() to return whether the user agent is overriding, clean up #

Total comments: 33

Patch Set 12 : update w/ review feedback #

Patch Set 13 : minor updates #

Patch Set 14 : fix chrome_frame_unittests link failure #

Patch Set 15 : merge to r102225 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -111 lines) Patch
M chrome/browser/ui/browser_init.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +0 lines, -6 lines 0 comments Download
M chrome/common/chrome_content_client.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -9 lines 0 comments Download
M chrome/common/chrome_content_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +12 lines, -6 lines 0 comments Download
M chrome_frame/html_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M chrome_frame/renderer_glue.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -13 lines 0 comments Download
M chrome_frame/test/html_util_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +11 lines, -5 lines 2 comments Download
M content/common/child_thread.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -6 lines 0 comments Download
M content/common/content_client.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -4 lines 0 comments Download
M content/common/content_client.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +14 lines, -0 lines 0 comments Download
M content/renderer/renderer_glue.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -4 lines 0 comments Download
M content/shell/shell_content_client.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/shell/shell_content_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -2 lines 0 comments Download
M content/test/test_content_client.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/test/test_content_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -2 lines 0 comments Download
M webkit/glue/user_agent.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -5 lines 0 comments Download
M webkit/glue/user_agent.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +2 lines, -4 lines 0 comments Download
M webkit/glue/webkit_glue.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -12 lines 0 comments Download
M webkit/glue/webkit_glue.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +14 lines, -20 lines 0 comments Download
M webkit/support/webkit_support.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M webkit/support/webkit_support_glue.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -5 lines 0 comments Download
M webkit/tools/test_shell/test_shell.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -4 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Dirk Pranke
Please take a look. I think this patch is finally close to done, but I ...
9 years, 3 months ago (2011-09-21 20:02:48 UTC) #1
tony
+evan is better reviewer for this code than I am
9 years, 3 months ago (2011-09-21 20:15:05 UTC) #2
Evan Martin
http://codereview.chromium.org/7922023/diff/17023/chrome/common/chrome_content_client.cc File chrome/common/chrome_content_client.cc (right): http://codereview.chromium.org/7922023/diff/17023/chrome/common/chrome_content_client.cc#newcode303 chrome/common/chrome_content_client.cc:303: std::string ChromeContentClient::GetUserAgent(bool *overriding) const { star on the left ...
9 years, 3 months ago (2011-09-21 20:27:23 UTC) #3
Dirk Pranke
http://codereview.chromium.org/7922023/diff/17023/chrome/common/chrome_content_client.cc File chrome/common/chrome_content_client.cc (right): http://codereview.chromium.org/7922023/diff/17023/chrome/common/chrome_content_client.cc#newcode304 chrome/common/chrome_content_client.cc:304: if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) { On 2011/09/21 20:27:24, Evan Martin wrote: ...
9 years, 3 months ago (2011-09-21 21:02:35 UTC) #4
jam
http://codereview.chromium.org/7922023/diff/17023/chrome_frame/test/html_util_unittests.cc File chrome_frame/test/html_util_unittests.cc (right): http://codereview.chromium.org/7922023/diff/17023/chrome_frame/test/html_util_unittests.cc#newcode407 chrome_frame/test/html_util_unittests.cc:407: chrome_ua = content::GetContentClient()->GetUserAgent(&overriding); On 2011/09/21 21:02:35, Dirk Pranke wrote: ...
9 years, 3 months ago (2011-09-21 21:27:36 UTC) #5
Dirk Pranke
Changes uploaded. Please take another look :). http://codereview.chromium.org/7922023/diff/17023/chrome_frame/test/html_util_unittests.cc File chrome_frame/test/html_util_unittests.cc (right): http://codereview.chromium.org/7922023/diff/17023/chrome_frame/test/html_util_unittests.cc#newcode407 chrome_frame/test/html_util_unittests.cc:407: chrome_ua = ...
9 years, 3 months ago (2011-09-21 22:19:59 UTC) #6
jam
http://codereview.chromium.org/7922023/diff/17023/webkit/glue/webkit_glue.cc File webkit/glue/webkit_glue.cc (right): http://codereview.chromium.org/7922023/diff/17023/webkit/glue/webkit_glue.cc#newcode401 webkit/glue/webkit_glue.cc:401: // Should be removed if the sniffing is removed: ...
9 years, 3 months ago (2011-09-21 22:26:29 UTC) #7
Dirk Pranke
On Wed, Sep 21, 2011 at 3:26 PM, <jam@chromium.org> wrote: > > http://codereview.chromium.org/7922023/diff/17023/webkit/glue/webkit_glue.cc > File ...
9 years, 3 months ago (2011-09-21 22:38:31 UTC) #8
Dirk Pranke
Tommi, can you take a look at the changes I had to make to chrome_frame/renderer_glue ...
9 years, 3 months ago (2011-09-21 23:09:17 UTC) #9
jam
lgtm
9 years, 3 months ago (2011-09-21 23:31:18 UTC) #10
tommi (sloooow) - chröme
9 years, 3 months ago (2011-09-22 08:58:46 UTC) #11
lgtm for html_util_unittests.cc with a couple of nits.

http://codereview.chromium.org/7922023/diff/20060/chrome_frame/test/html_util...
File chrome_frame/test/html_util_unittests.cc (right):

http://codereview.chromium.org/7922023/diff/20060/chrome_frame/test/html_util...
chrome_frame/test/html_util_unittests.cc:407: 
nit: remove empty line

http://codereview.chromium.org/7922023/diff/20060/chrome_frame/test/html_util...
chrome_frame/test/html_util_unittests.cc:413: std::string chrome_ua =
webkit_glue::BuildUserAgentFromProduct(product);
nit: constructor syntax for complex types as is done elsewhere.

Powered by Google App Engine
This is Rietveld 408576698