Fix API changes of Chrome58
This commit is contained in:
parent
453cb2c0b4
commit
fc2d62d5cb
28 changed files with 73 additions and 105 deletions
|
@ -93,9 +93,9 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
|
||||||
std::vector<std::string> codecs;
|
std::vector<std::string> codecs;
|
||||||
codecs.push_back(kCdmSupportedCodecVp8);
|
codecs.push_back(kCdmSupportedCodecVp8);
|
||||||
codecs.push_back(kCdmSupportedCodecVp9);
|
codecs.push_back(kCdmSupportedCodecVp9);
|
||||||
#if defined(USE_PROPRIETARY_CODECS)
|
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
codecs.push_back(kCdmSupportedCodecAvc1);
|
codecs.push_back(kCdmSupportedCodecAvc1);
|
||||||
#endif // defined(USE_PROPRIETARY_CODECS)
|
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
std::string codec_string = base::JoinString(
|
std::string codec_string = base::JoinString(
|
||||||
codecs, std::string(1, kCdmSupportedCodecsValueDelimiter));
|
codecs, std::string(1, kCdmSupportedCodecsValueDelimiter));
|
||||||
widevine_cdm_mime_type.additional_param_names.push_back(
|
widevine_cdm_mime_type.additional_param_names.push_back(
|
||||||
|
@ -198,11 +198,19 @@ base::string16 AtomContentClient::GetLocalizedString(int message_id) const {
|
||||||
return l10n_util::GetStringUTF16(message_id);
|
return l10n_util::GetStringUTF16(message_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomContentClient::AddAdditionalSchemes(
|
void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
||||||
std::vector<url::SchemeWithType>* standard_schemes,
|
schemes->standard_schemes.push_back("chrome-extension");
|
||||||
std::vector<url::SchemeWithType>* referrer_schemes,
|
|
||||||
std::vector<std::string>* savable_schemes) {
|
std::vector<std::string> splited;
|
||||||
standard_schemes->push_back({"chrome-extension", url::SCHEME_WITHOUT_PORT});
|
ConvertStringWithSeparatorToVector(&splited, ",",
|
||||||
|
switches::kRegisterServiceWorkerSchemes);
|
||||||
|
for (const std::string& scheme : splited)
|
||||||
|
schemes->service_worker_schemes.push_back(scheme);
|
||||||
|
schemes->service_worker_schemes.push_back(url::kFileScheme);
|
||||||
|
|
||||||
|
ConvertStringWithSeparatorToVector(&splited, ",", switches::kSecureSchemes);
|
||||||
|
for (const std::string& scheme : splited)
|
||||||
|
schemes->secure_schemes.push_back(scheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomContentClient::AddPepperPlugins(
|
void AtomContentClient::AddPepperPlugins(
|
||||||
|
@ -214,25 +222,4 @@ void AtomContentClient::AddPepperPlugins(
|
||||||
ComputeBuiltInPlugins(plugins);
|
ComputeBuiltInPlugins(plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomContentClient::AddServiceWorkerSchemes(
|
|
||||||
std::set<std::string>* service_worker_schemes) {
|
|
||||||
std::vector<std::string> schemes;
|
|
||||||
ConvertStringWithSeparatorToVector(&schemes, ",",
|
|
||||||
switches::kRegisterServiceWorkerSchemes);
|
|
||||||
for (const std::string& scheme : schemes)
|
|
||||||
service_worker_schemes->insert(scheme);
|
|
||||||
|
|
||||||
service_worker_schemes->insert(url::kFileScheme);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AtomContentClient::AddSecureSchemesAndOrigins(
|
|
||||||
std::set<std::string>* secure_schemes,
|
|
||||||
std::set<GURL>* secure_origins) {
|
|
||||||
std::vector<std::string> schemes;
|
|
||||||
ConvertStringWithSeparatorToVector(&schemes, ",", switches::kSecureSchemes);
|
|
||||||
for (const std::string& scheme : schemes)
|
|
||||||
secure_schemes->insert(scheme);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -23,17 +23,9 @@ class AtomContentClient : public brightray::ContentClient {
|
||||||
std::string GetProduct() const override;
|
std::string GetProduct() const override;
|
||||||
std::string GetUserAgent() const override;
|
std::string GetUserAgent() const override;
|
||||||
base::string16 GetLocalizedString(int message_id) const override;
|
base::string16 GetLocalizedString(int message_id) const override;
|
||||||
void AddAdditionalSchemes(
|
void AddAdditionalSchemes(Schemes* schemes) override;
|
||||||
std::vector<url::SchemeWithType>* standard_schemes,
|
|
||||||
std::vector<url::SchemeWithType>* referrer_schemes,
|
|
||||||
std::vector<std::string>* savable_schemes) override;
|
|
||||||
void AddPepperPlugins(
|
void AddPepperPlugins(
|
||||||
std::vector<content::PepperPluginInfo>* plugins) override;
|
std::vector<content::PepperPluginInfo>* plugins) override;
|
||||||
void AddServiceWorkerSchemes(
|
|
||||||
std::set<std::string>* service_worker_schemes) override;
|
|
||||||
void AddSecureSchemesAndOrigins(
|
|
||||||
std::set<std::string>* secure_schemes,
|
|
||||||
std::set<GURL>* secure_origins) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomContentClient);
|
DISALLOW_COPY_AND_ASSIGN(AtomContentClient);
|
||||||
|
|
|
@ -228,8 +228,8 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
|
||||||
GetCookieStore(getter)->SetCookieWithDetailsAsync(
|
GetCookieStore(getter)->SetCookieWithDetailsAsync(
|
||||||
GURL(url), name, value, domain, path, creation_time,
|
GURL(url), name, value, domain, path, creation_time,
|
||||||
expiration_time, last_access_time, secure, http_only,
|
expiration_time, last_access_time, secure, http_only,
|
||||||
net::CookieSameSite::DEFAULT_MODE, false,
|
net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT,
|
||||||
net::COOKIE_PRIORITY_DEFAULT, base::Bind(OnSetCookie, callback));
|
base::Bind(OnSetCookie, callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -46,7 +46,7 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
|
||||||
DCHECK(agent_host == agent_host_.get());
|
DCHECK(agent_host == agent_host_.get());
|
||||||
|
|
||||||
std::unique_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
|
std::unique_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
|
||||||
if (!parsed_message->IsType(base::Value::TYPE_DICTIONARY))
|
if (!parsed_message->IsType(base::Value::Type::DICTIONARY))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
base::DictionaryValue* dict =
|
base::DictionaryValue* dict =
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "atom/browser/api/atom_api_desktop_capturer.h"
|
#include "atom/browser/api/atom_api_desktop_capturer.h"
|
||||||
|
|
||||||
|
using base::PlatformThreadRef;
|
||||||
|
|
||||||
#include "atom/common/api/atom_api_native_image.h"
|
#include "atom/common/api/atom_api_native_image.h"
|
||||||
#include "atom/common/native_mate_converters/gfx_converter.h"
|
#include "atom/common/native_mate_converters/gfx_converter.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
|
|
|
@ -432,7 +432,8 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
|
||||||
last_modified, offset, length, std::string(),
|
last_modified, offset, length, std::string(),
|
||||||
content::DownloadItem::INTERRUPTED,
|
content::DownloadItem::INTERRUPTED,
|
||||||
content::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
content::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||||
content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false);
|
content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false,
|
||||||
|
std::vector<content::DownloadItem::ReceivedSlice>());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -296,27 +296,26 @@ void AtomBrowserClient::ResourceDispatcherHostCreated() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AtomBrowserClient::CanCreateWindow(
|
bool AtomBrowserClient::CanCreateWindow(
|
||||||
|
int opener_render_process_id,
|
||||||
|
int opener_render_frame_id,
|
||||||
const GURL& opener_url,
|
const GURL& opener_url,
|
||||||
const GURL& opener_top_level_frame_url,
|
const GURL& opener_top_level_frame_url,
|
||||||
const GURL& source_origin,
|
const GURL& source_origin,
|
||||||
WindowContainerType container_type,
|
content::mojom::WindowContainerType container_type,
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
const content::Referrer& referrer,
|
const content::Referrer& referrer,
|
||||||
const std::string& frame_name,
|
const std::string& frame_name,
|
||||||
WindowOpenDisposition disposition,
|
WindowOpenDisposition disposition,
|
||||||
const blink::WebWindowFeatures& features,
|
const blink::mojom::WindowFeatures& features,
|
||||||
const std::vector<std::string>& additional_features,
|
const std::vector<std::string>& additional_features,
|
||||||
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
|
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
|
||||||
bool user_gesture,
|
bool user_gesture,
|
||||||
bool opener_suppressed,
|
bool opener_suppressed,
|
||||||
content::ResourceContext* context,
|
content::ResourceContext* context,
|
||||||
int render_process_id,
|
|
||||||
int opener_render_view_id,
|
|
||||||
int opener_render_frame_id,
|
|
||||||
bool* no_javascript_access) {
|
bool* no_javascript_access) {
|
||||||
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
||||||
|
|
||||||
if (IsRendererSandboxed(render_process_id)) {
|
if (IsRendererSandboxed(opener_render_process_id)) {
|
||||||
*no_javascript_access = false;
|
*no_javascript_access = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -330,7 +329,7 @@ bool AtomBrowserClient::CanCreateWindow(
|
||||||
disposition,
|
disposition,
|
||||||
additional_features,
|
additional_features,
|
||||||
body,
|
body,
|
||||||
render_process_id,
|
opener_render_process_id,
|
||||||
opener_render_frame_id));
|
opener_render_frame_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,23 +80,22 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||||
void ResourceDispatcherHostCreated() override;
|
void ResourceDispatcherHostCreated() override;
|
||||||
bool CanCreateWindow(
|
bool CanCreateWindow(
|
||||||
|
int opener_render_process_id,
|
||||||
|
int opener_render_frame_id,
|
||||||
const GURL& opener_url,
|
const GURL& opener_url,
|
||||||
const GURL& opener_top_level_frame_url,
|
const GURL& opener_top_level_frame_url,
|
||||||
const GURL& source_origin,
|
const GURL& source_origin,
|
||||||
WindowContainerType container_type,
|
content::mojom::WindowContainerType container_type,
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
const content::Referrer& referrer,
|
const content::Referrer& referrer,
|
||||||
const std::string& frame_name,
|
const std::string& frame_name,
|
||||||
WindowOpenDisposition disposition,
|
WindowOpenDisposition disposition,
|
||||||
const blink::WebWindowFeatures& features,
|
const blink::mojom::WindowFeatures& features,
|
||||||
const std::vector<std::string>& additional_features,
|
const std::vector<std::string>& additional_features,
|
||||||
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
|
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
|
||||||
bool user_gesture,
|
bool user_gesture,
|
||||||
bool opener_suppressed,
|
bool opener_suppressed,
|
||||||
content::ResourceContext* context,
|
content::ResourceContext* context,
|
||||||
int render_process_id,
|
|
||||||
int opener_render_view_id,
|
|
||||||
int opener_render_frame_id,
|
|
||||||
bool* no_javascript_access) override;
|
bool* no_javascript_access) override;
|
||||||
void GetAdditionalAllowedSchemesForFileSystem(
|
void GetAdditionalAllowedSchemesForFileSystem(
|
||||||
std::vector<std::string>* schemes) override;
|
std::vector<std::string>* schemes) override;
|
||||||
|
|
|
@ -13,27 +13,27 @@
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "ui/gfx/image/image_skia.h"
|
#include "ui/gfx/image/image_skia.h"
|
||||||
|
|
||||||
using content::JavaScriptMessageType;
|
using content::JavaScriptDialogType;
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& origin_url,
|
const GURL& origin_url,
|
||||||
JavaScriptMessageType message_type,
|
JavaScriptDialogType dialog_type,
|
||||||
const base::string16& message_text,
|
const base::string16& message_text,
|
||||||
const base::string16& default_prompt_text,
|
const base::string16& default_prompt_text,
|
||||||
const DialogClosedCallback& callback,
|
const DialogClosedCallback& callback,
|
||||||
bool* did_suppress_message) {
|
bool* did_suppress_message) {
|
||||||
|
|
||||||
if (message_type != JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_ALERT &&
|
if (dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT &&
|
||||||
message_type != JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
|
dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
|
||||||
callback.Run(false, base::string16());
|
callback.Run(false, base::string16());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> buttons = {"OK"};
|
std::vector<std::string> buttons = {"OK"};
|
||||||
if (message_type == JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
|
if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
|
||||||
buttons.push_back("Cancel");
|
buttons.push_back("Cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
|
||||||
|
|
||||||
void AtomJavaScriptDialogManager::CancelDialogs(
|
void AtomJavaScriptDialogManager::CancelDialogs(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
bool suppress_callbacks,
|
|
||||||
bool reset_state) {
|
bool reset_state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
||||||
void RunJavaScriptDialog(
|
void RunJavaScriptDialog(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& origin_url,
|
const GURL& origin_url,
|
||||||
content::JavaScriptMessageType javascript_message_type,
|
content::JavaScriptDialogType dialog_type,
|
||||||
const base::string16& message_text,
|
const base::string16& message_text,
|
||||||
const base::string16& default_prompt_text,
|
const base::string16& default_prompt_text,
|
||||||
const DialogClosedCallback& callback,
|
const DialogClosedCallback& callback,
|
||||||
|
@ -27,7 +27,6 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
||||||
bool is_reload,
|
bool is_reload,
|
||||||
const DialogClosedCallback& callback) override;
|
const DialogClosedCallback& callback) override;
|
||||||
void CancelDialogs(content::WebContents* web_contents,
|
void CancelDialogs(content::WebContents* web_contents,
|
||||||
bool suppress_callbacks,
|
|
||||||
bool reset_state) override;
|
bool reset_state) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -131,7 +131,7 @@ int AtomPermissionManager::RequestPermissions(
|
||||||
|
|
||||||
auto web_contents =
|
auto web_contents =
|
||||||
content::WebContents::FromRenderFrameHost(render_frame_host);
|
content::WebContents::FromRenderFrameHost(render_frame_host);
|
||||||
int request_id = pending_requests_.Add(new PendingRequest(
|
int request_id = pending_requests_.Add(base::MakeUnique<PendingRequest>(
|
||||||
render_frame_host, permissions, response_callback));
|
render_frame_host, permissions, response_callback));
|
||||||
|
|
||||||
for (size_t i = 0; i < permissions.size(); ++i) {
|
for (size_t i = 0; i < permissions.size(); ++i) {
|
||||||
|
@ -187,12 +187,6 @@ blink::mojom::PermissionStatus AtomPermissionManager::GetPermissionStatus(
|
||||||
return blink::mojom::PermissionStatus::GRANTED;
|
return blink::mojom::PermissionStatus::GRANTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomPermissionManager::RegisterPermissionUsage(
|
|
||||||
content::PermissionType permission,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
const GURL& embedding_origin) {
|
|
||||||
}
|
|
||||||
|
|
||||||
int AtomPermissionManager::SubscribePermissionStatusChange(
|
int AtomPermissionManager::SubscribePermissionStatusChange(
|
||||||
content::PermissionType permission,
|
content::PermissionType permission,
|
||||||
const GURL& requesting_origin,
|
const GURL& requesting_origin,
|
||||||
|
|
|
@ -66,9 +66,6 @@ class AtomPermissionManager : public content::PermissionManager {
|
||||||
content::PermissionType permission,
|
content::PermissionType permission,
|
||||||
const GURL& requesting_origin,
|
const GURL& requesting_origin,
|
||||||
const GURL& embedding_origin) override;
|
const GURL& embedding_origin) override;
|
||||||
void RegisterPermissionUsage(content::PermissionType permission,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
const GURL& embedding_origin) override;
|
|
||||||
int SubscribePermissionStatusChange(
|
int SubscribePermissionStatusChange(
|
||||||
content::PermissionType permission,
|
content::PermissionType permission,
|
||||||
const GURL& requesting_origin,
|
const GURL& requesting_origin,
|
||||||
|
@ -79,7 +76,7 @@ class AtomPermissionManager : public content::PermissionManager {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class PendingRequest;
|
class PendingRequest;
|
||||||
using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>;
|
using PendingRequestsMap = IDMap<std::unique_ptr<PendingRequest>>;
|
||||||
|
|
||||||
RequestHandler request_handler_;
|
RequestHandler request_handler_;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const content::NativeWebKeyboardEvent& event) {
|
const content::NativeWebKeyboardEvent& event) {
|
||||||
if (event.skip_in_browser ||
|
if (event.skip_in_browser ||
|
||||||
event.type == content::NativeWebKeyboardEvent::Char)
|
event.type() == content::NativeWebKeyboardEvent::Char)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Escape exits tabbed fullscreen mode.
|
// Escape exits tabbed fullscreen mode.
|
||||||
|
|
|
@ -50,15 +50,16 @@ bool AtomURLRequestJobFactory::InterceptProtocol(
|
||||||
return false;
|
return false;
|
||||||
ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme];
|
ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme];
|
||||||
protocol_handler_map_[scheme] = protocol_handler.release();
|
protocol_handler_map_[scheme] = protocol_handler.release();
|
||||||
original_protocols_.set(scheme, base::WrapUnique(original_protocol_handler));
|
original_protocols_[scheme] = std::move(original_protocol_handler);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AtomURLRequestJobFactory::UninterceptProtocol(const std::string& scheme) {
|
bool AtomURLRequestJobFactory::UninterceptProtocol(const std::string& scheme) {
|
||||||
if (!original_protocols_.contains(scheme))
|
auto it = original_protocols_.find(scheme);
|
||||||
|
if (it == original_protocols_.end())
|
||||||
return false;
|
return false;
|
||||||
protocol_handler_map_[scheme] =
|
protocol_handler_map_[scheme] = std::move(it->second);
|
||||||
original_protocols_.take_and_erase(scheme).release();
|
original_protocols_.erase(it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/containers/scoped_ptr_hash_map.h"
|
|
||||||
#include "net/url_request/url_request_job_factory.h"
|
#include "net/url_request/url_request_job_factory.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -64,7 +64,7 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
|
||||||
ProtocolHandlerMap protocol_handler_map_;
|
ProtocolHandlerMap protocol_handler_map_;
|
||||||
|
|
||||||
// Map that stores the original protocols of schemes.
|
// Map that stores the original protocols of schemes.
|
||||||
using OriginalProtocolsMap = base::ScopedPtrHashMap<
|
using OriginalProtocolsMap = std::unordered_map<
|
||||||
std::string, std::unique_ptr<ProtocolHandler>>;
|
std::string, std::unique_ptr<ProtocolHandler>>;
|
||||||
// Can only be accessed in IO thread.
|
// Can only be accessed in IO thread.
|
||||||
OriginalProtocolsMap original_protocols_;
|
OriginalProtocolsMap original_protocols_;
|
||||||
|
|
|
@ -59,7 +59,7 @@ void AskForOptions(v8::Isolate* isolate,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsErrorOptions(base::Value* value, int* error) {
|
bool IsErrorOptions(base::Value* value, int* error) {
|
||||||
if (value->IsType(base::Value::TYPE_DICTIONARY)) {
|
if (value->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||||
base::DictionaryValue* dict = static_cast<base::DictionaryValue*>(value);
|
base::DictionaryValue* dict = static_cast<base::DictionaryValue*>(value);
|
||||||
if (dict->GetInteger("error", error))
|
if (dict->GetInteger("error", error))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -18,7 +18,7 @@ URLRequestAsyncAsarJob::URLRequestAsyncAsarJob(
|
||||||
|
|
||||||
void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr<base::Value> options) {
|
void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||||
base::FilePath::StringType file_path;
|
base::FilePath::StringType file_path;
|
||||||
if (options->IsType(base::Value::TYPE_DICTIONARY)) {
|
if (options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||||
static_cast<base::DictionaryValue*>(options.get())->GetString(
|
static_cast<base::DictionaryValue*>(options.get())->GetString(
|
||||||
"path", &file_path);
|
"path", &file_path);
|
||||||
} else if (options->IsType(base::Value::TYPE_STRING)) {
|
} else if (options->IsType(base::Value::TYPE_STRING)) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ URLRequestBufferJob::URLRequestBufferJob(
|
||||||
|
|
||||||
void URLRequestBufferJob::StartAsync(std::unique_ptr<base::Value> options) {
|
void URLRequestBufferJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||||
const base::BinaryValue* binary = nullptr;
|
const base::BinaryValue* binary = nullptr;
|
||||||
if (options->IsType(base::Value::TYPE_DICTIONARY)) {
|
if (options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||||
base::DictionaryValue* dict =
|
base::DictionaryValue* dict =
|
||||||
static_cast<base::DictionaryValue*>(options.get());
|
static_cast<base::DictionaryValue*>(options.get());
|
||||||
dict->GetString("mimeType", &mime_type_);
|
dict->GetString("mimeType", &mime_type_);
|
||||||
|
|
|
@ -112,7 +112,7 @@ void URLRequestFetchJob::BeforeStartInUI(
|
||||||
}
|
}
|
||||||
|
|
||||||
void URLRequestFetchJob::StartAsync(std::unique_ptr<base::Value> options) {
|
void URLRequestFetchJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||||
if (!options->IsType(base::Value::TYPE_DICTIONARY)) {
|
if (!options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||||
NotifyStartError(net::URLRequestStatus(
|
NotifyStartError(net::URLRequestStatus(
|
||||||
net::URLRequestStatus::FAILED, net::ERR_NOT_IMPLEMENTED));
|
net::URLRequestStatus::FAILED, net::ERR_NOT_IMPLEMENTED));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -17,7 +17,7 @@ URLRequestStringJob::URLRequestStringJob(
|
||||||
}
|
}
|
||||||
|
|
||||||
void URLRequestStringJob::StartAsync(std::unique_ptr<base::Value> options) {
|
void URLRequestStringJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||||
if (options->IsType(base::Value::TYPE_DICTIONARY)) {
|
if (options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||||
base::DictionaryValue* dict =
|
base::DictionaryValue* dict =
|
||||||
static_cast<base::DictionaryValue*>(options.get());
|
static_cast<base::DictionaryValue*>(options.get());
|
||||||
dict->GetString("mimeType", &mime_type_);
|
dict->GetString("mimeType", &mime_type_);
|
||||||
|
|
|
@ -181,7 +181,7 @@ bool Archive::Init() {
|
||||||
std::string error;
|
std::string error;
|
||||||
base::JSONReader reader;
|
base::JSONReader reader;
|
||||||
std::unique_ptr<base::Value> value(reader.ReadToValue(header));
|
std::unique_ptr<base::Value> value(reader.ReadToValue(header));
|
||||||
if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) {
|
if (!value || !value->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||||
LOG(ERROR) << "Failed to parse header: " << error;
|
LOG(ERROR) << "Failed to parse header: " << error;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -269,8 +269,9 @@ bool Archive::Realpath(const base::FilePath& path, base::FilePath* realpath) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Archive::CopyFileOut(const base::FilePath& path, base::FilePath* out) {
|
bool Archive::CopyFileOut(const base::FilePath& path, base::FilePath* out) {
|
||||||
if (external_files_.contains(path)) {
|
auto it = external_files_.find(path.value());
|
||||||
*out = external_files_.get(path)->path();
|
if (it != external_files_.end()) {
|
||||||
|
*out = it->second->path();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,7 +297,7 @@ bool Archive::CopyFileOut(const base::FilePath& path, base::FilePath* out) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*out = temp_file->path();
|
*out = temp_file->path();
|
||||||
external_files_.set(path, std::move(temp_file));
|
external_files_[path.value()] = std::move(temp_file);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
#define ATOM_COMMON_ASAR_ARCHIVE_H_
|
#define ATOM_COMMON_ASAR_ARCHIVE_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/containers/scoped_ptr_hash_map.h"
|
|
||||||
#include "base/files/file.h"
|
#include "base/files/file.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ class Archive {
|
||||||
std::unique_ptr<base::DictionaryValue> header_;
|
std::unique_ptr<base::DictionaryValue> header_;
|
||||||
|
|
||||||
// Cached external temporary files.
|
// Cached external temporary files.
|
||||||
base::ScopedPtrHashMap<base::FilePath, std::unique_ptr<ScopedTemporaryFile>>
|
std::unordered_map<base::FilePath::StringType,
|
||||||
external_files_;
|
std::unique_ptr<ScopedTemporaryFile>> external_files_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Archive);
|
DISALLOW_COPY_AND_ASSIGN(Archive);
|
||||||
};
|
};
|
||||||
|
|
|
@ -198,7 +198,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8ValueImpl(
|
||||||
case base::Value::TYPE_LIST:
|
case base::Value::TYPE_LIST:
|
||||||
return ToV8Array(isolate, static_cast<const base::ListValue*>(value));
|
return ToV8Array(isolate, static_cast<const base::ListValue*>(value));
|
||||||
|
|
||||||
case base::Value::TYPE_DICTIONARY:
|
case base::Value::TYPE::DICTIONARY:
|
||||||
return ToV8Object(isolate,
|
return ToV8Object(isolate,
|
||||||
static_cast<const base::DictionaryValue*>(value));
|
static_cast<const base::DictionaryValue*>(value));
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ bool Converter<base::DictionaryValue>::FromV8(v8::Isolate* isolate,
|
||||||
std::unique_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
std::unique_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||||
std::unique_ptr<base::Value> value(converter->FromV8Value(
|
std::unique_ptr<base::Value> value(converter->FromV8Value(
|
||||||
val, isolate->GetCurrentContext()));
|
val, isolate->GetCurrentContext()));
|
||||||
if (value && value->IsType(base::Value::TYPE_DICTIONARY)) {
|
if (value && value->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||||
out->Swap(static_cast<base::DictionaryValue*>(value.get()));
|
out->Swap(static_cast<base::DictionaryValue*>(value.get()));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -66,11 +66,11 @@ class ExternalClearKeyProperties : public KeySystemProperties {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case media::EmeInitDataType::CENC:
|
case media::EmeInitDataType::CENC:
|
||||||
#if defined(USE_PROPRIETARY_CODECS)
|
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif // defined(USE_PROPRIETARY_CODECS)
|
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
|
|
||||||
case media::EmeInitDataType::UNKNOWN:
|
case media::EmeInitDataType::UNKNOWN:
|
||||||
return false;
|
return false;
|
||||||
|
@ -80,7 +80,7 @@ class ExternalClearKeyProperties : public KeySystemProperties {
|
||||||
}
|
}
|
||||||
|
|
||||||
SupportedCodecs GetSupportedCodecs() const override {
|
SupportedCodecs GetSupportedCodecs() const override {
|
||||||
#if defined(USE_PROPRIETARY_CODECS)
|
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL;
|
return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL;
|
||||||
#else
|
#else
|
||||||
return media::EME_CODEC_WEBM_ALL;
|
return media::EME_CODEC_WEBM_ALL;
|
||||||
|
@ -224,21 +224,21 @@ static void AddPepperBasedWidevine(
|
||||||
// as those may offer a higher level of protection.
|
// as those may offer a higher level of protection.
|
||||||
supported_codecs |= media::EME_CODEC_WEBM_OPUS;
|
supported_codecs |= media::EME_CODEC_WEBM_OPUS;
|
||||||
supported_codecs |= media::EME_CODEC_WEBM_VORBIS;
|
supported_codecs |= media::EME_CODEC_WEBM_VORBIS;
|
||||||
#if defined(USE_PROPRIETARY_CODECS)
|
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
supported_codecs |= media::EME_CODEC_MP4_AAC;
|
supported_codecs |= media::EME_CODEC_MP4_AAC;
|
||||||
#endif // defined(USE_PROPRIETARY_CODECS)
|
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
|
|
||||||
for (size_t i = 0; i < codecs.size(); ++i) {
|
for (size_t i = 0; i < codecs.size(); ++i) {
|
||||||
if (codecs[i] == kCdmSupportedCodecVp8)
|
if (codecs[i] == kCdmSupportedCodecVp8)
|
||||||
supported_codecs |= media::EME_CODEC_WEBM_VP8;
|
supported_codecs |= media::EME_CODEC_WEBM_VP8;
|
||||||
if (codecs[i] == kCdmSupportedCodecVp9)
|
if (codecs[i] == kCdmSupportedCodecVp9)
|
||||||
supported_codecs |= media::EME_CODEC_WEBM_VP9;
|
supported_codecs |= media::EME_CODEC_WEBM_VP9;
|
||||||
#if defined(USE_PROPRIETARY_CODECS)
|
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
if (codecs[i] == kCdmSupportedCodecAvc1)
|
if (codecs[i] == kCdmSupportedCodecAvc1)
|
||||||
supported_codecs |= media::EME_CODEC_MP4_AVC1;
|
supported_codecs |= media::EME_CODEC_MP4_AVC1;
|
||||||
if (codecs[i] == kCdmSupportedCodecVp9)
|
if (codecs[i] == kCdmSupportedCodecVp9)
|
||||||
supported_codecs |= media::EME_CODEC_MP4_VP9;
|
supported_codecs |= media::EME_CODEC_MP4_VP9;
|
||||||
#endif // defined(USE_PROPRIETARY_CODECS)
|
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||||
}
|
}
|
||||||
|
|
||||||
using Robustness = cdm::WidevineKeySystemProperties::Robustness;
|
using Robustness = cdm::WidevineKeySystemProperties::Robustness;
|
||||||
|
|
|
@ -237,9 +237,6 @@
|
||||||
'USING_V8_SHARED',
|
'USING_V8_SHARED',
|
||||||
'USING_V8_PLATFORM_SHARED',
|
'USING_V8_PLATFORM_SHARED',
|
||||||
'USING_V8_BASE_SHARED',
|
'USING_V8_BASE_SHARED',
|
||||||
# Remove this after enable_plugins becomes a feature flag.
|
|
||||||
'ENABLE_PLUGINS',
|
|
||||||
'USE_PROPRIETARY_CODECS',
|
|
||||||
],
|
],
|
||||||
'sources': [
|
'sources': [
|
||||||
'<@(lib_sources)',
|
'<@(lib_sources)',
|
||||||
|
|
2
vendor/crashpad
vendored
2
vendor/crashpad
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit eeac857dfb5b255c899c8763d62654863b4c8890
|
Subproject commit 4054e6cba3ba023d9c00260518ec2912607ae17c
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 3fe90cfcf54dd946980e59daf550a7cdb2317c8f
|
Subproject commit 42eee8a69267191ac20505bf929bb39a688d7385
|
Loading…
Reference in a new issue