See crbug.com/710702 for spec. This is an implementation tracking bug.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3a2b4be52d3f11b216be38f9e5f2ca10962a4591 commit 3a2b4be52d3f11b216be38f9e5f2ca10962a4591 Author: fmeawad <fmeawad@chromium.org> Date: Tue May 30 23:51:37 2017 Implement device-ram client hints header BUG= 718622 Review-Url: https://codereview.chromium.org/2860093003 Cr-Commit-Position: refs/heads/master@{#475694} [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/LayoutTests/http/tests/misc/client-hint-accept-on-subresource.html [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-accept-meta.html [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-accept.php [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-invalid-accept.php [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-no-accept.html [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php [add] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/LayoutTests/http/tests/misc/resources/image-checks-for-device-ram.php [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/core/frame/UseCounter.h [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/core/loader/FrameFetchContext.h [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/core/loader/private/FrameClientHintsPreferencesContext.cpp [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/core/loader/private/FrameClientHintsPreferencesContext.h [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/platform/MemoryCoordinator.cpp [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/platform/MemoryCoordinator.h [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.h [modify] https://crrev.com/3a2b4be52d3f11b216be38f9e5f2ca10962a4591/tools/metrics/histograms/enums.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1d35dcc9ba194c0b1bbbc01bce7e04caed7022b0 commit 1d35dcc9ba194c0b1bbbc01bce7e04caed7022b0 Author: Fadi Meawad <fmeawad@chromium.org> Date: Mon Jun 26 17:35:16 2017 [device-ram] Update the <value> calculations to match the updated spec After implmenting the original spec, we noticed that the returned value did not provide a good representation of the actual device-ram. The issue was discussed on the spec: https://github.com/WICG/device-ram/issues/1 and the spec was updated. The new <value> is a rounding (instead of flooring) of the actual memory to a bound that can have only the 2 most significant bits set. More details in the spec description at: https://github.com/WICG/device-ram Bug: chromium:718622 Change-Id: I33df6b0480b8e65a24fe4765839fb22633dfcd43 Reviewed-on: https://chromium-review.googlesource.com/546997 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Fadi Meawad <fmeawad@chromium.org> Cr-Commit-Position: refs/heads/master@{#482306} [modify] https://crrev.com/1d35dcc9ba194c0b1bbbc01bce7e04caed7022b0/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp [modify] https://crrev.com/1d35dcc9ba194c0b1bbbc01bce7e04caed7022b0/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/949e4fe96e90ac91af5c8a26de9228a0d78ad2f4 commit 949e4fe96e90ac91af5c8a26de9228a0d78ad2f4 Author: Fadi Meawad <fmeawad@chromium.org> Date: Tue Jun 27 15:13:04 2017 [device-ram] Move the feature to experimental The spec for device-ram client header is not stable enough to start exposing it to web developers, thus moving the feature from test to experimental. Bug: chromium:718622 Change-Id: Ie54614305be10a55cbad13cc7b2cd1c4dda5c551 Reviewed-on: https://chromium-review.googlesource.com/549009 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Fadi Meawad <fmeawad@chromium.org> Cr-Commit-Position: refs/heads/master@{#482628} [modify] https://crrev.com/949e4fe96e90ac91af5c8a26de9228a0d78ad2f4/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
The the client-header name is changed from device-ram to memory, fixing the code to follow.
Note that the header is "Memory" with capital M
Let's continue discussion here: https://github.com/WICG/device-ram/issues/6#issuecomment-315194305
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1b9b4fcbf1e264402a348e737241fea29c39bad9 commit 1b9b4fcbf1e264402a348e737241fea29c39bad9 Author: Fadi Meawad <fmeawad@chromium.org> Date: Wed Jul 19 21:33:06 2017 [device-memory] Rename client header from Device-Ram to Device-Memory Based on the discussion in the spec: https://github.com/WICG/device-ram/issues/6 there was a decision to rename the header to Device-Memory instead of Device-Ram, hence this CL Bug: chromium:718622 Change-Id: I5420af3aa5aa96ef913e88f1fee361c6a39eeace Reviewed-on: https://chromium-review.googlesource.com/578128 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Fadi Meawad <fmeawad@chromium.org> Cr-Commit-Position: refs/heads/master@{#487995} [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/LayoutTests/http/tests/misc/client-hint-accept-on-subresource.html [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-accept-meta.html [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-accept.php [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-invalid-accept.php [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/LayoutTests/http/tests/misc/client-hints-no-accept.html [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php [add] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/LayoutTests/http/tests/misc/resources/image-checks-for-device-memory.php [delete] https://crrev.com/e20eaff5a1370e290a8ac4923dfeefb40303b45e/third_party/WebKit/LayoutTests/http/tests/misc/resources/image-checks-for-device-ram.php [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/Source/core/loader/FrameFetchContext.h [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/Source/core/loader/private/FrameClientHintsPreferencesContext.cpp [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/public/platform/WebClientHintsType.h [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/third_party/WebKit/public/platform/web_feature.mojom [modify] https://crrev.com/1b9b4fcbf1e264402a348e737241fea29c39bad9/tools/metrics/histograms/enums.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f73f35d0e461c62ad1e9f5d894c24330b836f76f commit f73f35d0e461c62ad1e9f5d894c24330b836f76f Author: Fadi Meawad <fmeawad@chromium.org> Date: Thu Jul 20 22:58:07 2017 [Device-Memory] Ship Device-Memory Client Hints Header The feature is described in https://github.com/WICG/device-memory and the intent to ship is here: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/8qlTjzRY9Mc Bug: chromium:710702 , chromium:718622 Change-Id: If738affc6e171c60ad4b4540c2fec19959a1561a Reviewed-on: https://chromium-review.googlesource.com/579795 Reviewed-by: Shubhie Panicker <panicker@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Commit-Queue: Fadi Meawad <fmeawad@chromium.org> Cr-Commit-Position: refs/heads/master@{#488463} [modify] https://crrev.com/f73f35d0e461c62ad1e9f5d894c24330b836f76f/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b5f22e2af61f1d15a6e253fd4aeef8f7fb194904 commit b5f22e2af61f1d15a6e253fd4aeef8f7fb194904 Author: Fadi Meawad <fmeawad@chromium.org> Date: Fri Oct 13 00:16:55 2017 [DeviceMemory] Limit the possibile reported value by the DeviceMemory APIs In this CL, we revert back to using a single most significant bit instead of 2 bits (i.e. resulting values should only be powers of 2). We also limit the max reported value to 8GB, beyond that the value is not relevant. Bug: 718622 Change-Id: Id83482a4b77dd3f6b8c49af34029564ab20dd8fe Reviewed-on: https://chromium-review.googlesource.com/717020 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Shubhie Panicker <panicker@chromium.org> Commit-Queue: Fadi Meawad <fmeawad@chromium.org> Cr-Commit-Position: refs/heads/master@{#508561} [modify] https://crrev.com/b5f22e2af61f1d15a6e253fd4aeef8f7fb194904/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp [modify] https://crrev.com/b5f22e2af61f1d15a6e253fd4aeef8f7fb194904/third_party/WebKit/common/device_memory/approximated_device_memory.cc [modify] https://crrev.com/b5f22e2af61f1d15a6e253fd4aeef8f7fb194904/third_party/WebKit/common/device_memory/approximated_device_memory_unittest.cc
Comment 1 by bugdroid1@chromium.org
, May 30 2017