Fix API changes of Chrome 58
This commit is contained in:
parent
0a110a44f9
commit
c41fb922b3
13 changed files with 14 additions and 49 deletions
|
@ -15,7 +15,7 @@
|
|||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "media/base/media_resources.h"
|
||||
#include "media/base/localized_strings.h"
|
||||
#include "net/proxy/proxy_resolver_v8.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/material_design/material_design_controller.h"
|
||||
|
|
|
@ -194,7 +194,6 @@ DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend(
|
|||
d->RegisterHandler("dispatchProtocolMessage",
|
||||
&Delegate::DispatchProtocolMessageFromDevToolsFrontend,
|
||||
delegate);
|
||||
d->RegisterHandler("recordActionUMA", &Delegate::RecordActionUMA, delegate);
|
||||
d->RegisterHandlerWithCallback("sendJsonRequest",
|
||||
&Delegate::SendJsonRequest, delegate);
|
||||
d->RegisterHandlerWithCallback("getPreferences",
|
||||
|
|
|
@ -70,7 +70,6 @@ class DevToolsEmbedderMessageDispatcher {
|
|||
virtual void SetDevicesUpdatesEnabled(bool enabled) = 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,
|
||||
const std::string& url) = 0;
|
||||
|
|
|
@ -61,11 +61,6 @@ const char kFrontendHostMethod[] = "method";
|
|||
const char kFrontendHostParams[] = "params";
|
||||
const char kTitleFormat[] = "Developer Tools - %s";
|
||||
|
||||
const char kDevToolsActionTakenHistogram[] = "DevTools.ActionTaken";
|
||||
const int kDevToolsActionTakenBoundary = 100;
|
||||
const char kDevToolsPanelShownHistogram[] = "DevTools.PanelShown";
|
||||
const int kDevToolsPanelShownBoundary = 20;
|
||||
|
||||
const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
|
||||
|
||||
void RectToDictionary(const gfx::Rect& bounds, base::DictionaryValue* dict) {
|
||||
|
@ -171,7 +166,7 @@ int ResponseWriter::Initialize(const net::CompletionCallback& callback) {
|
|||
int ResponseWriter::Write(net::IOBuffer* buffer,
|
||||
int num_bytes,
|
||||
const net::CompletionCallback& callback) {
|
||||
auto* id = new base::FundamentalValue(stream_id_);
|
||||
auto* id = new base::Value(stream_id_);
|
||||
base::StringValue* chunk =
|
||||
new base::StringValue(std::string(buffer->data(), num_bytes));
|
||||
|
||||
|
@ -563,14 +558,6 @@ void InspectableWebContentsImpl::DispatchProtocolMessageFromDevToolsFrontend(
|
|||
agent_host_->DispatchProtocolMessage(this, message);
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::RecordActionUMA(const std::string& name,
|
||||
int action) {
|
||||
if (name == kDevToolsActionTakenHistogram)
|
||||
UMA_HISTOGRAM_ENUMERATION(name, action, kDevToolsActionTakenBoundary);
|
||||
else if (name == kDevToolsPanelShownHistogram)
|
||||
UMA_HISTOGRAM_ENUMERATION(name, action, kDevToolsPanelShownBoundary);
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::SendJsonRequest(
|
||||
const DispatchCallback& callback,
|
||||
const std::string& browser_id,
|
||||
|
@ -639,7 +626,7 @@ void InspectableWebContentsImpl::DispatchProtocolMessage(
|
|||
return;
|
||||
}
|
||||
|
||||
base::FundamentalValue total_size(static_cast<int>(message.length()));
|
||||
base::Value total_size(static_cast<int>(message.length()));
|
||||
for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
|
||||
base::StringValue message_value(message.substr(pos, kMaxMessageChunkSize));
|
||||
CallClientFunction("DevToolsAPI.dispatchMessageChunk",
|
||||
|
@ -686,10 +673,12 @@ bool InspectableWebContentsImpl::DidAddMessageToConsole(
|
|||
|
||||
bool InspectableWebContentsImpl::ShouldCreateWebContents(
|
||||
content::WebContents* web_contents,
|
||||
content::SiteInstance* source_site_instance,
|
||||
int32_t route_id,
|
||||
int32_t main_frame_route_id,
|
||||
int32_t main_frame_widget_route_id,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
const std::string& partition_id,
|
||||
|
@ -777,7 +766,7 @@ void InspectableWebContentsImpl::OnURLFetchComplete(
|
|||
|
||||
void InspectableWebContentsImpl::SendMessageAck(int request_id,
|
||||
const base::Value* arg) {
|
||||
base::FundamentalValue id_value(request_id);
|
||||
base::Value id_value(request_id);
|
||||
CallClientFunction("DevToolsAPI.embedderMessageAck",
|
||||
&id_value, arg, nullptr);
|
||||
}
|
||||
|
|
|
@ -107,7 +107,6 @@ class InspectableWebContentsImpl :
|
|||
void SetDevicesUpdatesEnabled(bool enabled) 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,
|
||||
const std::string& url) override;
|
||||
|
@ -143,10 +142,12 @@ class InspectableWebContentsImpl :
|
|||
const base::string16& source_id) override;
|
||||
bool ShouldCreateWebContents(
|
||||
content::WebContents* web_contents,
|
||||
content::SiteInstance* source_site_instance,
|
||||
int32_t route_id,
|
||||
int32_t main_frame_route_id,
|
||||
int32_t main_frame_widget_route_id,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
const std::string& partition_id,
|
||||
|
|
|
@ -134,14 +134,6 @@ bool NetworkDelegate::OnCanEnablePrivacyMode(
|
|||
return false;
|
||||
}
|
||||
|
||||
bool NetworkDelegate::OnAreStrictSecureCookiesEnabled() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
|
||||
const net::URLRequest& request,
|
||||
const GURL& target_url,
|
||||
|
|
|
@ -63,7 +63,6 @@ class NetworkDelegate : public net::NetworkDelegate {
|
|||
bool OnCanEnablePrivacyMode(
|
||||
const GURL& url,
|
||||
const GURL& first_party_for_cookies) const override;
|
||||
bool OnAreStrictSecureCookiesEnabled() const override;
|
||||
bool OnAreExperimentalCookieFeaturesEnabled() const override;
|
||||
bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
|
||||
const net::URLRequest& request,
|
||||
|
|
|
@ -70,12 +70,6 @@ blink::mojom::PermissionStatus PermissionManager::GetPermissionStatus(
|
|||
return blink::mojom::PermissionStatus::GRANTED;
|
||||
}
|
||||
|
||||
void PermissionManager::RegisterPermissionUsage(
|
||||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin) {
|
||||
}
|
||||
|
||||
int PermissionManager::SubscribePermissionStatusChange(
|
||||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
|
|
|
@ -40,9 +40,6 @@ class PermissionManager : public content::PermissionManager {
|
|||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin) override;
|
||||
void RegisterPermissionUsage(content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin) override;
|
||||
int SubscribePermissionStatusChange(
|
||||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
|
|
|
@ -100,7 +100,7 @@ void PlatformNotificationService::ClosePersistentNotification(
|
|||
const std::string& notification_id) {
|
||||
}
|
||||
|
||||
bool PlatformNotificationService::GetDisplayedPersistentNotifications(
|
||||
bool PlatformNotificationService::GetDisplayedNotifications(
|
||||
content::BrowserContext* browser_context,
|
||||
std::set<std::string>* displayed_notifications) {
|
||||
return false;
|
||||
|
|
|
@ -45,7 +45,7 @@ class PlatformNotificationService
|
|||
const content::NotificationResources& notification_resources) override;
|
||||
void ClosePersistentNotification(content::BrowserContext* browser_context,
|
||||
const std::string& notification_id) override;
|
||||
bool GetDisplayedPersistentNotifications(
|
||||
bool GetDisplayedNotifications(
|
||||
content::BrowserContext* browser_context,
|
||||
std::set<std::string>* displayed_notifications) override;
|
||||
|
||||
|
|
|
@ -24,20 +24,16 @@ bool SpecialStoragePolicy::IsStorageDurable(const GURL& origin) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
|
||||
bool SpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::CanQueryDiskSize(const GURL& origin) {
|
||||
return true;
|
||||
bool SpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::HasSessionOnlyOrigins() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
|
|
@ -17,9 +17,8 @@ class SpecialStoragePolicy : public storage::SpecialStoragePolicy {
|
|||
bool IsStorageProtected(const GURL& origin) override;
|
||||
bool IsStorageUnlimited(const GURL& origin) override;
|
||||
bool IsStorageDurable(const GURL& origin) override;
|
||||
bool IsStorageSessionOnly(const GURL& origin) override;
|
||||
bool CanQueryDiskSize(const GURL& origin) override;
|
||||
bool HasIsolatedStorage(const GURL& origin) override;
|
||||
bool IsStorageSessionOnly(const GURL& origin) override;
|
||||
bool HasSessionOnlyOrigins() override;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue