Fix compilation errors on OS X

This commit is contained in:
Cheng Zhao 2016-03-08 23:28:28 +09:00
Родитель baf5f384cd
Коммит d3a39540b5
8 изменённых файлов: 31 добавлений и 22 удалений

Просмотреть файл

@ -232,4 +232,8 @@ content::PermissionManager* BrowserContext::GetPermissionManager() {
return permission_manager_.get();
}
content::BackgroundSyncController* BrowserContext::GetBackgroundSyncController() {
return nullptr;
}
} // namespace brightray

Просмотреть файл

@ -57,6 +57,7 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
content::PushMessagingService* GetPushMessagingService() override;
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
content::PermissionManager* GetPermissionManager() override;
content::BackgroundSyncController* GetBackgroundSyncController() override;
net::URLRequestContextGetter* CreateRequestContext(
NetLog* net_log,

Просмотреть файл

@ -190,8 +190,9 @@ DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend(
d->RegisterHandler("resetZoom", &Delegate::ResetZoom, delegate);
d->RegisterHandler("setDevicesUpdatesEnabled",
&Delegate::SetDevicesUpdatesEnabled, delegate);
d->RegisterHandler("sendMessageToBrowser",
&Delegate::SendMessageToBrowser, delegate);
d->RegisterHandler("dispatchProtocolMessage",
&Delegate::DispatchProtocolMessageFromDevToolsFrontend,
delegate);
d->RegisterHandler("recordActionUMA", &Delegate::RecordActionUMA, delegate);
d->RegisterHandlerWithCallback("sendJsonRequest",
&Delegate::SendJsonRequest, delegate);

Просмотреть файл

@ -68,7 +68,8 @@ class DevToolsEmbedderMessageDispatcher {
virtual void ZoomOut() = 0;
virtual void ResetZoom() = 0;
virtual void SetDevicesUpdatesEnabled(bool enabled) = 0;
virtual void SendMessageToBrowser(const std::string& message) = 0;
virtual void DispatchProtocolMessageFromDevToolsFrontend(
const std::string& message) = 0;
virtual void RecordActionUMA(const std::string& name, int action) = 0;
virtual void SendJsonRequest(const DispatchCallback& callback,
const std::string& browser_id,

Просмотреть файл

@ -26,6 +26,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/user_agent.h"
#include "ipc/ipc_channel.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_response_writer.h"
@ -251,7 +252,9 @@ void InspectableWebContentsImpl::ShowDevTools() {
agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(web_contents_.get());
frontend_host_.reset(content::DevToolsFrontendHost::Create(
web_contents_->GetMainFrame(), this));
web_contents_->GetMainFrame(),
base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend,
base::Unretained(this))));
agent_host_->AttachClient(this);
GURL devtools_url(base::StringPrintf(kChromeUIDevToolsURL,
@ -477,7 +480,8 @@ void InspectableWebContentsImpl::ResetZoom() {
void InspectableWebContentsImpl::SetDevicesUpdatesEnabled(bool enabled) {
}
void InspectableWebContentsImpl::SendMessageToBrowser(const std::string& message) {
void InspectableWebContentsImpl::DispatchProtocolMessageFromDevToolsFrontend(
const std::string& message) {
if (agent_host_.get())
agent_host_->DispatchProtocolMessage(message);
}
@ -543,12 +547,6 @@ void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend(const std::st
params);
}
void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontendToBackend(
const std::string& message) {
if (agent_host_.get())
agent_host_->DispatchProtocolMessage(message);
}
void InspectableWebContentsImpl::DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host, const std::string& message) {
if (!frontend_loaded_)
@ -578,7 +576,10 @@ void InspectableWebContentsImpl::RenderFrameHostChanged(
content::RenderFrameHost* new_host) {
if (new_host->GetParent())
return;
frontend_host_.reset(content::DevToolsFrontendHost::Create(new_host, this));
frontend_host_.reset(content::DevToolsFrontendHost::Create(
web_contents_->GetMainFrame(),
base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend,
base::Unretained(this))));
}
void InspectableWebContentsImpl::WebContentsDestroyed() {

Просмотреть файл

@ -104,7 +104,8 @@ class InspectableWebContentsImpl :
void ZoomOut() override;
void ResetZoom() override;
void SetDevicesUpdatesEnabled(bool enabled) override;
void SendMessageToBrowser(const std::string& message) override;
void DispatchProtocolMessageFromDevToolsFrontend(
const std::string& message) override;
void RecordActionUMA(const std::string& name, int action) override;
void SendJsonRequest(const DispatchCallback& callback,
const std::string& browser_id,

Просмотреть файл

@ -140,11 +140,11 @@ bool NetworkDelegate::OnCanEnablePrivacyMode(
return false;
}
bool OnAreStrictSecureCookiesEnabled() {
bool NetworkDelegate::OnAreStrictSecureCookiesEnabled() const {
return true;
}
bool OnAreExperimentalCookieFeaturesEnabled() {
bool NetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
return true;
}

Просмотреть файл

@ -310,15 +310,15 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
#else
http_auth_preferences_.reset(new net::HttpAuthPreferences(schemes));
#endif
auto auth_handler_factory = make_scoped_ptr(
auto auth_handler_factory =
net::HttpAuthHandlerRegistryFactory::Create(
http_auth_preferences_.get(), host_resolver.get()));
http_auth_preferences_.get(), host_resolver.get());
storage_->set_cert_verifier(delegate_->CreateCertVerifier());
storage_->set_transport_security_state(
make_scoped_ptr(new net::TransportSecurityState));
storage_->set_ssl_config_service(delegate_->CreateSSLConfigService());
storage_->set_http_auth_handler_factory(auth_handler_factory.Pass());
storage_->set_http_auth_handler_factory(std::move(auth_handler_factory));
scoped_ptr<net::HttpServerProperties> server_properties(
new net::HttpServerPropertiesImpl);
storage_->set_http_server_properties(std::move(server_properties));
@ -367,10 +367,10 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
}
storage_->set_http_transaction_factory(make_scoped_ptr(
new net::HttpCache(
new DevToolsNetworkTransactionFactory(controller_,
http_network_session_.get()),
url_request_context_->net_log(),
std::move(backend))));
make_scoped_ptr(new DevToolsNetworkTransactionFactory(
controller_, http_network_session_.get())),
std::move(backend),
false)));
storage_->set_job_factory(delegate_->CreateURLRequestJobFactory(
&protocol_handlers_, &protocol_interceptors_));