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

Side by Side Diff: chrome/browser/net/client_hints.h

Issue 23654014: Updated Client-Hints patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed issues raised in review by mmenke and bengr Created 7 years, 3 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 | « chrome/browser/net/chrome_network_delegate.cc ('k') | chrome/browser/net/client_hints.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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 #ifndef CHROME_BROWSER_NET_CLIENT_HINTS_H_
6 #define CHROME_BROWSER_NET_CLIENT_HINTS_H_
7
8 #include <string>
9
10 #include "base/memory/weak_ptr.h"
11
12 // ClientHints is a repository in Chrome for information used
13 // to create the Client-Hints request header. For more information, see:
14 // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik-htt p-client-hints-01.txt
15 class ClientHints {
16 public:
17 ClientHints();
18 ~ClientHints();
19
20 void Init();
21
22 // Retrieves screen information for use on the IO thread.
23 bool RetrieveScreenInfo();
24
25 // Returns client hints pertaining to screen information. The format is:
26 // "dpr=x", where x is pixel ratio. Its value is the same as the value
27 // returned by the JavaScript command window.devicePixelRatio
28 const std::string& GetString() const;
29
30 private:
31 friend class ClientHintsTest;
32
33 void UpdateScreenInfo(const float* device_pixel_ratio_value);
34
35 std::string screen_hints_;
36
37 base::WeakPtrFactory<ClientHints> weak_ptr_factory_;
38
39 DISALLOW_COPY_AND_ASSIGN(ClientHints);
40 };
41
42 #endif // CHROME_BROWSER_NET_CLIENT_HINTS_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.cc ('k') | chrome/browser/net/client_hints.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698