Compare commits

..

60 Commits
3071 ... 3112

Author SHA1 Message Date
Marshall Greenblatt
fef43e07d6 Windows: Fix crash during window creation (see https://crbug.com/761389) 2017-09-05 11:46:34 -04:00
Marshall Greenblatt
3d5ae838ca Windows: Wait for WM_NCDESTROY before calling OnBeforeClose (issue #2248) 2017-08-31 18:12:02 -04:00
Marshall Greenblatt
2c22842b7e Update to Chromium version 60.0.3112.113 2017-08-28 19:28:15 -04:00
Marshall Greenblatt
9ec3e425dd Fix Widevine DRM loading 2017-08-09 14:29:44 -04:00
Marshall Greenblatt
d97fbff8c6 Update to Chromium version 60.0.3112.90 2017-08-08 19:41:40 -04:00
Marshall Greenblatt
0ce82ecb6a views: Fix LabelButton size calculation 2017-08-08 16:50:26 -04:00
Marshall Greenblatt
f69054f2da Linux: Work around gold linker bug for 32-bit code. 2017-08-01 15:02:59 -04:00
Marshall Greenblatt
8c8deea63a Fix encoding of linux_build.patch 2017-08-01 12:58:56 -04:00
Marshall Greenblatt
9809504014 Fix encoding of linux_build.patch 2017-08-01 12:41:13 -04:00
Marshall Greenblatt
0488961250 Linux: Fix build error related to GTK dependency version. 2017-07-31 10:28:35 -04:00
Marshall Greenblatt
0dba8a1f29 Update to Chromium version 60.0.3112.78 2017-07-28 22:24:49 -04:00
Marshall Greenblatt
d5392b33ef Linux/Mac: Fix handling of command-line arguments (issue #2208) 2017-07-18 16:58:12 -04:00
Marshall Greenblatt
1b2f997a30 Windows: Build cef_sandbox.lib with different GN args for official binary distributions (issue #2220) 2017-07-18 15:51:15 -04:00
Marshall Greenblatt
6c71485135 Add support for loading certificate revocation lists (issue #2213) 2017-07-11 15:46:49 -04:00
Marshall Greenblatt
4407ef95c4 Fix incorrect OSR browser display during navigation (issue #2209) 2017-07-05 15:39:10 -04:00
Marshall Greenblatt
a906bdd2e3 Fix OSR PDF mouse events after keyboard input (issue #2078) 2017-06-30 16:34:25 -04:00
Marshall Greenblatt
86bb301075 Update to Chromium version 60.0.3112.40 2017-06-27 12:50:17 -04:00
Marshall Greenblatt
7afb6c61ff Fix OSR PDF mouse wheel scrolling (issue #2078) 2017-06-23 15:09:04 -04:00
Marshall Greenblatt
c5896eb456 Windows: cefclient: Fix ATL-related build errors (issue #2200) 2017-06-19 15:01:53 +03:00
Marshall Greenblatt
822508f4b4 Linux: Don't pass NULL CefBrowser to PrintHandler::GetPdfPaperSize (issue #2199) 2017-06-17 12:47:48 +03:00
Marshall Greenblatt
141ab16dcd Linux: Pass CefBrowser to CefPrintHandler callbacks (issue #2196) 2017-06-15 19:04:37 +03:00
Marshall Greenblatt
56ba4400a2 Fix gtest path (issue #2188) 2017-06-13 17:08:56 +03:00
Marshall Greenblatt
b96dd2462d macOS: Fix error: unknown type name 'size_t' 2017-06-05 15:40:04 +03:00
Marshall Greenblatt
8774cd9639 Linux: Update to debian jessie sysroots 2017-06-05 15:39:58 +03:00
Marshall Greenblatt
7d05784842 Linux: Fix error: use of undeclared identifier 'GetPreferredSize' 2017-06-05 11:59:45 +02:00
Marshall Greenblatt
a2749d8fbd Update to Chromium version 60.0.3112.10 2017-06-02 22:26:54 +02:00
Marshall Greenblatt
5c79944b31 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.
2017-06-02 05:55:23 -07:00
Marshall Greenblatt
12150b43d2 Apply yapf formatting to all Python files (issue #2171) 2017-05-28 15:04:18 +02:00
Marshall Greenblatt
59606b88d2 Update tooling to use yapf for Python file formatting (issue #2171) 2017-05-28 15:03:42 +02:00
Marshall Greenblatt
d4f06e3806 Move matching h file to top of header list (issue #2171) 2017-05-19 11:11:18 +02:00
Marshall Greenblatt
f6eb19f8d6 Fix discovery of the .clang-format file (issue #2171) 2017-05-19 11:00:44 +02:00
Marshall Greenblatt
24e20aec0f Fix duplicate definition of MSVC_PUSH_DISABLE_WARNING (issue #2171) 2017-05-18 12:30:06 +02:00
Marshall Greenblatt
31d9407ee2 Apply clang-format to all C, C++ and ObjC files (issue #2171) 2017-05-18 12:30:05 +02:00
Marshall Greenblatt
a566549e04 Update tooling to use clang-format (issue #2171) 2017-05-18 12:30:04 +02:00
Nishant Kaushik
816f700d3e Implement accessibility enhancements (issue #1217)
- Add new CefBrowserHost::SetAccessibilityState method for toggling
  accessibility state when readers are detected by the client.
- Add new CefAccessibilityHandler interface for the delivery of
  accessibility notifications to windowless (OSR) clients.
- Fix delivery of CefFocusHandler callbacks to windowless clients.
- cefclient: Add example windowless accessibility implementation on Windows and macOS.
- cefclient: Automatically detect screen readers on Windows and macOS.
2017-05-12 18:28:25 +00:00
Marshall Greenblatt
64fcfa6068 Linux: cefclient: Add OSR drag&drop implementation (issue #2008) 2017-05-11 12:06:32 -07:00
Marshall Greenblatt
67e23b472a Expose drag image via CefDragData (issue #1715) 2017-05-11 14:22:21 -04:00
Marshall Greenblatt
eaa0942690 Make CMake target settings private (issue #2007) 2017-05-11 13:43:38 -04:00
Marshall Greenblatt
49d1fe3b30 CMake configuration improvements (issue #2120)
- Windows: Fix excessive Ninja build warnings.
- Windows: Fix ATL detection for different VC toolchain paths.
- Windows: Fix Ninja Debug build when official build sandbox is enabled.
- Update build tool version recommendations.
2017-05-11 13:19:35 -04:00
Marshall Greenblatt
eea39b8413 Windows: Fix wrong calling convention with gcc compiler (issue 1209) 2017-05-10 16:26:11 -04:00
Marshall Greenblatt
b28a6145a1 Make the CefAuthCallback::Continue password parameter optional (issue #1928) 2017-05-10 12:16:53 -04:00
Marshall Greenblatt
7a02419cac Fix crash when parent is destroyed during popup creation (issue #2041) 2017-05-09 18:54:34 -04:00
Marshall Greenblatt
1347fec298 Remove unused function (issue #1853) 2017-05-09 17:14:02 -04:00
Marshall Greenblatt
51e8c53f30 Remove CefForceShutdown and make failure to call CefShutdown a DCHECK instead (issue #1932) 2017-05-09 15:52:52 -04:00
Marshall Greenblatt
77097ffab7 Remove the CefSettings.context_safety_implementation option (issue #1853).
The default hash implementation will now always be used.
2017-05-09 15:29:27 -04:00
Andrew Warnick
96f9108343 Fix crash when a resource is cancelled due to browser closing (issue #2165) 2017-05-09 15:30:48 +00:00
Marshall Greenblatt
e5ad5a8fcd Fix DCHECK during Find (issue #2050) 2017-05-05 15:34:20 -04:00
Marshall Greenblatt
86c329e790 Linux: Fix DCHECK during GPU feature info detection. 2017-05-04 16:58:47 -07:00
Marshall Greenblatt
3f970689a0 Popups must share the parent context to avoid crashes on parent browser destruction (issue #2162) 2017-05-04 18:17:24 -04:00
Marshall Greenblatt
5a5b538af7 macOS: Fix incorrect creation of NSAutoreleasePool (issue #2160) 2017-04-28 17:49:23 -04:00
Marshall Greenblatt
6d97cfb761 cefclient: macOS: Fix Xcode 5 compile error (issue #2116) 2017-04-28 17:19:29 -04:00
Marshall Greenblatt
b85e69a94c Add support for WebRTC screen sharing (issue #1065) 2017-04-28 16:39:37 -04:00
Marshall Greenblatt
03e25c778a Exit early when patches fail to apply (issue #2012) 2017-04-27 15:20:50 -04:00
Marshall Greenblatt
6a603af993 Fix IndexedDB quota (issue #2070) 2017-04-27 14:59:31 -04:00
Marshall Greenblatt
4fe6ac0d4b Use git apply for applying patch files (issue #1825) 2017-04-27 13:53:32 -04:00
Marshall Greenblatt
a2b8c250a8 Windows: Revert early chrome_elf crashpad initialization (issue #2122) 2017-04-27 13:20:33 -04:00
Marshall Greenblatt
0a2b82757a cefclient: macOS: Fix crash during shutdown from full-screen (issue #2158) 2017-04-26 15:17:49 -04:00
Marshall Greenblatt
f440f850ef cefclient: macOS: Fix CefBrowser leak during OSR shutdown (issue #2151) 2017-04-26 15:05:12 -04:00
Marshall Greenblatt
f2b988a0ce Windows: Fix crash on touch press text selection (issue #2149) 2017-04-26 12:49:30 -04:00
Marshall Greenblatt
10fccbd6cf Windows: Fix VS2008 compile error (issue #2155) 2017-04-26 12:15:59 -04:00
161 changed files with 2211 additions and 1461 deletions

View File

@@ -406,6 +406,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",
@@ -569,10 +571,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 += [
@@ -642,6 +640,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",
@@ -654,6 +655,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",
@@ -1714,7 +1716,7 @@ if (is_mac) {
deps = [
":libcef",
":libcef_dll_wrapper",
"//build/config/sanitizers:deps",
"//build/config:exe_and_shlib_deps",
]
if (is_win) {
@@ -1790,7 +1792,7 @@ if (is_mac) {
deps = [
":libcef",
":libcef_dll_wrapper",
"//build/config/sanitizers:deps",
"//build/config:exe_and_shlib_deps",
]
if (is_win) {
@@ -1859,7 +1861,7 @@ if (is_mac) {
deps = [
":libcef",
":libcef_dll_wrapper",
"//build/config/sanitizers:deps",
"//build/config:exe_and_shlib_deps",
"//testing/gtest",
]

View File

@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/59.0.3071.109',
'chromium_checkout': 'refs/tags/60.0.3112.113',
}

View File

@@ -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',

View File

@@ -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.

View 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_

View File

@@ -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.

View File

@@ -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

View File

@@ -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;

View 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_

View File

@@ -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 =

View File

@@ -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))

View File

@@ -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;

View File

@@ -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_)

View File

@@ -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,

View File

@@ -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;

View File

@@ -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_;

View File

@@ -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(&params->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);
}

View File

@@ -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_;

View File

@@ -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

View File

@@ -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();

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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,

View File

@@ -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);

View File

@@ -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(

View File

@@ -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);

View File

@@ -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.

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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);

View File

@@ -594,7 +594,7 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
// Allow the close.
break;
case WM_DESTROY:
case WM_NCDESTROY:
if (platform_delegate) {
// Clear the user data pointer.
gfx::SetWindowUserData(hwnd, NULL);
@@ -604,7 +604,7 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
// CreateHostWindow().
browser->WindowDestroyed();
}
return 0;
break;
case WM_SIZE:
if (platform_delegate && platform_delegate->window_widget_) {

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -9,6 +9,8 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "net/cert/crl_set.h"
#include "net/cert/crl_set_storage.h"
#include "net/ssl/ssl_config_service.h"
@@ -31,7 +33,7 @@ void SetCRLSetIfNewer(scoped_refptr<net::CRLSet> crl_set) {
}
void LoadFromDisk(const base::FilePath& path) {
CEF_REQUIRE_FILET();
base::ThreadRestrictions::AssertIOAllowed();
std::string crl_set_bytes;
if (!base::ReadFileToString(path, &crl_set_bytes)) {
@@ -57,5 +59,7 @@ void CefLoadCRLSetsFile(const CefString& path) {
return;
}
CEF_POST_TASK(CEF_FILET, base::BindOnce(&LoadFromDisk, path));
base::PostTaskWithTraits(FROM_HERE,
{base::TaskPriority::BACKGROUND, base::MayBlock()},
base::BindOnce(&LoadFromDisk, path));
}

View File

@@ -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() {

View File

@@ -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);

View File

@@ -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)
@@ -952,8 +936,9 @@ void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) {
}
void CefRenderWidgetHostViewOSR::ProcessKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
render_widget_host_->ForwardKeyboardEvent(event);
const content::NativeWebKeyboardEvent& event,
const ui::LatencyInfo& latency) {
render_widget_host_->ForwardKeyboardEventWithLatencyInfo(event, latency);
}
void CefRenderWidgetHostViewOSR::ProcessMouseEvent(
@@ -1182,7 +1167,12 @@ void CefRenderWidgetHostViewOSR::SendKeyEvent(
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
if (render_widget_host_ && render_widget_host_->GetView()) {
// Direct routing requires that events go directly to the View.
render_widget_host_->GetView()->ProcessKeyboardEvent(event);
render_widget_host_->GetView()->ProcessKeyboardEvent(
event, ui::LatencyInfo(event.GetType() == blink::WebInputEvent::kChar ||
event.GetType() ==
blink::WebInputEvent::kRawKeyDown
? ui::SourceEventType::KEY_PRESS
: ui::SourceEventType::OTHER));
}
}

View File

@@ -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;
@@ -177,8 +178,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void SetNeedsBeginFrames(bool enabled) override;
void ProcessKeyboardEvent(const content::NativeWebKeyboardEvent& event)
override;
void ProcessKeyboardEvent(const content::NativeWebKeyboardEvent& event,
const ui::LatencyInfo& latency) override;
void ProcessMouseEvent(const blink::WebMouseEvent& event,
const ui::LatencyInfo& latency) override;
void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event,

View File

@@ -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());
}

View File

@@ -6,10 +6,13 @@
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "chrome/browser/renderer_host/pepper/pepper_broker_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h"
#include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h"
#include "chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_output_protection_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_platform_verification_message_filter.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "ppapi/host/message_filter_host.h"
#include "ppapi/host/ppapi_host.h"
@@ -38,6 +41,33 @@ std::unique_ptr<ResourceHost> CefBrowserPepperHostFactory::CreateResourceHost(
if (!host_->IsValidInstance(instance))
return nullptr;
// Private interfaces.
if (host_->GetPpapiHost()->permissions().HasPermission(
ppapi::PERMISSION_PRIVATE)) {
switch (message.type()) {
case PpapiHostMsg_Broker_Create::ID: {
scoped_refptr<ResourceMessageFilter> broker_filter(
new chrome::PepperBrokerMessageFilter(instance, host_));
return std::unique_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, resource, broker_filter));
}
case PpapiHostMsg_PlatformVerification_Create::ID: {
scoped_refptr<ResourceMessageFilter> pv_filter(
new chrome::PepperPlatformVerificationMessageFilter(host_,
instance));
return std::unique_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, resource, pv_filter));
}
case PpapiHostMsg_OutputProtection_Create::ID: {
scoped_refptr<ResourceMessageFilter> output_protection_filter(
new chrome::PepperOutputProtectionMessageFilter(host_, instance));
return std::unique_ptr<ResourceHost>(
new MessageFilterHost(host_->GetPpapiHost(), instance, resource,
output_protection_filter));
}
}
}
// Flash interfaces.
if (host_->GetPpapiHost()->permissions().HasPermission(
ppapi::PERMISSION_FLASH)) {

View File

@@ -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(

View 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() {}

View 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_

View File

@@ -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))

View File

@@ -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(

View File

@@ -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);

View File

@@ -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))

View File

@@ -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;

View File

@@ -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));

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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_);
}

View File

@@ -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;
}

View File

@@ -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_);
}

View File

@@ -63,7 +63,7 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass {
}
// views::View methods:
gfx::Size GetPreferredSize() const override;
gfx::Size CalculatePreferredSize() const override;
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;
int GetHeightForWidth(int w) const override;
@@ -87,7 +87,7 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass {
CefViewDelegateClass* cef_delegate_;
};
CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::GetPreferredSize() const {
CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::CalculatePreferredSize() const {
gfx::Size result;
if (cef_delegate()) {
CefSize cef_size = cef_delegate()->GetPreferredSize(GetCefView());
@@ -95,7 +95,7 @@ CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::GetPreferredSize() const {
result = gfx::Size(cef_size.width, cef_size.height);
}
if (result.IsEmpty())
result = ParentClass::GetPreferredSize();
result = ParentClass::CalculatePreferredSize();
if (result.IsEmpty()) {
// Some layouts like BoxLayout expect the preferred size to be non-empty.
// The user may have set the size explicitly. Therefore return the current
@@ -142,7 +142,7 @@ CEF_VIEW_VIEW_T int CEF_VIEW_VIEW_D::GetHeightForWidth(int w) const {
// Some layouts like FillLayout will ignore the preferred size if this view
// has no children. We want to use the preferred size if not otherwise
// specified.
result = GetPreferredSize().height();
result = ParentClass::GetPreferredSize().height();
}
return result;
}

View File

@@ -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() {

View File

@@ -176,7 +176,7 @@ class CaptionlessFrameView : public views::NonClientFrameView {
client_view_bounds_.SetRect(0, 0, width(), height());
}
gfx::Size GetPreferredSize() const override {
gfx::Size CalculatePreferredSize() const override {
return widget_->non_client_view()
->GetWindowBoundsForClientBounds(
gfx::Rect(widget_->client_view()->GetPreferredSize()))

View File

@@ -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() {}

View File

@@ -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);

View File

@@ -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 */,

View File

@@ -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";

View File

@@ -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[];

View File

@@ -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"

View File

@@ -1,5 +1,12 @@
{
"display_name": "Chrome Render Process",
"name": "content_renderer",
"interface_provider_specs": {
"service_manager:connector": {
"provides": {
"browser": [
"spellcheck::mojom::SpellChecker"
]
}
}
}
}

View File

@@ -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) \

View File

@@ -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;
}

View File

@@ -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(

View File

@@ -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);

View File

@@ -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(&params));
// 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(&params));
// 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,
&params.attribute_names, &params.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, &params.attribute_names,
&params.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, &params, &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, &params, &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

View File

@@ -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);

View File

@@ -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 &&

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -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_;

View File

@@ -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()) {

View File

@@ -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,

View File

@@ -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() {}

View File

@@ -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);
}

View File

@@ -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() {

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=a3b7d128aa7c1d9c78b416978e944da4eafaf14a$
// $hash=45f1ced8a482b44d73c8538fbbdbc27e73003d6f$
//
#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"
@@ -1192,3 +1194,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));
}

View File

@@ -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:

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=b9a497935b8b0378d130ba55a92d188025df7350$
// $hash=5adfe7f61a476b5b7dac0365f481efc213b3c579$
//
#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"
@@ -1114,3 +1116,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());
}

View File

@@ -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',
@@ -160,11 +157,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 +193,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.
@@ -278,6 +274,9 @@ patches = [
{
# Fix white flash during browser creation.
# https://bitbucket.org/chromiumembedded/cef/issues/1984
#
# Windows: Fix crash during window creation.
# https://bugs.chromium.org/p/chromium/issues/detail?id=761389
'name': 'rwh_background_color_1984',
},
{
@@ -293,6 +292,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',
},
{
@@ -300,33 +304,6 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2015
'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',
},
{
# macOS: Fix compilation error with 10.11 SDK
# https://codereview.chromium.org/2843463003
'name': 'process_metrics_mac_2843463003',
},
{
# Linux: Work around gold linker bug for 32-bit code.
# https://bugs.chromium.org/p/chromium/issues/detail?id=729532
'name': 'swiftshader_729532',
'path': 'third_party/swiftshader/',
},
{
# Linux: Attach routing IDs to PrintingContext.
# https://bitbucket.org/chromiumembedded/cef/issues/2196
@@ -337,4 +314,15 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2220
'name': 'sandbox_2220',
},
{
# Linux: Fix build errors related to dependency versions.
# https://chromium-review.googlesource.com/c/590271/
'name': 'linux_build',
},
{
# Linux: Work around gold linker bug for 32-bit code.
# https://bugs.chromium.org/p/chromium/issues/detail?id=729532
'name': 'swiftshader_729532',
'path': 'third_party/swiftshader/',
},
]

View File

@@ -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 16599b12409c..e489af16f4d1 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 4121584c970f..c82127536fca 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 {

View File

@@ -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 b7e4883f030e..2dfd11ec94bb 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 {

View File

@@ -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 e05acc6ca6dc..c5e82a9484a2 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(
@@ -818,7 +824,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 60dce63f16d3..1126c41ea8fe 100644
--- content/browser/frame_host/interstitial_page_impl.cc
+++ content/browser/frame_host/interstitial_page_impl.cc
@@ -598,7 +598,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
@@ -610,7 +610,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
WebContentsView* wcv =
static_cast<WebContentsImpl*>(web_contents())->GetView();
RenderWidgetHostViewBase* view =
@@ -49,7 +49,7 @@ index d0c4ffa..6399af8 100644
render_view_host_->GetMainFrame()->AllowBindings(
BINDINGS_POLICY_DOM_AUTOMATION);
diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h
index e4401f8..f2fdb9b 100644
index e4401f85bf3f..f2fdb9be0d5c 100644
--- content/browser/web_contents/web_contents_view.h
+++ content/browser/web_contents/web_contents_view.h
@@ -86,13 +86,9 @@ class WebContentsView {
@@ -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 84b906e8b965..ec0d014b7ae8 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 c52692ed1634..63402a66e44a 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
@@ -104,7 +104,7 @@ index fc703087..2a1c368 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_child_frame.cc content/browser/web_contents/web_contents_view_child_frame.cc
index d10fbca..18df45f 100644
index d10fbca3c81e..18df45f5b778 100644
--- content/browser/web_contents/web_contents_view_child_frame.cc
+++ content/browser/web_contents/web_contents_view_child_frame.cc
@@ -94,7 +94,7 @@ void WebContentsViewChildFrame::CreateView(const gfx::Size& initial_size,
@@ -117,7 +117,7 @@ index d10fbca..18df45f 100644
}
diff --git content/browser/web_contents/web_contents_view_child_frame.h content/browser/web_contents/web_contents_view_child_frame.h
index 86ce68b..fd21e5a 100644
index 86ce68bfbe69..fd21e5a7f12b 100644
--- content/browser/web_contents/web_contents_view_child_frame.h
+++ content/browser/web_contents/web_contents_view_child_frame.h
@@ -39,7 +39,7 @@ class WebContentsViewChildFrame : public WebContentsView,
@@ -130,7 +130,7 @@ index 86ce68b..fd21e5a 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_guest.cc content/browser/web_contents/web_contents_view_guest.cc
index 702a579..2acceda 100644
index 702a579c19a8..2acceda336b3 100644
--- content/browser/web_contents/web_contents_view_guest.cc
+++ content/browser/web_contents/web_contents_view_guest.cc
@@ -72,6 +72,8 @@ void WebContentsViewGuest::GetScreenInfo(ScreenInfo* screen_info) const {
@@ -185,7 +185,7 @@ index 702a579..2acceda 100644
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForPopupWidget(
diff --git content/browser/web_contents/web_contents_view_guest.h content/browser/web_contents/web_contents_view_guest.h
index 0102d7e..b89d66c 100644
index 0102d7ee960b..b89d66c025cf 100644
--- content/browser/web_contents/web_contents_view_guest.h
+++ content/browser/web_contents/web_contents_view_guest.h
@@ -58,7 +58,7 @@ class WebContentsViewGuest : public WebContentsView,
@@ -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 b0a1a1d99593..12fce1d3f5fb 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 ebd0ce35c1c1..64a9d8525b9e 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 61662f4bab77..6a4648fb76ff 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 255217dc252d..15710641cba3 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 f3fb78307bc8..642342cfff43 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 0928bf2f44da..e9542785ec8a 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() {}

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/profiles/incognito_helpers.cc chrome/browser/profiles/incognito_helpers.cc
index 6155e96..2125a436 100644
index 6155e9606d67..2125a436c87e 100644
--- chrome/browser/profiles/incognito_helpers.cc
+++ chrome/browser/profiles/incognito_helpers.cc
@@ -8,13 +8,35 @@
@@ -39,7 +39,7 @@ index 6155e96..2125a436 100644
}
diff --git chrome/browser/profiles/incognito_helpers.h chrome/browser/profiles/incognito_helpers.h
index 4b43013..169ca47 100644
index 4b430133e16f..169ca4765907 100644
--- chrome/browser/profiles/incognito_helpers.h
+++ chrome/browser/profiles/incognito_helpers.h
@@ -11,6 +11,19 @@ class BrowserContext;
@@ -63,10 +63,10 @@ index 4b43013..169ca47 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 385f9c3..3d126bd 100644
index 5753fecbe39f..cc23f0662993 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -89,7 +89,7 @@ class ProfileManager : public base::NonThreadSafe,
@@ -95,7 +95,7 @@ class ProfileManager : public base::NonThreadSafe,
// acceptable. Returns null if creation of the new profile fails.
// TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then
// make this method private.
@@ -75,7 +75,7 @@ index 385f9c3..3d126bd 100644
// Returns total number of profiles available on this machine.
size_t GetNumberOfProfiles();
@@ -117,7 +117,7 @@ class ProfileManager : public base::NonThreadSafe,
@@ -123,7 +123,7 @@ class ProfileManager : public base::NonThreadSafe,
// Returns true if the profile pointer is known to point to an existing
// profile.
@@ -84,7 +84,7 @@ index 385f9c3..3d126bd 100644
// Returns the directory where the first created profile is stored,
// relative to the user data directory currently in use.
@@ -126,7 +126,7 @@ class ProfileManager : public base::NonThreadSafe,
@@ -132,7 +132,7 @@ class ProfileManager : public base::NonThreadSafe,
// Get the Profile last used (the Profile to which owns the most recently
// focused window) with this Chrome build. If no signed profile has been
// stored in Local State, hand back the Default profile.

View File

@@ -1,8 +1,8 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index ac5ffb5..47433a2 100644
index b7429b126490..a65dfbfb7709 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) && \

View File

@@ -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 409df107103e..e1df1826410e 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 2e95a3f..625b7ae 100644
index 54a104ae7619..ba76d902d4ea 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -18,6 +18,7 @@
@@ -28,7 +28,7 @@ index 2e95a3f..625b7ae 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 2e95a3f..625b7ae 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 2e95a3f..625b7ae 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
@@ -379,6 +394,8 @@ class COMPOSITOR_EXPORT Compositor
@@ -381,6 +396,8 @@ class COMPOSITOR_EXPORT Compositor
ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;

View File

@@ -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 ecc79522d5ae..69ef4b40ccd9 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(
@@ -14,7 +14,7 @@ index 47820a5..520ca4cd 100644
// The GetPlugins call causes the plugin list to be refreshed. Once that's
// done we can retry the GetPluginInfo call. We break out of this cycle
diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc
index 1783a10..b380ef8 100644
index 1783a101aa02..b380ef826ff7 100644
--- chrome/browser/plugins/chrome_plugin_service_filter.cc
+++ chrome/browser/plugins/chrome_plugin_service_filter.cc
@@ -179,6 +179,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
@@ -26,7 +26,7 @@ index 1783a10..b380ef8 100644
content::WebPluginInfo* plugin) {
base::AutoLock auto_lock(lock_);
diff --git chrome/browser/plugins/chrome_plugin_service_filter.h chrome/browser/plugins/chrome_plugin_service_filter.h
index f8b651f..ec39f8d 100644
index f8b651f1ddc4..ec39f8d7dc85 100644
--- chrome/browser/plugins/chrome_plugin_service_filter.h
+++ chrome/browser/plugins/chrome_plugin_service_filter.h
@@ -71,6 +71,7 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter,
@@ -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 8c31c98cf439..beef4cb9d3ae 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 fd8c99386bdd..7f70c965ce49 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 ea5764be19f4..ae06854189cd 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 578c05b0c757..b2d26876b4bd 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() {
@@ -299,12 +299,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 585a523..2ea3aa6 100644
index 747f19a594c2..642a86d8e60b 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) {
@@ -881,10 +881,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 585a523..2ea3aa6 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(
@@ -1347,6 +1345,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 585a523..2ea3aa6 100644
}
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
@@ -2425,14 +2424,12 @@ void RenderFrameHostImpl::OnHidePopup() {
@@ -2602,14 +2601,12 @@ void RenderFrameHostImpl::OnHidePopup() {
}
#endif
@@ -130,13 +130,13 @@ index 585a523..2ea3aa6 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 caf341b..f94da4c 100644
index 1d1de6edf081..bd05959f98bb 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 caf341b..f94da4c 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 bbbb37d8917d..1fa30da1385b 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 3f49cc40b6d9..c593146686f2 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,
@@ -230,7 +230,7 @@ index 05500b4..cd00c4c 100644
const std::string& mime_type,
bool* found,
diff --git content/browser/loader/mime_sniffing_resource_handler.cc content/browser/loader/mime_sniffing_resource_handler.cc
index 11adad4..283f116 100644
index 11adad470477..283f11625851 100644
--- content/browser/loader/mime_sniffing_resource_handler.cc
+++ content/browser/loader/mime_sniffing_resource_handler.cc
@@ -519,8 +519,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
@@ -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 4bdfa1d5455f..cf9b9166ae43 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 85b64dad4b90..e77f1bb5a1c2 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 7077b9a6cefe..5fa68b1b1bdd 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 bf0088e..e70677e 100644
index e9b89307ad89..42e3aec266e0 100644
--- content/ppapi_plugin/ppapi_blink_platform_impl.cc
+++ content/ppapi_plugin/ppapi_blink_platform_impl.cc
@@ -212,6 +212,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 bf0088e..e70677e 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 84d29a5ae84a..3541ff0650be 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 ac05c13b1df8..762262bff01a 100644
--- content/public/browser/plugin_service.h
+++ content/public/browser/plugin_service.h
@@ -74,6 +74,7 @@ class PluginService {
@@ -353,7 +353,7 @@ index c404ac8..9dd87e7 100644
const std::string& mime_type,
bool allow_wildcard,
diff --git content/public/browser/plugin_service_filter.h content/public/browser/plugin_service_filter.h
index 3b610b1..7c439e0 100644
index 3b610b1f554e..7c439e060779 100644
--- content/public/browser/plugin_service_filter.h
+++ content/public/browser/plugin_service_filter.h
@@ -33,6 +33,7 @@ class PluginServiceFilter {
@@ -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 02565ee6d990..de8fa6e7d535 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 0e554ba8467a..8ac5c5428a5c 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 ebf4cd4b118c..27a9df408783 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 ffb4d51..adfb515 100644
index 2fd389c96cb5..8aa049b62e8e 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -2788,7 +2788,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;
@@ -5337,9 +5338,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() {
@@ -5509,9 +5512,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
(!IsBrowserSideNavigationEnabled() ||
url != pending_navigation_params_->request_params.redirects[0]));
@@ -430,7 +463,7 @@ index ffb4d51..adfb515 100644
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation(
@@ -5352,7 +5352,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
@@ -5524,7 +5526,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
}
return blink::kWebNavigationPolicyIgnore;
}
@@ -438,11 +471,24 @@ index ffb4d51..adfb515 100644
Referrer referrer(
RenderViewImpl::GetReferrerFromRequest(frame_, info.url_request));
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 574acb32ff2a..924d6cf35e5d 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -756,6 +756,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 a54028632b2d..41b19d41472a 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 b931470c95ce..af3719abb371 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 3a48c59b7e3e..d10ef64adbba 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 7767a620a9fd..8a95377f5f3b 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 6746b9f16e7e..8634ada48d57 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 db23a83ed079..57a4c536118c 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 7150daf1402c..69fcc9e7442b 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 78b7d2cf4c02..62a52cbc905f 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;

View File

@@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc
index 6f03077..c61fed3 100644
index 6f030773518c..c61fed3ab2f2 100644
--- content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc
+++ content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc
@@ -55,7 +55,7 @@ PepperFlashFileMessageFilter::PepperFlashFileMessageFilter(

View File

@@ -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 4d385dd5512b..1b51f2d17491 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 1e332ab..0290e49 100644
index e9578be2cd28..2561824f984b 100644
--- chrome/common/crash_keys.cc
+++ chrome/common/crash_keys.cc
@@ -4,6 +4,8 @@
@@ -43,7 +43,7 @@ index 1e332ab..0290e49 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 1e332ab..0290e49 100644
// The following keys may be chunked by the underlying crash logging system,
// but ultimately constitute a single key-value pair.
//
@@ -233,10 +235,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 1e332ab..0290e49 100644
// Register the extension IDs.
{
@@ -270,7 +278,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 1e332ab..0290e49 100644
static const char* const kIgnoreSwitches[] = {
switches::kEnableLogging,
switches::kFlagSwitchesBegin,
@@ -326,7 +334,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 1e332ab..0290e49 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 93fb0b07ec1e..3e543d211ff3 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 c8197e919e95..21ad726a223e 100644
--- chrome_elf/BUILD.gn
+++ chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@
@@ -169,7 +169,7 @@ index 40f611f..b5e7d64 100644
"//components/crash/content/app:app",
"//components/crash/core/common", # crash_keys
diff --git chrome_elf/crash/crash_helper.cc chrome_elf/crash/crash_helper.cc
index c658fa9..8c4a145 100644
index c658fa949b7c..8c4a145d1d9a 100644
--- chrome_elf/crash/crash_helper.cc
+++ chrome_elf/crash/crash_helper.cc
@@ -11,12 +11,17 @@
@@ -203,7 +203,7 @@ index c658fa9..8c4a145 100644
g_crash_helper_enabled = true;
return true;
diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc
index 0d3de65..a1b8b09 100644
index 0d3de65043a0..a1b8b092f23a 100644
--- components/crash/content/app/breakpad_linux.cc
+++ components/crash/content/app/breakpad_linux.cc
@@ -29,6 +29,7 @@
@@ -281,7 +281,7 @@ index 0d3de65..a1b8b09 100644
void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) {
SanitizationInfo sanitization_info;
diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h
index 0160f62..b732498 100644
index 0160f6284561..b732498f86ab 100644
--- components/crash/content/app/breakpad_linux.h
+++ components/crash/content/app/breakpad_linux.h
@@ -16,6 +16,9 @@ namespace breakpad {
@@ -295,7 +295,7 @@ index 0160f62..b732498 100644
extern void InitCrashKeysForTesting();
diff --git components/crash/content/app/crash_reporter_client.cc components/crash/content/app/crash_reporter_client.cc
index 2e9ee28..de53f59 100644
index 2e9ee28e1b00..de53f5927143 100644
--- components/crash/content/app/crash_reporter_client.cc
+++ components/crash/content/app/crash_reporter_client.cc
@@ -88,11 +88,12 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
@@ -364,7 +364,7 @@ index 2e9ee28..de53f59 100644
-
} // namespace crash_reporter
diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h
index 9f69c19..2abaee00 100644
index 9f69c193dda2..2abaee004c47 100644
--- components/crash/content/app/crash_reporter_client.h
+++ components/crash/content/app/crash_reporter_client.h
@@ -8,6 +8,7 @@
@@ -390,14 +390,14 @@ index 9f69c19..2abaee00 100644
virtual base::FilePath GetReporterLogFilename();
// Custom crash minidump handler after the minidump is generated.
@@ -119,6 +121,7 @@ class CrashReporterClient {
@@ -118,6 +120,7 @@ class CrashReporterClient {
// WARNING: this handler runs in a compromised context. It may not call into
// libc nor allocate memory normally.
virtual bool HandleCrashDump(const char* crashdump_filename);
#endif
+#endif
#endif
// The location where minidump files should be written. Returns true if
// |crash_dir| was set. Windows has to use base::string16 because this code
@@ -197,6 +200,23 @@ class CrashReporterClient {
// Returns true if breakpad should run in the given process type.
@@ -423,7 +423,7 @@ 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 dcec34684352..6272df65bd0d 100644
--- components/crash/content/app/crashpad.cc
+++ components/crash/content/app/crashpad.cc
@@ -142,7 +142,8 @@ void InitializeCrashpadImpl(bool initial_client,
@@ -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..b2bee0e 100644
index 3bae07e14c69..b2bee0ee1572 100644
--- components/crash/content/app/crashpad_mac.mm
+++ components/crash/content/app/crashpad_mac.mm
@@ -16,11 +16,14 @@
@@ -538,7 +538,7 @@ index 3bae07e..b2bee0e 100644
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..4de2228 100644
index 94a350f4b5a4..09fce540a054 100644
--- components/crash/content/app/crashpad_win.cc
+++ components/crash/content/app/crashpad_win.cc
@@ -33,8 +33,8 @@ void GetPlatformCrashpadAnnotations(
@@ -581,15 +581,16 @@ index 94a350f..4de2228 100644
- // reinvoke it with --type=crashpad-handler. Otherwise, we use the
- // standalone crashpad_handler.exe (for tests, etc.).
std::vector<std::string> start_arguments;
- if (embedded_handler) {
- start_arguments.push_back(std::string("--type=") +
- switches::kCrashpadHandler);
+
+ // Always add --type=crashpad-handler because the value is expected by
+ // CefExecuteProcess.
+ start_arguments.push_back(
+ std::string("--type=") + switches::kCrashpadHandler);
+
if (embedded_handler) {
- start_arguments.push_back(std::string("--type=") +
- switches::kCrashpadHandler);
+ if (embedded_handler) {
// 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.
@@ -607,7 +608,7 @@ index 94a350f..4de2228 100644
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc
index bcf53d5..d4f070b 100644
index bcf53d5960e4..d4f070b19cd8 100644
--- content/browser/frame_host/debug_urls.cc
+++ content/browser/frame_host/debug_urls.cc
@@ -139,7 +139,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {

View File

@@ -1,5 +1,5 @@
diff --git third_party/crashpad/crashpad/client/prune_crash_reports.cc third_party/crashpad/crashpad/client/prune_crash_reports.cc
index 3aaaeee..d99fcb4 100644
index 3aaaeee5d07f..d99fcb418d9e 100644
--- third_party/crashpad/crashpad/client/prune_crash_reports.cc
+++ third_party/crashpad/crashpad/client/prune_crash_reports.cc
@@ -67,13 +67,19 @@ void PruneCrashReportDatabase(CrashReportDatabase* database,
@@ -26,7 +26,7 @@ index 3aaaeee..d99fcb4 100644
static const time_t kSecondsInDay = 60 * 60 * 24;
diff --git third_party/crashpad/crashpad/client/prune_crash_reports.h third_party/crashpad/crashpad/client/prune_crash_reports.h
index 6dac5f3..34f5ee1 100644
index 6dac5f3002b3..34f5ee111d3d 100644
--- third_party/crashpad/crashpad/client/prune_crash_reports.h
+++ third_party/crashpad/crashpad/client/prune_crash_reports.h
@@ -57,7 +57,8 @@ class PruneCondition {
@@ -40,7 +40,7 @@ index 6dac5f3..34f5ee1 100644
virtual ~PruneCondition() {}
diff --git third_party/crashpad/crashpad/client/settings.cc third_party/crashpad/crashpad/client/settings.cc
index 15d16f2..5e8eadf 100644
index 15d16f2e0928..5e8eadfd3ad1 100644
--- third_party/crashpad/crashpad/client/settings.cc
+++ third_party/crashpad/crashpad/client/settings.cc
@@ -38,7 +38,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) {
@@ -130,7 +130,7 @@ index 15d16f2..5e8eadf 100644
Settings::ScopedLockedFileHandle Settings::MakeScopedLockedFileHandle(
FileHandle file,
diff --git third_party/crashpad/crashpad/client/settings.h third_party/crashpad/crashpad/client/settings.h
index b64f74f..0c3c22e 100644
index b64f74fbaf28..0c3c22e215b6 100644
--- third_party/crashpad/crashpad/client/settings.h
+++ third_party/crashpad/crashpad/client/settings.h
@@ -102,6 +102,11 @@ class Settings {
@@ -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 c769efed5c54..daec6cd17f37 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 e6d05e22b639..93e5eb17f7c5 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(),

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/font_family_cache.h chrome/browser/font_family_cache.h
index 743448d..0a9f350 100644
index 743448d8744a..0a9f35025a8b 100644
--- chrome/browser/font_family_cache.h
+++ chrome/browser/font_family_cache.h
@@ -20,6 +20,8 @@ class Profile;

View File

@@ -1,8 +1,8 @@
diff --git .gn .gn
index cd7ed79..0c318f9 100644
index c91f91148cf0..bd906bc2e851 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 5559319..65fde09 100644
index 94297185eddd..1f8c4866a48a 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",
@@ -24,7 +24,7 @@ index 5559319..65fde09 100644
"//chrome/test:unit_tests",
"//components:components_browsertests",
diff --git build/config/win/visual_studio_version.gni build/config/win/visual_studio_version.gni
index 982fbe8..e757be46 100644
index 982fbe8d3f0d..e757be4688f1 100644
--- build/config/win/visual_studio_version.gni
+++ build/config/win/visual_studio_version.gni
@@ -12,9 +12,8 @@ declare_args() {
@@ -56,7 +56,7 @@ index 982fbe8..e757be46 100644
+ "studio path")
}
diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py
index e8b0849..0bfc676 100644
index e8b08495745c..0bfc67619941 100644
--- build/toolchain/win/setup_toolchain.py
+++ build/toolchain/win/setup_toolchain.py
@@ -132,18 +132,20 @@ def _LoadToolchainEnv(cpu, sdk_dir):
@@ -91,10 +91,10 @@ index e8b0849..0bfc676 100644
diff --git build/vs_toolchain.py build/vs_toolchain.py
index 90a562d..8c63b12 100755
index bb8f96c4e52c..690223784382 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 1f9a1fc9a687..aa69e8c98648 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 2afab1a3c6a3..c8791ea51be2 100644
--- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn
@@ -128,7 +128,7 @@ template("generate_mini_installer") {

Some files were not shown because too many files have changed in this diff Show More