Update to Chromium revision 9cedf753 (#418732)

- Simplify usage of OnBeforePluginLoad (issue #2015)
- Switch crash reporting from crashpad to breakpad on Windows and OS X.
  Adds a new chrome_elf.dll dependency on Windows (issue #1995)
- Remove CefTextfield::GetPlaceholderTextColor() method which is no
  longer supported by Chromium.
This commit is contained in:
Marshall Greenblatt
2016-10-17 14:14:44 -04:00
parent a1fc6f1ad0
commit 07d12b78e1
101 changed files with 943 additions and 843 deletions

View File

@@ -26,6 +26,8 @@ namespace tabs = api::tabs;
namespace {
const char kNotImplementedError[] = "Not implemented";
// Any out parameter (|browser|, |contents|, & |tab_index|) may be NULL and will
// not be set within the function.
// Based on ExtensionTabUtil::GetTabById().
@@ -124,6 +126,10 @@ void ZoomModeToZoomSettings(zoom::ZoomController::ZoomMode zoom_mode,
} // namespace
ExtensionFunction::ResponseAction TabsGetFunction::Run() {
return RespondNow(Error(kNotImplementedError));
}
content::WebContents* ZoomAPIFunction::GetWebContents(int tab_id) {
content::WebContents* web_contents = NULL;
if (tab_id != -1) {

View File

@@ -18,6 +18,14 @@ class WebContents;
namespace extensions {
namespace cef {
class TabsGetFunction : public UIThreadExtensionFunction {
~TabsGetFunction() override {}
ResponseAction Run() override;
DECLARE_EXTENSION_FUNCTION("tabs.get", TABS_GET)
};
class ZoomAPIFunction : public AsyncExtensionFunction {
protected:
~ZoomAPIFunction() override {}

View File

@@ -31,6 +31,7 @@ bool ChromeFunctionRegistry::IsSupported(const std::string& name) {
"streamsPrivate",
EXTENSION_FUNCTION_NAME(StreamsPrivateAbortFunction),
"tabs",
EXTENSION_FUNCTION_NAME(cefimpl::TabsGetFunction),
EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomFunction),
EXTENSION_FUNCTION_NAME(cefimpl::TabsGetZoomFunction),
EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomSettingsFunction),
@@ -48,6 +49,7 @@ bool ChromeFunctionRegistry::IsSupported(const std::string& name) {
void ChromeFunctionRegistry::RegisterAll(ExtensionFunctionRegistry* registry) {
registry->RegisterFunction<ResourcesPrivateGetStringsFunction>();
registry->RegisterFunction<StreamsPrivateAbortFunction>();
registry->RegisterFunction<cefimpl::TabsGetFunction>();
registry->RegisterFunction<cefimpl::TabsSetZoomFunction>();
registry->RegisterFunction<cefimpl::TabsGetZoomFunction>();
registry->RegisterFunction<cefimpl::TabsSetZoomSettingsFunction>();

View File

@@ -112,32 +112,43 @@ void CefExtensionSystem::Init() {
// Add the built-in PDF extension. PDF loading works as follows:
// 1. PDF PPAPI plugin is registered to handle kPDFPluginOutOfProcessMimeType
// in libcef/common/content_client.cc ComputeBuiltInPlugins.
// 2. PDF extension is registered with the below call to AddExtension.
// 3. A page requests a plugin to handle "application/pdf" mime type. This
// results in a call to CefContentRendererClient::OverrideCreatePlugin
// in the renderer process which calls CefContentRendererClient::
// CreateBrowserPluginDelegate indirectly to create a
// MimeHandlerViewContainer.
// 2. PDF extension is registered and associated with the "application/pdf"
// mime type by the below call to AddExtension.
// 3. A page requests a resource with the "application/pdf" mime type. For
// example, by loading a PDF file.
// 4. CefResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream
// intercepts the PDF load in the browser process, associates the load with
// the PDF extension and makes the PDF file contents available to the
// extension via the Stream API.
// 5. A MimeHandlerViewGuest and CefMimeHandlerViewGuestDelegate is created in
// intercepts the PDF resource load in the browser process, generates a
// unique View ID that is associated with the resource request for later
// retrieval via MimeHandlerStreamManager and the
// chrome.mimeHandlerPrivate JS API (extensions/common/api/
// mime_handler_private.idl), and returns the unique View ID via the
// |payload| argument.
// 5. The unique View ID arrives in the renderer process via
// ResourceLoader::didReceiveData and triggers creation of a new Document.
// DOMImplementation::createDocument indirectly calls
// RendererBlinkPlatformImpl::getPluginList to retrieve the list of
// supported plugins from the browser process. If a plugin supports the
// "application/pdf" mime type then a PluginDocument is created and
// CefContentRendererClient::OverrideCreatePlugin is called. This then
// indirectly calls CefContentRendererClient::CreateBrowserPluginDelegate
// to create a MimeHandlerViewContainer.
// 6. A MimeHandlerViewGuest and CefMimeHandlerViewGuestDelegate is created in
// the browser process.
// 6. MimeHandlerViewGuest navigates to the PDF extension URL.
// 7. Access to PDF extension resources is checked by
// 7. MimeHandlerViewGuest navigates to the PDF extension URL.
// 8. Access to PDF extension resources is checked by
// CefExtensionsBrowserClient::AllowCrossRendererResourceLoad.
// 8. PDF extension resources are provided from bundle via
// 9. PDF extension resources are provided from bundle via
// CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob and
// CefComponentExtensionResourceManager.
// 9. The PDF extension communicates via the chrome.mimeHandlerPrivate Mojo
// API which is implemented as described in
// 10.The PDF extension (chrome/browser/resources/pdf/browser_api.js) calls
// chrome.mimeHandlerPrivate.getStreamInfo to retrieve the PDF resource
// stream. This API is implemented using Mojo as described in
// libcef/common/extensions/api/README.txt.
// 10.The PDF extension requests a plugin to handle
// 11.The PDF extension requests a plugin to handle
// kPDFPluginOutOfProcessMimeType which loads the PDF PPAPI plugin.
// 11.Routing of print-related commands are handled by ChromePDFPrintClient
// 12.Routing of print-related commands are handled by ChromePDFPrintClient
// and CefPrintWebViewHelperDelegate in the renderer process.
// 12.The PDF extension is granted access to chrome://resources via
// 13.The PDF extension is granted access to chrome://resources via
// CefExtensionWebContentsObserver::RenderViewCreated in the browser
// process.
if (PdfExtensionEnabled()) {

View File

@@ -95,14 +95,24 @@ bool CefMimeHandlerViewGuestDelegate::OnGuestDetached(
CefRefPtr<CefBrowserHostImpl> owner_browser = GetOwnerBrowser(guest_);
const int render_process_id = main_frame_host->GetProcess()->GetID();
const int render_frame_id = main_frame_host->GetRoutingID();
const bool is_main_frame = (main_frame_host->GetParent() == nullptr);
// Disassociate guest state information with the owner browser.
scoped_refptr<CefBrowserInfo> info = owner_browser->browser_info();
info->guest_render_id_manager()->remove_render_view_id(
view_host->GetProcess()->GetID(),
view_host->GetRoutingID());
info->guest_render_id_manager()->remove_render_frame_id(
main_frame_host->GetProcess()->GetID(),
main_frame_host->GetRoutingID());
render_process_id, render_frame_id);
scoped_refptr<CefBrowserContext> context =
static_cast<CefBrowserContext*>(web_contents->GetBrowserContext());
if (context) {
context->OnRenderFrameDeleted(render_process_id, render_frame_id,
is_main_frame, true);
}
// Do nothing when the browser is windowless.
return owner_browser->IsWindowless();