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" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/task_runner_util.h" | 12 #include "base/task_runner_util.h" |
13 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
14 #include "components/feedback/feedback_report.h" | 14 #include "components/feedback/feedback_report.h" |
15 #include "components/feedback/feedback_switches.h" | 15 #include "components/feedback/feedback_switches.h" |
16 #include "components/feedback/feedback_uploader_delegate.h" | 16 #include "components/feedback/feedback_uploader_delegate.h" |
17 #include "components/variations/net/variations_http_headers.h" | 17 #include "components/variations/net/variations_http_headers.h" |
18 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/storage_partition.h" |
20 #include "net/base/load_flags.h" | 21 #include "net/base/load_flags.h" |
21 #include "net/url_request/url_fetcher.h" | 22 #include "net/url_request/url_fetcher.h" |
22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
23 | 24 |
24 using content::BrowserThread; | 25 using content::BrowserThread; |
25 | 26 |
26 namespace feedback { | 27 namespace feedback { |
27 namespace { | 28 namespace { |
28 | 29 |
29 const char kProtoBufMimeType[] = "application/x-protobuf"; | 30 const char kProtoBufMimeType[] = "application/x-protobuf"; |
(...skipping 25 matching lines...) Expand all Loading... |
55 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr()))) | 56 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr()))) |
56 .release(); | 57 .release(); |
57 | 58 |
58 // Tell feedback server about the variation state of this install. | 59 // Tell feedback server about the variation state of this install. |
59 net::HttpRequestHeaders headers; | 60 net::HttpRequestHeaders headers; |
60 variations::AppendVariationHeaders( | 61 variations::AppendVariationHeaders( |
61 fetcher->GetOriginalURL(), context_->IsOffTheRecord(), false, &headers); | 62 fetcher->GetOriginalURL(), context_->IsOffTheRecord(), false, &headers); |
62 fetcher->SetExtraRequestHeaders(headers.ToString()); | 63 fetcher->SetExtraRequestHeaders(headers.ToString()); |
63 | 64 |
64 fetcher->SetUploadData(kProtoBufMimeType, data); | 65 fetcher->SetUploadData(kProtoBufMimeType, data); |
65 fetcher->SetRequestContext(context_->GetRequestContext()); | 66 fetcher->SetRequestContext( |
| 67 content::BrowserContext::GetDefaultStoragePartition(context_)-> |
| 68 GetURLRequestContext()); |
66 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | | 69 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | |
67 net::LOAD_DO_NOT_SEND_COOKIES); | 70 net::LOAD_DO_NOT_SEND_COOKIES); |
68 fetcher->Start(); | 71 fetcher->Start(); |
69 } | 72 } |
70 | 73 |
71 } // namespace feedback | 74 } // namespace feedback |
OLD | NEW |