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

Side by Side Diff: components/feedback/feedback_uploader_chrome.cc

Issue 1878153002: Revert of Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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"
21 #include "net/base/load_flags.h" 20 #include "net/base/load_flags.h"
22 #include "net/url_request/url_fetcher.h" 21 #include "net/url_request/url_fetcher.h"
23 #include "url/gurl.h" 22 #include "url/gurl.h"
24 23
25 using content::BrowserThread; 24 using content::BrowserThread;
26 25
27 namespace feedback { 26 namespace feedback {
28 namespace { 27 namespace {
29 28
30 const char kProtoBufMimeType[] = "application/x-protobuf"; 29 const char kProtoBufMimeType[] = "application/x-protobuf";
(...skipping 25 matching lines...) Expand all
56 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr()))) 55 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr())))
57 .release(); 56 .release();
58 57
59 // Tell feedback server about the variation state of this install. 58 // Tell feedback server about the variation state of this install.
60 net::HttpRequestHeaders headers; 59 net::HttpRequestHeaders headers;
61 variations::AppendVariationHeaders( 60 variations::AppendVariationHeaders(
62 fetcher->GetOriginalURL(), context_->IsOffTheRecord(), false, &headers); 61 fetcher->GetOriginalURL(), context_->IsOffTheRecord(), false, &headers);
63 fetcher->SetExtraRequestHeaders(headers.ToString()); 62 fetcher->SetExtraRequestHeaders(headers.ToString());
64 63
65 fetcher->SetUploadData(kProtoBufMimeType, data); 64 fetcher->SetUploadData(kProtoBufMimeType, data);
66 fetcher->SetRequestContext( 65 fetcher->SetRequestContext(context_->GetRequestContext());
67 content::BrowserContext::GetDefaultStoragePartition(context_)->
68 GetURLRequestContext());
69 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 66 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
70 net::LOAD_DO_NOT_SEND_COOKIES); 67 net::LOAD_DO_NOT_SEND_COOKIES);
71 fetcher->Start(); 68 fetcher->Start();
72 } 69 }
73 70
74 } // namespace feedback 71 } // namespace feedback
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698