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

Unified Diff: chrome/browser/component_updater/component_updater_configurator.cc

Issue 8122015: Component updater: send extra attributes in the request to (Closed) Base URL: svn://chrome-svn/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 | chrome/browser/component_updater/component_updater_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/component_updater_configurator.cc
===================================================================
--- chrome/browser/component_updater/component_updater_configurator.cc (revision 103990)
+++ chrome/browser/component_updater/component_updater_configurator.cc (working copy)
@@ -12,6 +12,7 @@
#include "base/compiler_specific.h"
#include "base/metrics/histogram.h"
#include "base/string_util.h"
+#include "build/build_config.h"
#include "chrome/common/chrome_switches.h"
#include "net/url_request/url_request_context_getter.h"
@@ -30,6 +31,43 @@
return (std::find(vec.begin(), vec.end(), test) != vec.end());
}
+// The request extra information is the OS and architecture, this helps
+// the server select the right package to be delivered.
+const char kExtraInfo[] =
+#if defined(OS_MACOSX)
+ #if defined(__amd64__)
+ "os=mac&arch=x64";
+ #elif defined(__i386__)
+ "os=mac&arch=x86";
+ #else
+ #error "unknown mac architecture"
+ #endif
+#elif defined(OS_WIN)
+ #if defined(_WIN64)
+ "os=win&arch=x64";
+ #elif defined(_WIN32)
+ "os=win&arch=x86";
+ #else
+ #error "unknown windows architecture"
+ #endif
+#elif defined(OS_LINUX)
+ #if defined(__amd64__)
+ "os=linux&arch=x64";
+ #elif defined(__i386__)
+ "os=linux&arch=x86";
+ #else
+ #error "unknown linux architecture"
+ #endif
+#elif defined(OS_CHROMEOS)
+ #if defined(__i386__)
+ "os=cros&arch=x86";
+ #else
+ #error "unknown chromeOs architecture"
+ #endif
+#else
+ #error "unknown os or architecture"
+#endif
+
} // namespace
class ChromeConfigurator : public ComponentUpdateService::Configurator {
@@ -44,6 +82,7 @@
virtual int StepDelay() OVERRIDE;
virtual int MinimumReCheckWait() OVERRIDE;
virtual GURL UpdateUrl() OVERRIDE;
+ virtual const char* ExtraRequestParams() OVERRIDE;
virtual size_t UrlSizeLimit() OVERRIDE;
virtual net::URLRequestContextGetter* RequestContext() OVERRIDE;
virtual bool InProcess() OVERRIDE;
@@ -53,6 +92,7 @@
net::URLRequestContextGetter* url_request_getter_;
bool fast_update_;
bool out_of_process_;
+ std::string extra_info_;
};
ChromeConfigurator::ChromeConfigurator(const CommandLine* cmdline,
@@ -86,6 +126,10 @@
return GURL("http://clients2.google.com/service/update2/crx");
}
+const char* ChromeConfigurator::ExtraRequestParams() {
+ return kExtraInfo;
+}
+
size_t ChromeConfigurator::UrlSizeLimit() {
return 1024ul;
}
« no previous file with comments | « no previous file | chrome/browser/component_updater/component_updater_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698