mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-03-16 12:00:13 +01:00
Update to Chromium revision d483fb77 (#474934)
- CefLifeSpanHandler::OnBeforePopup is now called on the UI thread. - Remove CefBrowserSettings.javascript_open_windows which is no longer supported.
This commit is contained in:
parent
12150b43d2
commit
5c79944b31
16
BUILD.gn
16
BUILD.gn
@ -405,6 +405,8 @@ static_library("libcef_static") {
|
||||
"libcef/browser/plugins/plugin_service_filter.h",
|
||||
"libcef/browser/prefs/browser_prefs.cc",
|
||||
"libcef/browser/prefs/browser_prefs.h",
|
||||
"libcef/browser/prefs/pref_store.cc",
|
||||
"libcef/browser/prefs/pref_store.h",
|
||||
"libcef/browser/prefs/renderer_prefs.cc",
|
||||
"libcef/browser/prefs/renderer_prefs.h",
|
||||
"libcef/browser/print_settings_impl.cc",
|
||||
@ -568,10 +570,6 @@ static_library("libcef_static") {
|
||||
# with enable_print_preview=0.
|
||||
"//chrome/renderer/pepper/chrome_pdf_print_client.cc",
|
||||
"//chrome/renderer/pepper/chrome_pdf_print_client.h",
|
||||
|
||||
# Part of //components/prefs:test_support which is testingonly.
|
||||
"//components/prefs/testing_pref_store.cc",
|
||||
"//components/prefs/testing_pref_store.h",
|
||||
]
|
||||
|
||||
configs += [
|
||||
@ -641,6 +639,9 @@ static_library("libcef_static") {
|
||||
"//components/printing/browser",
|
||||
"//components/printing/common",
|
||||
"//components/printing/renderer",
|
||||
"//components/printing/service:pdf_compositor_manifest",
|
||||
"//components/printing/service/public/cpp:factory",
|
||||
"//components/printing/service/public/interfaces",
|
||||
"//components/proxy_config",
|
||||
"//components/ssl_config",
|
||||
"//components/update_client",
|
||||
@ -653,6 +654,7 @@ static_library("libcef_static") {
|
||||
"//components/web_cache/renderer",
|
||||
"//content/public/app:both",
|
||||
"//content/public/browser",
|
||||
"//content/public/child",
|
||||
"//content/public/common",
|
||||
"//content/public/gpu",
|
||||
"//content/public/renderer",
|
||||
@ -1713,7 +1715,7 @@ if (is_mac) {
|
||||
deps = [
|
||||
":libcef",
|
||||
":libcef_dll_wrapper",
|
||||
"//build/config/sanitizers:deps",
|
||||
"//build/config:exe_and_shlib_deps",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
@ -1789,7 +1791,7 @@ if (is_mac) {
|
||||
deps = [
|
||||
":libcef",
|
||||
":libcef_dll_wrapper",
|
||||
"//build/config/sanitizers:deps",
|
||||
"//build/config:exe_and_shlib_deps",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
@ -1858,7 +1860,7 @@ if (is_mac) {
|
||||
deps = [
|
||||
":libcef",
|
||||
":libcef_dll_wrapper",
|
||||
"//build/config/sanitizers:deps",
|
||||
"//build/config:exe_and_shlib_deps",
|
||||
"//testing/gtest",
|
||||
]
|
||||
|
||||
|
@ -7,5 +7,5 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'a106f0abbf69dad349d4aaf4bcc4f5d376dd2377',
|
||||
'chromium_checkout': 'd483fb7716e28b377c70c26c1bf1e3695aa1d8c9',
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
# $hash=9b613878ab9c9f72136f890b1df4a145d6341790$
|
||||
# $hash=20588ad142633d169a929c7631888e287ab66b9a$
|
||||
#
|
||||
|
||||
{
|
||||
@ -80,6 +80,7 @@
|
||||
'include/cef_x509_certificate.h',
|
||||
'include/cef_xml_reader.h',
|
||||
'include/cef_zip_reader.h',
|
||||
'include/test/cef_test_helpers.h',
|
||||
'include/test/cef_translator_test.h',
|
||||
'include/views/cef_box_layout.h',
|
||||
'include/views/cef_browser_view.h',
|
||||
@ -169,6 +170,7 @@
|
||||
'include/capi/cef_x509_certificate_capi.h',
|
||||
'include/capi/cef_xml_reader_capi.h',
|
||||
'include/capi/cef_zip_reader_capi.h',
|
||||
'include/capi/test/cef_test_helpers_capi.h',
|
||||
'include/capi/test/cef_translator_test_capi.h',
|
||||
'include/capi/views/cef_box_layout_capi.h',
|
||||
'include/capi/views/cef_browser_view_capi.h',
|
||||
|
@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=7894d507f337ebe5f9296770e10773a4e6458f00$
|
||||
// $hash=fe38af40efe76e5d6babf0644d7d4af679a4ca6f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
@ -61,7 +61,7 @@ typedef struct _cef_life_span_handler_t {
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the IO thread before a new popup browser is created. The
|
||||
// Called on the UI thread before a new popup browser is created. The
|
||||
// |browser| and |frame| values represent the source of the popup request. The
|
||||
// |target_url| and |target_frame_name| values indicate where the popup
|
||||
// browser should navigate and may be NULL if not specified with the request.
|
||||
|
66
include/capi/test/cef_test_helpers_capi.h
Normal file
66
include/capi/test/cef_test_helpers_capi.h
Normal file
@ -0,0 +1,66 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=a43c32d6951dd8f125f87d21948798f4d596768e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED) && !defined(WRAPPING_CEF_SHARED) && \
|
||||
!defined(UNIT_TEST)
|
||||
#error This file can be included for unit tests only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Execute JavaScript with a user gesture to trigger functionality like
|
||||
// onbeforeunload handlers that will otherwise be blocked.
|
||||
///
|
||||
CEF_EXPORT void cef_execute_java_script_with_user_gesture_for_tests(
|
||||
struct _cef_frame_t* frame,
|
||||
const cef_string_t* javascript);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
|
@ -54,7 +54,7 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
|
||||
typedef cef_window_open_disposition_t WindowOpenDisposition;
|
||||
|
||||
///
|
||||
// Called on the IO thread before a new popup browser is created. The
|
||||
// Called on the UI thread before a new popup browser is created. The
|
||||
// |browser| and |frame| values represent the source of the popup request. The
|
||||
// |target_url| and |target_frame_name| values indicate where the popup
|
||||
// browser should navigate and may be empty if not specified with the request.
|
||||
|
@ -523,13 +523,6 @@ typedef struct _cef_browser_settings_t {
|
||||
///
|
||||
cef_state_t javascript;
|
||||
|
||||
///
|
||||
// Controls whether JavaScript can be used for opening windows. Also
|
||||
// configurable using the "disable-javascript-open-windows" command-line
|
||||
// switch.
|
||||
///
|
||||
cef_state_t javascript_open_windows;
|
||||
|
||||
///
|
||||
// Controls whether JavaScript can be used to close windows that were not
|
||||
// opened via JavaScript. JavaScript can still be used to close windows that
|
||||
|
@ -679,7 +679,6 @@ struct CefBrowserSettingsTraits {
|
||||
|
||||
target->remote_fonts = src->remote_fonts;
|
||||
target->javascript = src->javascript;
|
||||
target->javascript_open_windows = src->javascript_open_windows;
|
||||
target->javascript_close_windows = src->javascript_close_windows;
|
||||
target->javascript_access_clipboard = src->javascript_access_clipboard;
|
||||
target->javascript_dom_paste = src->javascript_dom_paste;
|
||||
|
61
include/test/cef_test_helpers.h
Normal file
61
include/test/cef_test_helpers.h
Normal file
@ -0,0 +1,61 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
// THIS FILE IS FOR TESTING PURPOSES ONLY.
|
||||
//
|
||||
// The APIs defined in this file are for testing purposes only. They should only
|
||||
// be included from unit test targets.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_TEST_CEF_TEST_HELPERS_H_
|
||||
#define CEF_INCLUDE_TEST_CEF_TEST_HELPERS_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED) && !defined(WRAPPING_CEF_SHARED) && \
|
||||
!defined(UNIT_TEST)
|
||||
#error This file can be included for unit tests only
|
||||
#endif
|
||||
|
||||
#include "include/cef_frame.h"
|
||||
|
||||
///
|
||||
// Execute JavaScript with a user gesture to trigger functionality like
|
||||
// onbeforeunload handlers that will otherwise be blocked.
|
||||
///
|
||||
/*--cef(optional_param=javascript)--*/
|
||||
void CefExecuteJavaScriptWithUserGestureForTests(CefRefPtr<CefFrame> frame,
|
||||
const CefString& javascript);
|
||||
|
||||
#endif // CEF_INCLUDE_TEST_CEF_TEST_HELPERS_H_
|
@ -505,7 +505,7 @@ HostContentSettingsMap* CefBrowserContextImpl::GetHostContentSettingsMap() {
|
||||
// that can be stored in the settings map (for example, default values set
|
||||
// via DefaultProvider::SetWebsiteSetting).
|
||||
host_content_settings_map_ =
|
||||
new HostContentSettingsMap(GetPrefs(), false, false);
|
||||
new HostContentSettingsMap(GetPrefs(), false, false, false);
|
||||
|
||||
// Change the default plugin policy.
|
||||
const base::CommandLine* command_line =
|
||||
|
@ -95,13 +95,6 @@ base::SupportsUserData::Data* CefBrowserContextProxy::GetUserData(
|
||||
return BrowserContext::GetUserData(key);
|
||||
}
|
||||
|
||||
void CefBrowserContextProxy::SetUserData(const void* key, Data* data) {
|
||||
if (ShouldProxyUserData(key))
|
||||
parent_->SetUserData(key, data);
|
||||
else
|
||||
BrowserContext::SetUserData(key, data);
|
||||
}
|
||||
|
||||
void CefBrowserContextProxy::SetUserData(const void* key,
|
||||
std::unique_ptr<Data> data) {
|
||||
if (ShouldProxyUserData(key))
|
||||
|
@ -29,7 +29,6 @@ class CefBrowserContextProxy : public CefBrowserContext {
|
||||
|
||||
// SupportsUserData methods.
|
||||
Data* GetUserData(const void* key) const override;
|
||||
void SetUserData(const void* key, Data* data) override;
|
||||
void SetUserData(const void* key, std::unique_ptr<Data> data) override;
|
||||
void RemoveUserData(const void* key) override;
|
||||
|
||||
|
@ -96,7 +96,7 @@ class WebContentsUserDataAdapter : public base::SupportsUserData::Data {
|
||||
|
||||
private:
|
||||
WebContentsUserDataAdapter(CefBrowserHostImpl* browser) : browser_(browser) {
|
||||
browser->web_contents()->SetUserData(UserDataKey(), this);
|
||||
browser->web_contents()->SetUserData(UserDataKey(), base::WrapUnique(this));
|
||||
}
|
||||
|
||||
static void* UserDataKey() {
|
||||
@ -1692,6 +1692,35 @@ void CefBrowserHostImpl::SendCode(
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::ExecuteJavaScriptWithUserGestureForTests(
|
||||
int64 frame_id,
|
||||
const CefString& javascript) {
|
||||
DCHECK(frame_id >= CefFrameHostImpl::kMainFrameId);
|
||||
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(
|
||||
CEF_UIT,
|
||||
base::Bind(
|
||||
&CefBrowserHostImpl::ExecuteJavaScriptWithUserGestureForTests, this,
|
||||
frame_id, javascript));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
return;
|
||||
|
||||
content::RenderFrameHost* rfh;
|
||||
if (frame_id == CefFrameHostImpl::kMainFrameId) {
|
||||
rfh = web_contents()->GetMainFrame();
|
||||
} else {
|
||||
rfh = content::RenderFrameHost::FromID(
|
||||
web_contents()->GetRenderProcessHost()->GetID(), frame_id);
|
||||
}
|
||||
|
||||
if (rfh)
|
||||
rfh->ExecuteJavaScriptWithUserGestureForTests(javascript);
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::SendProcessMessage(CefProcessId target_process,
|
||||
const std::string& name,
|
||||
base::ListValue* arguments,
|
||||
@ -2276,7 +2305,8 @@ void CefBrowserHostImpl::WebContentsCreated(
|
||||
int opener_render_frame_id,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
content::WebContents* new_contents) {
|
||||
content::WebContents* new_contents,
|
||||
const base::Optional<content::WebContents::CreateParams>& create_params) {
|
||||
CefBrowserSettings settings;
|
||||
CefRefPtr<CefClient> client;
|
||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
|
||||
@ -2672,6 +2702,18 @@ bool CefBrowserHostImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
return handled;
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::OnMessageReceived(
|
||||
const IPC::Message& message,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
bool handled = true;
|
||||
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(CefBrowserHostImpl, message,
|
||||
render_frame_host)
|
||||
IPC_MESSAGE_HANDLER(CefHostMsg_FrameFocused, OnFrameFocused)
|
||||
IPC_MESSAGE_UNHANDLED(handled = false)
|
||||
IPC_END_MESSAGE_MAP()
|
||||
return handled;
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::AccessibilityEventReceived(
|
||||
const std::vector<content::AXEventNotificationDetails>& eventData) {
|
||||
// Only needed in windowless mode.
|
||||
@ -2743,6 +2785,38 @@ void CefBrowserHostImpl::OnFrameIdentified(int64 frame_id,
|
||||
GetOrCreateFrame(frame_id, parent_frame_id, is_main_frame, name, GURL());
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnFrameFocused(
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
const int64 frame_id = render_frame_host->GetRoutingID();
|
||||
|
||||
CefRefPtr<CefFrameHostImpl> unfocused_frame;
|
||||
CefRefPtr<CefFrameHostImpl> focused_frame;
|
||||
|
||||
{
|
||||
base::AutoLock lock_scope(state_lock_);
|
||||
|
||||
if (focused_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
|
||||
// Unfocus the previously focused frame.
|
||||
FrameMap::const_iterator it = frames_.find(frame_id);
|
||||
if (it != frames_.end())
|
||||
unfocused_frame = it->second;
|
||||
}
|
||||
|
||||
// Focus the newly focused frame.
|
||||
FrameMap::iterator it = frames_.find(frame_id);
|
||||
if (it != frames_.end())
|
||||
focused_frame = it->second;
|
||||
|
||||
focused_frame_id_ =
|
||||
focused_frame.get() ? frame_id : CefFrameHostImpl::kInvalidFrameId;
|
||||
}
|
||||
|
||||
if (unfocused_frame.get())
|
||||
unfocused_frame->SetFocused(false);
|
||||
if (focused_frame.get())
|
||||
focused_frame->SetFocused(true);
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnDidFinishLoad(int64 frame_id,
|
||||
const GURL& validated_url,
|
||||
bool is_main_frame,
|
||||
@ -3016,37 +3090,6 @@ void CefBrowserHostImpl::DetachAllFrames() {
|
||||
it->second->Detach();
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::SetFocusedFrame(int64 frame_id) {
|
||||
CefRefPtr<CefFrameHostImpl> unfocused_frame;
|
||||
CefRefPtr<CefFrameHostImpl> focused_frame;
|
||||
|
||||
{
|
||||
base::AutoLock lock_scope(state_lock_);
|
||||
|
||||
if (focused_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
|
||||
// Unfocus the previously focused frame.
|
||||
FrameMap::const_iterator it = frames_.find(frame_id);
|
||||
if (it != frames_.end())
|
||||
unfocused_frame = it->second;
|
||||
}
|
||||
|
||||
if (frame_id != CefFrameHostImpl::kInvalidFrameId) {
|
||||
// Focus the newly focused frame.
|
||||
FrameMap::iterator it = frames_.find(frame_id);
|
||||
if (it != frames_.end())
|
||||
focused_frame = it->second;
|
||||
}
|
||||
|
||||
focused_frame_id_ =
|
||||
focused_frame.get() ? frame_id : CefFrameHostImpl::kInvalidFrameId;
|
||||
}
|
||||
|
||||
if (unfocused_frame.get())
|
||||
unfocused_frame->SetFocused(false);
|
||||
if (focused_frame.get())
|
||||
focused_frame->SetFocused(true);
|
||||
}
|
||||
|
||||
gfx::Point CefBrowserHostImpl::GetScreenPoint(const gfx::Point& view) const {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (platform_delegate_)
|
||||
|
@ -319,6 +319,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
int script_start_line,
|
||||
CefRefPtr<CefResponseManager::Handler> responseHandler);
|
||||
|
||||
void ExecuteJavaScriptWithUserGestureForTests(int64 frame_id,
|
||||
const CefString& javascript);
|
||||
|
||||
bool SendProcessMessage(CefProcessId target_process,
|
||||
const std::string& name,
|
||||
base::ListValue* arguments,
|
||||
@ -330,9 +333,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
// Handler for URLs involving external protocols.
|
||||
void HandleExternalProtocol(const GURL& url);
|
||||
|
||||
// Set the frame that currently has focus.
|
||||
void SetFocusedFrame(int64 frame_id);
|
||||
|
||||
// Convert from view coordinates to screen coordinates. Potential display
|
||||
// scaling will be applied to the result.
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const;
|
||||
@ -412,12 +412,15 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
int opener_render_frame_id,
|
||||
content::WebContentsView** view,
|
||||
content::RenderViewHostDelegateView** delegate_view) override;
|
||||
void WebContentsCreated(content::WebContents* source_contents,
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
content::WebContents* new_contents) override;
|
||||
void WebContentsCreated(
|
||||
content::WebContents* source_contents,
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
content::WebContents* new_contents,
|
||||
const base::Optional<content::WebContents::CreateParams>& create_params)
|
||||
override;
|
||||
void DidNavigateMainFramePostCommit(
|
||||
content::WebContents* web_contents) override;
|
||||
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
|
||||
@ -472,6 +475,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
void DidUpdateFaviconURL(
|
||||
const std::vector<content::FaviconURL>& candidates) override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
bool OnMessageReceived(const IPC::Message& message,
|
||||
content::RenderFrameHost* render_frame_host) override;
|
||||
void AccessibilityEventReceived(
|
||||
const std::vector<content::AXEventNotificationDetails>& eventData)
|
||||
override;
|
||||
@ -507,6 +512,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
void OnFrameIdentified(int64 frame_id,
|
||||
int64 parent_frame_id,
|
||||
base::string16 name);
|
||||
void OnFrameFocused(content::RenderFrameHost* render_frame_host);
|
||||
void OnDidFinishLoad(int64 frame_id,
|
||||
const GURL& validated_url,
|
||||
bool is_main_frame,
|
||||
|
@ -128,6 +128,7 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
|
||||
}
|
||||
|
||||
bool CefBrowserInfoManager::CanCreateWindow(
|
||||
content::RenderFrameHost* opener,
|
||||
const GURL& target_url,
|
||||
const content::Referrer& referrer,
|
||||
const std::string& frame_name,
|
||||
@ -135,16 +136,12 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
bool* no_javascript_access) {
|
||||
DCHECK_NE(opener_render_process_id,
|
||||
content::ChildProcessHost::kInvalidUniqueID);
|
||||
DCHECK_GT(opener_render_frame_id, 0);
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
bool is_guest_view = false;
|
||||
CefRefPtr<CefBrowserHostImpl> browser = extensions::GetOwnerBrowserForFrame(
|
||||
opener_render_process_id, opener_render_frame_id, &is_guest_view);
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
extensions::GetOwnerBrowserForHost(opener, &is_guest_view);
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get()) {
|
||||
// Cancel the popup.
|
||||
@ -177,8 +174,8 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
|
||||
auto pending_popup = base::MakeUnique<CefBrowserInfoManager::PendingPopup>();
|
||||
pending_popup->step = CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
|
||||
pending_popup->opener_process_id = opener_render_process_id;
|
||||
pending_popup->opener_frame_id = opener_render_frame_id;
|
||||
pending_popup->opener_process_id = opener->GetProcess()->GetID();
|
||||
pending_popup->opener_frame_id = opener->GetRoutingID();
|
||||
pending_popup->target_url = target_url;
|
||||
pending_popup->target_frame_name = frame_name;
|
||||
|
||||
@ -229,10 +226,14 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
CefBrowserPlatformDelegate::Create(create_params);
|
||||
CHECK(pending_popup->platform_delegate.get());
|
||||
|
||||
// Filtering needs to be done on the UI thread.
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(FilterPendingPopupURL, opener_render_process_id,
|
||||
base::Passed(&pending_popup)));
|
||||
// Between the calls to CanCreateWindow and GetCustomWebContentsView
|
||||
// RenderViewHostImpl::CreateNewWindow() will call
|
||||
// RenderProcessHostImpl::FilterURL() which, in the case of "javascript:"
|
||||
// URIs, rewrites the URL to "about:blank". We need to apply the same filter
|
||||
// otherwise GetCustomWebContentsView will fail to retrieve the PopupInfo.
|
||||
opener->GetProcess()->FilterURL(false, &pending_popup->target_url);
|
||||
|
||||
PushPendingPopup(std::move(pending_popup));
|
||||
}
|
||||
|
||||
return allow;
|
||||
@ -244,6 +245,8 @@ void CefBrowserInfoManager::GetCustomWebContentsView(
|
||||
int opener_render_frame_id,
|
||||
content::WebContentsView** view,
|
||||
content::RenderViewHostDelegateView** delegate_view) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
|
||||
PopPendingPopup(CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW,
|
||||
opener_render_process_id, opener_render_frame_id,
|
||||
@ -268,6 +271,8 @@ void CefBrowserInfoManager::WebContentsCreated(
|
||||
CefBrowserSettings& settings,
|
||||
CefRefPtr<CefClient>& client,
|
||||
std::unique_ptr<CefBrowserPlatformDelegate>& platform_delegate) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
|
||||
PopPendingPopup(
|
||||
CefBrowserInfoManager::PendingPopup::GET_CUSTOM_WEB_CONTENTS_VIEW,
|
||||
@ -399,6 +404,8 @@ void CefBrowserInfoManager::GetBrowserInfoList(BrowserInfoList& list) {
|
||||
|
||||
void CefBrowserInfoManager::RenderProcessHostDestroyed(
|
||||
content::RenderProcessHost* host) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
const int render_process_id = host->GetID();
|
||||
DCHECK_GT(render_process_id, 0);
|
||||
|
||||
@ -419,8 +426,6 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
|
||||
|
||||
// Remove all pending popups that reference the destroyed host as the opener.
|
||||
{
|
||||
base::AutoLock lock_scope(pending_popup_lock_);
|
||||
|
||||
PendingPopupList::iterator it = pending_popup_list_.begin();
|
||||
while (it != pending_popup_list_.end()) {
|
||||
PendingPopup* popup = *it;
|
||||
@ -433,22 +438,9 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserInfoManager::FilterPendingPopupURL(
|
||||
int opener_process_id,
|
||||
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup) {
|
||||
// |host| may be nullptr if the parent browser is destroyed while the popup is
|
||||
// pending.
|
||||
content::RenderProcessHost* host =
|
||||
content::RenderProcessHost::FromID(opener_process_id);
|
||||
if (host) {
|
||||
host->FilterURL(false, &pending_popup->target_url);
|
||||
GetInstance()->PushPendingPopup(std::move(pending_popup));
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserInfoManager::PushPendingPopup(
|
||||
std::unique_ptr<PendingPopup> popup) {
|
||||
base::AutoLock lock_scope(pending_popup_lock_);
|
||||
CEF_REQUIRE_UIT();
|
||||
pending_popup_list_.push_back(std::move(popup));
|
||||
}
|
||||
|
||||
@ -457,11 +449,10 @@ CefBrowserInfoManager::PopPendingPopup(PendingPopup::Step step,
|
||||
int opener_process_id,
|
||||
int opener_frame_id,
|
||||
const GURL& target_url) {
|
||||
CEF_REQUIRE_UIT();
|
||||
DCHECK_GT(opener_process_id, 0);
|
||||
DCHECK_GT(opener_frame_id, 0);
|
||||
|
||||
base::AutoLock lock_scope(pending_popup_lock_);
|
||||
|
||||
PendingPopupList::iterator it = pending_popup_list_.begin();
|
||||
for (; it != pending_popup_list_.end(); ++it) {
|
||||
PendingPopup* popup = *it;
|
||||
|
@ -25,6 +25,7 @@ struct WebWindowFeatures;
|
||||
|
||||
namespace content {
|
||||
struct Referrer;
|
||||
class RenderFrameHost;
|
||||
class RenderViewHostDelegateView;
|
||||
class WebContents;
|
||||
class WebContentsView;
|
||||
@ -60,15 +61,14 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
|
||||
// Called from CefContentBrowserClient::CanCreateWindow. See comments on
|
||||
// PendingPopup for more information.
|
||||
bool CanCreateWindow(const GURL& target_url,
|
||||
bool CanCreateWindow(content::RenderFrameHost* opener,
|
||||
const GURL& target_url,
|
||||
const content::Referrer& referrer,
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
bool* no_javascript_access);
|
||||
|
||||
// Called from CefBrowserHostImpl::GetCustomWebContentsView. See comments on
|
||||
@ -131,7 +131,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
|
||||
|
||||
// Store state information about pending popups. Call order is:
|
||||
// - CefContentBrowserClient::CanCreateWindow (IOT)
|
||||
// - CefContentBrowserClient::CanCreateWindow (UIT)
|
||||
// Provides an opportunity to cancel the popup (calls OnBeforePopup) and
|
||||
// creates the new platform delegate for the popup. If the popup owner is
|
||||
// an extension guest view then the popup is canceled and
|
||||
@ -168,16 +168,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
|
||||
};
|
||||
|
||||
// Between the calls to CanCreateWindow and GetCustomWebContentsView
|
||||
// RenderViewHostImpl::CreateNewWindow() will call
|
||||
// RenderProcessHostImpl::FilterURL() which, in the case of "javascript:"
|
||||
// URIs, rewrites the URL to "about:blank". We need to apply the same filter
|
||||
// otherwise GetCustomWebContentsView will fail to retrieve the PopupInfo.
|
||||
static void FilterPendingPopupURL(
|
||||
int opener_process_id,
|
||||
std::unique_ptr<PendingPopup> pending_popup);
|
||||
|
||||
// Manage pending popups.
|
||||
// Manage pending popups. Only called on the UI thread.
|
||||
void PushPendingPopup(std::unique_ptr<PendingPopup> popup);
|
||||
std::unique_ptr<PendingPopup> PopPendingPopup(PendingPopup::Step step,
|
||||
int opener_process_id,
|
||||
@ -216,10 +207,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
typedef ScopedVector<PendingNewBrowserInfo> PendingNewBrowserInfoList;
|
||||
PendingNewBrowserInfoList pending_new_browser_info_list_;
|
||||
|
||||
base::Lock pending_popup_lock_;
|
||||
|
||||
// Access to the below members must be protected by |pending_popup_lock_|.
|
||||
|
||||
// Only accessed on the UI thread.
|
||||
typedef ScopedVector<PendingPopup> PendingPopupList;
|
||||
PendingPopupList pending_popup_list_;
|
||||
|
||||
|
@ -5,37 +5,28 @@
|
||||
|
||||
#include "libcef/browser/browser_message_filter.h"
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/browser_info_manager.h"
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/browser/origin_whitelist_impl.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/common/cef_messages.h"
|
||||
#include "libcef/common/content_client.h"
|
||||
#include "libcef/common/values_impl.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "content/common/frame_messages.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/common/child_process_host.h"
|
||||
|
||||
CefBrowserMessageFilter::CefBrowserMessageFilter(int render_process_id)
|
||||
: render_process_id_(render_process_id) {}
|
||||
: content::BrowserMessageFilter(ExtensionMsgStart),
|
||||
render_process_id_(render_process_id) {}
|
||||
|
||||
CefBrowserMessageFilter::~CefBrowserMessageFilter() {}
|
||||
|
||||
void CefBrowserMessageFilter::OnFilterRemoved() {
|
||||
render_process_id_ = content::ChildProcessHost::kInvalidUniqueID;
|
||||
content::BrowserMessageFilter::OnFilterRemoved();
|
||||
}
|
||||
|
||||
bool CefBrowserMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
||||
if (message.type() == FrameHostMsg_FrameFocused::ID) {
|
||||
// Observe but don't handle this message.
|
||||
OnFrameFocused(message.routing_id());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool handled = true;
|
||||
|
||||
IPC_BEGIN_MESSAGE_MAP(CefBrowserMessageFilter, message)
|
||||
@ -48,24 +39,6 @@ bool CefBrowserMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
||||
return handled;
|
||||
}
|
||||
|
||||
bool CefBrowserMessageFilter::Send(IPC::Message* message) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(base::IgnoreResult(&CefBrowserMessageFilter::Send),
|
||||
this, message));
|
||||
return true;
|
||||
}
|
||||
|
||||
content::RenderProcessHost* host =
|
||||
content::RenderProcessHost::FromID(render_process_id_);
|
||||
if (!host) {
|
||||
delete message;
|
||||
return false;
|
||||
}
|
||||
|
||||
return host->Send(message);
|
||||
}
|
||||
|
||||
void CefBrowserMessageFilter::OnGetNewRenderThreadInfo(
|
||||
CefProcessHostMsg_GetNewRenderThreadInfo_Params* params) {
|
||||
GetCrossOriginWhitelistEntries(¶ms->cross_origin_whitelist_entries);
|
||||
@ -94,20 +67,3 @@ void CefBrowserMessageFilter::OnGetNewBrowserInfo(int render_view_routing_id,
|
||||
delete reply_msg;
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserMessageFilter::OnFrameFocused(int32_t render_frame_routing_id) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserMessageFilter::OnFrameFocused,
|
||||
this, render_frame_routing_id));
|
||||
return;
|
||||
}
|
||||
|
||||
if (render_process_id_ == content::ChildProcessHost::kInvalidUniqueID)
|
||||
return;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForFrame(render_process_id_,
|
||||
render_frame_routing_id);
|
||||
if (browser.get())
|
||||
browser->SetFocusedFrame(render_frame_routing_id);
|
||||
}
|
||||
|
@ -10,18 +10,13 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ipc/ipc_channel_proxy.h"
|
||||
#include "ipc/message_filter.h"
|
||||
|
||||
namespace content {
|
||||
class RenderProcessHost;
|
||||
}
|
||||
#include "content/public/browser/browser_message_filter.h"
|
||||
|
||||
struct CefProcessHostMsg_GetNewBrowserInfo_Params;
|
||||
struct CefProcessHostMsg_GetNewRenderThreadInfo_Params;
|
||||
|
||||
// This class sends and receives control messages on the browser process.
|
||||
class CefBrowserMessageFilter : public IPC::MessageFilter {
|
||||
class CefBrowserMessageFilter : public content::BrowserMessageFilter {
|
||||
public:
|
||||
explicit CefBrowserMessageFilter(int render_process_id);
|
||||
~CefBrowserMessageFilter() override;
|
||||
@ -30,8 +25,6 @@ class CefBrowserMessageFilter : public IPC::MessageFilter {
|
||||
void OnFilterRemoved() override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
bool Send(IPC::Message* message);
|
||||
|
||||
private:
|
||||
// Message handlers.
|
||||
void OnGetNewRenderThreadInfo(
|
||||
@ -39,7 +32,6 @@ class CefBrowserMessageFilter : public IPC::MessageFilter {
|
||||
void OnGetNewBrowserInfo(int render_view_routing_id,
|
||||
int render_frame_routing_id,
|
||||
IPC::Message* reply_msg);
|
||||
void OnFrameFocused(int32_t render_frame_routing_id);
|
||||
|
||||
int render_process_id_;
|
||||
|
||||
|
@ -115,9 +115,9 @@ class CefURLFetcherResponseWriter : public net::URLFetcherResponseWriter {
|
||||
DISALLOW_COPY_AND_ASSIGN(CefURLFetcherResponseWriter);
|
||||
};
|
||||
|
||||
base::SupportsUserData::Data* CreateURLRequestUserData(
|
||||
std::unique_ptr<base::SupportsUserData::Data> CreateURLRequestUserData(
|
||||
CefRefPtr<CefURLRequestClient> client) {
|
||||
return new CefURLRequestUserData(client);
|
||||
return base::WrapUnique(new CefURLRequestUserData(client));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -103,6 +103,11 @@ rappor::RapporServiceImpl* ChromeBrowserProcessStub::rappor_service() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ukm::UkmRecorder* ChromeBrowserProcessStub::ukm_recorder() {
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
IOThread* ChromeBrowserProcessStub::io_thread() {
|
||||
return NULL;
|
||||
}
|
||||
@ -112,11 +117,6 @@ WatchDogThread* ChromeBrowserProcessStub::watchdog_thread() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ukm::UkmService* ChromeBrowserProcessStub::ukm_service() {
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ProfileManager* ChromeBrowserProcessStub::profile_manager() {
|
||||
DCHECK(context_initialized_);
|
||||
return profile_manager_.get();
|
||||
|
@ -46,9 +46,9 @@ class ChromeBrowserProcessStub : public BrowserProcess,
|
||||
override;
|
||||
metrics::MetricsService* metrics_service() override;
|
||||
rappor::RapporServiceImpl* rappor_service() override;
|
||||
ukm::UkmRecorder* ukm_recorder() override;
|
||||
IOThread* io_thread() override;
|
||||
WatchDogThread* watchdog_thread() override;
|
||||
ukm::UkmService* ukm_service() override;
|
||||
ProfileManager* profile_manager() override;
|
||||
PrefService* local_state() override;
|
||||
net::URLRequestContextGetter* system_request_context() override;
|
||||
|
@ -46,8 +46,10 @@
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/spellchecker/spellcheck_message_filter.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/grit/browser_resources.h"
|
||||
#include "components/navigation_interception/intercept_navigation_throttle.h"
|
||||
#include "components/navigation_interception/navigation_params.h"
|
||||
#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
|
||||
#include "content/browser/frame_host/navigation_handle_impl.h"
|
||||
#include "content/browser/frame_host/render_frame_host_impl.h"
|
||||
#include "content/browser/plugin_service_impl.h"
|
||||
@ -452,7 +454,7 @@ void CefContentBrowserClient::RenderProcessWillLaunch(
|
||||
const int id = host->GetID();
|
||||
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
|
||||
|
||||
host->GetChannel()->AddFilter(new CefBrowserMessageFilter(id));
|
||||
host->AddFilter(new CefBrowserMessageFilter(id));
|
||||
host->AddFilter(new printing::CefPrintingMessageFilter(id, profile));
|
||||
|
||||
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
|
||||
@ -574,6 +576,12 @@ void CefContentBrowserClient::SiteInstanceDeleting(
|
||||
site_instance->GetId()));
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::RegisterOutOfProcessServices(
|
||||
OutOfProcessServiceMap* services) {
|
||||
services->emplace(printing::mojom::kServiceName,
|
||||
base::ASCIIToUTF16("PDF Compositor Service"));
|
||||
}
|
||||
|
||||
std::unique_ptr<base::Value> CefContentBrowserClient::GetServiceManifestOverlay(
|
||||
base::StringPiece name) {
|
||||
int id = -1;
|
||||
@ -592,6 +600,13 @@ std::unique_ptr<base::Value> CefContentBrowserClient::GetServiceManifestOverlay(
|
||||
return base::JSONReader::Read(manifest_contents);
|
||||
}
|
||||
|
||||
std::vector<content::ContentBrowserClient::ServiceManifestInfo>
|
||||
CefContentBrowserClient::GetExtraServiceManifests() {
|
||||
return std::vector<ServiceManifestInfo>({
|
||||
{printing::mojom::kServiceName, IDR_PDF_COMPOSITOR_MANIFEST},
|
||||
});
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||
base::CommandLine* command_line,
|
||||
int child_process_id) {
|
||||
@ -768,6 +783,7 @@ void CefContentBrowserClient::AllowCertificateError(
|
||||
void CefContentBrowserClient::SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::CertificateList client_certs,
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
@ -787,8 +803,8 @@ void CefContentBrowserClient::SelectClientCertificate(
|
||||
|
||||
CefRequestHandler::X509CertificateList certs;
|
||||
for (std::vector<scoped_refptr<net::X509Certificate>>::iterator iter =
|
||||
cert_request_info->client_certs.begin();
|
||||
iter != cert_request_info->client_certs.end(); iter++) {
|
||||
client_certs.begin();
|
||||
iter != client_certs.end(); iter++) {
|
||||
certs.push_back(new CefX509CertificateImpl(*iter));
|
||||
}
|
||||
|
||||
@ -806,8 +822,7 @@ void CefContentBrowserClient::SelectClientCertificate(
|
||||
}
|
||||
|
||||
bool CefContentBrowserClient::CanCreateWindow(
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
content::RenderFrameHost* opener,
|
||||
const GURL& opener_url,
|
||||
const GURL& opener_top_level_frame_url,
|
||||
const GURL& source_origin,
|
||||
@ -819,15 +834,13 @@ bool CefContentBrowserClient::CanCreateWindow(
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
content::ResourceContext* context,
|
||||
bool* no_javascript_access) {
|
||||
CEF_REQUIRE_IOT();
|
||||
CEF_REQUIRE_UIT();
|
||||
*no_javascript_access = false;
|
||||
|
||||
return CefBrowserInfoManager::GetInstance()->CanCreateWindow(
|
||||
target_url, referrer, frame_name, disposition, features, user_gesture,
|
||||
opener_suppressed, opener_render_process_id, opener_render_frame_id,
|
||||
no_javascript_access);
|
||||
opener, target_url, referrer, frame_name, disposition, features,
|
||||
user_gesture, opener_suppressed, no_javascript_access);
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::ResourceDispatcherHostCreated() {
|
||||
|
@ -49,8 +49,10 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
bool IsHandledURL(const GURL& url) override;
|
||||
void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
|
||||
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
|
||||
void RegisterOutOfProcessServices(OutOfProcessServiceMap* services) override;
|
||||
std::unique_ptr<base::Value> GetServiceManifestOverlay(
|
||||
base::StringPiece name) override;
|
||||
std::vector<ServiceManifestInfo> GetExtraServiceManifests() override;
|
||||
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
|
||||
int child_process_id) override;
|
||||
content::QuotaPermissionContext* CreateQuotaPermissionContext() override;
|
||||
@ -75,9 +77,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
void SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::CertificateList client_certs,
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||
bool CanCreateWindow(int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
bool CanCreateWindow(content::RenderFrameHost* opener,
|
||||
const GURL& opener_url,
|
||||
const GURL& opener_top_level_frame_url,
|
||||
const GURL& source_origin,
|
||||
@ -89,7 +91,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
content::ResourceContext* context,
|
||||
bool* no_javascript_access) override;
|
||||
void ResourceDispatcherHostCreated() override;
|
||||
void OverrideWebkitPrefs(content::RenderViewHost* rvh,
|
||||
|
@ -359,7 +359,11 @@ bool CefCookieManagerImpl::GetCefCookie(const GURL& url,
|
||||
if (!GetCookieDomain(url, pc, &cookie_domain))
|
||||
return false;
|
||||
|
||||
std::string cookie_path = net::CanonicalCookie::CanonPath(url, pc);
|
||||
std::string path_string;
|
||||
if (pc.HasPath())
|
||||
path_string = pc.Path();
|
||||
std::string cookie_path =
|
||||
net::CanonicalCookie::CanonPathWithString(url, path_string);
|
||||
base::Time creation_time = base::Time::Now();
|
||||
base::Time cookie_expires =
|
||||
net::CanonicalCookie::CanonExpiration(pc, creation_time, creation_time);
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "net/base/io_buffer.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
#include "net/traffic_annotation/network_traffic_annotation.h"
|
||||
#include "net/url_request/url_fetcher.h"
|
||||
#include "net/url_request/url_fetcher_response_writer.h"
|
||||
|
||||
@ -281,8 +282,35 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
return;
|
||||
}
|
||||
|
||||
net::NetworkTrafficAnnotationTag traffic_annotation =
|
||||
net::DefineNetworkTrafficAnnotation(
|
||||
"devtools_handle_front_end_messages", R"(
|
||||
semantics {
|
||||
sender: "Developer Tools"
|
||||
description:
|
||||
"When user opens Developer Tools, the browser may fetch "
|
||||
"additional resources from the network to enrich the debugging "
|
||||
"experience (e.g. source map resources)."
|
||||
trigger: "User opens Developer Tools to debug a web page."
|
||||
data: "Any resources requested by Developer Tools."
|
||||
destination: OTHER
|
||||
}
|
||||
policy {
|
||||
cookies_allowed: true
|
||||
cookies_store: "user"
|
||||
setting:
|
||||
"It's not possible to disable this feature from settings."
|
||||
chrome_policy {
|
||||
DeveloperToolsDisabled {
|
||||
policy_options {mode: MANDATORY}
|
||||
DeveloperToolsDisabled: true
|
||||
}
|
||||
}
|
||||
})");
|
||||
net::URLFetcher* fetcher =
|
||||
net::URLFetcher::Create(gurl, net::URLFetcher::GET, this).release();
|
||||
net::URLFetcher::Create(gurl, net::URLFetcher::GET, this,
|
||||
traffic_annotation)
|
||||
.release();
|
||||
pending_requests_[fetcher] = request_id;
|
||||
fetcher->SetRequestContext(
|
||||
content::BrowserContext::GetDefaultStoragePartition(
|
||||
|
@ -179,7 +179,7 @@ const Extension* CefExtensionSystem::AddExtension(
|
||||
void CefExtensionSystem::RemoveExtension(const std::string& extension_id) {
|
||||
scoped_refptr<const Extension> extension(
|
||||
registry_->enabled_extensions().GetByID(extension_id));
|
||||
UnloadExtension(extension_id, UnloadedExtensionInfo::REASON_UNINSTALL);
|
||||
UnloadExtension(extension_id, UnloadedExtensionReason::UNINSTALL);
|
||||
if (extension.get()) {
|
||||
registry_->TriggerOnUninstalled(
|
||||
extension.get(), extensions::UNINSTALL_REASON_COMPONENT_REMOVED);
|
||||
@ -262,7 +262,7 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
|
||||
// ExtensionSystemImpl::UnregisterExtensionWithRequestContexts.
|
||||
void CefExtensionSystem::UnregisterExtensionWithRequestContexts(
|
||||
const std::string& extension_id,
|
||||
const UnloadedExtensionInfo::Reason reason) {
|
||||
const UnloadedExtensionReason reason) {
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
|
||||
@ -332,7 +332,7 @@ const Extension* CefExtensionSystem::LoadExtension(
|
||||
|
||||
// Implementation based on ExtensionService::UnloadExtension.
|
||||
void CefExtensionSystem::UnloadExtension(const std::string& extension_id,
|
||||
UnloadedExtensionInfo::Reason reason) {
|
||||
UnloadedExtensionReason reason) {
|
||||
// Make sure the extension gets deleted after we return from this function.
|
||||
int include_mask =
|
||||
ExtensionRegistry::EVERYTHING & ~ExtensionRegistry::TERMINATED;
|
||||
@ -385,14 +385,13 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) {
|
||||
// Tell renderers about the loaded extension.
|
||||
renderer_helper_->OnExtensionLoaded(*extension);
|
||||
|
||||
// Tell subsystems that use the EXTENSION_LOADED notification about the new
|
||||
// extension.
|
||||
// Tell subsystems that use the ExtensionRegistryObserver::OnExtensionLoaded
|
||||
// about the new extension.
|
||||
//
|
||||
// NOTE: It is important that this happen after notifying the renderers about
|
||||
// the new extensions so that if we navigate to an extension URL in
|
||||
// ExtensionRegistryObserver::OnLoaded or
|
||||
// NOTIFICATION_EXTENSION_LOADED_DEPRECATED, the
|
||||
// renderer is guaranteed to know about it.
|
||||
// ExtensionRegistryObserver::OnExtensionLoaded the renderer is guaranteed to
|
||||
// know about it.
|
||||
registry_->TriggerOnLoaded(extension);
|
||||
|
||||
// Register plugins included with the extension.
|
||||
@ -421,11 +420,6 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) {
|
||||
plugin_service->RefreshPlugins();
|
||||
plugin_service->RegisterInternalPlugin(info, true);
|
||||
}
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<content::BrowserContext>(browser_context_),
|
||||
content::Details<const Extension>(extension));
|
||||
}
|
||||
|
||||
void CefExtensionSystem::OnExtensionRegisteredWithRequestContexts(
|
||||
@ -438,9 +432,7 @@ void CefExtensionSystem::OnExtensionRegisteredWithRequestContexts(
|
||||
// Implementation based on ExtensionService::NotifyExtensionUnloaded.
|
||||
void CefExtensionSystem::NotifyExtensionUnloaded(
|
||||
const Extension* extension,
|
||||
UnloadedExtensionInfo::Reason reason) {
|
||||
UnloadedExtensionInfo details(extension, reason);
|
||||
|
||||
UnloadedExtensionReason reason) {
|
||||
// Unregister plugins included with the extension.
|
||||
// Implementation based on PluginManager::OnExtensionUnloaded.
|
||||
const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension);
|
||||
@ -455,11 +447,6 @@ void CefExtensionSystem::NotifyExtensionUnloaded(
|
||||
|
||||
registry_->TriggerOnUnloaded(extension, reason);
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::Source<content::BrowserContext>(browser_context_),
|
||||
content::Details<UnloadedExtensionInfo>(&details));
|
||||
|
||||
// Tell renderers about the unloaded extension.
|
||||
renderer_helper_->OnExtensionUnloaded(*extension);
|
||||
|
||||
|
@ -70,7 +70,7 @@ class CefExtensionSystem : public ExtensionSystem {
|
||||
const base::Closure& callback) override;
|
||||
void UnregisterExtensionWithRequestContexts(
|
||||
const std::string& extension_id,
|
||||
const UnloadedExtensionInfo::Reason reason) override;
|
||||
const UnloadedExtensionReason reason) override;
|
||||
const OneShotEvent& ready() const override;
|
||||
ContentVerifier* content_verifier() override;
|
||||
std::unique_ptr<ExtensionSet> GetDependentExtensions(
|
||||
@ -105,14 +105,14 @@ class CefExtensionSystem : public ExtensionSystem {
|
||||
|
||||
// Unload the specified extension.
|
||||
void UnloadExtension(const std::string& extension_id,
|
||||
extensions::UnloadedExtensionInfo::Reason reason);
|
||||
extensions::UnloadedExtensionReason reason);
|
||||
|
||||
// Handles sending notification that |extension| was loaded.
|
||||
void NotifyExtensionLoaded(const Extension* extension);
|
||||
|
||||
// Handles sending notification that |extension| was unloaded.
|
||||
void NotifyExtensionUnloaded(const Extension* extension,
|
||||
UnloadedExtensionInfo::Reason reason);
|
||||
UnloadedExtensionReason reason);
|
||||
|
||||
// Completes extension loading after URLRequestContexts have been updated
|
||||
// on the IO thread.
|
||||
|
@ -14,11 +14,13 @@ namespace extensions {
|
||||
class CefExtensionWebContentsObserver
|
||||
: public ExtensionWebContentsObserver,
|
||||
public content::WebContentsUserData<CefExtensionWebContentsObserver> {
|
||||
public:
|
||||
~CefExtensionWebContentsObserver() override;
|
||||
|
||||
private:
|
||||
friend class content::WebContentsUserData<CefExtensionWebContentsObserver>;
|
||||
|
||||
explicit CefExtensionWebContentsObserver(content::WebContents* web_contents);
|
||||
~CefExtensionWebContentsObserver() override;
|
||||
|
||||
// content::WebContentsObserver overrides.
|
||||
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_
|
||||
#define CEF_LIBCEF_BROWSER_EXTENSIONS_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_
|
||||
|
||||
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
|
||||
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h"
|
||||
|
||||
namespace content {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "include/cef_request.h"
|
||||
#include "include/cef_stream.h"
|
||||
#include "include/cef_v8.h"
|
||||
#include "include/test/cef_test_helpers.h"
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/common/cef_messages.h"
|
||||
|
||||
@ -257,6 +258,21 @@ void CefFrameHostImpl::SendJavaScript(const std::string& jsCode,
|
||||
browser->SendCode(frame_id, true, jsCode, scriptUrl, startLine, NULL);
|
||||
}
|
||||
|
||||
void CefFrameHostImpl::ExecuteJavaScriptWithUserGestureForTests(
|
||||
const CefString& javascript) {
|
||||
CefRefPtr<CefBrowserHostImpl> browser;
|
||||
int64 frame_id;
|
||||
|
||||
{
|
||||
base::AutoLock lock_scope(state_lock_);
|
||||
browser = browser_;
|
||||
frame_id = (is_main_frame_ ? kMainFrameId : frame_id_);
|
||||
}
|
||||
|
||||
if (browser.get() && frame_id != kInvalidFrameId)
|
||||
browser->ExecuteJavaScriptWithUserGestureForTests(frame_id, javascript);
|
||||
}
|
||||
|
||||
void CefFrameHostImpl::Detach() {
|
||||
base::AutoLock lock_scope(state_lock_);
|
||||
browser_ = NULL;
|
||||
@ -278,3 +294,9 @@ void CefFrameHostImpl::SendCommand(
|
||||
if (browser.get() && frame_id != kInvalidFrameId)
|
||||
browser->SendCommand(frame_id, command, responseHandler);
|
||||
}
|
||||
|
||||
void CefExecuteJavaScriptWithUserGestureForTests(CefRefPtr<CefFrame> frame,
|
||||
const CefString& javascript) {
|
||||
CefFrameHostImpl* impl = static_cast<CefFrameHostImpl*>(frame.get());
|
||||
impl->ExecuteJavaScriptWithUserGestureForTests(javascript);
|
||||
}
|
||||
|
@ -66,6 +66,8 @@ class CefFrameHostImpl : public CefFrame {
|
||||
const std::string& scriptUrl,
|
||||
int startLine);
|
||||
|
||||
void ExecuteJavaScriptWithUserGestureForTests(const CefString& javascript);
|
||||
|
||||
// Detach the frame from the browser.
|
||||
void Detach();
|
||||
|
||||
|
@ -135,11 +135,7 @@ bool CefImageImpl::AddBitmap(float scale_factor,
|
||||
}
|
||||
|
||||
DCHECK_EQ(pixel_data_size, bitmap.getSize());
|
||||
|
||||
{
|
||||
SkAutoLockPixels bitmap_lock(bitmap);
|
||||
memcpy(bitmap.getPixels(), pixel_data, pixel_data_size);
|
||||
}
|
||||
memcpy(bitmap.getPixels(), pixel_data, pixel_data_size);
|
||||
|
||||
return AddBitmap(scale_factor, bitmap);
|
||||
}
|
||||
@ -229,7 +225,6 @@ CefRefPtr<CefBinaryValue> CefImageImpl::GetAsBitmap(float scale_factor,
|
||||
if (!bitmap)
|
||||
return nullptr;
|
||||
|
||||
SkAutoLockPixels bitmap_lock(*bitmap);
|
||||
DCHECK(bitmap->readyToDraw());
|
||||
|
||||
pixel_width = bitmap->width();
|
||||
@ -242,7 +237,6 @@ CefRefPtr<CefBinaryValue> CefImageImpl::GetAsBitmap(float scale_factor,
|
||||
SkBitmap desired_bitmap;
|
||||
if (!ConvertBitmap(*bitmap, &desired_bitmap, desired_ct, desired_at))
|
||||
return nullptr;
|
||||
SkAutoLockPixels bitmap_lock(desired_bitmap);
|
||||
DCHECK(desired_bitmap.readyToDraw());
|
||||
return CefBinaryValue::Create(desired_bitmap.getPixels(),
|
||||
desired_bitmap.getSize());
|
||||
@ -324,10 +318,7 @@ gfx::ImageSkia CefImageImpl::GetForced1xScaleRepresentation(
|
||||
|
||||
bool CefImageImpl::AddBitmap(float scale_factor, const SkBitmap& bitmap) {
|
||||
#if DCHECK_IS_ON()
|
||||
{
|
||||
SkAutoLockPixels bitmap_lock(bitmap);
|
||||
DCHECK(bitmap.readyToDraw());
|
||||
}
|
||||
DCHECK(bitmap.readyToDraw());
|
||||
#endif
|
||||
DCHECK(bitmap.colorType() == kBGRA_8888_SkColorType ||
|
||||
bitmap.colorType() == kRGBA_8888_SkColorType);
|
||||
@ -369,7 +360,6 @@ bool CefImageImpl::ConvertBitmap(const SkBitmap& src_bitmap,
|
||||
if (!target_bitmap->tryAllocPixels(target_info))
|
||||
return false;
|
||||
|
||||
SkAutoLockPixels bitmap_lock(*target_bitmap);
|
||||
if (!src_bitmap.readPixels(target_info, target_bitmap->getPixels(),
|
||||
target_bitmap->rowBytes(), 0, 0)) {
|
||||
return false;
|
||||
@ -387,7 +377,6 @@ bool CefImageImpl::WriteCompressedFormat(const SkBitmap& bitmap,
|
||||
SkBitmap bitmap_postalpha;
|
||||
if (bitmap.alphaType() == kPremul_SkAlphaType) {
|
||||
// Compression methods require post-multiplied alpha values.
|
||||
SkAutoLockPixels bitmap_lock(bitmap);
|
||||
if (!ConvertBitmap(bitmap, &bitmap_postalpha, bitmap.colorType(),
|
||||
kUnpremul_SkAlphaType)) {
|
||||
return false;
|
||||
@ -397,7 +386,6 @@ bool CefImageImpl::WriteCompressedFormat(const SkBitmap& bitmap,
|
||||
bitmap_ptr = &bitmap;
|
||||
}
|
||||
|
||||
SkAutoLockPixels bitmap_lock(*bitmap_ptr);
|
||||
DCHECK(bitmap_ptr->readyToDraw());
|
||||
DCHECK(bitmap_ptr->colorType() == kBGRA_8888_SkColorType ||
|
||||
bitmap_ptr->colorType() == kRGBA_8888_SkColorType);
|
||||
|
@ -396,7 +396,7 @@ bool RunOpenFolderDialog(const CefFileDialogRunner::FileChooserParams& params,
|
||||
ZeroMemory(&out_dir_buffer, sizeof(out_dir_buffer));
|
||||
out_dir_buffer.uType = STRRET_WSTR;
|
||||
base::win::ScopedComPtr<IShellFolder> shell_folder;
|
||||
if (SHGetDesktopFolder(shell_folder.Receive()) == NOERROR) {
|
||||
if (SHGetDesktopFolder(shell_folder.GetAddressOf()) == NOERROR) {
|
||||
HRESULT hr = shell_folder->GetDisplayNameOf(list, SHGDN_FORPARSING,
|
||||
&out_dir_buffer);
|
||||
if (SUCCEEDED(hr) && out_dir_buffer.uType == STRRET_WSTR) {
|
||||
|
@ -26,10 +26,8 @@ bool CefMenuRunnerLinux::RunContextMenu(
|
||||
if (!browser->IsWindowless())
|
||||
parent_widget = browser->GetWindowWidget();
|
||||
|
||||
views::MenuRunner::RunResult result = menu_->RunMenuAt(
|
||||
parent_widget, NULL, gfx::Rect(screen_point, gfx::Size()),
|
||||
views::MENU_ANCHOR_TOPRIGHT, ui::MENU_SOURCE_NONE);
|
||||
ALLOW_UNUSED_LOCAL(result);
|
||||
menu_->RunMenuAt(parent_widget, NULL, gfx::Rect(screen_point, gfx::Size()),
|
||||
views::MENU_ANCHOR_TOPRIGHT, ui::MENU_SOURCE_NONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -46,7 +46,8 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
DCHECK(url_request_);
|
||||
|
||||
// Add an association between the URLRequest and this object.
|
||||
url_request_->SetUserData(UserDataKey(), new Disconnector(this));
|
||||
url_request_->SetUserData(UserDataKey(),
|
||||
base::WrapUnique(new Disconnector(this)));
|
||||
}
|
||||
|
||||
~CefBeforeResourceLoadCallbackImpl() {
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "content/public/browser/ax_event_notification_details.h"
|
||||
#include "ui/accessibility/ax_enums.h"
|
||||
#include "ui/accessibility/ax_text_utils.h"
|
||||
#include "ui/accessibility/ax_tree_update.h"
|
||||
#include "ui/gfx/transform.h"
|
||||
@ -36,27 +37,11 @@ CefRefPtr<CefListValue> ToCefValue<int>(const std::vector<int>& vecData) {
|
||||
CefRefPtr<CefListValue> ToCefValue(uint32_t state) {
|
||||
CefRefPtr<CefListValue> value = CefListValue::Create();
|
||||
|
||||
static ui::AXState state_arr[] = {
|
||||
ui::AX_STATE_NONE, ui::AX_STATE_BUSY,
|
||||
ui::AX_STATE_CHECKED, ui::AX_STATE_COLLAPSED,
|
||||
ui::AX_STATE_DEFAULT, ui::AX_STATE_DISABLED,
|
||||
ui::AX_STATE_EDITABLE, ui::AX_STATE_EXPANDED,
|
||||
ui::AX_STATE_FOCUSABLE, ui::AX_STATE_HASPOPUP,
|
||||
ui::AX_STATE_HORIZONTAL, ui::AX_STATE_HOVERED,
|
||||
ui::AX_STATE_INVISIBLE, ui::AX_STATE_LINKED,
|
||||
ui::AX_STATE_MULTILINE, ui::AX_STATE_MULTISELECTABLE,
|
||||
ui::AX_STATE_OFFSCREEN, ui::AX_STATE_PRESSED,
|
||||
ui::AX_STATE_PROTECTED, ui::AX_STATE_READ_ONLY,
|
||||
ui::AX_STATE_REQUIRED, ui::AX_STATE_RICHLY_EDITABLE,
|
||||
ui::AX_STATE_SELECTABLE, ui::AX_STATE_SELECTED,
|
||||
ui::AX_STATE_VERTICAL, ui::AX_STATE_VISITED,
|
||||
ui::AX_STATE_LAST};
|
||||
|
||||
int index = 0;
|
||||
// Iterate and find which states are set.
|
||||
for (unsigned i = 0; i < arraysize(state_arr); i++) {
|
||||
if (state & (1 << state_arr[i]))
|
||||
value->SetString(index++, ToString(state_arr[i]));
|
||||
for (unsigned i = ui::AX_STATE_NONE; i <= ui::AX_STATE_LAST; i++) {
|
||||
if (state & (1 << i))
|
||||
value->SetString(index++, ToString(static_cast<ui::AXState>(i)));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@ -96,10 +81,10 @@ struct PopulateAxNodeAttributes {
|
||||
case ui::AX_ATTR_HIERARCHICAL_LEVEL:
|
||||
case ui::AX_ATTR_TEXT_SEL_START:
|
||||
case ui::AX_ATTR_TEXT_SEL_END:
|
||||
case ui::AX_ATTR_ARIA_COL_COUNT:
|
||||
case ui::AX_ATTR_ARIA_COL_INDEX:
|
||||
case ui::AX_ATTR_ARIA_COLUMN_COUNT:
|
||||
case ui::AX_ATTR_ARIA_CELL_COLUMN_INDEX:
|
||||
case ui::AX_ATTR_ARIA_ROW_COUNT:
|
||||
case ui::AX_ATTR_ARIA_ROW_INDEX:
|
||||
case ui::AX_ATTR_ARIA_CELL_ROW_INDEX:
|
||||
case ui::AX_ATTR_TABLE_ROW_COUNT:
|
||||
case ui::AX_ATTR_TABLE_COLUMN_COUNT:
|
||||
case ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX:
|
||||
@ -122,11 +107,11 @@ struct PopulateAxNodeAttributes {
|
||||
case ui::AX_ATTR_POS_IN_SET:
|
||||
attributes->SetInt(ToString(attr.first), attr.second);
|
||||
break;
|
||||
case ui::AX_ATTR_ACTION:
|
||||
case ui::AX_ATTR_DEFAULT_ACTION_VERB:
|
||||
attributes->SetString(
|
||||
ToString(attr.first),
|
||||
ui::ActionToUnlocalizedString(
|
||||
static_cast<ui::AXSupportedAction>(attr.second)));
|
||||
ui::ActionVerbToUnlocalizedString(
|
||||
static_cast<ui::AXDefaultActionVerb>(attr.second)));
|
||||
break;
|
||||
case ui::AX_ATTR_INVALID_STATE:
|
||||
if (ui::AX_INVALID_STATE_NONE != attr.second) {
|
||||
@ -135,6 +120,13 @@ struct PopulateAxNodeAttributes {
|
||||
ToString(static_cast<ui::AXInvalidState>(attr.second)));
|
||||
}
|
||||
break;
|
||||
case ui::AX_ATTR_CHECKED_STATE:
|
||||
if (ui::AX_CHECKED_STATE_NONE != attr.second) {
|
||||
attributes->SetString(
|
||||
ToString(attr.first),
|
||||
ToString(static_cast<ui::AXCheckedState>(attr.second)));
|
||||
}
|
||||
break;
|
||||
case ui::AX_ATTR_SORT_DIRECTION:
|
||||
if (ui::AX_SORT_DIRECTION_NONE != attr.second) {
|
||||
attributes->SetString(
|
||||
@ -265,6 +257,20 @@ CefRefPtr<CefDictionaryValue> ToCefValue(const ui::AXNodeData& node) {
|
||||
if (!node.child_ids.empty())
|
||||
value->SetList("child_ids", ToCefValue(node.child_ids));
|
||||
|
||||
CefRefPtr<CefListValue> actions_strings;
|
||||
size_t actions_idx = 0;
|
||||
for (int action_index = ui::AX_ACTION_NONE + 1;
|
||||
action_index <= ui::AX_ACTION_LAST; ++action_index) {
|
||||
auto action = static_cast<ui::AXAction>(action_index);
|
||||
if (node.HasAction(action)) {
|
||||
if (!actions_strings)
|
||||
actions_strings = CefListValue::Create();
|
||||
actions_strings->SetString(actions_idx++, ToString(action));
|
||||
}
|
||||
}
|
||||
if (actions_strings)
|
||||
value->SetList("actions", actions_strings);
|
||||
|
||||
CefRefPtr<CefDictionaryValue> attributes = CefDictionaryValue::Create();
|
||||
PopulateAxNodeAttributes func(attributes);
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "cc/base/switches.h"
|
||||
#include "cc/output/copy_output_request.h"
|
||||
#include "cc/scheduler/delay_based_time_source.h"
|
||||
#include "components/display_compositor/gl_helper.h"
|
||||
#include "components/viz/display_compositor/gl_helper.h"
|
||||
#include "content/browser/bad_message.h"
|
||||
#include "content/browser/compositor/image_transport_factory.h"
|
||||
#include "content/browser/frame_host/render_widget_host_view_guest.h"
|
||||
@ -181,12 +181,10 @@ class CefCopyFrameGenerator {
|
||||
|
||||
content::ImageTransportFactory* factory =
|
||||
content::ImageTransportFactory::GetInstance();
|
||||
display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
|
||||
viz::GLHelper* gl_helper = factory->GetGLHelper();
|
||||
if (!gl_helper)
|
||||
return;
|
||||
|
||||
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock(
|
||||
new SkAutoLockPixels(*bitmap_));
|
||||
uint8_t* pixels = static_cast<uint8_t*>(bitmap_->getPixels());
|
||||
|
||||
cc::TextureMailbox texture_mailbox;
|
||||
@ -204,9 +202,8 @@ class CefCopyFrameGenerator {
|
||||
base::Bind(
|
||||
&CefCopyFrameGenerator::CopyFromCompositingSurfaceFinishedProxy,
|
||||
weak_ptr_factory_.GetWeakPtr(), base::Passed(&release_callback),
|
||||
damage_rect, base::Passed(&bitmap_),
|
||||
base::Passed(&bitmap_pixels_lock)),
|
||||
display_compositor::GLHelper::SCALER_QUALITY_FAST);
|
||||
damage_rect, base::Passed(&bitmap_)),
|
||||
viz::GLHelper::SCALER_QUALITY_FAST);
|
||||
}
|
||||
|
||||
static void CopyFromCompositingSurfaceFinishedProxy(
|
||||
@ -214,12 +211,11 @@ class CefCopyFrameGenerator {
|
||||
std::unique_ptr<cc::SingleReleaseCallback> release_callback,
|
||||
const gfx::Rect& damage_rect,
|
||||
std::unique_ptr<SkBitmap> bitmap,
|
||||
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock,
|
||||
bool result) {
|
||||
// This method may be called after the view has been deleted.
|
||||
gpu::SyncToken sync_token;
|
||||
if (result) {
|
||||
display_compositor::GLHelper* gl_helper =
|
||||
viz::GLHelper* gl_helper =
|
||||
content::ImageTransportFactory::GetInstance()->GetGLHelper();
|
||||
if (gl_helper)
|
||||
gl_helper->GenerateSyncToken(&sync_token);
|
||||
@ -228,29 +224,23 @@ class CefCopyFrameGenerator {
|
||||
release_callback->Run(sync_token, lost_resource);
|
||||
|
||||
if (generator) {
|
||||
generator->CopyFromCompositingSurfaceFinished(
|
||||
damage_rect, std::move(bitmap), std::move(bitmap_pixels_lock),
|
||||
result);
|
||||
generator->CopyFromCompositingSurfaceFinished(damage_rect,
|
||||
std::move(bitmap), result);
|
||||
} else {
|
||||
bitmap_pixels_lock.reset();
|
||||
bitmap.reset();
|
||||
}
|
||||
}
|
||||
|
||||
void CopyFromCompositingSurfaceFinished(
|
||||
const gfx::Rect& damage_rect,
|
||||
std::unique_ptr<SkBitmap> bitmap,
|
||||
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock,
|
||||
bool result) {
|
||||
void CopyFromCompositingSurfaceFinished(const gfx::Rect& damage_rect,
|
||||
std::unique_ptr<SkBitmap> bitmap,
|
||||
bool result) {
|
||||
// Restore ownership of the bitmap to the view.
|
||||
DCHECK(!bitmap_);
|
||||
bitmap_ = std::move(bitmap);
|
||||
|
||||
if (result) {
|
||||
OnCopyFrameCaptureSuccess(damage_rect, *bitmap_,
|
||||
std::move(bitmap_pixels_lock));
|
||||
OnCopyFrameCaptureSuccess(damage_rect, *bitmap_);
|
||||
} else {
|
||||
bitmap_pixels_lock.reset();
|
||||
OnCopyFrameCaptureFailure(damage_rect);
|
||||
}
|
||||
}
|
||||
@ -262,10 +252,7 @@ class CefCopyFrameGenerator {
|
||||
std::unique_ptr<SkBitmap> source = result->TakeBitmap();
|
||||
DCHECK(source);
|
||||
if (source) {
|
||||
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock(
|
||||
new SkAutoLockPixels(*source));
|
||||
OnCopyFrameCaptureSuccess(damage_rect, *source,
|
||||
std::move(bitmap_pixels_lock));
|
||||
OnCopyFrameCaptureSuccess(damage_rect, *source);
|
||||
} else {
|
||||
OnCopyFrameCaptureFailure(damage_rect);
|
||||
}
|
||||
@ -279,13 +266,10 @@ class CefCopyFrameGenerator {
|
||||
OnCopyFrameCaptureCompletion(force_frame);
|
||||
}
|
||||
|
||||
void OnCopyFrameCaptureSuccess(
|
||||
const gfx::Rect& damage_rect,
|
||||
const SkBitmap& bitmap,
|
||||
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock) {
|
||||
void OnCopyFrameCaptureSuccess(const gfx::Rect& damage_rect,
|
||||
const SkBitmap& bitmap) {
|
||||
view_->OnPaint(damage_rect, bitmap.width(), bitmap.height(),
|
||||
bitmap.getPixels());
|
||||
bitmap_pixels_lock.reset();
|
||||
|
||||
// Reset the frame retry count on successful frame generation.
|
||||
if (frame_retry_count_ > 0)
|
||||
|
@ -146,6 +146,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
int error_code) override;
|
||||
void Destroy() override;
|
||||
void SetTooltipText(const base::string16& tooltip_text) override;
|
||||
void OnSetNeedsFlushInput() override {}
|
||||
|
||||
gfx::Size GetRequestedRendererSize() const override;
|
||||
gfx::Size GetPhysicalBackingSize() const override;
|
||||
|
@ -103,7 +103,6 @@ void CefSoftwareOutputDeviceOSR::OnPaint(const gfx::Rect& damage_rect) {
|
||||
if (rect.IsEmpty())
|
||||
return;
|
||||
|
||||
SkAutoLockPixels bitmap_pixels_lock(*bitmap_.get());
|
||||
callback_.Run(rect, bitmap_->width(), bitmap_->height(),
|
||||
bitmap_->getPixels());
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "libcef/browser/media_capture_devices_dispatcher.h"
|
||||
#include "libcef/browser/net/url_request_context_getter_impl.h"
|
||||
#include "libcef/browser/prefs/pref_store.h"
|
||||
#include "libcef/browser/prefs/renderer_prefs.h"
|
||||
#include "libcef/common/cef_switches.h"
|
||||
|
||||
@ -30,7 +31,6 @@
|
||||
#include "components/prefs/pref_filter.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/prefs/testing_pref_store.h"
|
||||
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
|
||||
#include "components/proxy_config/proxy_config_dictionary.h"
|
||||
#include "components/spellcheck/browser/pref_names.h"
|
||||
@ -136,9 +136,9 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
|
||||
pref_path, sequenced_task_runner, std::unique_ptr<PrefFilter>());
|
||||
factory.set_user_prefs(json_pref_store.get());
|
||||
} else {
|
||||
scoped_refptr<TestingPrefStore> testing_pref_store = new TestingPrefStore();
|
||||
testing_pref_store->SetInitializationCompleted();
|
||||
factory.set_user_prefs(testing_pref_store.get());
|
||||
scoped_refptr<CefPrefStore> cef_pref_store = new CefPrefStore();
|
||||
cef_pref_store->SetInitializationCompleted();
|
||||
factory.set_user_prefs(cef_pref_store.get());
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
|
||||
@ -152,10 +152,9 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
|
||||
supervised_user_settings->Init(cache_path, sequenced_task_runner.get(),
|
||||
true);
|
||||
} else {
|
||||
scoped_refptr<TestingPrefStore> testing_pref_store =
|
||||
new TestingPrefStore();
|
||||
testing_pref_store->SetInitializationCompleted();
|
||||
supervised_user_settings->Init(testing_pref_store);
|
||||
scoped_refptr<CefPrefStore> cef_pref_store = new CefPrefStore();
|
||||
cef_pref_store->SetInitializationCompleted();
|
||||
supervised_user_settings->Init(cef_pref_store);
|
||||
}
|
||||
|
||||
scoped_refptr<PrefStore> supervised_user_prefs = make_scoped_refptr(
|
||||
|
188
libcef/browser/prefs/pref_store.cc
Normal file
188
libcef/browser/prefs/pref_store.cc
Normal file
@ -0,0 +1,188 @@
|
||||
// Copyright (c) 2012 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.
|
||||
|
||||
#include "libcef/browser/prefs/pref_store.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/values.h"
|
||||
|
||||
CefPrefStore::CefPrefStore()
|
||||
: read_only_(true),
|
||||
read_success_(true),
|
||||
read_error_(PersistentPrefStore::PREF_READ_ERROR_NONE),
|
||||
block_async_read_(false),
|
||||
pending_async_read_(false),
|
||||
init_complete_(false),
|
||||
committed_(true) {}
|
||||
|
||||
bool CefPrefStore::GetValue(const std::string& key,
|
||||
const base::Value** value) const {
|
||||
return prefs_.GetValue(key, value);
|
||||
}
|
||||
|
||||
std::unique_ptr<base::DictionaryValue> CefPrefStore::GetValues() const {
|
||||
return prefs_.AsDictionaryValue();
|
||||
}
|
||||
|
||||
bool CefPrefStore::GetMutableValue(const std::string& key,
|
||||
base::Value** value) {
|
||||
return prefs_.GetValue(key, value);
|
||||
}
|
||||
|
||||
void CefPrefStore::AddObserver(PrefStore::Observer* observer) {
|
||||
observers_.AddObserver(observer);
|
||||
}
|
||||
|
||||
void CefPrefStore::RemoveObserver(PrefStore::Observer* observer) {
|
||||
observers_.RemoveObserver(observer);
|
||||
}
|
||||
|
||||
bool CefPrefStore::HasObservers() const {
|
||||
return observers_.might_have_observers();
|
||||
}
|
||||
|
||||
bool CefPrefStore::IsInitializationComplete() const {
|
||||
return init_complete_;
|
||||
}
|
||||
|
||||
void CefPrefStore::SetValue(const std::string& key,
|
||||
std::unique_ptr<base::Value> value,
|
||||
uint32_t flags) {
|
||||
if (prefs_.SetValue(key, std::move(value))) {
|
||||
committed_ = false;
|
||||
NotifyPrefValueChanged(key);
|
||||
}
|
||||
}
|
||||
|
||||
void CefPrefStore::SetValueSilently(const std::string& key,
|
||||
std::unique_ptr<base::Value> value,
|
||||
uint32_t flags) {
|
||||
if (prefs_.SetValue(key, std::move(value)))
|
||||
committed_ = false;
|
||||
}
|
||||
|
||||
void CefPrefStore::RemoveValue(const std::string& key, uint32_t flags) {
|
||||
if (prefs_.RemoveValue(key)) {
|
||||
committed_ = false;
|
||||
NotifyPrefValueChanged(key);
|
||||
}
|
||||
}
|
||||
|
||||
bool CefPrefStore::ReadOnly() const {
|
||||
return read_only_;
|
||||
}
|
||||
|
||||
PersistentPrefStore::PrefReadError CefPrefStore::GetReadError() const {
|
||||
return read_error_;
|
||||
}
|
||||
|
||||
PersistentPrefStore::PrefReadError CefPrefStore::ReadPrefs() {
|
||||
NotifyInitializationCompleted();
|
||||
return read_error_;
|
||||
}
|
||||
|
||||
void CefPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate) {
|
||||
DCHECK(!pending_async_read_);
|
||||
error_delegate_.reset(error_delegate);
|
||||
if (block_async_read_)
|
||||
pending_async_read_ = true;
|
||||
else
|
||||
NotifyInitializationCompleted();
|
||||
}
|
||||
|
||||
void CefPrefStore::CommitPendingWrite() {
|
||||
committed_ = true;
|
||||
}
|
||||
|
||||
void CefPrefStore::SchedulePendingLossyWrites() {}
|
||||
|
||||
void CefPrefStore::SetInitializationCompleted() {
|
||||
NotifyInitializationCompleted();
|
||||
}
|
||||
|
||||
void CefPrefStore::NotifyPrefValueChanged(const std::string& key) {
|
||||
for (Observer& observer : observers_)
|
||||
observer.OnPrefValueChanged(key);
|
||||
}
|
||||
|
||||
void CefPrefStore::NotifyInitializationCompleted() {
|
||||
DCHECK(!init_complete_);
|
||||
init_complete_ = true;
|
||||
if (read_success_ && read_error_ != PREF_READ_ERROR_NONE && error_delegate_)
|
||||
error_delegate_->OnError(read_error_);
|
||||
for (Observer& observer : observers_)
|
||||
observer.OnInitializationCompleted(read_success_);
|
||||
}
|
||||
|
||||
void CefPrefStore::ReportValueChanged(const std::string& key, uint32_t flags) {
|
||||
for (Observer& observer : observers_)
|
||||
observer.OnPrefValueChanged(key);
|
||||
}
|
||||
|
||||
void CefPrefStore::SetString(const std::string& key, const std::string& value) {
|
||||
SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
|
||||
}
|
||||
|
||||
void CefPrefStore::SetInteger(const std::string& key, int value) {
|
||||
SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
|
||||
}
|
||||
|
||||
void CefPrefStore::SetBoolean(const std::string& key, bool value) {
|
||||
SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
|
||||
}
|
||||
|
||||
bool CefPrefStore::GetString(const std::string& key, std::string* value) const {
|
||||
const base::Value* stored_value;
|
||||
if (!prefs_.GetValue(key, &stored_value) || !stored_value)
|
||||
return false;
|
||||
|
||||
return stored_value->GetAsString(value);
|
||||
}
|
||||
|
||||
bool CefPrefStore::GetInteger(const std::string& key, int* value) const {
|
||||
const base::Value* stored_value;
|
||||
if (!prefs_.GetValue(key, &stored_value) || !stored_value)
|
||||
return false;
|
||||
|
||||
return stored_value->GetAsInteger(value);
|
||||
}
|
||||
|
||||
bool CefPrefStore::GetBoolean(const std::string& key, bool* value) const {
|
||||
const base::Value* stored_value;
|
||||
if (!prefs_.GetValue(key, &stored_value) || !stored_value)
|
||||
return false;
|
||||
|
||||
return stored_value->GetAsBoolean(value);
|
||||
}
|
||||
|
||||
void CefPrefStore::SetBlockAsyncRead(bool block_async_read) {
|
||||
DCHECK(!init_complete_);
|
||||
block_async_read_ = block_async_read;
|
||||
if (pending_async_read_ && !block_async_read_)
|
||||
NotifyInitializationCompleted();
|
||||
}
|
||||
|
||||
void CefPrefStore::ClearMutableValues() {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
void CefPrefStore::set_read_only(bool read_only) {
|
||||
read_only_ = read_only;
|
||||
}
|
||||
|
||||
void CefPrefStore::set_read_success(bool read_success) {
|
||||
DCHECK(!init_complete_);
|
||||
read_success_ = read_success;
|
||||
}
|
||||
|
||||
void CefPrefStore::set_read_error(
|
||||
PersistentPrefStore::PrefReadError read_error) {
|
||||
DCHECK(!init_complete_);
|
||||
read_error_ = read_error;
|
||||
}
|
||||
|
||||
CefPrefStore::~CefPrefStore() {}
|
117
libcef/browser/prefs/pref_store.h
Normal file
117
libcef/browser/prefs/pref_store.h
Normal file
@ -0,0 +1,117 @@
|
||||
// Copyright (c) 2012 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.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_PREFS_PREF_STORE_H_
|
||||
#define CEF_LIBCEF_BROWSER_PREFS_PREF_STORE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "components/prefs/persistent_pref_store.h"
|
||||
#include "components/prefs/pref_value_map.h"
|
||||
|
||||
// Preference store implementation that supports explicit manipulation of the
|
||||
// contents of the store, triggering notifications where appropriate.
|
||||
// Based on components/prefs/testing_pref_store.h.
|
||||
class CefPrefStore : public PersistentPrefStore {
|
||||
public:
|
||||
CefPrefStore();
|
||||
|
||||
// Overriden from PrefStore.
|
||||
bool GetValue(const std::string& key,
|
||||
const base::Value** result) const override;
|
||||
std::unique_ptr<base::DictionaryValue> GetValues() const override;
|
||||
void AddObserver(PrefStore::Observer* observer) override;
|
||||
void RemoveObserver(PrefStore::Observer* observer) override;
|
||||
bool HasObservers() const override;
|
||||
bool IsInitializationComplete() const override;
|
||||
|
||||
// PersistentPrefStore overrides:
|
||||
bool GetMutableValue(const std::string& key, base::Value** result) override;
|
||||
void ReportValueChanged(const std::string& key, uint32_t flags) override;
|
||||
void SetValue(const std::string& key,
|
||||
std::unique_ptr<base::Value> value,
|
||||
uint32_t flags) override;
|
||||
void SetValueSilently(const std::string& key,
|
||||
std::unique_ptr<base::Value> value,
|
||||
uint32_t flags) override;
|
||||
void RemoveValue(const std::string& key, uint32_t flags) override;
|
||||
bool ReadOnly() const override;
|
||||
PrefReadError GetReadError() const override;
|
||||
PersistentPrefStore::PrefReadError ReadPrefs() override;
|
||||
void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override;
|
||||
void CommitPendingWrite() override;
|
||||
void SchedulePendingLossyWrites() override;
|
||||
|
||||
// Marks the store as having completed initialization.
|
||||
void SetInitializationCompleted();
|
||||
|
||||
// Used for tests to trigger notifications explicitly.
|
||||
void NotifyPrefValueChanged(const std::string& key);
|
||||
void NotifyInitializationCompleted();
|
||||
|
||||
// Some convenience getters/setters.
|
||||
void SetString(const std::string& key, const std::string& value);
|
||||
void SetInteger(const std::string& key, int value);
|
||||
void SetBoolean(const std::string& key, bool value);
|
||||
|
||||
bool GetString(const std::string& key, std::string* value) const;
|
||||
bool GetInteger(const std::string& key, int* value) const;
|
||||
bool GetBoolean(const std::string& key, bool* value) const;
|
||||
|
||||
// Determines whether ReadPrefsAsync completes immediately. Defaults to false
|
||||
// (non-blocking). To block, invoke this with true (blocking) before the call
|
||||
// to ReadPrefsAsync. To unblock, invoke again with false (non-blocking) after
|
||||
// the call to ReadPrefsAsync.
|
||||
void SetBlockAsyncRead(bool block_async_read);
|
||||
|
||||
void ClearMutableValues() override;
|
||||
|
||||
// Getter and Setter methods for setting and getting the state of the
|
||||
// |TestingPrefStore|.
|
||||
virtual void set_read_only(bool read_only);
|
||||
void set_read_success(bool read_success);
|
||||
void set_read_error(PersistentPrefStore::PrefReadError read_error);
|
||||
bool committed() { return committed_; }
|
||||
|
||||
protected:
|
||||
~CefPrefStore() override;
|
||||
|
||||
private:
|
||||
// Stores the preference values.
|
||||
PrefValueMap prefs_;
|
||||
|
||||
// Flag that indicates if the PrefStore is read-only
|
||||
bool read_only_;
|
||||
|
||||
// The result to pass to PrefStore::Observer::OnInitializationCompleted
|
||||
bool read_success_;
|
||||
|
||||
// The result to return from ReadPrefs or ReadPrefsAsync.
|
||||
PersistentPrefStore::PrefReadError read_error_;
|
||||
|
||||
// Whether a call to ReadPrefsAsync should block.
|
||||
bool block_async_read_;
|
||||
|
||||
// Whether there is a pending call to ReadPrefsAsync.
|
||||
bool pending_async_read_;
|
||||
|
||||
// Whether initialization has been completed.
|
||||
bool init_complete_;
|
||||
|
||||
// Whether the store contents have been committed to disk since the last
|
||||
// mutation.
|
||||
bool committed_;
|
||||
|
||||
std::unique_ptr<ReadErrorDelegate> error_delegate_;
|
||||
base::ObserverList<PrefStore::Observer, true> observers_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefPrefStore);
|
||||
};
|
||||
|
||||
#endif // COMPONENTS_PREFS_TESTING_PREF_STORE_H_
|
@ -96,8 +96,6 @@ void SetChromePrefs(CefBrowserContext* profile, content::WebPreferences& web) {
|
||||
|
||||
web.default_encoding = prefs->GetString(prefs::kDefaultCharset);
|
||||
|
||||
web.javascript_can_open_windows_automatically =
|
||||
prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically);
|
||||
web.dom_paste_enabled = prefs->GetBoolean(prefs::kWebKitDomPasteEnabled);
|
||||
web.tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks);
|
||||
|
||||
@ -232,8 +230,6 @@ void SetCefPrefs(const CefBrowserSettings& cef, content::WebPreferences& web) {
|
||||
|
||||
SET_STATE(cef.remote_fonts, web.remote_fonts_enabled);
|
||||
SET_STATE(cef.javascript, web.javascript_enabled);
|
||||
SET_STATE(cef.javascript_open_windows,
|
||||
web.javascript_can_open_windows_automatically);
|
||||
SET_STATE(cef.javascript_close_windows, web.allow_scripts_to_close_windows);
|
||||
SET_STATE(cef.javascript_access_clipboard,
|
||||
web.javascript_can_access_clipboard);
|
||||
@ -282,8 +278,6 @@ void SetCommandLinePrefDefaults(CommandLinePrefStore* prefs) {
|
||||
command_line->GetSwitchValueASCII(switches::kDefaultEncoding));
|
||||
}
|
||||
|
||||
if (command_line->HasSwitch(switches::kDisableJavascriptOpenWindows))
|
||||
SetBool(prefs, prefs::kWebKitJavascriptCanOpenWindowsAutomatically, false);
|
||||
if (command_line->HasSwitch(switches::kDisableJavascriptDomPaste))
|
||||
SetBool(prefs, prefs::kWebKitDomPasteEnabled, false);
|
||||
if (command_line->HasSwitch(switches::kDisableImageLoading))
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/location.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
@ -173,7 +174,7 @@ void CefPrintViewManagerBase::OnDidPrintPage(
|
||||
|
||||
const auto& settings = document->settings();
|
||||
if ((settings.printer_is_ps2() || settings.printer_is_ps3()) &&
|
||||
base::FeatureList::IsEnabled(features::kPostScriptPrinting)) {
|
||||
!base::FeatureList::IsEnabled(features::kDisablePostScriptPrinting)) {
|
||||
print_job_->StartPdfToPostScriptConversion(bytes, params.content_area,
|
||||
params.physical_offsets,
|
||||
settings.printer_is_ps2());
|
||||
@ -542,8 +543,9 @@ void CefPrintViewManagerBase::ReleasePrinterQuery() {
|
||||
printer_query = queue_->PopPrinterQuery(cookie);
|
||||
if (!printer_query.get())
|
||||
return;
|
||||
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&PrinterQuery::StopWorker, printer_query));
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
base::BindOnce(&PrinterQuery::StopWorker, printer_query));
|
||||
}
|
||||
|
||||
void CefPrintViewManagerBase::SendPrintingEnabled(
|
||||
|
@ -364,11 +364,10 @@ CefRefPtr<CefDictionaryValue> CefRequestContextImpl::GetAllPreferences(
|
||||
|
||||
PrefService* pref_service = browser_context()->GetPrefs();
|
||||
|
||||
std::unique_ptr<base::DictionaryValue> values;
|
||||
if (include_defaults)
|
||||
values = pref_service->GetPreferenceValues();
|
||||
else
|
||||
values = pref_service->GetPreferenceValuesOmitDefaults();
|
||||
std::unique_ptr<base::DictionaryValue> values =
|
||||
pref_service->GetPreferenceValues(include_defaults
|
||||
? PrefService::INCLUDE_DEFAULTS
|
||||
: PrefService::EXCLUDE_DEFAULTS);
|
||||
|
||||
// CefDictionaryValueImpl takes ownership of |values|.
|
||||
return new CefDictionaryValueImpl(values.release(), true, false);
|
||||
|
@ -51,13 +51,6 @@ base::SupportsUserData::Data* CefResourceContext::GetUserData(
|
||||
return content::ResourceContext::GetUserData(key);
|
||||
}
|
||||
|
||||
void CefResourceContext::SetUserData(const void* key, Data* data) {
|
||||
if (parent_ && ShouldProxyUserData(key))
|
||||
parent_->SetUserData(key, data);
|
||||
else
|
||||
content::ResourceContext::SetUserData(key, data);
|
||||
}
|
||||
|
||||
void CefResourceContext::SetUserData(const void* key,
|
||||
std::unique_ptr<Data> data) {
|
||||
if (parent_ && ShouldProxyUserData(key))
|
||||
|
@ -33,7 +33,6 @@ class CefResourceContext : public content::ResourceContext {
|
||||
|
||||
// SupportsUserData implementation.
|
||||
Data* GetUserData(const void* key) const override;
|
||||
void SetUserData(const void* key, Data* data) override;
|
||||
void SetUserData(const void* key, std::unique_ptr<Data> data) override;
|
||||
void RemoveUserData(const void* key) override;
|
||||
|
||||
|
@ -153,6 +153,19 @@ void CefStoragePartitionProxy::ClearBluetoothAllowedDevicesMapForTesting() {
|
||||
parent_->ClearBluetoothAllowedDevicesMapForTesting();
|
||||
}
|
||||
|
||||
content::mojom::NetworkContext* CefStoragePartitionProxy::network_context() {
|
||||
return parent_->network_context();
|
||||
}
|
||||
|
||||
content::URLLoaderFactoryGetter*
|
||||
CefStoragePartitionProxy::url_loader_factory_getter() {
|
||||
return parent_->url_loader_factory_getter();
|
||||
}
|
||||
|
||||
content::BrowserContext* CefStoragePartitionProxy::browser_context() const {
|
||||
return parent_->browser_context();
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::Bind(
|
||||
mojo::InterfaceRequest<content::mojom::StoragePartitionService> request) {
|
||||
parent_->Bind(std::move(request));
|
||||
|
@ -68,6 +68,9 @@ class CefStoragePartitionProxy : public content::StoragePartition {
|
||||
const base::Closure& callback) override;
|
||||
void Flush() override;
|
||||
void ClearBluetoothAllowedDevicesMapForTesting() override;
|
||||
content::mojom::NetworkContext* network_context() override;
|
||||
content::URLLoaderFactoryGetter* url_loader_factory_getter() override;
|
||||
content::BrowserContext* browser_context() const override;
|
||||
void Bind(mojo::InterfaceRequest<content::mojom::StoragePartitionService>
|
||||
request) override;
|
||||
|
||||
|
@ -25,8 +25,10 @@ CefRefPtr<CefBasicLabelButtonImpl> CefBasicLabelButtonImpl::Create(
|
||||
label_button->Initialize();
|
||||
if (!text.empty())
|
||||
label_button->SetText(text);
|
||||
if (with_frame)
|
||||
label_button->root_view()->SetStyle(views::CustomButton::STYLE_BUTTON);
|
||||
if (with_frame) {
|
||||
label_button->root_view()->SetStyleDeprecated(
|
||||
views::CustomButton::STYLE_BUTTON);
|
||||
}
|
||||
return label_button;
|
||||
}
|
||||
|
||||
|
@ -38,10 +38,13 @@ class UserData : public base::SupportsUserData::Data {
|
||||
|
||||
// The CefLayout previously associated with |owner_view|, if any, will be
|
||||
// destroyed by this call.
|
||||
owner_view->SetUserData(UserDataKey(), new UserData(cef_layout));
|
||||
owner_view->SetUserData(UserDataKey(),
|
||||
base::WrapUnique(new UserData(cef_layout)));
|
||||
}
|
||||
|
||||
private:
|
||||
friend std::default_delete<UserData>;
|
||||
|
||||
explicit UserData(CefRefPtr<CefLayout> cef_layout) : layout_(cef_layout) {
|
||||
DCHECK(layout_);
|
||||
}
|
||||
|
@ -33,8 +33,10 @@ CefRefPtr<CefMenuButtonImpl> CefMenuButtonImpl::Create(
|
||||
menu_button->Initialize();
|
||||
if (!text.empty())
|
||||
menu_button->SetText(text);
|
||||
if (with_frame)
|
||||
menu_button->root_view()->SetStyle(views::CustomButton::STYLE_BUTTON);
|
||||
if (with_frame) {
|
||||
menu_button->root_view()->SetStyleDeprecated(
|
||||
views::CustomButton::STYLE_BUTTON);
|
||||
}
|
||||
menu_button->root_view()->set_show_menu_marker(with_menu_marker);
|
||||
return menu_button;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class UserData : public base::SupportsUserData::Data {
|
||||
// The CefView should not already be registered.
|
||||
DCHECK(!view->GetUserData(UserDataKey()));
|
||||
|
||||
view->SetUserData(UserDataKey(), new UserData(cef_view));
|
||||
view->SetUserData(UserDataKey(), base::WrapUnique(new UserData(cef_view)));
|
||||
}
|
||||
|
||||
static CefRefPtr<CefView> GetFor(const views::View* view) {
|
||||
@ -90,6 +90,8 @@ class UserData : public base::SupportsUserData::Data {
|
||||
}
|
||||
|
||||
private:
|
||||
friend std::default_delete<UserData>;
|
||||
|
||||
explicit UserData(CefRefPtr<CefView> cef_view) : view_ref_(cef_view.get()) {
|
||||
DCHECK(view_ref_);
|
||||
}
|
||||
|
@ -431,17 +431,15 @@ void CefWindowImpl::ShowMenu(views::MenuButton* menu_button,
|
||||
|
||||
menu_runner_.reset(
|
||||
new views::MenuRunner(menu_model_impl->model(),
|
||||
views::MenuRunner::ASYNC |
|
||||
(menu_button ? views::MenuRunner::HAS_MNEMONICS
|
||||
: views::MenuRunner::CONTEXT_MENU),
|
||||
menu_button ? views::MenuRunner::HAS_MNEMONICS
|
||||
: views::MenuRunner::CONTEXT_MENU,
|
||||
base::Bind(&CefWindowImpl::MenuClosed, this)));
|
||||
|
||||
views::MenuRunner::RunResult result = menu_runner_->RunMenuAt(
|
||||
menu_runner_->RunMenuAt(
|
||||
widget_, menu_button,
|
||||
gfx::Rect(gfx::Point(screen_point.x, screen_point.y), gfx::Size()),
|
||||
static_cast<views::MenuAnchorPosition>(anchor_position),
|
||||
ui::MENU_SOURCE_NONE);
|
||||
ALLOW_UNUSED_LOCAL(result);
|
||||
}
|
||||
|
||||
void CefWindowImpl::MenuClosed() {
|
||||
|
@ -43,10 +43,15 @@ class CallRecordUploadAttempt {
|
||||
CefCrashReportUploadThread::CefCrashReportUploadThread(
|
||||
CrashReportDatabase* database,
|
||||
const std::string& url,
|
||||
bool watch_pending_reports,
|
||||
bool rate_limit,
|
||||
bool upload_gzip,
|
||||
int max_uploads)
|
||||
: CrashReportUploadThread(database, url, rate_limit, upload_gzip),
|
||||
: CrashReportUploadThread(database,
|
||||
url,
|
||||
watch_pending_reports,
|
||||
rate_limit,
|
||||
upload_gzip),
|
||||
max_uploads_(max_uploads) {}
|
||||
|
||||
CefCrashReportUploadThread::~CefCrashReportUploadThread() {}
|
||||
|
@ -11,6 +11,7 @@ class CefCrashReportUploadThread : public crashpad::CrashReportUploadThread {
|
||||
public:
|
||||
CefCrashReportUploadThread(crashpad::CrashReportDatabase* database,
|
||||
const std::string& url,
|
||||
bool watch_pending_reports,
|
||||
bool rate_limit,
|
||||
bool upload_gzip,
|
||||
int max_uploads);
|
||||
|
@ -252,6 +252,9 @@ IPC_MESSAGE_ROUTED3(CefHostMsg_FrameIdentified,
|
||||
int64_t /* parent_frame_id */,
|
||||
base::string16 /* frame_name */)
|
||||
|
||||
// Sent by the renderer when the frame becomes focused.
|
||||
IPC_MESSAGE_ROUTED0(CefHostMsg_FrameFocused)
|
||||
|
||||
// Sent when a frame has finished loading. Based on ViewHostMsg_DidFinishLoad.
|
||||
IPC_MESSAGE_ROUTED4(CefHostMsg_DidFinishLoad,
|
||||
int64_t /* frame_id */,
|
||||
|
@ -32,9 +32,6 @@ const char kUncaughtExceptionStackSize[] = "uncaught-exception-stack-size";
|
||||
// Default encoding.
|
||||
const char kDefaultEncoding[] = "default-encoding";
|
||||
|
||||
// Disable opening of windows via JavaScript.
|
||||
const char kDisableJavascriptOpenWindows[] = "disable-javascript-open-windows";
|
||||
|
||||
// Disable closing of windows via JavaScript.
|
||||
const char kDisableJavascriptCloseWindows[] =
|
||||
"disable-javascript-close-windows";
|
||||
|
@ -24,7 +24,6 @@ extern const char kLocalesDirPath[];
|
||||
extern const char kDisablePackLoading[];
|
||||
extern const char kUncaughtExceptionStackSize[];
|
||||
extern const char kDefaultEncoding[];
|
||||
extern const char kDisableJavascriptOpenWindows[];
|
||||
extern const char kDisableJavascriptCloseWindows[];
|
||||
extern const char kDisableJavascriptAccessClipboard[];
|
||||
extern const char kDisableJavascriptDomPaste[];
|
||||
|
@ -476,7 +476,8 @@ void CefCrashReporterClient::InitializeCrashReportingForProcess() {
|
||||
!g_crash_reporter_client->HasCrashExternalHandler();
|
||||
if (embedded_handler) {
|
||||
crash_reporter::InitializeCrashpadWithEmbeddedHandler(
|
||||
process_type.empty(), install_static::UTF16ToUTF8(process_type));
|
||||
process_type.empty(), install_static::UTF16ToUTF8(process_type),
|
||||
std::string());
|
||||
} else {
|
||||
crash_reporter::InitializeCrashpad(
|
||||
process_type.empty(), install_static::UTF16ToUTF8(process_type));
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Include this first to avoid compiler errors.
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
#include "include/cef_version.h"
|
||||
|
||||
#include "base/macros.h"
|
||||
|
@ -1,5 +1,12 @@
|
||||
{
|
||||
"display_name": "Chrome Render Process",
|
||||
"name": "content_renderer",
|
||||
"interface_provider_specs": {
|
||||
"service_manager:connector": {
|
||||
"provides": {
|
||||
"browser": [
|
||||
"spellcheck::mojom::SpellChecker"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/main_function_params.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "ipc/ipc_features.h"
|
||||
#include "pdf/pdf.h"
|
||||
#include "ui/base/layout.h"
|
||||
#include "ui/base/material_design/material_design_controller.h"
|
||||
@ -39,9 +40,7 @@
|
||||
#include "ui/base/ui_base_paths.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
|
||||
#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
|
||||
|
||||
#if defined(IPC_MESSAGE_LOG_ENABLED)
|
||||
#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
|
||||
#define IPC_MESSAGE_MACROS_LOG_ENABLED
|
||||
#include "content/public/common/content_ipc_logging.h"
|
||||
#define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \
|
||||
|
@ -534,7 +534,7 @@ CefRefPtr<CefBinaryValue> CefBinaryValueImpl::Copy() {
|
||||
|
||||
size_t CefBinaryValueImpl::GetSize() {
|
||||
CEF_VALUE_VERIFY_RETURN(false, 0);
|
||||
return const_value().GetSize();
|
||||
return const_value().GetBlob().size();
|
||||
}
|
||||
|
||||
size_t CefBinaryValueImpl::GetData(void* buffer,
|
||||
@ -547,13 +547,13 @@ size_t CefBinaryValueImpl::GetData(void* buffer,
|
||||
|
||||
CEF_VALUE_VERIFY_RETURN(false, 0);
|
||||
|
||||
size_t size = const_value().GetSize();
|
||||
size_t size = const_value().GetBlob().size();
|
||||
DCHECK_LT(data_offset, size);
|
||||
if (data_offset >= size)
|
||||
return 0;
|
||||
|
||||
size = std::min(buffer_size, size - data_offset);
|
||||
const char* data = const_value().GetBuffer();
|
||||
const char* data = const_value().GetBlob().data();
|
||||
memcpy(buffer, data + data_offset, size);
|
||||
return size;
|
||||
}
|
||||
@ -974,7 +974,8 @@ base::Value* CefDictionaryValueImpl::SetInternal(const CefString& key,
|
||||
base::Value* value) {
|
||||
DCHECK(value);
|
||||
RemoveInternal(key);
|
||||
mutable_value()->SetWithoutPathExpansion(base::StringPiece(key), value);
|
||||
mutable_value()->SetWithoutPathExpansion(
|
||||
base::StringPiece(key), base::WrapUnique<base::Value>(value));
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@ -409,12 +409,6 @@ void CefBrowserImpl::DidStopLoading() {
|
||||
OnLoadingStateChange(false);
|
||||
}
|
||||
|
||||
void CefBrowserImpl::DidFailLoad(blink::WebLocalFrame* frame,
|
||||
const blink::WebURLError& error) {
|
||||
OnLoadError(frame, error);
|
||||
OnLoadEnd(frame);
|
||||
}
|
||||
|
||||
void CefBrowserImpl::DidFinishLoad(blink::WebLocalFrame* frame) {
|
||||
blink::WebDataSource* ds = frame->DataSource();
|
||||
Send(new CefHostMsg_DidFinishLoad(
|
||||
|
@ -31,6 +31,10 @@ namespace base {
|
||||
class ListValue;
|
||||
}
|
||||
|
||||
namespace blink {
|
||||
class WebNode;
|
||||
}
|
||||
|
||||
// Renderer plumbing for CEF features. There is a one-to-one relationship
|
||||
// between RenderView on the renderer side and RenderViewHost on the browser
|
||||
// side.
|
||||
@ -102,24 +106,24 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
|
||||
|
||||
bool is_swapped_out() const;
|
||||
|
||||
private:
|
||||
// RenderViewObserver methods.
|
||||
void OnDestruct() override;
|
||||
void DidStartLoading() override;
|
||||
void DidStopLoading() override;
|
||||
void DidFailLoad(blink::WebLocalFrame* frame,
|
||||
const blink::WebURLError& error) override;
|
||||
void DidFinishLoad(blink::WebLocalFrame* frame) override;
|
||||
void DidStartProvisionalLoad(blink::WebLocalFrame* frame) override;
|
||||
void DidFailProvisionalLoad(blink::WebLocalFrame* frame,
|
||||
const blink::WebURLError& error) override;
|
||||
void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
|
||||
bool is_new_navigation) override;
|
||||
void FrameDetached(blink::WebFrame* frame) override;
|
||||
void FocusedNodeChanged(const blink::WebNode& node) override;
|
||||
void DraggableRegionsChanged(blink::WebFrame* frame) override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
// Forwarded from CefRenderFrameObserver.
|
||||
void DidFinishLoad(blink::WebLocalFrame* frame);
|
||||
void DidStartProvisionalLoad(blink::WebLocalFrame* frame);
|
||||
void FrameDetached(blink::WebFrame* frame);
|
||||
void FocusedNodeChanged(const blink::WebNode& node);
|
||||
|
||||
private:
|
||||
// RenderViewObserver::OnMessageReceived message handlers.
|
||||
void OnRequest(const Cef_Request_Params& params);
|
||||
void OnResponse(const Cef_Response_Params& params);
|
||||
|
@ -81,6 +81,7 @@
|
||||
#include "printing/print_settings.h"
|
||||
#include "third_party/WebKit/public/platform/URLConversion.h"
|
||||
#include "third_party/WebKit/public/platform/WebPrerenderingSupport.h"
|
||||
#include "third_party/WebKit/public/platform/WebRuntimeFeatures.h"
|
||||
#include "third_party/WebKit/public/platform/WebString.h"
|
||||
#include "third_party/WebKit/public/platform/WebURL.h"
|
||||
#include "third_party/WebKit/public/web/WebConsoleMessage.h"
|
||||
@ -88,7 +89,6 @@
|
||||
#include "third_party/WebKit/public/web/WebFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebPrerendererClient.h"
|
||||
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
|
||||
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
||||
#include "third_party/WebKit/public/web/WebView.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@ -407,13 +407,6 @@ void CefContentRendererClient::RenderThreadStarted() {
|
||||
|
||||
blink::WebPrerenderingSupport::Initialize(new CefPrerenderingSupport());
|
||||
|
||||
// Retrieve the new render thread information synchronously.
|
||||
CefProcessHostMsg_GetNewRenderThreadInfo_Params params;
|
||||
thread->Send(new CefProcessHostMsg_GetNewRenderThreadInfo(¶ms));
|
||||
|
||||
// Cross-origin entries need to be added after WebKit is initialized.
|
||||
cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
{
|
||||
base::ScopedCFTypeRef<CFStringRef> key(
|
||||
@ -438,6 +431,17 @@ void CefContentRendererClient::RenderThreadStarted() {
|
||||
|
||||
if (extensions::ExtensionsEnabled())
|
||||
extensions_renderer_client_->RenderThreadStarted();
|
||||
}
|
||||
|
||||
void CefContentRendererClient::RenderThreadConnected() {
|
||||
content::RenderThread* thread = content::RenderThread::Get();
|
||||
|
||||
// Retrieve the new render thread information synchronously.
|
||||
CefProcessHostMsg_GetNewRenderThreadInfo_Params params;
|
||||
thread->Send(new CefProcessHostMsg_GetNewRenderThreadInfo(¶ms));
|
||||
|
||||
// Cross-origin entries need to be added after WebKit is initialized.
|
||||
cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries;
|
||||
|
||||
// Notify the render process handler.
|
||||
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
|
||||
@ -502,7 +506,6 @@ void CefContentRendererClient::RenderViewCreated(
|
||||
|
||||
bool CefContentRendererClient::OverrideCreatePlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
blink::WebPlugin** plugin) {
|
||||
std::string orig_mime_type = params.mime_type.Utf8();
|
||||
@ -515,10 +518,11 @@ bool CefContentRendererClient::OverrideCreatePlugin(
|
||||
GURL url(params.url);
|
||||
CefViewHostMsg_GetPluginInfo_Output output;
|
||||
render_frame->Send(new CefViewHostMsg_GetPluginInfo(
|
||||
render_frame->GetRoutingID(), url, render_frame->IsMainFrame(),
|
||||
frame->Top()->GetSecurityOrigin(), orig_mime_type, &output));
|
||||
|
||||
*plugin = CreatePlugin(render_frame, frame, params, output);
|
||||
render_frame->GetRoutingID(), url,
|
||||
render_frame->GetWebFrame()->Parent() == nullptr,
|
||||
render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), orig_mime_type,
|
||||
&output));
|
||||
*plugin = CreatePlugin(render_frame, params, output);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -668,7 +672,6 @@ void CefContentRendererClient::WillDestroyCurrentMessageLoop() {
|
||||
// static
|
||||
blink::WebPlugin* CefContentRendererClient::CreatePlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& original_params,
|
||||
const CefViewHostMsg_GetPluginInfo_Output& output) {
|
||||
const content::WebPluginInfo& info = output.plugin;
|
||||
@ -686,15 +689,15 @@ blink::WebPlugin* CefContentRendererClient::CreatePlugin(
|
||||
if (status == CefViewHostMsg_GetPluginInfo_Status::kNotFound ||
|
||||
orig_mime_type == content::kBrowserPluginMimeType) {
|
||||
placeholder = CefPluginPlaceholder::CreateLoadableMissingPlugin(
|
||||
render_frame, frame, original_params);
|
||||
render_frame, original_params);
|
||||
} else {
|
||||
// TODO(bauerb): This should be in content/.
|
||||
blink::WebPluginParams params(original_params);
|
||||
for (size_t i = 0; i < info.mime_types.size(); ++i) {
|
||||
if (info.mime_types[i].mime_type == actual_mime_type) {
|
||||
AppendParams(info.mime_types[i].additional_param_names,
|
||||
info.mime_types[i].additional_param_values,
|
||||
¶ms.attribute_names, ¶ms.attribute_values);
|
||||
for (const auto& mime_type : info.mime_types) {
|
||||
if (mime_type.mime_type == actual_mime_type) {
|
||||
AppendParams(mime_type.additional_param_names,
|
||||
mime_type.additional_param_values, ¶ms.attribute_names,
|
||||
¶ms.attribute_values);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -706,13 +709,14 @@ blink::WebPlugin* CefContentRendererClient::CreatePlugin(
|
||||
params.mime_type = blink::WebString::FromUTF8(actual_mime_type);
|
||||
}
|
||||
|
||||
auto create_blocked_plugin =
|
||||
[&render_frame, &frame, ¶ms, &info, &identifier, &group_name](
|
||||
int template_id, const base::string16& message) {
|
||||
return CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
render_frame, frame, params, info, identifier, group_name,
|
||||
template_id, message, PowerSaverInfo());
|
||||
};
|
||||
auto create_blocked_plugin = [&render_frame, ¶ms, &info, &identifier,
|
||||
&group_name](int template_id,
|
||||
const base::string16& message) {
|
||||
return CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
render_frame, params, info, identifier, group_name, template_id,
|
||||
message, PowerSaverInfo());
|
||||
};
|
||||
blink::WebLocalFrame* frame = render_frame->GetWebFrame();
|
||||
switch (status) {
|
||||
case CefViewHostMsg_GetPluginInfo_Status::kNotFound: {
|
||||
NOTREACHED();
|
||||
@ -735,7 +739,7 @@ blink::WebPlugin* CefContentRendererClient::CreatePlugin(
|
||||
if (power_saver_info.blocked_for_background_tab || is_prerendering ||
|
||||
!power_saver_info.poster_attribute.empty()) {
|
||||
placeholder = CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
render_frame, frame, params, info, identifier, group_name,
|
||||
render_frame, params, info, identifier, group_name,
|
||||
power_saver_info.poster_attribute.empty()
|
||||
? IDR_BLOCKED_PLUGIN_HTML
|
||||
: IDR_PLUGIN_POSTER_HTML,
|
||||
@ -752,13 +756,12 @@ blink::WebPlugin* CefContentRendererClient::CreatePlugin(
|
||||
content::RenderFrame::DONT_RECORD_DECISION);
|
||||
// PluginPreroller manages its own lifetime.
|
||||
new CefPluginPreroller(
|
||||
render_frame, frame, params, info, identifier, group_name,
|
||||
render_frame, params, info, identifier, group_name,
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name),
|
||||
throttler.get());
|
||||
}
|
||||
|
||||
return render_frame->CreatePlugin(frame, info, params,
|
||||
std::move(throttler));
|
||||
return render_frame->CreatePlugin(info, params, std::move(throttler));
|
||||
}
|
||||
case CefViewHostMsg_GetPluginInfo_Status::kDisabled: {
|
||||
// Intentionally using the blocked plugin resources instead of the
|
||||
|
@ -90,10 +90,10 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
||||
|
||||
// ContentRendererClient implementation.
|
||||
void RenderThreadStarted() override;
|
||||
void RenderThreadConnected() override;
|
||||
void RenderFrameCreated(content::RenderFrame* render_frame) override;
|
||||
void RenderViewCreated(content::RenderView* render_view) override;
|
||||
bool OverrideCreatePlugin(content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
blink::WebPlugin** plugin) override;
|
||||
bool HandleNavigation(content::RenderFrame* render_frame,
|
||||
@ -133,7 +133,6 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
||||
|
||||
static blink::WebPlugin* CreatePlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
const CefViewHostMsg_GetPluginInfo_Output& output);
|
||||
|
||||
|
@ -62,22 +62,14 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame,
|
||||
// If old_url is still empty and this is an initial navigation, then this is
|
||||
// a window.open operation. We should look at the opener URL. Note that the
|
||||
// opener is a local frame in this case.
|
||||
if (is_initial_navigation && old_url.is_empty() && frame->Opener() &&
|
||||
frame->Opener()->IsWebLocalFrame()) {
|
||||
if (is_initial_navigation && old_url.is_empty() && frame->Opener()) {
|
||||
blink::WebLocalFrame* opener_frame = frame->Opener()->ToWebLocalFrame();
|
||||
|
||||
// We usually want to compare against the URL that determines the type of
|
||||
// process. In default Chrome, that's the URL of the opener's top frame and
|
||||
// not the opener frame itself. In --site-per-process, we can use the
|
||||
// opener frame itself.
|
||||
// TODO(nick): Either wire this up to SiteIsolationPolicy, or to state on
|
||||
// |opener_frame|/its ancestors.
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
::switches::kSitePerProcess) ||
|
||||
extensions::IsIsolateExtensionsEnabled())
|
||||
old_url = opener_frame->GetDocument().Url();
|
||||
else
|
||||
old_url = opener_frame->Top()->GetDocument().Url();
|
||||
// We want to compare against the URL that determines the type of
|
||||
// process. Use the URL of the opener's local frame root, which will
|
||||
// correctly handle any site isolation modes (e.g. --site-per-process).
|
||||
blink::WebLocalFrame* local_root = opener_frame->LocalRoot();
|
||||
old_url = local_root->GetDocument().Url();
|
||||
|
||||
// If we're about to open a normal web page from a same-origin opener stuck
|
||||
// in an extension process (other than the Chrome Web Store), we want to
|
||||
@ -88,7 +80,7 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame,
|
||||
bool opener_is_extension_url =
|
||||
!opener_origin.IsUnique() && extension_registry->GetExtensionOrAppByURL(
|
||||
opener_document.Url()) != nullptr;
|
||||
const extensions::Extension* opener_top_extension =
|
||||
const Extension* opener_top_extension =
|
||||
extension_registry->GetExtensionOrAppByURL(old_url);
|
||||
bool opener_is_web_store =
|
||||
opener_top_extension &&
|
||||
|
@ -48,14 +48,10 @@ const CefPluginPlaceholder* g_last_active_menu = NULL;
|
||||
gin::WrapperInfo CefPluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin};
|
||||
|
||||
CefPluginPlaceholder::CefPluginPlaceholder(content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
const std::string& html_data,
|
||||
const base::string16& title)
|
||||
: plugins::LoadablePluginPlaceholder(render_frame,
|
||||
frame,
|
||||
params,
|
||||
html_data),
|
||||
: plugins::LoadablePluginPlaceholder(render_frame, params, html_data),
|
||||
status_(CefViewHostMsg_GetPluginInfo_Status::kAllowed),
|
||||
title_(title),
|
||||
context_menu_request_id_(0),
|
||||
@ -72,7 +68,6 @@ CefPluginPlaceholder::~CefPluginPlaceholder() {
|
||||
// static
|
||||
CefPluginPlaceholder* CefPluginPlaceholder::CreateLoadableMissingPlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params) {
|
||||
const base::StringPiece template_html(
|
||||
ResourceBundle::GetSharedInstance().GetRawDataResource(
|
||||
@ -85,14 +80,13 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateLoadableMissingPlugin(
|
||||
std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
|
||||
|
||||
// Will destroy itself when its WebViewPlugin is going away.
|
||||
return new CefPluginPlaceholder(render_frame, frame, params, html_data,
|
||||
return new CefPluginPlaceholder(render_frame, params, html_data,
|
||||
params.mime_type.Utf16());
|
||||
}
|
||||
|
||||
// static
|
||||
CefPluginPlaceholder* CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
const content::WebPluginInfo& info,
|
||||
const std::string& identifier,
|
||||
@ -106,8 +100,8 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
values.SetString("hide", l10n_util::GetStringUTF8(IDS_PLUGIN_HIDE));
|
||||
values.SetString(
|
||||
"pluginType",
|
||||
frame->View()->MainFrame()->IsWebLocalFrame() &&
|
||||
frame->View()->MainFrame()->GetDocument().IsPluginDocument()
|
||||
render_frame->IsMainFrame() &&
|
||||
render_frame->GetWebFrame()->GetDocument().IsPluginDocument()
|
||||
? "document"
|
||||
: "embedded");
|
||||
|
||||
@ -116,8 +110,8 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
values.SetString("baseurl", power_saver_info.base_url.spec());
|
||||
|
||||
if (!power_saver_info.custom_poster_size.IsEmpty()) {
|
||||
float zoom_factor =
|
||||
blink::WebView::ZoomLevelToZoomFactor(frame->View()->ZoomLevel());
|
||||
float zoom_factor = blink::WebView::ZoomLevelToZoomFactor(
|
||||
render_frame->GetWebFrame()->View()->ZoomLevel());
|
||||
int width =
|
||||
roundf(power_saver_info.custom_poster_size.width() / zoom_factor);
|
||||
int height =
|
||||
@ -136,7 +130,7 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
|
||||
// |blocked_plugin| will destroy itself when its WebViewPlugin is going away.
|
||||
CefPluginPlaceholder* blocked_plugin =
|
||||
new CefPluginPlaceholder(render_frame, frame, params, html_data, name);
|
||||
new CefPluginPlaceholder(render_frame, params, html_data, name);
|
||||
|
||||
if (!power_saver_info.poster_attribute.empty())
|
||||
blocked_plugin->BlockForPowerSaverPoster();
|
||||
@ -172,22 +166,22 @@ void CefPluginPlaceholder::ShowPermissionBubbleCallback() {
|
||||
}
|
||||
|
||||
void CefPluginPlaceholder::PluginListChanged() {
|
||||
if (!GetFrame() || !plugin())
|
||||
if (!render_frame() || !plugin())
|
||||
return;
|
||||
blink::WebDocument document = GetFrame()->Top()->GetDocument();
|
||||
blink::WebLocalFrame* web_frame = render_frame()->GetWebFrame();
|
||||
blink::WebDocument document = web_frame->Top()->GetDocument();
|
||||
if (document.IsNull())
|
||||
return;
|
||||
|
||||
CefViewHostMsg_GetPluginInfo_Output output;
|
||||
std::string mime_type(GetPluginParams().mime_type.Utf8());
|
||||
render_frame()->Send(new CefViewHostMsg_GetPluginInfo(
|
||||
routing_id(), GURL(GetPluginParams().url),
|
||||
GetFrame()->Parent() == nullptr, GetFrame()->Top()->GetSecurityOrigin(),
|
||||
mime_type, &output));
|
||||
routing_id(), GURL(GetPluginParams().url), web_frame->Parent() == nullptr,
|
||||
web_frame->Top()->GetSecurityOrigin(), mime_type, &output));
|
||||
if (output.status == status_)
|
||||
return;
|
||||
blink::WebPlugin* new_plugin = CefContentRendererClient::CreatePlugin(
|
||||
render_frame(), GetFrame(), GetPluginParams(), output);
|
||||
render_frame(), GetPluginParams(), output);
|
||||
ReplacePlugin(new_plugin);
|
||||
}
|
||||
|
||||
@ -225,6 +219,8 @@ v8::Local<v8::Value> CefPluginPlaceholder::GetV8Handle(v8::Isolate* isolate) {
|
||||
void CefPluginPlaceholder::ShowContextMenu(const blink::WebMouseEvent& event) {
|
||||
if (context_menu_request_id_)
|
||||
return; // Don't allow nested context menu requests.
|
||||
if (!render_frame())
|
||||
return;
|
||||
|
||||
content::ContextMenuParams params;
|
||||
|
||||
@ -250,8 +246,8 @@ void CefPluginPlaceholder::ShowContextMenu(const blink::WebMouseEvent& event) {
|
||||
content::MenuItem hide_item;
|
||||
hide_item.action = chrome::MENU_COMMAND_PLUGIN_HIDE;
|
||||
bool is_main_frame_plugin_document =
|
||||
GetFrame()->View()->MainFrame()->IsWebLocalFrame() &&
|
||||
GetFrame()->View()->MainFrame()->GetDocument().IsPluginDocument();
|
||||
render_frame()->IsMainFrame() &&
|
||||
render_frame()->GetWebFrame()->GetDocument().IsPluginDocument();
|
||||
hide_item.enabled = !is_main_frame_plugin_document;
|
||||
hide_item.label = l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLUGIN_HIDE);
|
||||
params.custom_items.push_back(hide_item);
|
||||
@ -276,16 +272,16 @@ blink::WebPlugin* CefPluginPlaceholder::CreatePlugin() {
|
||||
content::RenderFrame::DONT_RECORD_DECISION);
|
||||
// PluginPreroller manages its own lifetime.
|
||||
new CefPluginPreroller(
|
||||
render_frame(), GetFrame(), GetPluginParams(), GetPluginInfo(),
|
||||
GetIdentifier(), title_,
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, title_),
|
||||
render_frame(), GetPluginParams(), GetPluginInfo(), GetIdentifier(),
|
||||
title_, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, title_),
|
||||
throttler.get());
|
||||
}
|
||||
return render_frame()->CreatePlugin(GetFrame(), GetPluginInfo(),
|
||||
GetPluginParams(), std::move(throttler));
|
||||
return render_frame()->CreatePlugin(GetPluginInfo(), GetPluginParams(),
|
||||
std::move(throttler));
|
||||
}
|
||||
|
||||
void CefPluginPlaceholder::OnBlockedTinyContent() {
|
||||
DCHECK(render_frame());
|
||||
if (did_send_blocked_content_notification_)
|
||||
return;
|
||||
did_send_blocked_content_notification_ = true;
|
||||
|
@ -24,7 +24,6 @@ class CefPluginPlaceholder final : public plugins::LoadablePluginPlaceholder,
|
||||
|
||||
static CefPluginPlaceholder* CreateBlockedPlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
const content::WebPluginInfo& info,
|
||||
const std::string& identifier,
|
||||
@ -36,14 +35,12 @@ class CefPluginPlaceholder final : public plugins::LoadablePluginPlaceholder,
|
||||
// Creates a new WebViewPlugin with a MissingPlugin as a delegate.
|
||||
static CefPluginPlaceholder* CreateLoadableMissingPlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params);
|
||||
|
||||
void SetStatus(CefViewHostMsg_GetPluginInfo_Status status);
|
||||
|
||||
private:
|
||||
CefPluginPlaceholder(content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
const std::string& html_data,
|
||||
const base::string16& title);
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
CefPluginPreroller::CefPluginPreroller(
|
||||
content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
const content::WebPluginInfo& info,
|
||||
const std::string& identifier,
|
||||
@ -26,7 +25,6 @@ CefPluginPreroller::CefPluginPreroller(
|
||||
const base::string16& message,
|
||||
content::PluginInstanceThrottler* throttler)
|
||||
: RenderFrameObserver(render_frame),
|
||||
frame_(frame),
|
||||
params_(params),
|
||||
info_(info),
|
||||
identifier_(identifier),
|
||||
@ -68,7 +66,7 @@ void CefPluginPreroller::OnThrottleStateChange() {
|
||||
power_saver_info.custom_poster_size = throttler_->GetSize();
|
||||
|
||||
CefPluginPlaceholder* placeholder = CefPluginPlaceholder::CreateBlockedPlugin(
|
||||
render_frame(), frame_, params_, info_, identifier_, name_,
|
||||
render_frame(), params_, info_, identifier_, name_,
|
||||
IDR_PLUGIN_POSTER_HTML, message_, power_saver_info);
|
||||
placeholder->SetPremadePlugin(throttler_);
|
||||
placeholder->set_power_saver_enabled(true);
|
||||
|
@ -12,10 +12,6 @@
|
||||
#include "third_party/WebKit/public/web/WebPluginParams.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace blink {
|
||||
class WebLocalFrame;
|
||||
}
|
||||
|
||||
class SkBitmap;
|
||||
|
||||
// This class manages a plugin briefly for the purposes of keyframe extraction.
|
||||
@ -25,9 +21,8 @@ class SkBitmap;
|
||||
class CefPluginPreroller : public content::PluginInstanceThrottler::Observer,
|
||||
public content::RenderFrameObserver {
|
||||
public:
|
||||
// Does not take ownership of either |plugin| or |throttler|.
|
||||
// Does not take ownership of |render_frame| or |throttler|.
|
||||
CefPluginPreroller(content::RenderFrame* render_frame,
|
||||
blink::WebLocalFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
const content::WebPluginInfo& info,
|
||||
const std::string& identifier,
|
||||
@ -46,7 +41,6 @@ class CefPluginPreroller : public content::PluginInstanceThrottler::Observer,
|
||||
// content::RenderFrameObserver implementation.
|
||||
void OnDestruct() override;
|
||||
|
||||
blink::WebLocalFrame* frame_;
|
||||
blink::WebPluginParams params_;
|
||||
content::WebPluginInfo info_;
|
||||
std::string identifier_;
|
||||
|
@ -16,6 +16,7 @@ MSVC_POP_WARNING();
|
||||
|
||||
#include "libcef/renderer/render_frame_observer.h"
|
||||
|
||||
#include "libcef/common/cef_messages.h"
|
||||
#include "libcef/common/content_client.h"
|
||||
#include "libcef/renderer/content_renderer_client.h"
|
||||
#include "libcef/renderer/v8_impl.h"
|
||||
@ -30,11 +31,55 @@ CefRenderFrameObserver::CefRenderFrameObserver(
|
||||
|
||||
CefRenderFrameObserver::~CefRenderFrameObserver() {}
|
||||
|
||||
void CefRenderFrameObserver::DidStartProvisionalLoad(
|
||||
blink::WebDataSource* data_source) {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (!browserPtr.get())
|
||||
return;
|
||||
|
||||
browserPtr->DidStartProvisionalLoad(frame);
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::DidFinishLoad() {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (!browserPtr.get())
|
||||
return;
|
||||
|
||||
browserPtr->DidFinishLoad(frame);
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::FrameDetached() {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (!browserPtr.get())
|
||||
return;
|
||||
|
||||
browserPtr->FrameDetached(frame);
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::FrameFocused() {
|
||||
Send(new CefHostMsg_FrameFocused(render_frame()->GetRoutingID()));
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::FocusedNodeChanged(const blink::WebNode& node) {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (!browserPtr.get())
|
||||
return;
|
||||
|
||||
browserPtr->FocusedNodeChanged(node);
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::DidCreateScriptContext(
|
||||
v8::Handle<v8::Context> context,
|
||||
int world_id) {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (!browserPtr.get())
|
||||
@ -64,7 +109,6 @@ void CefRenderFrameObserver::WillReleaseScriptContext(
|
||||
v8::Handle<v8::Context> context,
|
||||
int world_id) {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (browserPtr.get()) {
|
||||
|
@ -16,6 +16,12 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
|
||||
explicit CefRenderFrameObserver(content::RenderFrame* render_frame);
|
||||
~CefRenderFrameObserver() override;
|
||||
|
||||
// RenderFrameObserver methods:
|
||||
void DidStartProvisionalLoad(blink::WebDataSource* data_source) override;
|
||||
void DidFinishLoad() override;
|
||||
void FrameDetached() override;
|
||||
void FrameFocused() override;
|
||||
void FocusedNodeChanged(const blink::WebNode& node) override;
|
||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||
int world_id) override;
|
||||
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
|
||||
|
@ -10,9 +10,12 @@
|
||||
#include "libcef/renderer/content_renderer_client.h"
|
||||
|
||||
#include "components/visitedlink/renderer/visitedlink_slave.h"
|
||||
#include "content/public/child/child_thread.h"
|
||||
#include "content/public/common/service_manager_connection.h"
|
||||
#include "content/public/common/simple_connection_filter.h"
|
||||
#include "content/public/renderer/render_thread.h"
|
||||
#include "net/base/net_module.h"
|
||||
#include "services/service_manager/public/cpp/interface_registry.h"
|
||||
#include "services/service_manager/public/cpp/binder_registry.h"
|
||||
#include "third_party/WebKit/public/platform/WebString.h"
|
||||
#include "third_party/WebKit/public/platform/WebURL.h"
|
||||
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
||||
@ -23,9 +26,15 @@ CefRenderThreadObserver::CefRenderThreadObserver()
|
||||
: visited_link_slave_(new visitedlink::VisitedLinkSlave) {
|
||||
net::NetModule::SetResourceProvider(NetResourceProvider);
|
||||
|
||||
content::RenderThread* thread = content::RenderThread::Get();
|
||||
thread->GetInterfaceRegistry()->AddInterface(
|
||||
visited_link_slave_->GetBindCallback());
|
||||
auto registry = base::MakeUnique<service_manager::BinderRegistry>();
|
||||
registry->AddInterface(visited_link_slave_->GetBindCallback(),
|
||||
base::ThreadTaskRunnerHandle::Get());
|
||||
if (content::ChildThread::Get()) {
|
||||
content::ChildThread::Get()
|
||||
->GetServiceManagerConnection()
|
||||
->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>(
|
||||
std::move(registry)));
|
||||
}
|
||||
}
|
||||
|
||||
CefRenderThreadObserver::~CefRenderThreadObserver() {}
|
||||
|
@ -44,12 +44,14 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
|
||||
void DidDownloadData(int dataLength, int encodedDataLength) override;
|
||||
void DidReceiveData(const char* data, int dataLength) override;
|
||||
void DidReceiveCachedMetadata(const char* data, int dataLength) override;
|
||||
void DidFinishLoading(double finishTime,
|
||||
int64_t totalEncodedDataLength,
|
||||
int64_t totalEncodedBodyLength) override;
|
||||
void DidFail(const WebURLError& error,
|
||||
int64_t totalEncodedDataLength,
|
||||
int64_t totalEncodedBodyLength) override;
|
||||
void DidFinishLoading(double finish_time,
|
||||
int64_t total_encoded_data_length,
|
||||
int64_t total_encoded_body_length,
|
||||
int64_t total_decoded_body_length) override;
|
||||
void DidFail(const WebURLError&,
|
||||
int64_t total_encoded_data_length,
|
||||
int64_t total_encoded_body_length,
|
||||
int64_t total_decoded_body_length) override;
|
||||
|
||||
protected:
|
||||
// The context_ pointer will outlive this object.
|
||||
@ -92,7 +94,7 @@ class CefRenderURLRequest::Context
|
||||
if (!url.is_valid())
|
||||
return false;
|
||||
|
||||
loader_.reset(blink::Platform::Current()->CreateURLLoader());
|
||||
loader_ = blink::Platform::Current()->CreateURLLoader();
|
||||
url_client_.reset(new CefWebURLLoaderClient(this, request_->GetFlags()));
|
||||
|
||||
WebURLRequest urlRequest;
|
||||
@ -261,15 +263,18 @@ void CefWebURLLoaderClient::DidReceiveData(const char* data, int dataLength) {
|
||||
void CefWebURLLoaderClient::DidReceiveCachedMetadata(const char* data,
|
||||
int dataLength) {}
|
||||
|
||||
void CefWebURLLoaderClient::DidFinishLoading(double finishTime,
|
||||
int64_t totalEncodedDataLength,
|
||||
int64_t totalEncodedBodyLength) {
|
||||
void CefWebURLLoaderClient::DidFinishLoading(
|
||||
double finishTime,
|
||||
int64_t total_encoded_data_length,
|
||||
int64_t total_encoded_body_length,
|
||||
int64_t total_decoded_body_length) {
|
||||
context_->OnComplete();
|
||||
}
|
||||
|
||||
void CefWebURLLoaderClient::DidFail(const WebURLError& error,
|
||||
int64_t totalEncodedDataLength,
|
||||
int64_t totalEncodedBodyLength) {
|
||||
int64_t total_encoded_data_length,
|
||||
int64_t total_encoded_body_length,
|
||||
int64_t total_decoded_body_length) {
|
||||
context_->OnError(error);
|
||||
}
|
||||
|
||||
|
@ -26,13 +26,13 @@ MSVC_PUSH_WARNING_LEVEL(0);
|
||||
|
||||
#include "third_party/WebKit/Source/bindings/core/v8/ScriptController.h"
|
||||
#include "third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h"
|
||||
#include "third_party/WebKit/Source/bindings/core/v8/V8Binding.h"
|
||||
#include "third_party/WebKit/Source/core/dom/Document.h"
|
||||
#include "third_party/WebKit/Source/core/dom/Element.h"
|
||||
#include "third_party/WebKit/Source/core/dom/Node.h"
|
||||
#include "third_party/WebKit/Source/core/editing/serializers/Serialization.h"
|
||||
#include "third_party/WebKit/Source/core/frame/LocalFrame.h"
|
||||
#include "third_party/WebKit/Source/core/frame/Settings.h"
|
||||
#include "third_party/WebKit/Source/platform/bindings/V8Binding.h"
|
||||
#include "third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h"
|
||||
#include "third_party/WebKit/Source/web/WebLocalFrameImpl.h"
|
||||
#include "third_party/WebKit/Source/web/WebViewImpl.h"
|
||||
@ -200,25 +200,23 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||
v8::MaybeLocal<v8::Value> result;
|
||||
|
||||
blink::LocalFrame* frame = blink::ToLocalFrameIfNotDetached(context);
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return result;
|
||||
|
||||
if (frame) {
|
||||
blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault);
|
||||
if (frame && frame->GetSettings())
|
||||
v8CacheOptions = frame->GetSettings()->GetV8CacheOptions();
|
||||
blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault);
|
||||
if (frame && frame->GetSettings())
|
||||
v8CacheOptions = frame->GetSettings()->GetV8CacheOptions();
|
||||
|
||||
v8::Local<v8::Script> script;
|
||||
if (!blink::V8Call(blink::V8ScriptRunner::CompileScript(
|
||||
ssc, isolate, accessControlStatus, v8CacheOptions),
|
||||
script, tryCatch)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = blink::V8ScriptRunner::RunCompiledScript(
|
||||
isolate, script, blink::ToExecutionContext(context));
|
||||
v8::Local<v8::Script> script;
|
||||
if (!blink::V8ScriptRunner::CompileScript(ssc, isolate, accessControlStatus,
|
||||
v8CacheOptions)
|
||||
.ToLocal(&script)) {
|
||||
DCHECK(tryCatch.HasCaught());
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
return blink::V8ScriptRunner::RunCompiledScript(
|
||||
isolate, script, blink::ToExecutionContext(context));
|
||||
}
|
||||
|
||||
bool IsScriptForbidden() {
|
||||
|
@ -10,9 +10,14 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/common/chrome_utility_messages.h"
|
||||
#include "chrome/utility/utility_message_handler.h"
|
||||
#include "components/printing/service/public/cpp/pdf_compositor_service_factory.h"
|
||||
#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
|
||||
#include "content/public/child/child_thread.h"
|
||||
#include "content/public/common/service_manager_connection.h"
|
||||
#include "content/public/common/simple_connection_filter.h"
|
||||
#include "mojo/public/cpp/bindings/strong_binding.h"
|
||||
#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
|
||||
#include "services/service_manager/public/cpp/interface_registry.h"
|
||||
#include "services/service_manager/public/cpp/binder_registry.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "chrome/utility/printing_handler.h"
|
||||
@ -21,6 +26,7 @@
|
||||
namespace {
|
||||
|
||||
void CreateProxyResolverFactory(
|
||||
const service_manager::BindSourceInfo& source_info,
|
||||
net::interfaces::ProxyResolverFactoryRequest request) {
|
||||
mojo::MakeStrongBinding(base::MakeUnique<net::MojoProxyResolverFactoryImpl>(),
|
||||
std::move(request));
|
||||
@ -36,6 +42,25 @@ CefContentUtilityClient::CefContentUtilityClient() {
|
||||
|
||||
CefContentUtilityClient::~CefContentUtilityClient() {}
|
||||
|
||||
void CefContentUtilityClient::UtilityThreadStarted() {
|
||||
content::ServiceManagerConnection* connection =
|
||||
content::ChildThread::Get()->GetServiceManagerConnection();
|
||||
|
||||
// NOTE: Some utility process instances are not connected to the Service
|
||||
// Manager. Nothing left to do in that case.
|
||||
if (!connection)
|
||||
return;
|
||||
|
||||
auto registry = base::MakeUnique<service_manager::BinderRegistry>();
|
||||
|
||||
registry->AddInterface<net::interfaces::ProxyResolverFactory>(
|
||||
base::Bind(CreateProxyResolverFactory),
|
||||
base::ThreadTaskRunnerHandle::Get());
|
||||
|
||||
connection->AddConnectionFilter(
|
||||
base::MakeUnique<content::SimpleConnectionFilter>(std::move(registry)));
|
||||
}
|
||||
|
||||
bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) {
|
||||
bool handled = false;
|
||||
|
||||
@ -47,8 +72,9 @@ bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) {
|
||||
return handled;
|
||||
}
|
||||
|
||||
void CefContentUtilityClient::ExposeInterfacesToBrowser(
|
||||
service_manager::InterfaceRegistry* registry) {
|
||||
registry->AddInterface<net::interfaces::ProxyResolverFactory>(
|
||||
base::Bind(CreateProxyResolverFactory));
|
||||
void CefContentUtilityClient::RegisterServices(StaticServiceMap* services) {
|
||||
content::ServiceInfo pdf_compositor_info;
|
||||
pdf_compositor_info.factory =
|
||||
base::Bind(&printing::CreatePdfCompositorService, std::string());
|
||||
services->emplace(printing::mojom::kServiceName, pdf_compositor_info);
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ class CefContentUtilityClient : public content::ContentUtilityClient {
|
||||
CefContentUtilityClient();
|
||||
~CefContentUtilityClient() override;
|
||||
|
||||
void UtilityThreadStarted() override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
void ExposeInterfacesToBrowser(
|
||||
service_manager::InterfaceRegistry* registry) override;
|
||||
void RegisterServices(StaticServiceMap* services) override;
|
||||
|
||||
private:
|
||||
typedef ScopedVector<UtilityMessageHandler> Handlers;
|
||||
|
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=1713327e819a8a3e44808a4415926326886efdf7$
|
||||
// $hash=2ff7a51013987b111a12b700a0e018eb0bb08edc$
|
||||
//
|
||||
|
||||
#include "include/capi/cef_app_capi.h"
|
||||
@ -26,6 +26,7 @@
|
||||
#include "include/capi/cef_trace_capi.h"
|
||||
#include "include/capi/cef_v8_capi.h"
|
||||
#include "include/capi/cef_web_plugin_capi.h"
|
||||
#include "include/capi/test/cef_test_helpers_capi.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_crash_util.h"
|
||||
#include "include/cef_file_util.h"
|
||||
@ -40,6 +41,7 @@
|
||||
#include "include/cef_trace.h"
|
||||
#include "include/cef_v8.h"
|
||||
#include "include/cef_web_plugin.h"
|
||||
#include "include/test/cef_test_helpers.h"
|
||||
#include "libcef_dll/cpptoc/auth_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/before_download_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
|
||||
@ -1180,3 +1182,19 @@ CEF_EXPORT void cef_register_widevine_cdm(
|
||||
CefRegisterWidevineCdm(CefString(path),
|
||||
CefRegisterCdmCallbackCToCpp::Wrap(callback));
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_execute_java_script_with_user_gesture_for_tests(
|
||||
struct _cef_frame_t* frame,
|
||||
const cef_string_t* javascript) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: frame; type: refptr_same
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return;
|
||||
// Unverified params: javascript
|
||||
|
||||
// Execute
|
||||
CefExecuteJavaScriptWithUserGestureForTests(CefFrameCppToC::Unwrap(frame),
|
||||
CefString(javascript));
|
||||
}
|
||||
|
@ -2,11 +2,11 @@
|
||||
// 2011 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.
|
||||
|
||||
#include "include/cef_sandbox_win.h"
|
||||
|
||||
#include "sandbox/win/src/process_mitigations.h"
|
||||
#include "sandbox/win/src/sandbox_factory.h"
|
||||
|
||||
#include "include/cef_sandbox_win.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// From content/app/startup_helper_win.cc:
|
||||
|
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=62ad3894d1548a39b032798d25a7a9b157f8a7bc$
|
||||
// $hash=da690070ed610a81d9f5dcab623ca7822dbd0ac1$
|
||||
//
|
||||
|
||||
#include "include/capi/cef_app_capi.h"
|
||||
@ -26,6 +26,7 @@
|
||||
#include "include/capi/cef_trace_capi.h"
|
||||
#include "include/capi/cef_v8_capi.h"
|
||||
#include "include/capi/cef_web_plugin_capi.h"
|
||||
#include "include/capi/test/cef_test_helpers_capi.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_crash_util.h"
|
||||
#include "include/cef_file_util.h"
|
||||
@ -41,6 +42,7 @@
|
||||
#include "include/cef_v8.h"
|
||||
#include "include/cef_version.h"
|
||||
#include "include/cef_web_plugin.h"
|
||||
#include "include/test/cef_test_helpers.h"
|
||||
#include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/app_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
|
||||
@ -1102,3 +1104,19 @@ CEF_GLOBAL void CefRegisterWidevineCdm(
|
||||
cef_register_widevine_cdm(path.GetStruct(),
|
||||
CefRegisterCdmCallbackCppToC::Wrap(callback));
|
||||
}
|
||||
|
||||
CEF_GLOBAL void CefExecuteJavaScriptWithUserGestureForTests(
|
||||
CefRefPtr<CefFrame> frame,
|
||||
const CefString& javascript) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: frame; type: refptr_same
|
||||
DCHECK(frame.get());
|
||||
if (!frame.get())
|
||||
return;
|
||||
// Unverified params: javascript
|
||||
|
||||
// Execute
|
||||
cef_execute_java_script_with_user_gesture_for_tests(
|
||||
CefFrameCToCpp::Unwrap(frame), javascript.GetStruct());
|
||||
}
|
||||
|
@ -39,9 +39,6 @@ patches = [
|
||||
'name': 'zlib',
|
||||
},
|
||||
{
|
||||
# Avoid MessageLoop assertion on OS X.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/443
|
||||
#
|
||||
# Revert change on Windows that removes MessageLoop::os_modal_loop().
|
||||
# https://codereview.chromium.org/1992243003
|
||||
'name': 'message_loop_443_1992243003',
|
||||
@ -72,9 +69,6 @@ patches = [
|
||||
#
|
||||
# Support creation of captionless windows with resizable borders.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1749
|
||||
#
|
||||
# Remove console spam from RenderWidgetHostViewBase::IsInVR.
|
||||
# https://codereview.chromium.org/2822223002
|
||||
'name': 'views_widget_180_1481_1565_1677_1749',
|
||||
},
|
||||
{
|
||||
@ -160,11 +154,6 @@ patches = [
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1710
|
||||
'name': 'supports_user_data_1710',
|
||||
},
|
||||
{
|
||||
# Fix background color on Mac.
|
||||
# https://codereview.chromium.org/1070383005 (reverted)
|
||||
'name': 'render_widget_host_1070383005',
|
||||
},
|
||||
{
|
||||
# Fix missing check for defined(ENABLE_THEMES) in
|
||||
# renderer_preferences_util.cc on Linux.
|
||||
@ -201,10 +190,14 @@ patches = [
|
||||
# Reverts ink_drop_host_view.h changes from
|
||||
# https://codereview.chromium.org/2723843002
|
||||
#
|
||||
# Make LabelButton::SetFontList method public.
|
||||
# Reverts label_button.h changes from
|
||||
# https://codereview.chromium.org/2793283002
|
||||
'name': 'views_1749',
|
||||
# Add LabelButton::SetFontList method.
|
||||
# Reverts label_button.[cc|h] changes from
|
||||
# https://codereview.chromium.org/2801583002
|
||||
#
|
||||
# Expose callbacks for mouse/keyboard events that trigger menu switching.
|
||||
# Add accelerator display support to Label.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2102
|
||||
'name': 'views_1749_2102',
|
||||
},
|
||||
{
|
||||
# Expose RenderViewHostImpl swapped-out state.
|
||||
@ -293,6 +286,11 @@ patches = [
|
||||
# Expose RFH via NavigationHandle for retrieval in DidFinishNavigation on
|
||||
# network error.
|
||||
# https://groups.google.com/a/chromium.org/d/msg/chromium-dev/6iAQPx_hwh8/gaTR5f1GAQAJ
|
||||
#
|
||||
# Add ContentRendererClient::RenderThreadConnected to fix sync IPC issue.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=728195
|
||||
#
|
||||
# Add RenderFrameObserver::FrameFocused method.
|
||||
'name': 'content_1129_2015',
|
||||
},
|
||||
{
|
||||
@ -301,19 +299,8 @@ patches = [
|
||||
'name': 'webkit_plugin_info_2015',
|
||||
},
|
||||
{
|
||||
# Expose callbacks for mouse/keyboard events that trigger menu switching.
|
||||
# Add accelerator display support to Label.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2102
|
||||
'name': 'views_menu_2102',
|
||||
},
|
||||
{
|
||||
# Mac: Fix build error when including openssl/opensslconf.h.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=711670
|
||||
'name': 'mac_build_711670',
|
||||
},
|
||||
{
|
||||
# Linux: Fix DCHECK during GPU feature info detection.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=699278
|
||||
'name': 'gpu_feature_info_699278',
|
||||
# Windows: Fix AssertIOAllowed failure in NetworkChangeNotifier.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=721461
|
||||
'name': 'network_change_721461',
|
||||
},
|
||||
]
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
index 1c73b7f..606f29c 100644
|
||||
index 16599b1..e489af1 100644
|
||||
--- content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
+++ content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
@@ -51,9 +51,11 @@ class BrowserCompositorMac : public DelegatedFrameHostClient {
|
||||
@ -15,7 +15,7 @@ index 1c73b7f..606f29c 100644
|
||||
|
||||
void DidCreateNewRendererCompositorFrameSink(
|
||||
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
index fba983b..8cf9629 100644
|
||||
index 4121584..c821275 100644
|
||||
--- content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
@@ -202,6 +202,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
|
||||
@ -31,7 +31,7 @@ index fba983b..8cf9629 100644
|
||||
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
|
||||
if (recyclable_compositor_)
|
||||
return recyclable_compositor_->accelerated_widget_mac();
|
||||
@@ -421,8 +427,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
|
||||
@@ -420,8 +426,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
|
||||
}
|
||||
|
||||
gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git content/browser/frame_host/render_widget_host_view_guest.cc content/browser/frame_host/render_widget_host_view_guest.cc
|
||||
index fc720a7..1c30365 100644
|
||||
index b7e4883..2dfd11e 100644
|
||||
--- content/browser/frame_host/render_widget_host_view_guest.cc
|
||||
+++ content/browser/frame_host/render_widget_host_view_guest.cc
|
||||
@@ -247,13 +247,14 @@ void RenderWidgetHostViewGuest::Destroy() {
|
||||
@@ -246,13 +246,14 @@ void RenderWidgetHostViewGuest::Destroy() {
|
||||
}
|
||||
|
||||
gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
index e6baddc7..17dff91 100644
|
||||
index 1f985ec..47bf303 100644
|
||||
--- content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
+++ content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
@@ -316,14 +316,20 @@ void BrowserPluginGuest::InitInternal(
|
||||
@@ -322,14 +322,20 @@ void BrowserPluginGuest::InitInternal(
|
||||
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ index e6baddc7..17dff91 100644
|
||||
}
|
||||
|
||||
RendererPreferences* renderer_prefs =
|
||||
@@ -799,7 +805,8 @@ void BrowserPluginGuest::OnWillAttachComplete(
|
||||
@@ -805,7 +811,8 @@ void BrowserPluginGuest::OnWillAttachComplete(
|
||||
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
|
||||
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) {
|
||||
web_contents_view->CreateViewForWidget(
|
||||
@ -36,10 +36,10 @@ index e6baddc7..17dff91 100644
|
||||
}
|
||||
|
||||
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
|
||||
index d0c4ffa..6399af8 100644
|
||||
index d890e64..1965603 100644
|
||||
--- content/browser/frame_host/interstitial_page_impl.cc
|
||||
+++ content/browser/frame_host/interstitial_page_impl.cc
|
||||
@@ -598,7 +598,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
|
||||
@@ -605,7 +605,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
|
||||
WebContentsView* wcv =
|
||||
static_cast<WebContentsImpl*>(web_contents())->GetView();
|
||||
RenderWidgetHostViewBase* view =
|
||||
@ -69,7 +69,7 @@ index e4401f8..f2fdb9b 100644
|
||||
// Creates a new View that holds a popup and receives messages for it.
|
||||
virtual RenderWidgetHostViewBase* CreateViewForPopupWidget(
|
||||
diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc
|
||||
index 68481ad..4018641 100644
|
||||
index 84b906e..ec0d014 100644
|
||||
--- content/browser/web_contents/web_contents_view_aura.cc
|
||||
+++ content/browser/web_contents/web_contents_view_aura.cc
|
||||
@@ -846,7 +846,8 @@ void WebContentsViewAura::CreateView(
|
||||
@ -91,7 +91,7 @@ index 68481ad..4018641 100644
|
||||
g_create_render_widget_host_view
|
||||
? g_create_render_widget_host_view(render_widget_host,
|
||||
diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h
|
||||
index fc703087..2a1c368 100644
|
||||
index c52692e..63402a6 100644
|
||||
--- content/browser/web_contents/web_contents_view_aura.h
|
||||
+++ content/browser/web_contents/web_contents_view_aura.h
|
||||
@@ -118,7 +118,7 @@ class CONTENT_EXPORT WebContentsViewAura
|
||||
@ -198,10 +198,10 @@ index 0102d7e..b89d66c 100644
|
||||
RenderWidgetHost* render_widget_host) override;
|
||||
void SetPageTitle(const base::string16& title) override;
|
||||
diff --git content/browser/web_contents/web_contents_view_mac.h content/browser/web_contents/web_contents_view_mac.h
|
||||
index 4141b7f..921bc79 100644
|
||||
index b0a1a1d..12fce1d3 100644
|
||||
--- content/browser/web_contents/web_contents_view_mac.h
|
||||
+++ content/browser/web_contents/web_contents_view_mac.h
|
||||
@@ -90,7 +90,7 @@ class WebContentsViewMac : public WebContentsView,
|
||||
@@ -91,7 +91,7 @@ class WebContentsViewMac : public WebContentsView,
|
||||
gfx::NativeView context) override;
|
||||
RenderWidgetHostViewBase* CreateViewForWidget(
|
||||
RenderWidgetHost* render_widget_host,
|
||||
@ -211,10 +211,10 @@ index 4141b7f..921bc79 100644
|
||||
RenderWidgetHost* render_widget_host) override;
|
||||
void SetPageTitle(const base::string16& title) override;
|
||||
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
|
||||
index 2b45749..21c19b3 100644
|
||||
index ebd0ce3..64a9d85 100644
|
||||
--- content/browser/web_contents/web_contents_view_mac.mm
|
||||
+++ content/browser/web_contents/web_contents_view_mac.mm
|
||||
@@ -348,7 +348,8 @@ void WebContentsViewMac::CreateView(
|
||||
@@ -352,7 +352,8 @@ void WebContentsViewMac::CreateView(
|
||||
}
|
||||
|
||||
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@ -224,7 +224,7 @@ index 2b45749..21c19b3 100644
|
||||
if (render_widget_host->GetView()) {
|
||||
// During testing, the view will already be set up in most cases to the
|
||||
// test view, so we don't want to clobber it with a real one. To verify that
|
||||
@@ -360,6 +361,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@@ -364,6 +365,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
render_widget_host->GetView());
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ index 2b45749..21c19b3 100644
|
||||
g_create_render_widget_host_view
|
||||
? g_create_render_widget_host_view(render_widget_host,
|
||||
diff --git content/public/browser/browser_plugin_guest_delegate.h content/public/browser/browser_plugin_guest_delegate.h
|
||||
index a32205c..49f3c35 100644
|
||||
index 61662f4..6a4648f 100644
|
||||
--- content/public/browser/browser_plugin_guest_delegate.h
|
||||
+++ content/public/browser/browser_plugin_guest_delegate.h
|
||||
@@ -19,6 +19,7 @@ namespace content {
|
||||
@ -244,7 +244,7 @@ index a32205c..49f3c35 100644
|
||||
|
||||
// Objects implement this interface to get notified about changes in the guest
|
||||
// WebContents and to provide necessary functionality.
|
||||
@@ -85,6 +86,10 @@ class CONTENT_EXPORT BrowserPluginGuestDelegate {
|
||||
@@ -78,6 +79,10 @@ class CONTENT_EXPORT BrowserPluginGuestDelegate {
|
||||
// content module.
|
||||
virtual void SetGuestHost(GuestHost* guest_host) {}
|
||||
|
||||
@ -256,10 +256,10 @@ index a32205c..49f3c35 100644
|
||||
// reported from the guest renderer should be ignored. The reported value
|
||||
// from the guest renderer is incorrect in situations where BrowserPlugin is
|
||||
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
index 44793e9..77603b2 100644
|
||||
index 255217d..1571064 100644
|
||||
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
@@ -179,6 +179,8 @@ void MimeHandlerViewGuest::CreateWebContents(
|
||||
@@ -174,6 +174,8 @@ void MimeHandlerViewGuest::CreateWebContents(
|
||||
WebContents::CreateParams params(browser_context(),
|
||||
guest_site_instance.get());
|
||||
params.guest_delegate = this;
|
||||
@ -268,7 +268,7 @@ index 44793e9..77603b2 100644
|
||||
callback.Run(WebContents::Create(params));
|
||||
}
|
||||
|
||||
@@ -203,6 +205,18 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
|
||||
@@ -194,6 +196,18 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -288,11 +288,11 @@ index 44793e9..77603b2 100644
|
||||
WebContents* source,
|
||||
const content::OpenURLParams& params) {
|
||||
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
index d237318..3701bd2 100644
|
||||
index f3fb783..642342c 100644
|
||||
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
@@ -83,6 +83,10 @@ class MimeHandlerViewGuest :
|
||||
bool ShouldHandleFindRequestsForEmbedder() const final;
|
||||
@@ -87,6 +87,10 @@ class MimeHandlerViewGuest :
|
||||
void DidInitialize(const base::DictionaryValue& create_params) final;
|
||||
bool ZoomPropagatesFromEmbedderToGuest() const final;
|
||||
|
||||
+ // content::BrowserPluginGuestDelegate implementation
|
||||
@ -303,7 +303,7 @@ index d237318..3701bd2 100644
|
||||
content::WebContents* OpenURLFromTab(
|
||||
content::WebContents* source,
|
||||
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h
|
||||
index e065104d..e67ae566e 100644
|
||||
index 0928bf2..e954278 100644
|
||||
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h
|
||||
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h
|
||||
@@ -6,9 +6,9 @@
|
||||
@ -317,7 +317,7 @@ index e065104d..e67ae566e 100644
|
||||
struct ContextMenuParams;
|
||||
} // namespace content
|
||||
|
||||
@@ -22,6 +22,14 @@ class MimeHandlerViewGuestDelegate {
|
||||
@@ -20,6 +20,14 @@ class MimeHandlerViewGuestDelegate {
|
||||
MimeHandlerViewGuestDelegate() {}
|
||||
virtual ~MimeHandlerViewGuestDelegate() {}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
|
||||
index de5a0d8..59251d3 100644
|
||||
index b7429b1..a65dfbf 100644
|
||||
--- chrome/common/chrome_content_client.cc
|
||||
+++ chrome/common/chrome_content_client.cc
|
||||
@@ -82,7 +82,7 @@
|
||||
@@ -81,7 +81,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && \
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
|
||||
index 25b59f0..5d1c80f 100644
|
||||
index 409df10..e1df182 100644
|
||||
--- content/browser/compositor/gpu_process_transport_factory.cc
|
||||
+++ content/browser/compositor/gpu_process_transport_factory.cc
|
||||
@@ -217,6 +217,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
|
||||
@@ -240,6 +240,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
|
||||
std::unique_ptr<cc::SoftwareOutputDevice>
|
||||
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) {
|
||||
@ -17,7 +17,7 @@ index 25b59f0..5d1c80f 100644
|
||||
if (command_line->HasSwitch(switches::kHeadless))
|
||||
return base::WrapUnique(new cc::SoftwareOutputDevice);
|
||||
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
|
||||
index fe85a4e..e5584d2 100644
|
||||
index 54a104a..ba76d90 100644
|
||||
--- ui/compositor/compositor.h
|
||||
+++ ui/compositor/compositor.h
|
||||
@@ -18,6 +18,7 @@
|
||||
@ -28,7 +28,7 @@ index fe85a4e..e5584d2 100644
|
||||
#include "cc/surfaces/surface_sequence.h"
|
||||
#include "cc/trees/layer_tree_host_client.h"
|
||||
#include "cc/trees/layer_tree_host_single_thread_client.h"
|
||||
@@ -168,6 +169,17 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
@@ -166,6 +167,17 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
virtual void RemoveObserver(ContextFactoryObserver* observer) = 0;
|
||||
};
|
||||
|
||||
@ -46,7 +46,7 @@ index fe85a4e..e5584d2 100644
|
||||
// Compositor object to take care of GPU painting.
|
||||
// A Browser compositor object is responsible for generating the final
|
||||
// displayable form of pixels comprising a single widget's contents. It draws an
|
||||
@@ -200,6 +212,9 @@ class COMPOSITOR_EXPORT Compositor
|
||||
@@ -198,6 +210,9 @@ class COMPOSITOR_EXPORT Compositor
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
@ -56,7 +56,7 @@ index fe85a4e..e5584d2 100644
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -377,6 +392,8 @@ class COMPOSITOR_EXPORT Compositor
|
||||
@@ -381,6 +396,8 @@ class COMPOSITOR_EXPORT Compositor
|
||||
ui::ContextFactory* context_factory_;
|
||||
ui::ContextFactoryPrivate* context_factory_private_;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
|
||||
index 47820a5..520ca4cd 100644
|
||||
index ecc7952..69ef4b4 100644
|
||||
--- chrome/browser/download/download_target_determiner.cc
|
||||
+++ chrome/browser/download/download_target_determiner.cc
|
||||
@@ -475,8 +475,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
|
||||
@@ -476,8 +476,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
|
||||
content::PluginService* plugin_service =
|
||||
content::PluginService::GetInstance();
|
||||
bool plugin_found = plugin_service->GetPluginInfo(
|
||||
@ -38,7 +38,7 @@ index f8b651f..ec39f8d 100644
|
||||
content::WebPluginInfo* plugin) override;
|
||||
|
||||
diff --git chrome/browser/plugins/plugin_info_message_filter.cc chrome/browser/plugins/plugin_info_message_filter.cc
|
||||
index 09b5753..11a5f32 100644
|
||||
index 8c31c98..beef4cb 100644
|
||||
--- chrome/browser/plugins/plugin_info_message_filter.cc
|
||||
+++ chrome/browser/plugins/plugin_info_message_filter.cc
|
||||
@@ -451,8 +451,8 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
|
||||
@ -53,7 +53,7 @@ index 09b5753..11a5f32 100644
|
||||
}
|
||||
}
|
||||
diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm
|
||||
index 0ce31db0..58c4633 100644
|
||||
index fd8c993..7f70c96 100644
|
||||
--- chrome/browser/ui/cocoa/drag_util.mm
|
||||
+++ chrome/browser/ui/cocoa/drag_util.mm
|
||||
@@ -54,7 +54,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
|
||||
@ -66,10 +66,10 @@ index 0ce31db0..58c4633 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
|
||||
index c147373..2e7cb5f 100644
|
||||
index ea5764b..ae06854 100644
|
||||
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
|
||||
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
|
||||
@@ -591,6 +591,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
|
||||
@@ -585,6 +585,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
|
||||
content::PluginService::GetInstance()->GetPluginInfo(
|
||||
-1, // process ID
|
||||
MSG_ROUTING_NONE, // routing ID
|
||||
@ -78,10 +78,10 @@ index c147373..2e7cb5f 100644
|
||||
mime_type, false, NULL, &plugin, NULL));
|
||||
}
|
||||
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
|
||||
index 8dca644..d60c069 100644
|
||||
index 7563fdf..d4e0a38 100644
|
||||
--- content/browser/frame_host/navigation_handle_impl.cc
|
||||
+++ content/browser/frame_host/navigation_handle_impl.cc
|
||||
@@ -265,12 +265,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
|
||||
@@ -294,12 +294,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
|
||||
}
|
||||
|
||||
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
|
||||
@ -95,10 +95,10 @@ index 8dca644..d60c069 100644
|
||||
}
|
||||
|
||||
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
|
||||
index ccd8ee7..cc52a93 100644
|
||||
index 2bdb04d..b28722e 100644
|
||||
--- content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -814,10 +814,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
|
||||
@@ -865,10 +865,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
|
||||
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup)
|
||||
IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup)
|
||||
#endif
|
||||
@ -106,10 +106,10 @@ index ccd8ee7..cc52a93 100644
|
||||
IPC_MESSAGE_HANDLER(FrameHostMsg_NavigationHandledByEmbedder,
|
||||
OnNavigationHandledByEmbedder)
|
||||
-#endif
|
||||
IPC_MESSAGE_HANDLER(FrameHostMsg_RequestOverlayRoutingToken,
|
||||
OnRequestOverlayRoutingToken)
|
||||
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowCreatedWindow, OnShowCreatedWindow)
|
||||
IPC_END_MESSAGE_MAP()
|
||||
|
||||
@@ -1229,6 +1227,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
|
||||
@@ -1323,6 +1321,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
|
||||
if (navigation_handle_) {
|
||||
navigation_handle_->set_net_error_code(
|
||||
static_cast<net::Error>(params.error_code));
|
||||
@ -117,7 +117,7 @@ index ccd8ee7..cc52a93 100644
|
||||
}
|
||||
|
||||
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
|
||||
@@ -2425,14 +2424,12 @@ void RenderFrameHostImpl::OnHidePopup() {
|
||||
@@ -2573,14 +2572,12 @@ void RenderFrameHostImpl::OnHidePopup() {
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -130,13 +130,13 @@ index ccd8ee7..cc52a93 100644
|
||||
}
|
||||
-#endif
|
||||
|
||||
void RenderFrameHostImpl::OnShowCreatedWindow(int pending_widget_routing_id,
|
||||
WindowOpenDisposition disposition,
|
||||
void RenderFrameHostImpl::OnRequestOverlayRoutingToken() {
|
||||
// Make sure that we have a token.
|
||||
diff --git content/browser/frame_host/render_frame_host_impl.h content/browser/frame_host/render_frame_host_impl.h
|
||||
index 7d13f01..9b2d494 100644
|
||||
index 1d1de6e..bd05959 100644
|
||||
--- content/browser/frame_host/render_frame_host_impl.h
|
||||
+++ content/browser/frame_host/render_frame_host_impl.h
|
||||
@@ -783,8 +783,8 @@ class CONTENT_EXPORT RenderFrameHostImpl
|
||||
@@ -801,8 +801,8 @@ class CONTENT_EXPORT RenderFrameHostImpl
|
||||
void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params);
|
||||
void OnHidePopup();
|
||||
#endif
|
||||
@ -147,10 +147,10 @@ index 7d13f01..9b2d494 100644
|
||||
mojo::ScopedMessagePipeHandle pipe);
|
||||
#endif
|
||||
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
|
||||
index 5b8f571..958ebfb1 100644
|
||||
index bbbb37d..1fa30da 100644
|
||||
--- content/browser/frame_host/render_frame_message_filter.cc
|
||||
+++ content/browser/frame_host/render_frame_message_filter.cc
|
||||
@@ -446,6 +446,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
||||
@@ -449,6 +449,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
||||
|
||||
void RenderFrameMessageFilter::OnGetPlugins(
|
||||
bool refresh,
|
||||
@ -158,7 +158,7 @@ index 5b8f571..958ebfb1 100644
|
||||
const url::Origin& main_frame_origin,
|
||||
IPC::Message* reply_msg) {
|
||||
// Don't refresh if the specified threshold has not been passed. Note that
|
||||
@@ -467,18 +468,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
|
||||
@@ -470,18 +471,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
|
||||
|
||||
PluginServiceImpl::GetInstance()->GetPlugins(
|
||||
base::Bind(&RenderFrameMessageFilter::GetPluginsCallback, this, reply_msg,
|
||||
@ -180,7 +180,7 @@ index 5b8f571..958ebfb1 100644
|
||||
int routing_id = MSG_ROUTING_NONE;
|
||||
// In this loop, copy the WebPluginInfo (and do not use a reference) because
|
||||
// the filter might mutate it.
|
||||
@@ -487,7 +489,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
|
||||
@@ -490,7 +492,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
|
||||
if (!filter ||
|
||||
filter->IsPluginAvailable(child_process_id, routing_id,
|
||||
resource_context_, main_frame_origin.GetURL(),
|
||||
@ -189,7 +189,7 @@ index 5b8f571..958ebfb1 100644
|
||||
plugins.push_back(plugin);
|
||||
}
|
||||
}
|
||||
@@ -499,6 +501,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
|
||||
@@ -502,6 +504,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
|
||||
void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
int render_frame_id,
|
||||
const GURL& url,
|
||||
@ -197,7 +197,7 @@ index 5b8f571..958ebfb1 100644
|
||||
const url::Origin& main_frame_origin,
|
||||
const std::string& mime_type,
|
||||
bool* found,
|
||||
@@ -507,8 +510,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
@@ -510,8 +513,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
bool allow_wildcard = true;
|
||||
*found = plugin_service_->GetPluginInfo(
|
||||
render_process_id_, render_frame_id, resource_context_, url,
|
||||
@ -209,10 +209,10 @@ index 5b8f571..958ebfb1 100644
|
||||
|
||||
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
|
||||
diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h
|
||||
index 05500b4..cd00c4c 100644
|
||||
index 3f49cc4..c593146 100644
|
||||
--- content/browser/frame_host/render_frame_message_filter.h
|
||||
+++ content/browser/frame_host/render_frame_message_filter.h
|
||||
@@ -125,13 +125,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter
|
||||
@@ -124,13 +124,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter
|
||||
|
||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
||||
void OnGetPlugins(bool refresh,
|
||||
@ -245,10 +245,10 @@ index 11adad4..283f116 100644
|
||||
if (stale) {
|
||||
// Refresh the plugins asynchronously.
|
||||
diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
|
||||
index 480c659..ec4d108 100644
|
||||
index 4bdfa1d..cf9b916 100644
|
||||
--- content/browser/plugin_service_impl.cc
|
||||
+++ content/browser/plugin_service_impl.cc
|
||||
@@ -243,6 +243,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
||||
@@ -242,6 +242,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
||||
int render_frame_id,
|
||||
ResourceContext* context,
|
||||
const GURL& url,
|
||||
@ -256,7 +256,7 @@ index 480c659..ec4d108 100644
|
||||
const url::Origin& main_frame_origin,
|
||||
const std::string& mime_type,
|
||||
bool allow_wildcard,
|
||||
@@ -259,7 +260,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
||||
@@ -258,7 +259,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
||||
for (size_t i = 0; i < plugins.size(); ++i) {
|
||||
if (!filter_ ||
|
||||
filter_->IsPluginAvailable(render_process_id, render_frame_id, context,
|
||||
@ -267,10 +267,10 @@ index 480c659..ec4d108 100644
|
||||
if (actual_mime_type)
|
||||
*actual_mime_type = mime_types[i];
|
||||
diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h
|
||||
index 9e7a5ef..ee721d0 100644
|
||||
index 85b64da..e77f1bb 100644
|
||||
--- content/browser/plugin_service_impl.h
|
||||
+++ content/browser/plugin_service_impl.h
|
||||
@@ -70,6 +70,7 @@ class CONTENT_EXPORT PluginServiceImpl
|
||||
@@ -64,6 +64,7 @@ class CONTENT_EXPORT PluginServiceImpl
|
||||
int render_frame_id,
|
||||
ResourceContext* context,
|
||||
const GURL& url,
|
||||
@ -279,10 +279,10 @@ index 9e7a5ef..ee721d0 100644
|
||||
const std::string& mime_type,
|
||||
bool allow_wildcard,
|
||||
diff --git content/common/frame_messages.h content/common/frame_messages.h
|
||||
index b8be34e..db85a84 100644
|
||||
index 7077b9a..5fa68b1 100644
|
||||
--- content/common/frame_messages.h
|
||||
+++ content/common/frame_messages.h
|
||||
@@ -1277,8 +1277,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
||||
@@ -1298,8 +1298,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
||||
|
||||
// Used to get the list of plugins. |main_frame_origin| is used to handle
|
||||
// exceptions for plugin content settings.
|
||||
@ -293,7 +293,7 @@ index b8be34e..db85a84 100644
|
||||
url::Origin /* main_frame_origin */,
|
||||
std::vector<content::WebPluginInfo> /* plugins */)
|
||||
|
||||
@@ -1286,9 +1287,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
|
||||
@@ -1307,9 +1308,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
|
||||
// type. If there is no matching plugin, |found| is false.
|
||||
// |actual_mime_type| is the actual mime type supported by the
|
||||
// found plugin.
|
||||
@ -305,7 +305,7 @@ index b8be34e..db85a84 100644
|
||||
url::Origin /* main_frame_origin */,
|
||||
std::string /* mime_type */,
|
||||
bool /* found */,
|
||||
@@ -1648,9 +1650,9 @@ IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply,
|
||||
@@ -1677,9 +1679,9 @@ IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply,
|
||||
IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply,
|
||||
int /* nfr_request_id */,
|
||||
float /* distance */)
|
||||
@ -317,10 +317,10 @@ index b8be34e..db85a84 100644
|
||||
// Adding a new message? Stick to the sort order above: first platform
|
||||
// independent FrameMsg, then ifdefs for platform specific FrameMsg, then
|
||||
diff --git content/ppapi_plugin/ppapi_blink_platform_impl.cc content/ppapi_plugin/ppapi_blink_platform_impl.cc
|
||||
index 6c24359..279edb2 100644
|
||||
index e9b8930..42e3aec 100644
|
||||
--- content/ppapi_plugin/ppapi_blink_platform_impl.cc
|
||||
+++ content/ppapi_plugin/ppapi_blink_platform_impl.cc
|
||||
@@ -211,6 +211,7 @@ blink::WebURLLoader* PpapiBlinkPlatformImpl::CreateURLLoader() {
|
||||
@@ -213,6 +213,7 @@ std::unique_ptr<blink::WebURLLoader> PpapiBlinkPlatformImpl::CreateURLLoader() {
|
||||
|
||||
void PpapiBlinkPlatformImpl::GetPluginList(
|
||||
bool refresh,
|
||||
@ -329,19 +329,19 @@ index 6c24359..279edb2 100644
|
||||
blink::WebPluginListBuilder* builder) {
|
||||
NOTREACHED();
|
||||
diff --git content/ppapi_plugin/ppapi_blink_platform_impl.h content/ppapi_plugin/ppapi_blink_platform_impl.h
|
||||
index afcf809..1c9af66 100644
|
||||
index 84d29a5..3541ff0 100644
|
||||
--- content/ppapi_plugin/ppapi_blink_platform_impl.h
|
||||
+++ content/ppapi_plugin/ppapi_blink_platform_impl.h
|
||||
@@ -45,6 +45,7 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
blink::WebThemeEngine* ThemeEngine() override;
|
||||
blink::WebURLLoader* CreateURLLoader() override;
|
||||
std::unique_ptr<blink::WebURLLoader> CreateURLLoader() override;
|
||||
void GetPluginList(bool refresh,
|
||||
+ bool isMainFrame,
|
||||
const blink::WebSecurityOrigin& mainFrameOrigin,
|
||||
blink::WebPluginListBuilder*) override;
|
||||
blink::WebData LoadResource(const char* name) override;
|
||||
diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h
|
||||
index c404ac8..9dd87e7 100644
|
||||
index ac05c13..762262b 100644
|
||||
--- content/public/browser/plugin_service.h
|
||||
+++ content/public/browser/plugin_service.h
|
||||
@@ -74,6 +74,7 @@ class PluginService {
|
||||
@ -365,10 +365,10 @@ index 3b610b1..7c439e0 100644
|
||||
WebPluginInfo* plugin) = 0;
|
||||
|
||||
diff --git content/public/renderer/content_renderer_client.cc content/public/renderer/content_renderer_client.cc
|
||||
index d29d85f..6c32ef2 100644
|
||||
index 02565ee..de8fa6e 100644
|
||||
--- content/public/renderer/content_renderer_client.cc
|
||||
+++ content/public/renderer/content_renderer_client.cc
|
||||
@@ -97,7 +97,6 @@ bool ContentRendererClient::AllowPopup() {
|
||||
@@ -104,7 +104,6 @@ bool ContentRendererClient::AllowPopup() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -376,7 +376,7 @@ index d29d85f..6c32ef2 100644
|
||||
bool ContentRendererClient::HandleNavigation(
|
||||
RenderFrame* render_frame,
|
||||
bool is_content_initiated,
|
||||
@@ -110,6 +109,7 @@ bool ContentRendererClient::HandleNavigation(
|
||||
@@ -117,6 +116,7 @@ bool ContentRendererClient::HandleNavigation(
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -385,10 +385,20 @@ index d29d85f..6c32ef2 100644
|
||||
return false;
|
||||
}
|
||||
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
|
||||
index d544fb7..260079c 100644
|
||||
index 0e554ba..8ac5c54 100644
|
||||
--- content/public/renderer/content_renderer_client.h
|
||||
+++ content/public/renderer/content_renderer_client.h
|
||||
@@ -197,7 +197,6 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -75,6 +75,9 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
// Notifies us that the RenderThread has been created.
|
||||
virtual void RenderThreadStarted() {}
|
||||
|
||||
+ // Notifies that the RenderThread can now send sync IPC messages.
|
||||
+ virtual void RenderThreadConnected() {}
|
||||
+
|
||||
// Notifies that a new RenderFrame has been created.
|
||||
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
|
||||
|
||||
@@ -190,7 +193,6 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
// Returns true if a popup window should be allowed.
|
||||
virtual bool AllowPopup();
|
||||
|
||||
@ -396,7 +406,7 @@ index d544fb7..260079c 100644
|
||||
// TODO(sgurun) This callback is deprecated and will be removed as soon
|
||||
// as android webview completes implementation of a resource throttle based
|
||||
// shouldoverrideurl implementation. See crbug.com/325351
|
||||
@@ -213,6 +212,7 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -206,6 +208,7 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
blink::WebNavigationPolicy default_policy,
|
||||
bool is_redirect);
|
||||
|
||||
@ -404,21 +414,44 @@ index d544fb7..260079c 100644
|
||||
// Indicates if the Android MediaPlayer should be used instead of Chrome's
|
||||
// built in media player for the given |url|. Defaults to false.
|
||||
virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
|
||||
diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
|
||||
index ebf4cd4..27a9df4 100644
|
||||
--- content/public/renderer/render_frame_observer.h
|
||||
+++ content/public/renderer/render_frame_observer.h
|
||||
@@ -115,6 +115,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
virtual void DidObserveLoadingBehavior(
|
||||
blink::WebLoadingBehaviorFlag behavior) {}
|
||||
|
||||
+ // Called when this frame gains focus.
|
||||
+ virtual void FrameFocused() {}
|
||||
+
|
||||
// Called when the focused node has changed to |node|.
|
||||
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
|
||||
|
||||
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
|
||||
index 6922b94..473d148 100644
|
||||
index d1e9d50..ad7c36d7 100644
|
||||
--- content/renderer/render_frame_impl.cc
|
||||
+++ content/renderer/render_frame_impl.cc
|
||||
@@ -2795,7 +2795,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
@@ -2902,7 +2902,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
std::string mime_type;
|
||||
bool found = false;
|
||||
Send(new FrameHostMsg_GetPluginInfo(
|
||||
- routing_id_, params.url, frame->Top()->GetSecurityOrigin(),
|
||||
+ routing_id_, params.url, frame->Parent() == nullptr,
|
||||
+ frame->Top()->GetSecurityOrigin(),
|
||||
- routing_id_, params.url, frame_->Top()->GetSecurityOrigin(),
|
||||
+ routing_id_, params.url, frame_->Parent() == nullptr,
|
||||
+ frame_->Top()->GetSecurityOrigin(),
|
||||
params.mime_type.Utf8(), &found, &info, &mime_type));
|
||||
if (!found)
|
||||
return NULL;
|
||||
@@ -5364,9 +5365,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
||||
return nullptr;
|
||||
@@ -3390,6 +3391,8 @@ void RenderFrameImpl::FrameDetached(blink::WebLocalFrame* frame,
|
||||
|
||||
void RenderFrameImpl::FrameFocused() {
|
||||
Send(new FrameHostMsg_FrameFocused(routing_id_));
|
||||
+ for (auto& observer : observers_)
|
||||
+ observer.FrameFocused();
|
||||
}
|
||||
|
||||
void RenderFrameImpl::WillCommitProvisionalLoad() {
|
||||
@@ -5495,9 +5498,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
||||
(!IsBrowserSideNavigationEnabled() ||
|
||||
url != pending_navigation_params_->request_params.redirects[0]));
|
||||
|
||||
@ -430,7 +463,7 @@ index 6922b94..473d148 100644
|
||||
// The handlenavigation API is deprecated and will be removed once
|
||||
// crbug.com/325351 is resolved.
|
||||
if (GetContentClient()->renderer()->HandleNavigation(
|
||||
@@ -5379,7 +5379,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
||||
@@ -5510,7 +5512,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
||||
}
|
||||
return blink::kWebNavigationPolicyIgnore;
|
||||
}
|
||||
@ -438,11 +471,24 @@ index 6922b94..473d148 100644
|
||||
|
||||
Referrer referrer(
|
||||
RenderViewImpl::GetReferrerFromRequest(frame_, info.url_request));
|
||||
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
|
||||
index 116d31a8..ef645bb 100644
|
||||
--- content/renderer/render_thread_impl.cc
|
||||
+++ content/renderer/render_thread_impl.cc
|
||||
@@ -754,6 +754,8 @@ void RenderThreadImpl::Init(
|
||||
|
||||
StartServiceManagerConnection();
|
||||
|
||||
+ GetContentClient()->renderer()->RenderThreadConnected();
|
||||
+
|
||||
field_trial_syncer_.InitFieldTrialObserving(
|
||||
*base::CommandLine::ForCurrentProcess(), switches::kSingleProcess);
|
||||
|
||||
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
|
||||
index 4ba0c48..46f2afde 100644
|
||||
index a540286..41b19d4 100644
|
||||
--- content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -737,6 +737,7 @@ blink::WebMIDIAccessor* RendererBlinkPlatformImpl::CreateMIDIAccessor(
|
||||
@@ -738,6 +738,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor(
|
||||
|
||||
void RendererBlinkPlatformImpl::GetPluginList(
|
||||
bool refresh,
|
||||
@ -450,7 +496,7 @@ index 4ba0c48..46f2afde 100644
|
||||
const blink::WebSecurityOrigin& mainFrameOrigin,
|
||||
blink::WebPluginListBuilder* builder) {
|
||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
||||
@@ -744,7 +745,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
|
||||
@@ -745,7 +746,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
|
||||
if (!plugin_refresh_allowed_)
|
||||
refresh = false;
|
||||
RenderThread::Get()->Send(
|
||||
@ -461,10 +507,10 @@ index 4ba0c48..46f2afde 100644
|
||||
builder->AddPlugin(WebString::FromUTF16(plugin.name),
|
||||
WebString::FromUTF16(plugin.desc),
|
||||
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
|
||||
index 19306df..a731786 100644
|
||||
index b931470..af3719a 100644
|
||||
--- content/renderer/renderer_blink_platform_impl.h
|
||||
+++ content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -121,6 +121,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -124,6 +124,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
cc::FrameSinkId GenerateFrameSinkId() override;
|
||||
|
||||
void GetPluginList(bool refresh,
|
||||
@ -472,3 +518,75 @@ index 19306df..a731786 100644
|
||||
const blink::WebSecurityOrigin& mainFrameOrigin,
|
||||
blink::WebPluginListBuilder* builder) override;
|
||||
blink::WebPublicSuffixList* PublicSuffixList() override;
|
||||
diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc
|
||||
index 3a48c59..d10ef64 100644
|
||||
--- content/shell/browser/shell_plugin_service_filter.cc
|
||||
+++ content/shell/browser/shell_plugin_service_filter.cc
|
||||
@@ -18,6 +18,7 @@ bool ShellPluginServiceFilter::IsPluginAvailable(
|
||||
int render_frame_id,
|
||||
const void* context,
|
||||
const GURL& url,
|
||||
+ bool is_main_frame,
|
||||
const url::Origin& main_frame_origin,
|
||||
WebPluginInfo* plugin) {
|
||||
return plugin->name == base::ASCIIToUTF16("Blink Test Plugin") ||
|
||||
diff --git content/shell/browser/shell_plugin_service_filter.h content/shell/browser/shell_plugin_service_filter.h
|
||||
index 7767a62..8a95377 100644
|
||||
--- content/shell/browser/shell_plugin_service_filter.h
|
||||
+++ content/shell/browser/shell_plugin_service_filter.h
|
||||
@@ -21,6 +21,7 @@ class ShellPluginServiceFilter : public PluginServiceFilter {
|
||||
int render_frame_id,
|
||||
const void* context,
|
||||
const GURL& url,
|
||||
+ bool is_main_frame,
|
||||
const url::Origin& main_frame_origin,
|
||||
WebPluginInfo* plugin) override;
|
||||
|
||||
diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc
|
||||
index 6746b9f..8634ada 100644
|
||||
--- content/test/fake_plugin_service.cc
|
||||
+++ content/test/fake_plugin_service.cc
|
||||
@@ -29,6 +29,7 @@ bool FakePluginService::GetPluginInfo(int render_process_id,
|
||||
int render_frame_id,
|
||||
ResourceContext* context,
|
||||
const GURL& url,
|
||||
+ bool is_main_frame,
|
||||
const url::Origin& main_frame_origin,
|
||||
const std::string& mime_type,
|
||||
bool allow_wildcard,
|
||||
diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h
|
||||
index db23a83..57a4c536 100644
|
||||
--- content/test/fake_plugin_service.h
|
||||
+++ content/test/fake_plugin_service.h
|
||||
@@ -30,6 +30,7 @@ class FakePluginService : public PluginService {
|
||||
int render_frame_id,
|
||||
ResourceContext* context,
|
||||
const GURL& url,
|
||||
+ bool is_main_frame,
|
||||
const url::Origin& main_frame_origin,
|
||||
const std::string& mime_type,
|
||||
bool allow_wildcard,
|
||||
diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc
|
||||
index 7150daf..69fcc9e 100644
|
||||
--- content/test/test_blink_web_unit_test_support.cc
|
||||
+++ content/test/test_blink_web_unit_test_support.cc
|
||||
@@ -289,6 +289,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() {
|
||||
|
||||
void TestBlinkWebUnitTestSupport::GetPluginList(
|
||||
bool refresh,
|
||||
+ bool is_main_frame,
|
||||
const blink::WebSecurityOrigin& mainFrameOrigin,
|
||||
blink::WebPluginListBuilder* builder) {
|
||||
builder->AddPlugin("pdf", "pdf", "pdf-files");
|
||||
diff --git content/test/test_blink_web_unit_test_support.h content/test/test_blink_web_unit_test_support.h
|
||||
index 78b7d2c..62a52cb 100644
|
||||
--- content/test/test_blink_web_unit_test_support.h
|
||||
+++ content/test/test_blink_web_unit_test_support.h
|
||||
@@ -68,6 +68,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl {
|
||||
const blink::WebSize& size) override;
|
||||
|
||||
void GetPluginList(bool refresh,
|
||||
+ bool is_main_frame,
|
||||
const blink::WebSecurityOrigin& mainFrameOrigin,
|
||||
blink::WebPluginListBuilder* builder) override;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn
|
||||
index c4ca09c..40b981e 100644
|
||||
index 4d385dd..1b51f2d 100644
|
||||
--- build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn
|
||||
+++ build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn
|
||||
@@ -2,6 +2,8 @@
|
||||
@ -11,7 +11,7 @@ index c4ca09c..40b981e 100644
|
||||
static_library("handler_lib") {
|
||||
sources = [
|
||||
"crash_report_upload_thread.cc",
|
||||
@@ -28,8 +30,18 @@ static_library("handler_lib") {
|
||||
@@ -30,8 +32,18 @@ static_library("handler_lib") {
|
||||
"../snapshot",
|
||||
"../tools:tool_support",
|
||||
"//base",
|
||||
@ -31,7 +31,7 @@ index c4ca09c..40b981e 100644
|
||||
cflags = [ "/wd4201" ]
|
||||
}
|
||||
diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
|
||||
index 78b04f4..abf9c98 100644
|
||||
index e9578be..2561824 100644
|
||||
--- chrome/common/crash_keys.cc
|
||||
+++ chrome/common/crash_keys.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
@ -43,7 +43,7 @@ index 78b04f4..abf9c98 100644
|
||||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/format_macros.h"
|
||||
@@ -88,7 +90,7 @@ const char kViewCount[] = "view-count";
|
||||
@@ -86,7 +88,7 @@ const char kViewCount[] = "view-count";
|
||||
|
||||
const char kZeroEncodeDetails[] = "zero-encode-details";
|
||||
|
||||
@ -52,7 +52,7 @@ index 78b04f4..abf9c98 100644
|
||||
// The following keys may be chunked by the underlying crash logging system,
|
||||
// but ultimately constitute a single key-value pair.
|
||||
//
|
||||
@@ -254,10 +256,16 @@ size_t RegisterChromeCrashKeys() {
|
||||
@@ -226,10 +228,16 @@ size_t RegisterChromeCrashKeys() {
|
||||
|
||||
// This dynamic set of keys is used for sets of key value pairs when gathering
|
||||
// a collection of data, like command line switches or extension IDs.
|
||||
@ -71,7 +71,7 @@ index 78b04f4..abf9c98 100644
|
||||
|
||||
// Register the extension IDs.
|
||||
{
|
||||
@@ -291,7 +299,7 @@ size_t RegisterChromeCrashKeys() {
|
||||
@@ -263,7 +271,7 @@ size_t RegisterChromeCrashKeys() {
|
||||
return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength);
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ index 78b04f4..abf9c98 100644
|
||||
static const char* const kIgnoreSwitches[] = {
|
||||
switches::kEnableLogging,
|
||||
switches::kFlagSwitchesBegin,
|
||||
@@ -347,7 +355,7 @@ static bool IsBoringSwitch(const std::string& flag) {
|
||||
@@ -319,7 +327,7 @@ static bool IsBoringSwitch(const std::string& flag) {
|
||||
}
|
||||
|
||||
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
|
||||
@ -90,7 +90,7 @@ index 78b04f4..abf9c98 100644
|
||||
|
||||
void SetActiveExtensions(const std::set<std::string>& extensions) {
|
||||
diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h
|
||||
index 7abe208..424a2a4 100644
|
||||
index 93fb0b0..3e543d2 100644
|
||||
--- chrome/common/crash_keys.h
|
||||
+++ chrome/common/crash_keys.h
|
||||
@@ -22,10 +22,18 @@ class CommandLine;
|
||||
@ -113,7 +113,7 @@ index 7abe208..424a2a4 100644
|
||||
// on the given |command_line|.
|
||||
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
|
||||
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
|
||||
index 40f611f..b5e7d64 100644
|
||||
index c8197e9..21ad726 100644
|
||||
--- chrome_elf/BUILD.gn
|
||||
+++ chrome_elf/BUILD.gn
|
||||
@@ -7,6 +7,7 @@
|
||||
@ -423,10 +423,10 @@ index 9f69c19..2abaee00 100644
|
||||
|
||||
} // namespace crash_reporter
|
||||
diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc
|
||||
index dcec346..6272df6 100644
|
||||
index ba04da1..aa3f21a 100644
|
||||
--- components/crash/content/app/crashpad.cc
|
||||
+++ components/crash/content/app/crashpad.cc
|
||||
@@ -142,7 +142,8 @@ void InitializeCrashpadImpl(bool initial_client,
|
||||
@@ -143,7 +143,8 @@ void InitializeCrashpadImpl(bool initial_client,
|
||||
// fallback. Forwarding is turned off for debug-mode builds even for the
|
||||
// browser process, because the system's crash reporter can take a very long
|
||||
// time to chew on symbols.
|
||||
@ -437,7 +437,7 @@ index dcec346..6272df6 100644
|
||||
crashpad::TriState::kDisabled);
|
||||
}
|
||||
diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm
|
||||
index 3bae07e..12b0a16 100644
|
||||
index 485c2b4..3b5f3ea 100644
|
||||
--- components/crash/content/app/crashpad_mac.mm
|
||||
+++ components/crash/content/app/crashpad_mac.mm
|
||||
@@ -16,11 +16,14 @@
|
||||
@ -455,7 +455,7 @@ index 3bae07e..12b0a16 100644
|
||||
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
|
||||
#include "third_party/crashpad/crashpad/client/crashpad_client.h"
|
||||
#include "third_party/crashpad/crashpad/client/crashpad_info.h"
|
||||
@@ -40,9 +43,10 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -42,9 +45,10 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
|
||||
if (initial_client) {
|
||||
@autoreleasepool {
|
||||
@ -469,7 +469,7 @@ index 3bae07e..12b0a16 100644
|
||||
|
||||
// Is there a way to recover if this fails?
|
||||
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
|
||||
@@ -54,16 +58,27 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -56,16 +60,27 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
// crash server won't have symbols for any other build types.
|
||||
std::string url = "https://clients2.google.com/cr/report";
|
||||
#else
|
||||
@ -502,7 +502,7 @@ index 3bae07e..12b0a16 100644
|
||||
|
||||
#if defined(GOOGLE_CHROME_BUILD)
|
||||
// Empty means stable.
|
||||
@@ -79,12 +94,16 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -81,12 +96,16 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
process_annotations["channel"] = "";
|
||||
}
|
||||
|
||||
@ -524,21 +524,21 @@ index 3bae07e..12b0a16 100644
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
|
||||
@@ -105,6 +124,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
arguments.push_back(
|
||||
@@ -108,6 +127,12 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
"--reset-own-crash-exception-port-to-system-default");
|
||||
}
|
||||
+
|
||||
|
||||
+ // Since we're using the same subprocess helper exe we must specify the
|
||||
+ // process type.
|
||||
+ arguments.push_back(std::string("--type=") + switches::kCrashpadHandler);
|
||||
+
|
||||
+ crash_reporter_client->GetCrashOptionalArguments(&arguments);
|
||||
|
||||
+
|
||||
bool result = GetCrashpadClient().StartHandler(
|
||||
handler_path, database_path, metrics_path, url, process_annotations,
|
||||
arguments, true, false);
|
||||
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
|
||||
index 94a350f..61667a8 100644
|
||||
index 6fdfd83..1d5a2a9 100644
|
||||
--- components/crash/content/app/crashpad_win.cc
|
||||
+++ components/crash/content/app/crashpad_win.cc
|
||||
@@ -33,8 +33,8 @@ void GetPlatformCrashpadAnnotations(
|
||||
@ -564,7 +564,7 @@ index 94a350f..61667a8 100644
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -82,7 +82,7 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
#if defined(GOOGLE_CHROME_BUILD)
|
||||
std::string url = "https://clients2.google.com/cr/report";
|
||||
#else
|
||||
@ -573,7 +573,7 @@ index 94a350f..61667a8 100644
|
||||
#endif
|
||||
|
||||
// Allow the crash server to be overridden for testing. If the variable
|
||||
@@ -100,22 +100,26 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -102,13 +102,14 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
crashpad::TriState::kEnabled, kIndirectMemoryLimit);
|
||||
}
|
||||
|
||||
@ -590,9 +590,10 @@ index 94a350f..61667a8 100644
|
||||
if (embedded_handler) {
|
||||
- start_arguments.push_back(std::string("--type=") +
|
||||
- switches::kCrashpadHandler);
|
||||
// The prefetch argument added here has to be documented in
|
||||
// chrome_switches.cc, below the kPrefetchArgument* constants. A constant
|
||||
// can't be used here because crashpad can't depend on Chrome.
|
||||
if (!user_data_dir.empty()) {
|
||||
start_arguments.push_back(std::string("--user-data-dir=") +
|
||||
user_data_dir);
|
||||
@@ -119,9 +120,12 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
start_arguments.push_back("/prefetch:7");
|
||||
} else {
|
||||
base::FilePath exe_dir = exe_file.DirName();
|
||||
|
@ -146,28 +146,28 @@ index b64f74f..0c3c22e 100644
|
||||
struct Data;
|
||||
|
||||
diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.h third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
|
||||
index 14debac..c25c653 100644
|
||||
index c769efe..daec6cd 100644
|
||||
--- third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
|
||||
+++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
|
||||
@@ -78,7 +78,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
|
||||
@@ -89,7 +89,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
|
||||
//! This method may be called from any thread.
|
||||
void ReportPending();
|
||||
void ReportPending(const UUID& report_uuid);
|
||||
|
||||
- private:
|
||||
+ protected:
|
||||
//! \brief The result code from UploadReport().
|
||||
enum class UploadResult {
|
||||
//! \brief The crash report was uploaded successfully.
|
||||
@@ -101,7 +101,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
|
||||
|
||||
//! \brief Obtains all pending reports from the database, and calls
|
||||
//! ProcessPendingReport() to process each one.
|
||||
@@ -117,7 +117,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
|
||||
//! object was constructed with \a watch_pending_reports, it will also scan
|
||||
//! the crash report database for other pending reports, and process those as
|
||||
//! well.
|
||||
- void ProcessPendingReports();
|
||||
+ virtual void ProcessPendingReports();
|
||||
|
||||
//! \brief Processes a single pending report from the database.
|
||||
//!
|
||||
@@ -115,7 +115,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
|
||||
@@ -131,7 +131,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
|
||||
//! remain in the “pending” state. If the upload fails and no more retries are
|
||||
//! desired, or report upload is disabled, it will be marked as “completed” in
|
||||
//! the database without ever having been uploaded.
|
||||
@ -177,7 +177,7 @@ index 14debac..c25c653 100644
|
||||
//! \brief Attempts to upload a crash report.
|
||||
//!
|
||||
diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc
|
||||
index 641bf0f..3a86eb3 100644
|
||||
index e6d05e2..93e5eb1 100644
|
||||
--- third_party/crashpad/crashpad/handler/handler_main.cc
|
||||
+++ third_party/crashpad/crashpad/handler/handler_main.cc
|
||||
@@ -35,8 +35,10 @@
|
||||
@ -191,7 +191,7 @@ index 641bf0f..3a86eb3 100644
|
||||
#include "client/crash_report_database.h"
|
||||
#include "client/crashpad_client.h"
|
||||
#include "client/crashpad_info.h"
|
||||
@@ -75,6 +77,10 @@
|
||||
@@ -76,6 +78,10 @@
|
||||
#include "util/win/session_end_watcher.h"
|
||||
#endif // OS_MACOSX
|
||||
|
||||
@ -202,8 +202,8 @@ index 641bf0f..3a86eb3 100644
|
||||
namespace crashpad {
|
||||
|
||||
namespace {
|
||||
@@ -144,6 +150,9 @@ struct Options {
|
||||
bool monitor_self;
|
||||
@@ -147,6 +153,9 @@ struct Options {
|
||||
bool periodic_tasks;
|
||||
bool rate_limit;
|
||||
bool upload_gzip;
|
||||
+ int max_uploads;
|
||||
@ -212,7 +212,7 @@ index 641bf0f..3a86eb3 100644
|
||||
};
|
||||
|
||||
// Splits |key_value| on '=' and inserts the resulting key and value into |map|.
|
||||
@@ -425,6 +434,9 @@ int HandlerMain(int argc,
|
||||
@@ -430,6 +439,9 @@ int HandlerMain(int argc,
|
||||
kOptionResetOwnCrashExceptionPortToSystemDefault,
|
||||
#endif // OS_MACOSX
|
||||
kOptionURL,
|
||||
@ -222,7 +222,7 @@ index 641bf0f..3a86eb3 100644
|
||||
|
||||
// Standard options.
|
||||
kOptionHelp = -2,
|
||||
@@ -470,6 +482,9 @@ int HandlerMain(int argc,
|
||||
@@ -476,6 +488,9 @@ int HandlerMain(int argc,
|
||||
{"url", required_argument, nullptr, kOptionURL},
|
||||
{"help", no_argument, nullptr, kOptionHelp},
|
||||
{"version", no_argument, nullptr, kOptionVersion},
|
||||
@ -232,7 +232,7 @@ index 641bf0f..3a86eb3 100644
|
||||
{nullptr, 0, nullptr, 0},
|
||||
};
|
||||
|
||||
@@ -564,6 +579,27 @@ int HandlerMain(int argc,
|
||||
@@ -575,6 +590,27 @@ int HandlerMain(int argc,
|
||||
options.url = optarg;
|
||||
break;
|
||||
}
|
||||
@ -260,24 +260,32 @@ index 641bf0f..3a86eb3 100644
|
||||
case kOptionHelp: {
|
||||
Usage(me);
|
||||
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly);
|
||||
@@ -721,12 +757,19 @@ int HandlerMain(int argc,
|
||||
@@ -734,17 +770,27 @@ int HandlerMain(int argc,
|
||||
// TODO(scottmg): options.rate_limit should be removed when we have a
|
||||
// configurable database setting to control upload limiting.
|
||||
// See https://crashpad.chromium.org/bug/23.
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ CefCrashReportUploadThread upload_thread(
|
||||
+ database.get(), options.url, options.rate_limit, options.upload_gzip,
|
||||
+ options.max_uploads);
|
||||
+ CefCrashReportUploadThread upload_thread(database.get(),
|
||||
+ options.url,
|
||||
+ options.periodic_tasks,
|
||||
+ options.rate_limit,
|
||||
+ options.upload_gzip,
|
||||
+ options.max_uploads);
|
||||
+#else
|
||||
CrashReportUploadThread upload_thread(
|
||||
database.get(), options.url, options.rate_limit, options.upload_gzip);
|
||||
CrashReportUploadThread upload_thread(database.get(),
|
||||
options.url,
|
||||
options.periodic_tasks,
|
||||
options.rate_limit,
|
||||
options.upload_gzip);
|
||||
+#endif
|
||||
upload_thread.Start();
|
||||
|
||||
PruneCrashReportThread prune_thread(database.get(),
|
||||
- PruneCondition::GetDefault());
|
||||
+ PruneCondition::GetDefault(options.max_database_size,
|
||||
+ options.max_database_age));
|
||||
prune_thread.Start();
|
||||
std::unique_ptr<PruneCrashReportThread> prune_thread;
|
||||
if (options.periodic_tasks) {
|
||||
prune_thread.reset(new PruneCrashReportThread(
|
||||
- database.get(), PruneCondition::GetDefault()));
|
||||
+ database.get(), PruneCondition::GetDefault(options.max_database_size,
|
||||
+ options.max_database_age)));
|
||||
prune_thread->Start();
|
||||
}
|
||||
|
||||
CrashReportExceptionHandler exception_handler(database.get(),
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git .gn .gn
|
||||
index cd7ed79..0c318f9 100644
|
||||
index c91f911..bd906bc 100644
|
||||
--- .gn
|
||||
+++ .gn
|
||||
@@ -257,6 +257,8 @@ exec_script_whitelist =
|
||||
@@ -261,6 +261,8 @@ exec_script_whitelist =
|
||||
# in the Chromium repo outside of //build.
|
||||
"//build_overrides/build.gni",
|
||||
|
||||
@ -12,11 +12,11 @@ index cd7ed79..0c318f9 100644
|
||||
# https://crbug.com/474506.
|
||||
"//clank/java/BUILD.gn",
|
||||
diff --git BUILD.gn BUILD.gn
|
||||
index d24c2da..7f0d451 100644
|
||||
index 9429718..1f8c486 100644
|
||||
--- BUILD.gn
|
||||
+++ BUILD.gn
|
||||
@@ -158,6 +158,7 @@ group("gn_all") {
|
||||
# and whether there should be other targets that are iOS-only and missing.
|
||||
@@ -154,6 +154,7 @@ group("gn_all") {
|
||||
if (!is_ios && !is_fuchsia) {
|
||||
deps += [
|
||||
"//cc:cc_unittests",
|
||||
+ "//cef",
|
||||
@ -91,10 +91,10 @@ index e8b0849..0bfc676 100644
|
||||
|
||||
|
||||
diff --git build/vs_toolchain.py build/vs_toolchain.py
|
||||
index 90a562d..8c63b12 100755
|
||||
index bb8f96c..6902237 100755
|
||||
--- build/vs_toolchain.py
|
||||
+++ build/vs_toolchain.py
|
||||
@@ -78,11 +78,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
|
||||
@@ -79,11 +79,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
|
||||
runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs)
|
||||
os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH']
|
||||
elif sys.platform == 'win32' and not depot_tools_win_toolchain:
|
||||
@ -114,20 +114,20 @@ index 90a562d..8c63b12 100755
|
||||
# directory in order to run binaries locally, but they are needed in order
|
||||
# to create isolates or the mini_installer. Copying them to the output
|
||||
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
|
||||
index 4e303dc..a0398f1 100644
|
||||
index 1f9a1fc..aa69e8c 100644
|
||||
--- chrome/chrome_paks.gni
|
||||
+++ chrome/chrome_paks.gni
|
||||
@@ -249,7 +249,7 @@ template("chrome_paks") {
|
||||
additional_source_patterns = invoker.additional_locale_source_patterns
|
||||
}
|
||||
input_locales = locales
|
||||
- output_dir = "${invoker.output_dir}/locales"
|
||||
+ output_dir = "${invoker.output_dir}/chrome/locales"
|
||||
|
||||
if (is_mac) {
|
||||
output_locales = locales_as_mac_outputs
|
||||
@@ -245,7 +245,7 @@ template("chrome_paks") {
|
||||
])
|
||||
|
||||
input_locales = locales
|
||||
- output_dir = "${invoker.output_dir}/locales"
|
||||
+ output_dir = "${invoker.output_dir}/chrome/locales"
|
||||
|
||||
if (is_mac) {
|
||||
output_locales = locales_as_mac_outputs
|
||||
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
|
||||
index 5d2fe25..dd08482 100644
|
||||
index 2afab1a..c8791ea 100644
|
||||
--- chrome/installer/mini_installer/BUILD.gn
|
||||
+++ chrome/installer/mini_installer/BUILD.gn
|
||||
@@ -128,7 +128,7 @@ template("generate_mini_installer") {
|
||||
|
@ -1,17 +0,0 @@
|
||||
diff --git gpu/command_buffer/service/feature_info.cc gpu/command_buffer/service/feature_info.cc
|
||||
index 32e72c6..712d3ac 100644
|
||||
--- gpu/command_buffer/service/feature_info.cc
|
||||
+++ gpu/command_buffer/service/feature_info.cc
|
||||
@@ -1493,8 +1493,10 @@ void FeatureInfo::InitializeFloatAndHalfFloatFeatures(
|
||||
}
|
||||
enable_ext_color_buffer_float = full_float_support;
|
||||
}
|
||||
- // Likewise for EXT_color_buffer_half_float on ES2 contexts.
|
||||
- if (IsWebGL1OrES2Context() && !enable_ext_color_buffer_half_float) {
|
||||
+ // Likewise for EXT_color_buffer_half_float on ES2 contexts. On desktop,
|
||||
+ // require at least GL 3.0, to ensure that all formats are defined.
|
||||
+ if (IsWebGL1OrES2Context() && !enable_ext_color_buffer_half_float &&
|
||||
+ (gl_version_info_->is_es || gl_version_info_->IsAtLeastGL(3, 0))) {
|
||||
bool full_half_float_support = true;
|
||||
GLenum internal_formats[] = {
|
||||
GL_R16F, GL_RG16F, GL_RGBA16F,
|
@ -1,8 +1,8 @@
|
||||
diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids
|
||||
index 4e3fd2d..2cf62da 100644
|
||||
index 25abc65..04e8eab 100644
|
||||
--- tools/gritsettings/resource_ids
|
||||
+++ tools/gritsettings/resource_ids
|
||||
@@ -362,4 +362,11 @@
|
||||
@@ -371,4 +371,11 @@
|
||||
# Please read the header and find the right section above instead.
|
||||
|
||||
# Resource ids starting at 31000 are reserved for projects built on Chromium.
|
||||
|
@ -1,57 +0,0 @@
|
||||
diff --git chrome/browser/ui/views/BUILD.gn chrome/browser/ui/views/BUILD.gn
|
||||
index 47aa8b5bdbc9..d198a017a63c 100644
|
||||
--- chrome/browser/ui/views/BUILD.gn
|
||||
+++ chrome/browser/ui/views/BUILD.gn
|
||||
@@ -27,6 +27,7 @@ component("views") {
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome/app:command_ids",
|
||||
+ "//content/public/browser",
|
||||
"//printing/features",
|
||||
"//skia",
|
||||
"//ui/base",
|
||||
diff --git extensions/browser/api/BUILD.gn extensions/browser/api/BUILD.gn
|
||||
index dcf2bdb8fe74..96c9bf870c67 100644
|
||||
--- extensions/browser/api/BUILD.gn
|
||||
+++ extensions/browser/api/BUILD.gn
|
||||
@@ -25,6 +25,8 @@ source_set("api") {
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
+ "//content/public/browser",
|
||||
+ "//content/public/common",
|
||||
"//extensions/browser/api/activity_log",
|
||||
"//extensions/browser/api/alarms",
|
||||
"//extensions/browser/api/app_current_window_internal",
|
||||
diff --git extensions/common/BUILD.gn extensions/common/BUILD.gn
|
||||
index 8af643d9d426..189cf47e7756 100644
|
||||
--- extensions/common/BUILD.gn
|
||||
+++ extensions/common/BUILD.gn
|
||||
@@ -271,6 +271,7 @@ if (enable_extensions) {
|
||||
public_deps = [
|
||||
":common_constants",
|
||||
":mojo",
|
||||
+ "//content/public/common",
|
||||
"//ipc",
|
||||
"//skia",
|
||||
]
|
||||
@@ -284,7 +285,6 @@ if (enable_extensions) {
|
||||
"//chrome:resources",
|
||||
"//components/crx_file",
|
||||
"//components/url_matcher",
|
||||
- "//content/public/common",
|
||||
"//crypto",
|
||||
"//device/bluetooth",
|
||||
"//device/usb",
|
||||
diff --git extensions/renderer/BUILD.gn extensions/renderer/BUILD.gn
|
||||
index fca1114a561b..b049678396ee 100644
|
||||
--- extensions/renderer/BUILD.gn
|
||||
+++ extensions/renderer/BUILD.gn
|
||||
@@ -245,6 +245,7 @@ source_set("renderer") {
|
||||
"//components/guest_view/renderer",
|
||||
"//content:resources",
|
||||
"//extensions:extensions_resources",
|
||||
+ "//extensions/common",
|
||||
"//extensions/common/api",
|
||||
"//gin",
|
||||
"//mojo/edk/js",
|
@ -1,35 +1,8 @@
|
||||
diff --git base/message_loop/message_loop.cc base/message_loop/message_loop.cc
|
||||
index 3d55920..721aca1 100644
|
||||
--- base/message_loop/message_loop.cc
|
||||
+++ base/message_loop/message_loop.cc
|
||||
@@ -96,12 +96,6 @@ MessageLoop::~MessageLoop() {
|
||||
// may be current.
|
||||
DCHECK((pump_ && current() == this) || (!pump_ && current() != this));
|
||||
|
||||
- // iOS just attaches to the loop, it doesn't Run it.
|
||||
- // TODO(stuartmorgan): Consider wiring up a Detach().
|
||||
-#if !defined(OS_IOS)
|
||||
- DCHECK(!run_loop_);
|
||||
-#endif
|
||||
-
|
||||
#if defined(OS_WIN)
|
||||
if (in_high_res_mode_)
|
||||
Time::ActivateHighResolutionTimer(false);
|
||||
@@ -319,6 +313,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
|
||||
in_high_res_mode_(false),
|
||||
#endif
|
||||
nestable_tasks_allowed_(true),
|
||||
+#if defined(OS_WIN)
|
||||
+ os_modal_loop_(false),
|
||||
+#endif // OS_WIN
|
||||
pump_factory_(pump_factory),
|
||||
run_loop_(nullptr),
|
||||
current_pending_task_(nullptr),
|
||||
diff --git base/message_loop/message_loop.h base/message_loop/message_loop.h
|
||||
index 2ef4537..9c657f8 100644
|
||||
index fa25e78..cd62826 100644
|
||||
--- base/message_loop/message_loop.h
|
||||
+++ base/message_loop/message_loop.h
|
||||
@@ -303,6 +303,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
|
||||
@@ -288,6 +288,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate,
|
||||
void AddTaskObserver(TaskObserver* task_observer);
|
||||
void RemoveTaskObserver(TaskObserver* task_observer);
|
||||
|
||||
@ -43,24 +16,24 @@ index 2ef4537..9c657f8 100644
|
||||
+ }
|
||||
+#endif // OS_WIN
|
||||
+
|
||||
// Can only be called from the thread that owns the MessageLoop.
|
||||
bool is_running() const;
|
||||
|
||||
@@ -444,6 +454,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
|
||||
// Returns true if the message loop has high resolution timers enabled.
|
||||
// Provided for testing.
|
||||
bool HasHighResolutionTasks();
|
||||
@@ -416,6 +426,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate,
|
||||
// insider a (accidentally induced?) nested message pump.
|
||||
bool nestable_tasks_allowed_;
|
||||
|
||||
+#if defined(OS_WIN)
|
||||
+ // Should be set to true before calling Windows APIs like TrackPopupMenu, etc.
|
||||
+ // which enter a modal message loop.
|
||||
+ bool os_modal_loop_;
|
||||
+ bool os_modal_loop_ = false;
|
||||
+#endif
|
||||
+
|
||||
// pump_factory_.Run() is called to create a message pump for this loop
|
||||
// if type_ is TYPE_CUSTOM and pump_ is null.
|
||||
MessagePumpFactoryCallback pump_factory_;
|
||||
diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc
|
||||
index d52c785..a43b5b3 100644
|
||||
index 6f48da1..e427941 100644
|
||||
--- base/message_loop/message_pump_win.cc
|
||||
+++ base/message_loop/message_pump_win.cc
|
||||
@@ -366,20 +366,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git net/base/network_delegate.h net/base/network_delegate.h
|
||||
index f602f3c..091f53e 100644
|
||||
index eaa1e30..18b486d 100644
|
||||
--- net/base/network_delegate.h
|
||||
+++ net/base/network_delegate.h
|
||||
@@ -16,6 +16,7 @@
|
||||
@ -10,9 +10,9 @@ index f602f3c..091f53e 100644
|
||||
#include "net/proxy/proxy_retry_info.h"
|
||||
|
||||
class GURL;
|
||||
@@ -112,6 +113,10 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
|
||||
const GURL& target_url,
|
||||
const GURL& referrer_url) const;
|
||||
@@ -123,6 +124,10 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
|
||||
bool CanUseReportingClient(const url::Origin& origin,
|
||||
const GURL& endpoint) const;
|
||||
|
||||
+ virtual std::unique_ptr<SourceStream> CreateSourceStream(
|
||||
+ net::URLRequest* request,
|
||||
@ -22,10 +22,10 @@ index f602f3c..091f53e 100644
|
||||
// This is the interface for subclasses of NetworkDelegate to implement. These
|
||||
// member functions will be called by the respective public notification
|
||||
diff --git net/url_request/url_request_job.cc net/url_request/url_request_job.cc
|
||||
index 464e920..9c729b3 100644
|
||||
index 050ba28..05684c8 100644
|
||||
--- net/url_request/url_request_job.cc
|
||||
+++ net/url_request/url_request_job.cc
|
||||
@@ -500,6 +500,12 @@ void URLRequestJob::NotifyHeadersComplete() {
|
||||
@@ -499,6 +499,12 @@ void URLRequestJob::NotifyHeadersComplete() {
|
||||
DCHECK(!source_stream_);
|
||||
source_stream_ = SetUpSourceStream();
|
||||
|
||||
|
@ -55,11 +55,11 @@ index 7111970..f751d6c 100644
|
||||
|
||||
} // namespace net
|
||||
diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc
|
||||
index 2e829ad..5272c10 100644
|
||||
index e838cbe..d2f6f0f 100644
|
||||
--- net/http/transport_security_state.cc
|
||||
+++ net/http/transport_security_state.cc
|
||||
@@ -1382,8 +1382,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) {
|
||||
g_ct_required_for_testing = *required ? 1 : -1;
|
||||
@@ -1537,8 +1537,10 @@ void TransportSecurityState::ClearReportCachesForTesting() {
|
||||
sent_expect_ct_reports_cache_.Clear();
|
||||
}
|
||||
|
||||
-// static
|
||||
@ -72,12 +72,12 @@ index 2e829ad..5272c10 100644
|
||||
// We consider built-in information to be timely for 10 weeks.
|
||||
return (base::Time::Now() - build_time).InDays() < 70 /* 10 weeks */;
|
||||
diff --git net/http/transport_security_state.h net/http/transport_security_state.h
|
||||
index 5d3c126..2c970e8 100644
|
||||
index 19ba839..a0b9810 100644
|
||||
--- net/http/transport_security_state.h
|
||||
+++ net/http/transport_security_state.h
|
||||
@@ -479,6 +479,10 @@ class NET_EXPORT TransportSecurityState
|
||||
// nullptr to reset.
|
||||
static void SetShouldRequireCTForTesting(bool* required);
|
||||
@@ -576,6 +576,10 @@ class NET_EXPORT TransportSecurityState
|
||||
// Expect-CT reports.
|
||||
void ClearReportCachesForTesting();
|
||||
|
||||
+ void set_enforce_net_security_expiration(bool enforce) {
|
||||
+ enforce_net_security_expiration_ = enforce;
|
||||
@ -86,7 +86,7 @@ index 5d3c126..2c970e8 100644
|
||||
private:
|
||||
friend class TransportSecurityStateTest;
|
||||
friend class TransportSecurityStateStaticFuzzer;
|
||||
@@ -503,7 +507,7 @@ class NET_EXPORT TransportSecurityState
|
||||
@@ -596,7 +600,7 @@ class NET_EXPORT TransportSecurityState
|
||||
// IsBuildTimely returns true if the current build is new enough ensure that
|
||||
// built in security information (i.e. HSTS preloading and pinning
|
||||
// information) is timely.
|
||||
@ -95,7 +95,7 @@ index 5d3c126..2c970e8 100644
|
||||
|
||||
// Helper method for actually checking pins.
|
||||
PKPStatus CheckPublicKeyPinsImpl(
|
||||
@@ -594,6 +598,8 @@ class NET_EXPORT TransportSecurityState
|
||||
@@ -704,6 +708,8 @@ class NET_EXPORT TransportSecurityState
|
||||
// True if public key pinning bypass is enabled for local trust anchors.
|
||||
bool enable_pkp_bypass_for_local_trust_anchors_;
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
diff --git net/url_request/url_request.h net/url_request/url_request.h
|
||||
index e1406f3..ed9aa91 100644
|
||||
index 95a2667..68d7bfb 100644
|
||||
--- net/url_request/url_request.h
|
||||
+++ net/url_request/url_request.h
|
||||
@@ -651,10 +651,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
|
||||
// Returns the error status of the request.
|
||||
// Do not use! Going to be protected!
|
||||
const URLRequestStatus& status() const { return status_; }
|
||||
@@ -657,10 +657,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
|
||||
return traffic_annotation_;
|
||||
}
|
||||
|
||||
- protected:
|
||||
+
|
||||
// Allow the URLRequestJob class to control the is_pending() flag.
|
||||
void set_is_pending(bool value) { is_pending_ = value; }
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user