summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2019-02-12 13:06:06 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2019-02-15 17:52:55 +0000
commit6c56c89f1a0755e7036416b27fc146ff0286f98f (patch)
treefb09d253ba699a509ccd636ca9c712b989c5e32e
parentbb8520a5b4a49085e38b70cb4c95baf75ea374e9 (diff)
downloadqtwebengine-chromium-6c56c89f1a0755e7036416b27fc146ff0286f98f.tar.gz
Bypass CHECK for uninitialized resources when destroying plugin host
We have previously disabled the release asserts for plugin resources that could not be initialized. However, there was still a CHECK when destroying theses unintitalized resource, as there is no way to report the initialization failure back. This patch adds tracking of the failed initializations and bypasses the CHECK for those that previously failed. Change-Id: I95893670e172af70cfd716574f769dd7e49d20ef Task-number: QTBUG-64832 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--chromium/ppapi/host/ppapi_host.cc11
-rw-r--r--chromium/ppapi/host/ppapi_host.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/chromium/ppapi/host/ppapi_host.cc b/chromium/ppapi/host/ppapi_host.cc
index 8c1a719b6f4..6d1970275c6 100644
--- a/chromium/ppapi/host/ppapi_host.cc
+++ b/chromium/ppapi/host/ppapi_host.cc
@@ -241,9 +241,10 @@ void PpapiHost::OnHostMsgResourceCreated(
#ifndef TOOLKIT_QT
NOTREACHED();
#else
- LOG(INFO) << "Failed to create PPAPI resource host"
- << IPC_MESSAGE_ID_CLASS(nested_msg.type())
+ LOG(INFO) << "Failed to create PPAPI resource host, class:"
+ << IPC_MESSAGE_ID_CLASS(nested_msg.type()) << ", line:"
<< IPC_MESSAGE_ID_LINE(nested_msg.type());
+ uninitialized_resources_.insert(params.pp_resource());
#endif
return;
}
@@ -271,7 +272,11 @@ void PpapiHost::OnHostMsgAttachToPendingHost(PP_Resource pp_resource,
void PpapiHost::OnHostMsgResourceDestroyed(PP_Resource resource) {
ResourceMap::iterator found = resources_.find(resource);
if (found == resources_.end()) {
- NOTREACHED();
+#if defined(TOOLKIT_QT)
+ auto found_uninitialized = uninitialized_resources_.find(resource);
+ if (found_uninitialized == uninitialized_resources_.end())
+#endif
+ NOTREACHED();
return;
}
// Invoking the HostResource destructor might result in looking up the
diff --git a/chromium/ppapi/host/ppapi_host.h b/chromium/ppapi/host/ppapi_host.h
index f806b46a201..d1d9865b692 100644
--- a/chromium/ppapi/host/ppapi_host.h
+++ b/chromium/ppapi/host/ppapi_host.h
@@ -8,6 +8,7 @@
#include <map>
#include <memory>
#include <vector>
+#include <set>
#include "base/compiler_specific.h"
#include "base/macros.h"
@@ -141,6 +142,8 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
PendingHostResourceMap pending_resource_hosts_;
int next_pending_resource_host_id_;
+ std::set<PP_Resource> uninitialized_resources_;
+
DISALLOW_COPY_AND_ASSIGN(PpapiHost);
};