cefclient: Move StringResourceMap to ClientHandler (see issue #2586)

Fixes a DCHECK when creating multiple windows in cefclient due to the creation
of multiple StringResourceProvider objects.
This commit is contained in:
Marshall Greenblatt
2019-10-18 15:30:53 +02:00
parent 329facfbdf
commit aad4bf2464
4 changed files with 41 additions and 32 deletions

View File

@@ -14,6 +14,7 @@
#include "include/wrapper/cef_message_router.h"
#include "include/wrapper/cef_resource_manager.h"
#include "tests/cefclient/browser/client_types.h"
#include "tests/cefclient/browser/test_runner.h"
#if defined(OS_LINUX)
#include "tests/cefclient/browser/dialog_handler_gtk.h"
@@ -293,6 +294,9 @@ class ClientHandler : public CefClient,
// Show SSL information for the current site.
void ShowSSLInformation(CefRefPtr<CefBrowser> browser);
// Set a string resource for loading via StringResourceProvider.
void SetStringResource(const std::string& page, const std::string& data);
// Returns the Delegate.
Delegate* delegate() const { return delegate_; }
@@ -367,6 +371,10 @@ class ClientHandler : public CefClient,
// Manages the registration and delivery of resources.
CefRefPtr<CefResourceManager> resource_manager_;
// Used to manage string resources in combination with StringResourceProvider.
// Only accessed on the IO thread.
test_runner::StringResourceMap string_resource_map_;
// MAIN THREAD MEMBERS
// The following members will only be accessed on the main thread. This will
// be the same as the CEF UI thread except when using multi-threaded message