OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/feedback/feedback_uploader_chrome.h" | 5 #include "components/feedback/feedback_uploader_chrome.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 post_url, net::URLFetcher::POST, | 53 post_url, net::URLFetcher::POST, |
54 new FeedbackUploaderDelegate( | 54 new FeedbackUploaderDelegate( |
55 data, base::Bind(&FeedbackUploaderChrome::UpdateUploadTimer, | 55 data, base::Bind(&FeedbackUploaderChrome::UpdateUploadTimer, |
56 AsWeakPtr()), | 56 AsWeakPtr()), |
57 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr()))) | 57 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr()))) |
58 .release(); | 58 .release(); |
59 data_use_measurement::DataUseUserData::AttachToFetcher( | 59 data_use_measurement::DataUseUserData::AttachToFetcher( |
60 fetcher, data_use_measurement::DataUseUserData::FEEDBACK_UPLOADER); | 60 fetcher, data_use_measurement::DataUseUserData::FEEDBACK_UPLOADER); |
61 // Tell feedback server about the variation state of this install. | 61 // Tell feedback server about the variation state of this install. |
62 net::HttpRequestHeaders headers; | 62 net::HttpRequestHeaders headers; |
63 // Note: It's fine to pass in |is_signed_in| false, which does not affect | 63 // Note: It's OK to pass |is_signed_in| false if it's unknown, as it does |
64 // transmission of experiment ids coming from the variations server. | 64 // not affect transmission of experiments coming from the variations server. |
65 bool is_signed_in = false; | 65 bool is_signed_in = false; |
66 variations::AppendVariationHeaders(fetcher->GetOriginalURL(), | 66 variations::AppendVariationHeaders(fetcher->GetOriginalURL(), |
67 context_->IsOffTheRecord(), false, | 67 context_->IsOffTheRecord(), false, |
68 is_signed_in, &headers); | 68 is_signed_in, &headers); |
69 fetcher->SetExtraRequestHeaders(headers.ToString()); | 69 fetcher->SetExtraRequestHeaders(headers.ToString()); |
70 | 70 |
71 fetcher->SetUploadData(kProtoBufMimeType, data); | 71 fetcher->SetUploadData(kProtoBufMimeType, data); |
72 fetcher->SetRequestContext( | 72 fetcher->SetRequestContext( |
73 content::BrowserContext::GetDefaultStoragePartition(context_)-> | 73 content::BrowserContext::GetDefaultStoragePartition(context_)-> |
74 GetURLRequestContext()); | 74 GetURLRequestContext()); |
75 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | | 75 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | |
76 net::LOAD_DO_NOT_SEND_COOKIES); | 76 net::LOAD_DO_NOT_SEND_COOKIES); |
77 fetcher->Start(); | 77 fetcher->Start(); |
78 } | 78 } |
79 | 79 |
80 } // namespace feedback | 80 } // namespace feedback |
OLD | NEW |