New issue
Advanced search Search tips

Issue 764513 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 735518



Sign in to add a comment

Support attaching device-memory client hint header when browser side navigation is enabled

Project Member Reported by tbansal@chromium.org, Sep 12 2017

Issue description

Currently, the device-memory client hints header is attached in the Blink in the renderer process. However, when browser side navigation is enabled, then main frame navigation requests are sent over the network in the browser process itself. So, a way is needed to attach the device-memory header in the browser process.

This would require some refactor:

1.  Move the logic to determine the memory size from third_party/WebKit/Source/platform/MemoryCoordinator.cpp to third_party/WebKit/common/ so it can be accessed from chrome/browser.

2. Add logic in chrome/browser/chrome_content_browser_client.cc to attach headers based on persistent client hints. This would be called from 
 content/browser/frame_host/navigation_request.cc.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e7d7e16bb5af641db6f4e77f1877605a005cd0ee

commit e7d7e16bb5af641db6f4e77f1877605a005cd0ee
Author: Tarun Bansal <tbansal@chromium.org>
Date: Wed Sep 13 16:11:37 2017

Move some of the memory retrieving code to third_party/Webkit/common

This is a pure refactor CL and does not introduce any functionality change.
Moving some of the code that retrieves memory information to
t_p/Webkit/common makes it possible to access
that code from chrome/browser.

In the next CL, chrome/browser/chrome_content_browser_client.cc
would call GetApproximatedDeviceMemory() to attach the required
client hints to the navigation requests.

Bug:  764513 
Change-Id: I96e5d812b8f46e83601d02c6c48f1a37919f8041
Reviewed-on: https://chromium-review.googlesource.com/663768
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501648}
[modify] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/Source/core/frame/Navigator.cpp
[modify] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
[modify] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
[modify] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
[modify] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/Source/platform/MemoryCoordinator.h
[delete] https://crrev.com/1e9e0feda67b66f3d35bafd51dbc45b4418b56ee/third_party/WebKit/Source/platform/MemoryCoordinatorTest.cpp
[modify] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/common/BUILD.gn
[add] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/common/device_memory/approximated_device_memory.cc
[add] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/common/device_memory/approximated_device_memory.h
[add] https://crrev.com/e7d7e16bb5af641db6f4e77f1877605a005cd0ee/third_party/WebKit/common/device_memory/approximated_device_memory_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Sep 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/27fdaaa69847b9dd5f9f7a6f562eee01bcc756d5

commit 27fdaaa69847b9dd5f9f7a6f562eee01bcc756d5
Author: Tarun Bansal <tbansal@chromium.org>
Date: Wed Sep 13 23:55:56 2017

Move some of the client hints code to chrome/common

This is a pure refactor CL, and does not introduce any
functionality change. Moving this code to chrome/common
makes it possible to call it from chrome/browser.

In the next CL, the moved code will be called from
chrome/browser to attach client hint headers to
navigation requests when browser side navigation
is enabled.

Bug:  764513 
Change-Id: I31289d3ea29faa30c88a8298157c339f874c5ab8
Reviewed-on: https://chromium-review.googlesource.com/666226
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501808}
[modify] https://crrev.com/27fdaaa69847b9dd5f9f7a6f562eee01bcc756d5/chrome/common/BUILD.gn
[add] https://crrev.com/27fdaaa69847b9dd5f9f7a6f562eee01bcc756d5/chrome/common/client_hints/OWNERS
[add] https://crrev.com/27fdaaa69847b9dd5f9f7a6f562eee01bcc756d5/chrome/common/client_hints/client_hints.cc
[add] https://crrev.com/27fdaaa69847b9dd5f9f7a6f562eee01bcc756d5/chrome/common/client_hints/client_hints.h
[modify] https://crrev.com/27fdaaa69847b9dd5f9f7a6f562eee01bcc756d5/chrome/renderer/content_settings_observer.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6bf543088433a87fe72e5c312ee91a8756d55258

commit 6bf543088433a87fe72e5c312ee91a8756d55258
Author: Tarun Bansal <tbansal@chromium.org>
Date: Mon Oct 02 07:39:14 2017

Attach device-memory client hint based on persistent client hints

The device-memory header is attached in the browser process.
This ensures that the header is attached even to the
main frame requests when browser side navigation is enabled.

Bug:  764513 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I88353ce500b156425a75e3e22ec3c32241095044
Reviewed-on: https://chromium-review.googlesource.com/663791
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505553}
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/browser/BUILD.gn
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/browser/chrome_content_browser_client.h
[add] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/browser/client_hints/DEPS
[add] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/browser/client_hints/client_hints.cc
[add] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/browser/client_hints/client_hints.h
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/browser/client_hints/client_hints_browsertest.cc
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/test/data/client_hints/accept_ch_with_lifetime.html.mock-http-headers
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/chrome/test/data/client_hints/accept_ch_without_lifetime.html.mock-http-headers
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/content/browser/frame_host/navigation_request.cc
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/content/public/browser/content_browser_client.cc
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/content/public/browser/content_browser_client.h
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/third_party/WebKit/Source/platform/loader/BUILD.gn
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp
[modify] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/third_party/WebKit/common/BUILD.gn
[add] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/third_party/WebKit/common/client_hints/client_hints.cc
[add] https://crrev.com/6bf543088433a87fe72e5c312ee91a8756d55258/third_party/WebKit/common/client_hints/client_hints.h

Status: Fixed (was: Started)

Sign in to add a comment