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

Side by Side Diff: blimp/engine/app/blimp_system_url_request_context_getter.cc

Issue 1864163003: Add new system url request context getter to the blimp engine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure only have one system URLRequestContextGetter around at a time. 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "blimp/engine/app/blimp_system_url_request_context_getter.h"
6
7 #include <utility>
8 #include <vector>
9
10 #include "base/logging.h"
11 #include "base/single_thread_task_runner.h"
12 #include "blimp/engine/app/blimp_network_delegate.h"
Kevin M 2016/04/08 01:09:07 Is this needed?
Jess 2016/04/08 19:39:02 Nope. Removed.
13 #include "blimp/engine/common/blimp_content_client.h"
Kevin M 2016/04/08 01:09:08 Is this needed?
Jess 2016/04/08 19:39:02 Same here. Are they any includes checking tools I
Kevin M 2016/04/08 19:44:28 Last I checked, the Chromium IWYU tools were still
14 #include "content/public/browser/browser_thread.h"
15 #include "net/url_request/url_request_context.h"
16 #include "net/url_request/url_request_context_builder.h"
17
18 namespace blimp {
19 namespace engine {
20
21 BlimpSystemURLRequestContextGetter::BlimpSystemURLRequestContextGetter() {
22 // Must first be created on the UI thread.
23 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
24 }
25
26 BlimpSystemURLRequestContextGetter::~BlimpSystemURLRequestContextGetter() {}
27
28 net::URLRequestContext*
29 BlimpSystemURLRequestContextGetter::GetURLRequestContext() {
30 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
31 if (!url_request_context_.get()) {
Kevin M 2016/04/08 01:09:07 nit: get() isn't necessary for null checks
Jess 2016/04/08 19:39:02 Done.
32 // Use default values
33 net::URLRequestContextBuilder builder;
34 url_request_context_ = builder.Build();
35 }
36 return url_request_context_.get();
37 }
38
39 scoped_refptr<base::SingleThreadTaskRunner>
40 BlimpSystemURLRequestContextGetter::GetNetworkTaskRunner() const {
41 return content::BrowserThread::GetMessageLoopProxyForThread(
42 content::BrowserThread::IO);
43 }
44
45 } // namespace engine
46 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698