mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 3a87aecc (#433059)
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
# 2014 the Chromium Authors. All rights reserved. Use of this source code is
|
||||
# governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import("//build/json_schema_api.gni")
|
||||
import("//tools/json_schema_compiler/json_features.gni")
|
||||
#import("//tools/json_schema_compiler/json_schema_api.gni")
|
||||
|
||||
# TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See README.txt for
|
||||
# details.
|
||||
|
@@ -10,20 +10,22 @@ To add a new extension API implemented only in CEF ***:
|
||||
API.
|
||||
2. Add <api>.idl or .json to the 'schema_sources' list in
|
||||
libcef/common/extensions/api/BUILD.gn. Serialization code will be
|
||||
generated based on this list in step 5.
|
||||
3. Add an entry in the libcef/common/extensions/api/_*_features.json files if
|
||||
necessary [1].
|
||||
4. Add libcef/browser/extensions/api/<api>/<api>_api.[h|cc] class implementation
|
||||
generated based on this list in step 4.
|
||||
3. Add libcef/browser/extensions/api/<api>/<api>_api.[h|cc] class implementation
|
||||
files and associated entries to the 'libcef_static' target in BUILD.gn.
|
||||
5. Run the cef_create_projects script and build to generate the
|
||||
4. Run the cef_create_projects script and build to generate the
|
||||
cef/libcef/common/extensions/api/<api>.h file and other serialization code
|
||||
required by the extensions system.
|
||||
6. Call `<class>::GetInstance();` or `<class>Factory::GetFactoryInstance();` [2]
|
||||
5. Add an entry in the libcef/common/extensions/api/_*_features.json files if
|
||||
necessary [1].
|
||||
6. Add an entry in the libcef/common/extensions/api/*_manifest_overlay.json
|
||||
files if necessary [2].
|
||||
7. Call `<class>::GetInstance();` or `<class>Factory::GetFactoryInstance();` [3]
|
||||
from EnsureBrowserContextKeyedServiceFactoriesBuilt in
|
||||
libcef/browser/extensions/browser_context_keyed_service_factories.cc.
|
||||
7. Call `DependsOn(<class>Factory::GetInstance());` from
|
||||
8. Call `DependsOn(<class>Factory::GetInstance());` from
|
||||
CefExtensionSystemFactory::CefExtensionSystemFactory in
|
||||
libcef/browser/extensions/extension_system_factory.cc if necessary [2].
|
||||
libcef/browser/extensions/extension_system_factory.cc if necessary [3].
|
||||
|
||||
*** Note that CEF does not currently expose its own Mojo APIs. Related code is
|
||||
commented out in:
|
||||
@@ -36,7 +38,7 @@ commented out in:
|
||||
To add a new extension API implemented in Chrome:
|
||||
|
||||
1. Register the API in libcef/browser/extensions/chrome_api_registration.cc
|
||||
2. Perform steps 3, 6 and 7 above.
|
||||
2. Perform steps 5 through 8 above.
|
||||
|
||||
See https://www.chromium.org/developers/design-documents/mojo for more
|
||||
information.
|
||||
@@ -46,7 +48,17 @@ information.
|
||||
additional details. For Chrome extensions this should match the definitions
|
||||
in the chrome/common/extensions/api/_*_features.json files.
|
||||
|
||||
[2] Some Mojo APIs use singleton Factory objects that create a one-to-one
|
||||
[2] Service Manifest InterfaceProviderSpecs control interfaces exposed between
|
||||
processes. Mojo interfaces exposed at the frame level are controlled by the
|
||||
"navigation:frame" dictionary. Those exposed at the process level are
|
||||
controlled by the "service_manager:connector" dictionary. Failure to specify
|
||||
this correctly may result in a console error like the following:
|
||||
|
||||
InterfaceProviderSpec "navigation:frame" prevented service:
|
||||
service:content_renderer from binding interface:
|
||||
mojom::Foo exposed by: service:content_browser
|
||||
|
||||
[3] Some Mojo APIs use singleton Factory objects that create a one-to-one
|
||||
relationship between a service and a BrowserContext. This is used primarily
|
||||
to control shutdown/destruction order and implementors must explicitly state
|
||||
which services are depended on. See comments in
|
||||
|
14
libcef/common/extensions/api/browser_manifest_overlay.json
Normal file
14
libcef/common/extensions/api/browser_manifest_overlay.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "content_browser",
|
||||
"display_name": "CEF",
|
||||
"interface_provider_specs": {
|
||||
"navigation:frame": {
|
||||
"provides": {
|
||||
"renderer": [
|
||||
"extensions::KeepAlive",
|
||||
"extensions::mime_handler::MimeHandlerService"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"display_name": "Chrome Render Process",
|
||||
"interface_provider_specs": {
|
||||
}
|
||||
}
|
12
libcef/common/extensions/api/utility_manifest_overlay.json
Normal file
12
libcef/common/extensions/api/utility_manifest_overlay.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "content_utility",
|
||||
"interface_provider_specs": {
|
||||
"service_manager:connector": {
|
||||
"provides": {
|
||||
"browser": [
|
||||
"net::interfaces::ProxyResolverFactory"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -17,10 +17,12 @@
|
||||
#include "cef/libcef/common/extensions/api/cef_behavior_features.h"
|
||||
#include "cef/libcef/common/extensions/api/cef_manifest_features.h"
|
||||
#include "cef/libcef/common/extensions/api/cef_permission_features.h"
|
||||
#include "chrome/common/extensions/chrome_aliases.h"
|
||||
#include "chrome/common/extensions/chrome_manifest_handlers.h"
|
||||
#include "chrome/grit/common_resources.h"
|
||||
#include "extensions/common/api/generated_schemas.h"
|
||||
#include "extensions/common/common_manifest_handlers.h"
|
||||
#include "extensions/common/extensions_aliases.h"
|
||||
#include "extensions/common/extension_urls.h"
|
||||
#include "extensions/common/features/api_feature.h"
|
||||
#include "extensions/common/features/behavior_feature.h"
|
||||
@@ -59,8 +61,10 @@ void CefExtensionsClient::Initialize() {
|
||||
// TODO(jamescook): Do we need to whitelist any extensions?
|
||||
|
||||
// Set up permissions.
|
||||
PermissionsInfo::GetInstance()->AddProvider(chrome_api_permissions_);
|
||||
PermissionsInfo::GetInstance()->AddProvider(extensions_api_permissions_);
|
||||
PermissionsInfo::GetInstance()->AddProvider(chrome_api_permissions_,
|
||||
GetChromePermissionAliases());
|
||||
PermissionsInfo::GetInstance()->AddProvider(extensions_api_permissions_,
|
||||
GetExtensionsPermissionAliases());
|
||||
}
|
||||
|
||||
const PermissionMessageProvider&
|
||||
@@ -177,8 +181,10 @@ std::string CefExtensionsClient::GetWebstoreBaseURL() const {
|
||||
return extension_urls::kChromeWebstoreBaseURL;
|
||||
}
|
||||
|
||||
std::string CefExtensionsClient::GetWebstoreUpdateURL() const {
|
||||
return extension_urls::kChromeWebstoreUpdateURL;
|
||||
const GURL& CefExtensionsClient::GetWebstoreUpdateURL() const {
|
||||
if (webstore_update_url_.is_empty())
|
||||
webstore_update_url_ = GURL(extension_urls::GetWebstoreUpdateUrl());
|
||||
return webstore_update_url_;
|
||||
}
|
||||
|
||||
bool CefExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const {
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include "chrome/common/extensions/permissions/chrome_permission_message_provider.h"
|
||||
#include "extensions/common/extensions_client.h"
|
||||
#include "extensions/common/permissions/extensions_api_permissions.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace extensions {
|
||||
|
||||
@@ -44,7 +45,7 @@ class CefExtensionsClient : public ExtensionsClient {
|
||||
bool ShouldSuppressFatalErrors() const override;
|
||||
void RecordDidSuppressFatalError() override;
|
||||
std::string GetWebstoreBaseURL() const override;
|
||||
std::string GetWebstoreUpdateURL() const override;
|
||||
const GURL& GetWebstoreUpdateURL() const override;
|
||||
bool IsBlacklistUpdateURL(const GURL& url) const override;
|
||||
|
||||
private:
|
||||
@@ -54,6 +55,9 @@ class CefExtensionsClient : public ExtensionsClient {
|
||||
|
||||
ScriptingWhitelist scripting_whitelist_;
|
||||
|
||||
// Mutable to allow caching in a const method.
|
||||
mutable GURL webstore_update_url_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefExtensionsClient);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user