mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 78.0.3904.0 (#693954)
This commit is contained in:
@@ -21,7 +21,7 @@ class WebContents;
|
||||
namespace extensions {
|
||||
namespace cef {
|
||||
|
||||
class TabsGetFunction : public UIThreadExtensionFunction {
|
||||
class TabsGetFunction : public ExtensionFunction {
|
||||
~TabsGetFunction() override {}
|
||||
|
||||
ResponseAction Run() override;
|
||||
@@ -29,7 +29,7 @@ class TabsGetFunction : public UIThreadExtensionFunction {
|
||||
DECLARE_EXTENSION_FUNCTION("tabs.get", TABS_GET)
|
||||
};
|
||||
|
||||
class TabsCreateFunction : public UIThreadExtensionFunction {
|
||||
class TabsCreateFunction : public ExtensionFunction {
|
||||
public:
|
||||
TabsCreateFunction();
|
||||
~TabsCreateFunction() override {}
|
||||
@@ -88,7 +88,7 @@ class TabsInsertCSSFunction : public ExecuteCodeInTabFunction {
|
||||
};
|
||||
|
||||
// Based on ChromeAsyncExtensionFunction.
|
||||
class ZoomAPIFunction : public UIThreadExtensionFunction {
|
||||
class ZoomAPIFunction : public ExtensionFunction {
|
||||
public:
|
||||
ZoomAPIFunction();
|
||||
|
||||
|
@@ -83,9 +83,10 @@ class CefGetExtensionLoadFileCallbackImpl
|
||||
return;
|
||||
}
|
||||
|
||||
base::PostTaskWithTraitsAndReplyWithResult(
|
||||
base::PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
{base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
|
||||
{base::ThreadPool(), base::MayBlock(),
|
||||
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
|
||||
base::BindOnce(LoadFileFromStream, file, stream), std::move(callback));
|
||||
}
|
||||
|
||||
@@ -135,7 +136,7 @@ class CefGetExtensionLoadFileCallbackImpl
|
||||
} // namespace
|
||||
|
||||
CefExtensionFunctionDetails::CefExtensionFunctionDetails(
|
||||
UIThreadExtensionFunction* function)
|
||||
ExtensionFunction* function)
|
||||
: function_(function) {}
|
||||
|
||||
CefExtensionFunctionDetails::~CefExtensionFunctionDetails() {}
|
||||
@@ -401,9 +402,17 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
|
||||
return nullptr;
|
||||
|
||||
// Return data about the newly created tab.
|
||||
auto extension = function()->extension();
|
||||
auto web_contents = new_browser->web_contents();
|
||||
auto result = CreateTabObject(new_browser, opener_browser_id, active, index);
|
||||
ExtensionTabUtil::ScrubTabForExtension(
|
||||
function()->extension(), new_browser->web_contents(), result.get());
|
||||
auto scrub_tab_behavior = ExtensionTabUtil::GetScrubTabBehavior(
|
||||
extension, extensions::Feature::Context::UNSPECIFIED_CONTEXT,
|
||||
web_contents);
|
||||
if (scrub_tab_behavior != ExtensionTabUtil::kDontScrubTab) {
|
||||
ExtensionTabUtil::ScrubTabForExtension(extension, web_contents,
|
||||
result.get(), scrub_tab_behavior);
|
||||
}
|
||||
|
||||
return result->ToValue().release();
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
|
||||
class Profile;
|
||||
class UIThreadExtensionFunction;
|
||||
class ExtensionFunction;
|
||||
|
||||
namespace content {
|
||||
class WebContents;
|
||||
@@ -23,13 +23,13 @@ class WebContents;
|
||||
|
||||
namespace extensions {
|
||||
|
||||
// Provides CEF-specific details to UIThreadExtensionFunction implementations.
|
||||
// Provides CEF-specific details to ExtensionFunction implementations.
|
||||
// Based on chrome/browser/extensions/chrome_extension_function_details.h.
|
||||
class CefExtensionFunctionDetails {
|
||||
public:
|
||||
// Constructs a new ChromeExtensionFunctionDetails instance for |function|.
|
||||
// This instance does not own |function| and must outlive it.
|
||||
explicit CefExtensionFunctionDetails(UIThreadExtensionFunction* function);
|
||||
explicit CefExtensionFunctionDetails(ExtensionFunction* function);
|
||||
~CefExtensionFunctionDetails();
|
||||
|
||||
Profile* GetProfile() const;
|
||||
@@ -124,9 +124,9 @@ class CefExtensionFunctionDetails {
|
||||
static std::unique_ptr<api::tabs::MutedInfo> CreateMutedInfo(
|
||||
content::WebContents* contents);
|
||||
|
||||
// Returns a pointer to the associated UIThreadExtensionFunction
|
||||
UIThreadExtensionFunction* function() { return function_; }
|
||||
const UIThreadExtensionFunction* function() const { return function_; }
|
||||
// Returns a pointer to the associated ExtensionFunction
|
||||
ExtensionFunction* function() { return function_; }
|
||||
const ExtensionFunction* function() const { return function_; }
|
||||
|
||||
protected:
|
||||
CefRefPtr<CefExtension> GetCefExtension() const;
|
||||
@@ -134,7 +134,7 @@ class CefExtensionFunctionDetails {
|
||||
private:
|
||||
// The function for which these details have been created. Must outlive the
|
||||
// CefExtensionFunctionDetails instance.
|
||||
UIThreadExtensionFunction* function_;
|
||||
ExtensionFunction* function_;
|
||||
|
||||
mutable CefRefPtr<CefExtension> cef_extension_;
|
||||
|
||||
|
@@ -419,7 +419,7 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
|
||||
const base::Closure& callback) {
|
||||
// TODO(extensions): The |incognito_enabled| value should be set based on
|
||||
// manifest settings.
|
||||
base::PostTaskWithTraitsAndReply(
|
||||
base::PostTaskAndReply(
|
||||
FROM_HERE, {BrowserThread::IO},
|
||||
base::Bind(&InfoMap::AddExtension, info_map(),
|
||||
base::RetainedRef(extension), base::Time::Now(),
|
||||
@@ -433,7 +433,7 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
|
||||
void CefExtensionSystem::UnregisterExtensionWithRequestContexts(
|
||||
const std::string& extension_id,
|
||||
const UnloadedExtensionReason reason) {
|
||||
base::PostTaskWithTraits(
|
||||
base::PostTask(
|
||||
FROM_HERE, {BrowserThread::IO},
|
||||
base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
|
||||
}
|
||||
|
@@ -281,10 +281,11 @@ CefExtensionsBrowserClient::GetComponentExtensionResourceManager() {
|
||||
void CefExtensionsBrowserClient::BroadcastEventToRenderers(
|
||||
events::HistogramValue histogram_value,
|
||||
const std::string& event_name,
|
||||
std::unique_ptr<base::ListValue> args) {
|
||||
std::unique_ptr<base::ListValue> args,
|
||||
bool dispatch_to_off_the_record_profiles) {
|
||||
g_browser_process->extension_event_router_forwarder()
|
||||
->BroadcastEventToRenderers(histogram_value, event_name, std::move(args),
|
||||
GURL());
|
||||
GURL(), dispatch_to_off_the_record_profiles);
|
||||
}
|
||||
|
||||
ExtensionCache* CefExtensionsBrowserClient::GetExtensionCache() {
|
||||
|
@@ -93,7 +93,8 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
|
||||
void BroadcastEventToRenderers(
|
||||
events::HistogramValue histogram_value,
|
||||
const std::string& event_name,
|
||||
std::unique_ptr<base::ListValue> args) override;
|
||||
std::unique_ptr<base::ListValue> args,
|
||||
bool dispatch_to_off_the_record_profiles) override;
|
||||
ExtensionCache* GetExtensionCache() override;
|
||||
bool IsBackgroundUpdateAllowed() override;
|
||||
bool IsMinBrowserVersionSupported(const std::string& min_version) override;
|
||||
|
@@ -98,8 +98,10 @@ ValueStore::WriteResult CefValueStore::Set(
|
||||
if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) ||
|
||||
!old_value->Equals(&it.value())) {
|
||||
changes->push_back(ValueStoreChange(
|
||||
it.key(), old_value ? old_value->CreateDeepCopy() : nullptr,
|
||||
it.value().CreateDeepCopy()));
|
||||
it.key(),
|
||||
old_value ? base::Optional<base::Value>(old_value->Clone())
|
||||
: base::nullopt,
|
||||
it.value().Clone()));
|
||||
storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy());
|
||||
}
|
||||
}
|
||||
@@ -121,7 +123,8 @@ ValueStore::WriteResult CefValueStore::Remove(
|
||||
it != keys.end(); ++it) {
|
||||
std::unique_ptr<base::Value> old_value;
|
||||
if (storage_.RemoveWithoutPathExpansion(*it, &old_value)) {
|
||||
changes->push_back(ValueStoreChange(*it, std::move(old_value), nullptr));
|
||||
changes->push_back(
|
||||
ValueStoreChange(*it, std::move(*old_value), base::nullopt));
|
||||
}
|
||||
}
|
||||
return WriteResult(std::move(changes), CreateStatusCopy(status_));
|
||||
|
Reference in New Issue
Block a user