Update to Chromium revision cb947c01 (#352221)

- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle
  instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest
  object passed to OnBeforeBrowse will no longer have an associated request
  identifier.
- Mac: Remove additional helper apps which are no longer required (see
  http://crbug.com/520680)
- Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see
  http://crbug.com/517114)
- Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and
  NPAPI plugins are no longer supported (see http://crbug.com/470301#c11)
- Add CefFormatUrlForSecurityDisplay function in cef_parser.h
- Fix crash when passing `--disable-extensions` command-line flag (issue #1721)
- Linux: Fix NSS handler loading (issue #1727)
This commit is contained in:
Marshall Greenblatt
2015-10-09 11:23:12 -04:00
parent 5780ea8baa
commit 8aac23386e
104 changed files with 938 additions and 940 deletions

View File

@@ -35,6 +35,7 @@
#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/service_worker_manager.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/file_util.h"
@@ -131,7 +132,7 @@ void CefExtensionSystem::Init() {
// 10.Routing of print-related commands are handled by ChromePDFPrintClient
// and CefPrintWebViewHelperDelegate in the renderer process.
// 11.The PDF extension is granted access to chrome://resources via
// CefExtensionsDispatcherDelegate::InitOriginPermissions in the renderer
// CefExtensionWebContentsObserver::RenderViewCreated in the browser
// process.
if (PdfExtensionEnabled()) {
AddExtension(pdf_extension_util::GetManifest(),
@@ -169,6 +170,7 @@ void CefExtensionSystem::Shutdown() {
}
void CefExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
service_worker_manager_.reset(new ServiceWorkerManager(browser_context_));
runtime_data_.reset(new RuntimeData(registry_));
quota_service_.reset(new QuotaService);
app_sorting_.reset(new NullAppSorting);
@@ -186,6 +188,10 @@ ManagementPolicy* CefExtensionSystem::management_policy() {
return nullptr;
}
ServiceWorkerManager* CefExtensionSystem::service_worker_manager() {
return service_worker_manager_.get();
}
SharedUserScriptMaster* CefExtensionSystem::shared_user_script_master() {
return nullptr;
}

View File

@@ -56,6 +56,7 @@ class CefExtensionSystem : public ExtensionSystem {
ExtensionService* extension_service() override;
RuntimeData* runtime_data() override;
ManagementPolicy* management_policy() override;
ServiceWorkerManager* service_worker_manager() override;
SharedUserScriptMaster* shared_user_script_master() override;
StateStore* state_store() override;
StateStore* rules_store() override;
@@ -118,6 +119,7 @@ class CefExtensionSystem : public ExtensionSystem {
// Data to be accessed on the IO thread. Must outlive process_manager_.
scoped_refptr<InfoMap> info_map_;
scoped_ptr<ServiceWorkerManager> service_worker_manager_;
scoped_ptr<RuntimeData> runtime_data_;
scoped_ptr<QuotaService> quota_service_;
scoped_ptr<AppSorting> app_sorting_;

View File

@@ -22,7 +22,7 @@ ExtensionSystem* CefExtensionSystemFactory::GetForBrowserContext(
// static
CefExtensionSystemFactory* CefExtensionSystemFactory::GetInstance() {
return Singleton<CefExtensionSystemFactory>::get();
return base::Singleton<CefExtensionSystemFactory>::get();
}
CefExtensionSystemFactory::CefExtensionSystemFactory()

View File

@@ -20,7 +20,7 @@ class CefExtensionSystemFactory : public ExtensionSystemProvider {
static CefExtensionSystemFactory* GetInstance();
private:
friend struct DefaultSingletonTraits<CefExtensionSystemFactory>;
friend struct base::DefaultSingletonTraits<CefExtensionSystemFactory>;
CefExtensionSystemFactory();
~CefExtensionSystemFactory() override;

View File

@@ -4,6 +4,11 @@
#include "libcef/browser/extensions/extension_web_contents_observer.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/url_constants.h"
DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::CefExtensionWebContentsObserver);
namespace extensions {
@@ -16,4 +21,24 @@ CefExtensionWebContentsObserver::CefExtensionWebContentsObserver(
CefExtensionWebContentsObserver::~CefExtensionWebContentsObserver() {
}
void CefExtensionWebContentsObserver::RenderViewCreated(
content::RenderViewHost* render_view_host) {
ExtensionWebContentsObserver::RenderViewCreated(render_view_host);
const Extension* extension = GetExtension(render_view_host);
if (!extension)
return;
int process_id = render_view_host->GetProcess()->GetID();
auto policy = content::ChildProcessSecurityPolicy::GetInstance();
// Components of chrome that are implemented as extensions or platform apps
// are allowed to use chrome://resources/ URLs.
if ((extension->is_extension() || extension->is_platform_app()) &&
Manifest::IsComponentLocation(extension->location())) {
policy->GrantOrigin(process_id,
url::Origin(GURL(content::kChromeUIResourcesURL)));
}
}
} // namespace extensions

View File

@@ -21,6 +21,9 @@ class CefExtensionWebContentsObserver
content::WebContents* web_contents);
~CefExtensionWebContentsObserver() override;
// content::WebContentsObserver overrides.
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
DISALLOW_COPY_AND_ASSIGN(CefExtensionWebContentsObserver);
};

View File

@@ -156,6 +156,10 @@ bool CefExtensionsBrowserClient::IsRunningInForcedAppMode() {
return false;
}
bool CefExtensionsBrowserClient::IsLoggedInAsPublicAccount() {
return false;
}
ApiActivityMonitor* CefExtensionsBrowserClient::GetApiActivityMonitor(
BrowserContext* context) {
// CEF doesn't monitor API function calls or events.

View File

@@ -63,6 +63,7 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
bool DidVersionUpdate(content::BrowserContext* context) override;
void PermitExternalProtocolHandler() override;
bool IsRunningInForcedAppMode() override;
bool IsLoggedInAsPublicAccount() override;
ApiActivityMonitor* GetApiActivityMonitor(
content::BrowserContext* context) override;
ExtensionSystemProvider* GetExtensionSystemFactory() override;