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

Unified Diff: ui/display/types/display_snapshot.cc

Issue 1636153002: Give user ability to file a feedback report from the display error notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more comments Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/types/display_snapshot.h ('k') | ui/display/util/x11/edid_parser_x11.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/types/display_snapshot.cc
diff --git a/ui/display/types/display_snapshot.cc b/ui/display/types/display_snapshot.cc
index 30e3ea890b222629157b77909162748dedb7f6a1..073f0c376a91f7c89f02f4e20aaeec0b2c82329f 100644
--- a/ui/display/types/display_snapshot.cc
+++ b/ui/display/types/display_snapshot.cc
@@ -6,6 +6,16 @@
namespace ui {
+namespace {
+
+// The display serial number beginning byte position and its length in the
+// EDID number as defined in the spec.
+// https://en.wikipedia.org/wiki/Extended_Display_Identification_Data
+const size_t kSerialNumberBeginingByte = 12U;
+const size_t kSerialNumberLengthInBytes = 4U;
+
+} // namespace
+
DisplaySnapshot::DisplaySnapshot(int64_t display_id,
const gfx::Point& origin,
const gfx::Size& physical_size,
@@ -15,6 +25,7 @@ DisplaySnapshot::DisplaySnapshot(int64_t display_id,
std::string display_name,
const base::FilePath& sys_path,
const std::vector<const DisplayMode*>& modes,
+ const std::vector<uint8_t>& edid,
const DisplayMode* current_mode,
const DisplayMode* native_mode)
: display_id_(display_id),
@@ -26,9 +37,17 @@ DisplaySnapshot::DisplaySnapshot(int64_t display_id,
display_name_(display_name),
sys_path_(sys_path),
modes_(modes),
+ edid_(edid),
current_mode_(current_mode),
native_mode_(native_mode),
- product_id_(kInvalidProductID) {}
+ product_id_(kInvalidProductID) {
+ // We must explicitly clear out the bytes that represent the serial number.
+ const size_t end =
+ std::min(kSerialNumberBeginingByte + kSerialNumberLengthInBytes,
+ edid_.size());
+ for (size_t i = kSerialNumberBeginingByte; i < end; ++i)
+ edid_[i] = 0;
+}
DisplaySnapshot::~DisplaySnapshot() {}
« no previous file with comments | « ui/display/types/display_snapshot.h ('k') | ui/display/util/x11/edid_parser_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698