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

Unified Diff: chrome/browser/extensions/webstore_data_fetcher.cc

Issue 2655823002: Include referrer chain with inline install requests. (Closed)
Patch Set: Add missing comment. Created 3 years, 11 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
Index: chrome/browser/extensions/webstore_data_fetcher.cc
diff --git a/chrome/browser/extensions/webstore_data_fetcher.cc b/chrome/browser/extensions/webstore_data_fetcher.cc
index c914ff374d5f8cc22053c54a6acd45b734dbdec0..e8e8b691b9eebf3d5db3cefba59fd381f67cedd3 100644
--- a/chrome/browser/extensions/webstore_data_fetcher.cc
+++ b/chrome/browser/extensions/webstore_data_fetcher.cc
@@ -37,15 +37,26 @@ WebstoreDataFetcher::WebstoreDataFetcher(
WebstoreDataFetcher::~WebstoreDataFetcher() {}
+void WebstoreDataFetcher::SetJsonPostData(const std::string& json) {
+ json_post_data_ = json;
+}
+
void WebstoreDataFetcher::Start() {
GURL webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_));
-
+ net::URLFetcher::RequestType request_type =
+ json_post_data_.empty() ? net::URLFetcher::GET : net::URLFetcher::POST;
webstore_data_url_fetcher_ =
- net::URLFetcher::Create(webstore_data_url, net::URLFetcher::GET, this);
+ net::URLFetcher::Create(webstore_data_url, request_type, this);
webstore_data_url_fetcher_->SetRequestContext(request_context_);
webstore_data_url_fetcher_->SetReferrer(referrer_url_.spec());
webstore_data_url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
net::LOAD_DISABLE_CACHE);
+
+ if (!json_post_data_.empty()) {
+ webstore_data_url_fetcher_->SetUploadData("application/json",
+ json_post_data_);
+ }
+
if (max_auto_retries_ > 0) {
webstore_data_url_fetcher_->SetMaxRetriesOn5xx(max_auto_retries_);
webstore_data_url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(
« no previous file with comments | « chrome/browser/extensions/webstore_data_fetcher.h ('k') | chrome/browser/extensions/webstore_inline_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698