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

Unified Diff: content/app/content_main.cc

Issue 8296011: Make setting the user agent work with the zygote on linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.h » ('j') | webkit/glue/webkit_glue.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main.cc
diff --git a/content/app/content_main.cc b/content/app/content_main.cc
index 85d6144e306107051a9c1970a003d1c3623bf410..5b88e14149688d3bce27fc714cbcc4421b8215c2 100644
--- a/content/app/content_main.cc
+++ b/content/app/content_main.cc
@@ -18,6 +18,7 @@
#include "content/app/content_main_delegate.h"
#include "content/app/startup_helper_win.h"
#include "content/browser/browser_main.h"
+#include "content/common/content_client.h"
#include "content/common/content_constants.h"
#include "content/common/content_paths.h"
#include "content/common/main_function_params.h"
@@ -28,6 +29,7 @@
#include "ipc/ipc_switches.h"
#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_base_paths.h"
+#include "webkit/glue/webkit_glue.h"
#if defined(OS_WIN)
#include <atlbase.h>
@@ -203,6 +205,15 @@ int RunZygote(const MainFunctionParams& main_function_params,
// line so update it here with the new version.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ // If a custom user agent was passed on the command line, we need
+ // to (re)set it now, rather than using the default one the zygote
+ // initialized.
+ bool custom = false;
+ std::string ua = content::GetContentClient()->GetUserAgent(&custom);
+ if (custom) {
jam 2011/10/15 01:32:04 nit: this file doesn't use brace brackets for sing
Dirk Pranke 2011/10/15 02:14:07 Will fix.
+ webkit_glue::ResetUserAgent(ua, custom);
+ }
+
// The StatsTable must be initialized in each process; we already
// initialized for the browser process, now we need to initialize
// within the new processes as well.
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.h » ('j') | webkit/glue/webkit_glue.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698