Commit 8da8a4fb authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision 12bfc336 (#338390).

- The ffmpeg library is now statically linked (see https://codereview.chromium.org/1141703002).
- Off-screen rendering of the PDF viewer does not work in combination with surfaces. Pass the
  `--disable-surfaces` command-line flag if GPU is enabled (see https://codereview.chromium.org/1169983006).
parent 50a9343c
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': '14bd12d63019fbdd6f9d6c16b986a5f64a21264b',
'chromium_checkout': '12bfc3360892ec53cd00fc239a47e5298beb063b',
}
......@@ -278,7 +278,6 @@ if(OS_LINUX)
# List of CEF binary files.
set(CEF_BINARY_FILES
chrome-sandbox
libffmpegsumo.so
libcef.so
natives_blob.bin
snapshot_blob.bin
......@@ -438,7 +437,6 @@ if(OS_WINDOWS)
set(CEF_BINARY_FILES
d3dcompiler_43.dll
d3dcompiler_47.dll
ffmpegsumo.dll
libcef.dll
libEGL.dll
libGLESv2.dll
......
......@@ -949,6 +949,7 @@
'<(DEPTH)/components/components.gyp:pref_registry',
'<(DEPTH)/components/components.gyp:printing_common',
'<(DEPTH)/components/components.gyp:printing_renderer',
'<(DEPTH)/components/components.gyp:proxy_config',
'<(DEPTH)/components/components.gyp:update_client',
'<(DEPTH)/components/components.gyp:user_prefs',
'<(DEPTH)/components/components.gyp:web_cache_renderer',
......@@ -1276,10 +1277,6 @@
'<(DEPTH)/chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h',
'<(DEPTH)/chrome/browser/prefs/command_line_pref_store.cc',
'<(DEPTH)/chrome/browser/prefs/command_line_pref_store.h',
'<(DEPTH)/chrome/browser/prefs/proxy_config_dictionary.cc',
'<(DEPTH)/chrome/browser/prefs/proxy_config_dictionary.h',
'<(DEPTH)/chrome/browser/prefs/proxy_prefs.cc',
'<(DEPTH)/chrome/browser/prefs/proxy_prefs.h',
'<(DEPTH)/chrome/common/pref_names.cc',
'<(DEPTH)/chrome/common/pref_names.h',
'<(DEPTH)/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.cc',
......@@ -1546,13 +1543,6 @@
},
],
'copies': [
{
# Copy binaries for HTML5 audio/video support.
'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
'files': [
'<(PRODUCT_DIR)/ffmpegsumo.so',
],
},
{
# Copy binaries for breakpad support.
'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources',
......
......@@ -37,6 +37,10 @@
#include "include/base/cef_string16.h"
#include "include/internal/cef_string_types.h"
#if defined(BUILDING_CEF_SHARED)
#include "base/files/file_path.h"
#endif
///
// Traits implementation for wide character strings.
///
......@@ -692,6 +696,17 @@ class CefStringBase {
return *this;
}
#endif // WCHAR_T_IS_UTF32
#if defined(BUILDING_CEF_SHARED)
// The base::FilePath constructor is marked as explicit so provide the
// conversion here for convenience.
operator base::FilePath() const {
#if defined(OS_WIN)
return base::FilePath(ToWString());
#else
return base::FilePath(ToString());
#endif
}
#endif // BUILDING_CEF_SHARED
private:
// Allocate the string structure if it doesn't already exist.
......
......@@ -886,8 +886,7 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) {
if (!manager)
return;
scoped_ptr<content::DownloadUrlParameters> params;
params.reset(
scoped_ptr<content::DownloadUrlParameters> params(
content::DownloadUrlParameters::FromWebContents(web_contents(), gurl));
manager->DownloadUrl(params.Pass());
}
......@@ -1393,6 +1392,13 @@ bool CefBrowserHostImpl::CanGoBack() {
void CefBrowserHostImpl::GoBack() {
if (CEF_CURRENTLY_ON_UIT()) {
if (frame_destruction_pending_) {
// Try again after frame destruction has completed.
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::GoBack, this));
return;
}
if (web_contents_.get() && web_contents_->GetController().CanGoBack())
web_contents_->GetController().GoBack();
} else {
......@@ -1408,6 +1414,13 @@ bool CefBrowserHostImpl::CanGoForward() {
void CefBrowserHostImpl::GoForward() {
if (CEF_CURRENTLY_ON_UIT()) {
if (frame_destruction_pending_) {
// Try again after frame destruction has completed.
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::GoForward, this));
return;
}
if (web_contents_.get() && web_contents_->GetController().CanGoForward())
web_contents_->GetController().GoForward();
} else {
......@@ -1423,6 +1436,13 @@ bool CefBrowserHostImpl::IsLoading() {
void CefBrowserHostImpl::Reload() {
if (CEF_CURRENTLY_ON_UIT()) {
if (frame_destruction_pending_) {
// Try again after frame destruction has completed.
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::Reload, this));
return;
}
if (web_contents_.get())
web_contents_->GetController().Reload(true);
} else {
......@@ -1433,6 +1453,13 @@ void CefBrowserHostImpl::Reload() {
void CefBrowserHostImpl::ReloadIgnoreCache() {
if (CEF_CURRENTLY_ON_UIT()) {
if (frame_destruction_pending_) {
// Try again after frame destruction has completed.
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this));
return;
}
if (web_contents_.get())
web_contents_->GetController().ReloadIgnoringCache(true);
} else {
......@@ -1443,6 +1470,13 @@ void CefBrowserHostImpl::ReloadIgnoreCache() {
void CefBrowserHostImpl::StopLoad() {
if (CEF_CURRENTLY_ON_UIT()) {
if (frame_destruction_pending_) {
// Try again after frame destruction has completed.
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::StopLoad, this));
return;
}
if (web_contents_.get())
web_contents_->Stop();
} else {
......@@ -1719,6 +1753,14 @@ void CefBrowserHostImpl::LoadURL(
if (frame_id == CefFrameHostImpl::kMainFrameId) {
// Go through the navigation controller.
if (CEF_CURRENTLY_ON_UIT()) {
if (frame_destruction_pending_) {
// Try again after frame destruction has completed.
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::LoadURL, this, frame_id, url,
referrer, transition, extra_headers));
return;
}
if (web_contents_.get()) {
GURL gurl = GURL(url);
......@@ -2407,7 +2449,7 @@ bool CefBrowserHostImpl::ShouldCreateWebContents(
int route_id,
int main_frame_route_id,
WindowContainerType window_container_type,
const base::string16& frame_name,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace,
......@@ -2433,7 +2475,7 @@ bool CefBrowserHostImpl::ShouldCreateWebContents(
void CefBrowserHostImpl::WebContentsCreated(
content::WebContents* source_contents,
int opener_render_frame_id,
const base::string16& frame_name,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) {
DCHECK(new_contents);
......@@ -2675,8 +2717,11 @@ void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) {
if (client_.get()) {
CefRefPtr<CefRequestHandler> handler = client_->GetRequestHandler();
if (handler.get())
if (handler.get()) {
frame_destruction_pending_ = true;
handler->OnRenderProcessTerminated(this, ts);
frame_destruction_pending_ = false;
}
}
}
......@@ -2700,7 +2745,8 @@ void CefBrowserHostImpl::DidFailProvisionalLoad(
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) {
const base::string16& error_description,
bool was_ignored_by_handler) {
const bool is_main_frame = !render_frame_host->GetParent();
CefRefPtr<CefFrame> frame = GetOrCreateFrame(
render_frame_host->GetRoutingID(),
......@@ -2720,7 +2766,8 @@ void CefBrowserHostImpl::DidFailLoad(
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) {
const base::string16& error_description,
bool was_ignored_by_handler) {
const bool is_main_frame = !render_frame_host->GetParent();
CefRefPtr<CefFrame> frame = GetOrCreateFrame(
render_frame_host->GetRoutingID(),
......@@ -2968,6 +3015,7 @@ CefBrowserHostImpl::CefBrowserHostImpl(
main_frame_id_(CefFrameHostImpl::kInvalidFrameId),
focused_frame_id_(CefFrameHostImpl::kInvalidFrameId),
destruction_state_(DESTRUCTION_STATE_NONE),
frame_destruction_pending_(false),
window_destroyed_(false),
is_in_onsetfocus_(false),
focus_on_editable_field_(false),
......@@ -3147,11 +3195,13 @@ void CefBrowserHostImpl::OnLoadError(CefRefPtr<CefFrame> frame,
if (client_.get()) {
CefRefPtr<CefLoadHandler> handler = client_->GetLoadHandler();
if (handler.get()) {
frame_destruction_pending_ = true;
// Notify the handler that loading has failed.
handler->OnLoadError(this, frame,
static_cast<cef_errorcode_t>(error_code),
CefString(error_description),
url.spec());
frame_destruction_pending_ = false;
}
}
}
......
......@@ -397,7 +397,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
int route_id,
int main_frame_route_id,
WindowContainerType window_container_type,
const base::string16& frame_name,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace,
......@@ -405,7 +405,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
content::RenderViewHostDelegateView** delegate_view) override;
void WebContentsCreated(content::WebContents* source_contents,
int opener_render_frame_id,
const base::string16& frame_name,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) override;
void DidNavigateMainFramePostCommit(
......@@ -461,12 +461,14 @@ class CefBrowserHostImpl : public CefBrowserHost,
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) override;
const base::string16& error_description,
bool was_ignored_by_handler) override;
void DocumentAvailableInMainFrame() override;
void DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) override;
const base::string16& error_description,
bool was_ignored_by_handler) override;
void FrameDeleted(
content::RenderFrameHost* render_frame_host) override;
void PluginCrashed(const base::FilePath& plugin_path,
......@@ -662,6 +664,10 @@ class CefBrowserHostImpl : public CefBrowserHost,
// thread.
DestructionState destruction_state_;
// True if frame destruction is currently pending. Navigation should not occur
// while this flag is true.
bool frame_destruction_pending_;
// True if the OS window hosting the browser has been destroyed. Only accessed
// on the UI thread.
bool window_destroyed_;
......
......@@ -82,7 +82,6 @@ void CefBrowserMainParts::ToolkitInitialized() {
#if defined(USE_AURA)
CHECK(aura::Env::GetInstance());
DCHECK(!views::ViewsDelegate::views_delegate);
new views::DesktopTestViewsDelegate;
#if defined(OS_WIN)
......@@ -193,7 +192,9 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
void CefBrowserMainParts::PostDestroyThreads() {
#if defined(USE_AURA)
aura::Env::DeleteInstance();
delete views::ViewsDelegate::views_delegate;
// Delete the DesktopTestViewsDelegate.
delete views::ViewsDelegate::GetInstance();
#endif
#ifndef NDEBUG
......
......@@ -15,10 +15,10 @@
#include "base/values.h"
#include "chrome/browser/net/pref_proxy_config_tracker_impl.h"
#include "chrome/browser/prefs/command_line_pref_store.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "extensions/browser/extension_prefs.h"
#include "grit/cef_strings.h"
#include "ui/base/l10n/l10n_util.h"
......
......@@ -58,9 +58,9 @@ class NET_EXPORT CefURLFetcherResponseWriter :
public:
CefURLFetcherResponseWriter(
CefRefPtr<CefBrowserURLRequest> url_request,
scoped_refptr<base::MessageLoopProxy> message_loop_proxy)
scoped_refptr<base::SequencedTaskRunner> task_runner)
: url_request_(url_request),
message_loop_proxy_(message_loop_proxy) {
task_runner_(task_runner) {
}
// net::URLFetcherResponseWriter methods.
......@@ -72,11 +72,11 @@ class NET_EXPORT CefURLFetcherResponseWriter :
int num_bytes,
const net::CompletionCallback& callback) override {
if (url_request_.get()) {
message_loop_proxy_->PostTask(FROM_HERE,
task_runner_->PostTask(FROM_HERE,
base::Bind(&CefURLFetcherResponseWriter::WriteOnClientThread,
url_request_, scoped_refptr<net::IOBuffer>(buffer),
num_bytes, callback,
base::MessageLoop::current()->message_loop_proxy()));
base::MessageLoop::current()->task_runner()));
return net::ERR_IO_PENDING;
}
return num_bytes;
......@@ -94,7 +94,7 @@ class NET_EXPORT CefURLFetcherResponseWriter :
scoped_refptr<net::IOBuffer> buffer,
int num_bytes,
const net::CompletionCallback& callback,
scoped_refptr<base::MessageLoopProxy> source_message_loop_proxy) {
scoped_refptr<base::SequencedTaskRunner> source_message_loop_proxy) {
CefRefPtr<CefURLRequestClient> client = url_request->GetClient();
if (client.get())
client->OnDownloadData(url_request.get(), buffer->data(), num_bytes);
......@@ -111,7 +111,7 @@ class NET_EXPORT CefURLFetcherResponseWriter :
}
CefRefPtr<CefBrowserURLRequest> url_request_;
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
scoped_refptr<base::SequencedTaskRunner> task_runner_;
DISALLOW_COPY_AND_ASSIGN(CefURLFetcherResponseWriter);
};
......@@ -137,7 +137,7 @@ class CefBrowserURLRequest::Context
request_(request),
client_(client),
request_context_(request_context),
message_loop_proxy_(base::MessageLoop::current()->message_loop_proxy()),
task_runner_(base::MessageLoop::current()->task_runner()),
status_(UR_IO_PENDING),
error_code_(ERR_NONE),
upload_data_size_(0),
......@@ -147,7 +147,7 @@ class CefBrowserURLRequest::Context
}
inline bool CalledOnValidThread() {
return message_loop_proxy_->BelongsToCurrentThread();
return task_runner_->RunsTasksOnCurrentThread();
}
bool Start() {
......@@ -160,14 +160,14 @@ class CefBrowserURLRequest::Context
std::string method = request_->GetMethod();
base::StringToLowerASCII(&method);
net::URLFetcher::RequestType request_type = net::URLFetcher::GET;
if (LowerCaseEqualsASCII(method, "get")) {
} else if (LowerCaseEqualsASCII(method, "post")) {
if (base::LowerCaseEqualsASCII(method, "get")) {
} else if (base::LowerCaseEqualsASCII(method, "post")) {
request_type = net::URLFetcher::POST;
} else if (LowerCaseEqualsASCII(method, "head")) {
} else if (base::LowerCaseEqualsASCII(method, "head")) {
request_type = net::URLFetcher::HEAD;
} else if (LowerCaseEqualsASCII(method, "delete")) {
} else if (base::LowerCaseEqualsASCII(method, "delete")) {
request_type = net::URLFetcher::DELETE_REQUEST;
} else if (LowerCaseEqualsASCII(method, "put")) {
} else if (base::LowerCaseEqualsASCII(method, "put")) {
request_type = net::URLFetcher::PUT;
} else {
NOTREACHED() << "invalid request type";
......@@ -324,7 +324,7 @@ class CefBrowserURLRequest::Context
response_writer.reset(new CefURLFetcherResponseWriter(NULL, NULL));
} else {
response_writer.reset(
new CefURLFetcherResponseWriter(url_request_, message_loop_proxy_));
new CefURLFetcherResponseWriter(url_request_, task_runner_));
}
fetcher_->SaveResponseWithWriter(response_writer.Pass());
......@@ -429,7 +429,7 @@ class CefBrowserURLRequest::Context
~Context() {
if (fetcher_.get()) {
// Delete the fetcher object on the thread that created it.
message_loop_proxy_->DeleteSoon(FROM_HERE, fetcher_.release());
task_runner_->DeleteSoon(FROM_HERE, fetcher_.release());
}
}
......@@ -463,7 +463,7 @@ class CefBrowserURLRequest::Context
CefRefPtr<CefRequest> request_;
CefRefPtr<CefURLRequestClient> client_;
CefRefPtr<CefRequestContext> request_context_;
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
scoped_refptr<base::SequencedTaskRunner> task_runner_;
scoped_ptr<net::URLFetcher> fetcher_;
scoped_ptr<CefURLFetcherDelegate> fetcher_delegate_;
CefURLRequest::Status status_;
......
......@@ -273,3 +273,8 @@ gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() {
NOTIMPLEMENTED();
return NULL;
}
memory::OomPriorityManager* ChromeBrowserProcessStub::GetOomPriorityManager() {
NOTIMPLEMENTED();
return NULL;
}
......@@ -96,6 +96,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
#endif
network_time::NetworkTimeTracker* network_time_tracker() override;
gcm::GCMDriver* gcm_driver() override;
memory::OomPriorityManager* GetOomPriorityManager() override;
private:
std::string locale_;
......
......@@ -209,7 +209,7 @@ const ResourcesMap* CreateResourcesMap() {
const int resource_id = kWebuiResources[i].value;
AddResource(resource_name, resource_id, result);
for (const char* (&alias)[2]: kPathAliases) {
if (StartsWithASCII(resource_name, alias[0], true)) {
if (base::StartsWithASCII(resource_name, alias[0], true)) {
AddResource(alias[1] + resource_name.substr(strlen(alias[0])),
resource_id, result);
}
......
......@@ -57,7 +57,6 @@
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
#include "extensions/browser/io_thread_extension_message_filter.h"
#include "extensions/common/constants.h"
#include "gin/v8_initializer.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
#include "ui/base/ui_base_switches.h"
......@@ -718,15 +717,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
arraysize(kSwitchNames));
}
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (process_type != switches::kZygoteProcess) {
command_line->AppendSwitch(switches::kV8NativesPassedByFD);
command_line->AppendSwitch(switches::kV8SnapshotPassedByFD);
}
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#endif // OS_POSIX && !OS_MACOSX
#if defined(OS_LINUX)
if (process_type == switches::kZygoteProcess) {
// Propagate the following switches to the zygone command line (along with
......@@ -858,7 +848,8 @@ bool CefContentBrowserClient::CanCreateWindow(
bool opener_suppressed,
content::ResourceContext* context,
int render_process_id,
int opener_id,
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) {
CEF_REQUIRE_IOT();
*no_javascript_access = false;
......@@ -1003,21 +994,6 @@ void CefContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
content::FileDescriptorInfo* mappings) {
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) {
int v8_natives_fd = -1;
int v8_snapshot_fd = -1;
if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd,
&v8_snapshot_fd)) {
v8_natives_fd_.reset(v8_natives_fd);
v8_snapshot_fd_.reset(v8_snapshot_fd);
}
}
DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1);
mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
#endif // V8_USE_EXTERNAL_STARTUP_DATA
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
mappings->Share(kCrashDumpSignal, crash_signal_fd);
......
......@@ -125,7 +125,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
bool opener_suppressed,
content::ResourceContext* context,
int render_process_id,
int opener_id,
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) override;
void ResourceDispatcherHostCreated() override;
void OverrideWebkitPrefs(content::RenderViewHost* rvh,
......@@ -159,7 +160,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
int opener_view_id;
int64 opener_frame_id;
GURL target_url;
base::string16 target_frame_name;
std::string target_frame_name;
};
void set_last_create_window_params(const LastCreateWindowParams& params);
......@@ -176,11 +177,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
scoped_ptr<CefResourceDispatcherHostDelegate>
resource_dispatcher_host_delegate_;
#if defined(OS_POSIX) && !defined(OS_MACOSX)
base::ScopedFD v8_natives_fd_;
base::ScopedFD v8_snapshot_fd_;
#endif
base::Lock browser_info_lock_;
// Access must be protected by |browser_info_lock_|.
......
......@@ -108,9 +108,9 @@ void StreamsPrivateAPI::ExecuteMimeTypeHandler(
CreateResponseHeadersDictionary(stream->response_headers.get(),
&info.response_headers.additional_properties);
scoped_ptr<Event> event(
new Event(streams_private::OnExecuteMimeTypeHandler::kEventName,
streams_private::OnExecuteMimeTypeHandler::Create(info)));
scoped_ptr<Event> event(new Event(
events::UNKNOWN, streams_private::OnExecuteMimeTypeHandler::kEventName,
streams_private::OnExecuteMimeTypeHandler::Create(info)));
EventRouter::Get(browser_context_)
->DispatchEventToExtension(extension_id, event.Pass());
......
......@@ -110,7 +110,8 @@ void EventRouterForwarder::CallEventRouter(
scoped_ptr<base::ListValue> event_args,
content::BrowserContext* restrict_to_profile,
const GURL& event_url) {
scoped_ptr<Event> event(new Event(event_name, event_args.Pass()));
scoped_ptr<Event> event(
new Event(events::UNKNOWN, event_name, event_args.Pass()));
event->restrict_to_browser_context = restrict_to_profile;
event->event_url = event_url;
if (extension_id.empty()) {
......
......@@ -256,22 +256,26 @@ CefExtensionSystem::ComponentExtensionInfo::ComponentExtensionInfo(
extension_id = GenerateId(manifest, root_directory);
}
// Implementation based on ComponentLoader::Load and
// ExtensionService::AddExtension.
const Extension* CefExtensionSystem::LoadExtension(
const ComponentExtensionInfo& info) {
// Implementation based on ComponentLoader::CreateExtension.
scoped_refptr<const Extension> CefExtensionSystem::CreateExtension(
const ComponentExtensionInfo& info, std::string* utf8_error) {
// TODO(abarth): We should REQUIRE_MODERN_MANIFEST_VERSION once we've updated
// our component extensions to the new manifest version.
int flags = Extension::REQUIRE_KEY;
std::string error;
scoped_refptr<const Extension> extension(Extension::Create(
return Extension::Create(
info.root_directory,
Manifest::COMPONENT,
*info.manifest,
flags,
&error));
utf8_error);
}
// Implementation based on ComponentLoader::Load and
// ExtensionService::AddExtension.
const Extension* CefExtensionSystem::LoadExtension(
const ComponentExtensionInfo& info) {
std::string error;
scoped_refptr<const Extension> extension(CreateExtension(info, &error));
if (!extension.get()) {
LOG(ERROR) << error;
return NULL;
......
......@@ -86,6 +86,9 @@ class CefExtensionSystem : public ExtensionSystem {
std::string extension_id;
};
scoped_refptr<const Extension> CreateExtension(
const ComponentExtensionInfo& info, std::string* utf8_error);
// Loads a registered component extension.
const Extension* LoadExtension(const ComponentExtensionInfo& info);
......
......@@ -5,7 +5,13 @@
#include "libcef/browser/extensions/extensions_api_client.h"