mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 304f01a1 (#358063)
- Improve ordering of CefLoadHandler callbacks. OnLoadingStateChange will be called before and after all calls to OnLoadStart and OnLoadEnd. OnLoadStart/OnLoadEnd calls will occur as matching pairs (see http://crbug.com/539952#c2). - Remove the |requesting_url| argument to CefGeolocationHandler:: OnCancelGeolocationPermission. Clients can use the |request_id| argument to track this information themselves. - Fix a crash when loading the PDF extension in multiple browsers with a custom CefRequestContext (issue #1757).
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "ipc/ipc_channel.h"
|
||||
#include "net/base/io_buffer.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
@ -179,9 +180,11 @@ CefDevToolsFrontend::~CefDevToolsFrontend() {
|
||||
void CefDevToolsFrontend::RenderViewCreated(
|
||||
content::RenderViewHost* render_view_host) {
|
||||
if (!frontend_host_) {
|
||||
frontend_host_.reset(
|
||||
content::DevToolsFrontendHost::Create(
|
||||
web_contents()->GetMainFrame(), this));
|
||||
frontend_host_.reset(content::DevToolsFrontendHost::Create(
|
||||
web_contents()->GetMainFrame(),
|
||||
base::Bind(&CefDevToolsFrontend::HandleMessageFromDevToolsFrontend,
|
||||
base::Unretained(this))));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,10 +223,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
dict->GetInteger("id", &request_id);
|
||||
dict->GetList("params", ¶ms);
|
||||
|
||||
std::string browser_message;
|
||||
if (method == "sendMessageToBrowser" && params &&
|
||||
params->GetSize() == 1 && params->GetString(0, &browser_message)) {
|
||||
agent_host_->DispatchProtocolMessage(browser_message);
|
||||
if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) {
|
||||
std::string protocol_message;
|
||||
if (!params->GetString(0, &protocol_message))
|
||||
return;
|
||||
if (agent_host_)
|
||||
agent_host_->DispatchProtocolMessage(protocol_message);
|
||||
} else if (method == "loadCompleted") {
|
||||
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
|
||||
base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"));
|
||||
@ -283,12 +288,6 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
SendMessageAck(request_id, nullptr);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::HandleMessageFromDevToolsFrontendToBackend(
|
||||
const std::string& message) {
|
||||
if (agent_host_)
|
||||
agent_host_->DispatchProtocolMessage(message);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::DispatchProtocolMessage(
|
||||
content::DevToolsAgentHost* agent_host,
|
||||
const std::string& message) {
|
||||
|
Reference in New Issue
Block a user