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

Side by Side Diff: components/network_hints/renderer/renderer_preconnect.cc

Issue 2179693002: Revert of Convert network hints to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « components/network_hints/renderer/renderer_preconnect.h ('k') | components/typemaps.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // See header file for description of RendererPreconnect class 5 // See header file for description of RendererPreconnect class
6 6
7 #include "components/network_hints/renderer/renderer_preconnect.h" 7 #include "components/network_hints/renderer/renderer_preconnect.h"
8 8
9 #include "components/network_hints/common/network_hints_common.h" 9 #include "components/network_hints/common/network_hints_common.h"
10 #include "components/network_hints/public/cpp/network_hints_param_traits.h" 10 #include "components/network_hints/common/network_hints_messages.h"
11 #include "content/public/renderer/render_thread.h" 11 #include "content/public/renderer/render_thread.h"
12 #include "services/shell/public/cpp/interface_provider.h"
13 12
14 using content::RenderThread; 13 using content::RenderThread;
15 14
16 namespace network_hints { 15 namespace network_hints {
17 16
18 RendererPreconnect::RendererPreconnect() { 17 RendererPreconnect::RendererPreconnect() {
19 } 18 }
20 19
21 RendererPreconnect::~RendererPreconnect() { 20 RendererPreconnect::~RendererPreconnect() {
22 } 21 }
23 22
24 void RendererPreconnect::Preconnect(const GURL& url, bool allow_credentials) { 23 void RendererPreconnect::Preconnect(const GURL& url, bool allow_credentials) {
25 if (!url.is_valid()) 24 if (!url.is_valid())
26 return; 25 return;
27 26
28 GetNetworkHints().Preconnect(url, allow_credentials, 1); 27 RenderThread::Get()->Send(
29 } 28 new NetworkHintsMsg_Preconnect(url, allow_credentials, 1));
30
31 mojom::NetworkHints& RendererPreconnect::GetNetworkHints() {
32 DCHECK(content::RenderThread::Get());
33 if (!network_hints_) {
34 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(
35 mojo::GetProxy(&network_hints_));
36 }
37 return *network_hints_;
38 } 29 }
39 30
40 } // namespace network_hints 31 } // namespace network_hints
OLDNEW
« no previous file with comments | « components/network_hints/renderer/renderer_preconnect.h ('k') | components/typemaps.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698