Update to Chromium revision 59d44948 (#323860)

This commit is contained in:
Marshall Greenblatt
2015-04-20 14:11:11 +03:00
parent 0369063810
commit 1c6da5fe86
38 changed files with 491 additions and 429 deletions

View File

@@ -9,6 +9,7 @@
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h"
#include "libcef/browser/download_manager_delegate.h"
#include "libcef/browser/permission_manager.h"
#include "libcef/browser/thread_util.h"
#include "base/files/file_util.h"
@@ -197,6 +198,12 @@ content::SSLHostStateDelegate*
return NULL;
}
content::PermissionManager* CefBrowserContextImpl::GetPermissionManager() {
if (!permission_manager_.get())
permission_manager_.reset(new CefPermissionManager());
return permission_manager_.get();
}
bool CefBrowserContextImpl::IsProxy() const {
return false;
}

View File

@@ -58,6 +58,7 @@ class CefBrowserContextImpl : public CefBrowserContext {
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
content::PushMessagingService* GetPushMessagingService() override;
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
content::PermissionManager* GetPermissionManager() override;
// CefBrowserContext methods.
bool IsProxy() const override;
@@ -95,6 +96,7 @@ class CefBrowserContextImpl : public CefBrowserContext {
scoped_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
scoped_refptr<CefURLRequestContextGetterImpl> url_request_getter_;
scoped_ptr<content::PermissionManager> permission_manager_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserContextImpl);
};

View File

@@ -95,6 +95,10 @@ content::SSLHostStateDelegate*
return parent_->GetSSLHostStateDelegate();
}
content::PermissionManager* CefBrowserContextProxy::GetPermissionManager() {
return parent_->GetPermissionManager();
}
bool CefBrowserContextProxy::IsProxy() const {
return true;
}

View File

@@ -49,6 +49,7 @@ class CefBrowserContextProxy : public CefBrowserContext {
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
content::PushMessagingService* GetPushMessagingService() override;
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
content::PermissionManager* GetPermissionManager() override;
// CefBrowserContext methods.
bool IsProxy() const override;

View File

@@ -1620,9 +1620,6 @@ void CefBrowserHostImpl::LoadURL(
return;
}
// Update the loading URL.
OnLoadingURLChange(gurl);
web_contents_->GetController().LoadURL(
gurl,
referrer,
@@ -1786,11 +1783,6 @@ int CefBrowserHostImpl::browser_id() const {
return browser_info_->browser_id();
}
GURL CefBrowserHostImpl::GetLoadingURL() {
base::AutoLock lock_scope(state_lock_);
return loading_url_;
}
void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
if (CEF_CURRENTLY_ON_UIT()) {
// SetFocus() might be called while inside the OnSetFocus() callback. If so,
@@ -2641,7 +2633,6 @@ bool CefBrowserHostImpl::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(CefBrowserHostImpl, message)
IPC_MESSAGE_HANDLER(CefHostMsg_FrameIdentified, OnFrameIdentified)
IPC_MESSAGE_HANDLER(CefHostMsg_DidFinishLoad, OnDidFinishLoad)
IPC_MESSAGE_HANDLER(CefHostMsg_LoadingURLChange, OnLoadingURLChange)
IPC_MESSAGE_HANDLER(CefHostMsg_Request, OnRequest)
IPC_MESSAGE_HANDLER(CefHostMsg_Response, OnResponse)
IPC_MESSAGE_HANDLER(CefHostMsg_ResponseAck, OnResponseAck)
@@ -2691,11 +2682,6 @@ void CefBrowserHostImpl::OnDidFinishLoad(int64 frame_id,
OnLoadEnd(frame, validated_url, http_status_code);
}
void CefBrowserHostImpl::OnLoadingURLChange(const GURL& loading_url) {
base::AutoLock lock_scope(state_lock_);
loading_url_ = loading_url;
}
void CefBrowserHostImpl::OnRequest(const Cef_Request_Params& params) {
bool success = false;
std::string response;

View File

@@ -307,9 +307,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
CefWindowX11* window_x11() const { return window_x11_; }
#endif
// Returns the URL that is currently loading (or loaded) in the main frame.
GURL GetLoadingURL();
#if defined(OS_WIN)
static void RegisterWindowClass();
#endif
@@ -478,7 +475,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
const GURL& validated_url,
bool is_main_frame,
int http_status_code);
void OnLoadingURLChange(const GURL& pending_url);
void OnRequest(const Cef_Request_Params& params);
void OnResponse(const Cef_Response_Params& params);
void OnResponseAck(int request_id);
@@ -617,7 +613,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool can_go_back_;
bool can_go_forward_;
bool has_document_;
GURL loading_url_;
// Messages we queue while waiting for the RenderView to be ready. We queue
// them here instead of in the RenderProcessHost to ensure that they're sent

View File

@@ -37,7 +37,6 @@
#include "content/public/browser/access_token_store.h"
#include "content/public/browser/browser_url_handler.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/geolocation_provider.h"
#include "content/public/browser/plugin_service_filter.h"
#include "content/public/browser/quota_permission_context.h"
#include "content/public/browser/render_process_host.h"
@@ -198,42 +197,6 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback {
DISALLOW_COPY_AND_ASSIGN(CefAllowCertificateErrorCallbackImpl);
};
class CefGeolocationCallbackImpl : public CefGeolocationCallback {
public:
typedef base::Callback<void(content::PermissionStatus)> CallbackType;
explicit CefGeolocationCallbackImpl(const CallbackType& callback)
: callback_(callback) {}
void Continue(bool allow) override {
if (CEF_CURRENTLY_ON_UIT()) {
if (!callback_.is_null()) {
if (allow) {
content::GeolocationProvider::GetInstance()->
UserDidOptIntoLocationServices();
}
callback_.Run(allow ? content::PERMISSION_STATUS_GRANTED :
content::PERMISSION_STATUS_DENIED);
callback_.Reset();
}
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefGeolocationCallbackImpl::Continue, this, allow));
}
}
void Disconnect() {
callback_.Reset();
}
private:
CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefGeolocationCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefGeolocationCallbackImpl);
};
class CefQuotaPermissionContext : public content::QuotaPermissionContext {
public:
CefQuotaPermissionContext() {
@@ -787,75 +750,6 @@ content::AccessTokenStore* CefContentBrowserClient::CreateAccessTokenStore() {
browser_main_parts_->browser_context()->request_context().get());
}
void CefContentBrowserClient::RequestPermission(
content::PermissionType permission,
content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& result_callback) {
CEF_REQUIRE_UIT();
if (permission != content::PermissionType::PERMISSION_GEOLOCATION) {
result_callback.Run(content::PERMISSION_STATUS_DENIED);
return;
}
bool proceed = false;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
CefRefPtr<CefGeolocationHandler> handler =
client->GetGeolocationHandler();
if (handler.get()) {
CefRefPtr<CefGeolocationCallbackImpl> callbackImpl(
new CefGeolocationCallbackImpl(result_callback));
// Notify the handler.
proceed = handler->OnRequestGeolocationPermission(
browser.get(), requesting_frame.spec(), bridge_id,
callbackImpl.get());
if (!proceed)
callbackImpl->Disconnect();
}
}
}
if (!proceed) {
// Disallow geolocation access by default.
result_callback.Run(content::PERMISSION_STATUS_DENIED);
}
}
void CefContentBrowserClient::CancelPermissionRequest(
content::PermissionType permission,
content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame) {
CEF_REQUIRE_UIT();
if (permission != content::PermissionType::PERMISSION_GEOLOCATION)
return;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
CefRefPtr<CefGeolocationHandler> handler =
client->GetGeolocationHandler();
if (handler.get()) {
handler->OnCancelGeolocationPermission(browser.get(),
requesting_frame.spec(),
bridge_id);
}
}
}
}
bool CefContentBrowserClient::CanCreateWindow(
const GURL& opener_url,
const GURL& opener_top_level_frame_url,

View File

@@ -106,18 +106,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* result) override;
content::AccessTokenStore* CreateAccessTokenStore() override;
void RequestPermission(
content::PermissionType permission,
content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& result_callback)
override;
void CancelPermissionRequest(content::PermissionType permission,
content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame) override;
bool CanCreateWindow(const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,

View File

@@ -0,0 +1,161 @@
// Copyright 2015 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/permission_manager.h"
#include "include/cef_client.h"
#include "include/cef_geolocation_handler.h"
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/thread_util.h"
#include "base/callback.h"
#include "content/public/browser/geolocation_provider.h"
#include "content/public/browser/permission_type.h"
namespace {
class CefGeolocationCallbackImpl : public CefGeolocationCallback {
public:
typedef base::Callback<void(content::PermissionStatus)> CallbackType;
explicit CefGeolocationCallbackImpl(const CallbackType& callback)
: callback_(callback) {}
void Continue(bool allow) override {
if (CEF_CURRENTLY_ON_UIT()) {
if (!callback_.is_null()) {
if (allow) {
content::GeolocationProvider::GetInstance()->
UserDidOptIntoLocationServices();
}
callback_.Run(allow ? content::PERMISSION_STATUS_GRANTED :
content::PERMISSION_STATUS_DENIED);
callback_.Reset();
}
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefGeolocationCallbackImpl::Continue, this, allow));
}
}
void Disconnect() {
callback_.Reset();
}
private:
CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefGeolocationCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefGeolocationCallbackImpl);
};
} // namespace
CefPermissionManager::CefPermissionManager()
: PermissionManager() {
}
CefPermissionManager::~CefPermissionManager() {
}
void CefPermissionManager::RequestPermission(
content::PermissionType permission,
content::WebContents* web_contents,
int request_id,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback) {
CEF_REQUIRE_UIT();
if (permission != content::PermissionType::GEOLOCATION) {
callback.Run(content::PERMISSION_STATUS_DENIED);
return;
}
bool proceed = false;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
CefRefPtr<CefGeolocationHandler> handler =
client->GetGeolocationHandler();
if (handler.get()) {
CefRefPtr<CefGeolocationCallbackImpl> callbackImpl(
new CefGeolocationCallbackImpl(callback));
// Notify the handler.
proceed = handler->OnRequestGeolocationPermission(
browser.get(), requesting_origin.spec(), request_id,
callbackImpl.get());
if (!proceed)
callbackImpl->Disconnect();
}
}
}
if (!proceed) {
// Disallow geolocation access by default.
callback.Run(content::PERMISSION_STATUS_DENIED);
}
}
void CefPermissionManager::CancelPermissionRequest(
content::PermissionType permission,
content::WebContents* web_contents,
int request_id,
const GURL& requesting_origin) {
CEF_REQUIRE_UIT();
if (permission != content::PermissionType::GEOLOCATION)
return;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
CefRefPtr<CefGeolocationHandler> handler =
client->GetGeolocationHandler();
if (handler.get()) {
handler->OnCancelGeolocationPermission(browser.get(),
requesting_origin.spec(),
request_id);
}
}
}
}
void CefPermissionManager::ResetPermission(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) {
}
content::PermissionStatus CefPermissionManager::GetPermissionStatus(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) {
return content::PERMISSION_STATUS_DENIED;
}
void CefPermissionManager::RegisterPermissionUsage(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) {
}
int CefPermissionManager::SubscribePermissionStatusChange(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin,
const base::Callback<void(content::PermissionStatus)>& callback) {
return -1;
}
void CefPermissionManager::UnsubscribePermissionStatusChange(
int subscription_id) {
}

View File

@@ -0,0 +1,50 @@
// Copyright 2015 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_PERMISSION_MANAGER_H_
#define CEF_LIBCEF_BROWSER_PERMISSION_MANAGER_H_
#include "base/callback_forward.h"
#include "base/macros.h"
#include "content/public/browser/permission_manager.h"
class CefPermissionManager : public content::PermissionManager {
public:
CefPermissionManager();
~CefPermissionManager() override;
// PermissionManager implementation.
void RequestPermission(
content::PermissionType permission,
content::WebContents* web_contents,
int request_id,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback) override;
void CancelPermissionRequest(content::PermissionType permission,
content::WebContents* web_contents,
int request_id,
const GURL& requesting_origin) override;
void ResetPermission(content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) override;
content::PermissionStatus GetPermissionStatus(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) override;
void RegisterPermissionUsage(content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) override;
int SubscribePermissionStatusChange(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin,
const base::Callback<void(content::PermissionStatus)>& callback) override;
void UnsubscribePermissionStatusChange(int subscription_id) override;
private:
DISALLOW_COPY_AND_ASSIGN(CefPermissionManager);
};
#endif // CEF_LIBCEF_BROWSER_PERMISSION_MANAGER_H_

View File

@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "cc/output/copy_output_request.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "content/browser/bad_message.h"
#include "content/browser/compositor/image_transport_factory.h"
#include "content/browser/compositor/resize_lock.h"
#include "content/browser/renderer_host/dip_util.h"
@@ -651,8 +652,11 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
if (frame->software_frame_data) {
DLOG(ERROR) << "Unable to use software frame in CEF windowless rendering";
if (render_widget_host_)
render_widget_host_->GetProcess()->ReceivedBadMessage();
if (render_widget_host_) {
content::bad_message::ReceivedBadMessage(
render_widget_host_->GetProcess(),
content::bad_message::RWHVM_UNEXPECTED_FRAME_TYPE);
}
return;
}
}

View File

@@ -175,11 +175,6 @@ IPC_MESSAGE_ROUTED4(CefHostMsg_DidFinishLoad,
bool /* is_main_frame */,
int /* http_status_code */)
// Sent when a new URL is about to be loaded in the main frame. Used for the
// cookie manager.
IPC_MESSAGE_ROUTED1(CefHostMsg_LoadingURLChange,
GURL /* loading_url */)
// Sent when the renderer has a request for the browser. The browser may respond
// with a CefMsg_Response.
IPC_MESSAGE_ROUTED1(CefHostMsg_Request,

View File

@@ -307,9 +307,6 @@ void CefBrowserImpl::LoadRequest(const CefMsg_LoadRequest_Params& params) {
blink::WebURLRequest request(params.url);
// DidCreateDataSource checks for this value.
request.setRequestorID(-1);
if (!params.method.empty())
request.setHTTPMethod(base::ASCIIToUTF16(params.method));
@@ -574,30 +571,6 @@ void CefBrowserImpl::FocusedNodeChanged(const blink::WebNode& node) {
}
}
void CefBrowserImpl::DidCreateDataSource(blink::WebLocalFrame* frame,
blink::WebDataSource* ds) {
const blink::WebURLRequest& request = ds->request();
if (request.requestorID() == -1) {
// Mark the request as browser-initiated so
// RenderViewImpl::decidePolicyForNavigation won't attempt to fork it.
content::DocumentState* document_state =
content::DocumentState::FromDataSource(ds);
document_state->set_navigation_state(
content::NavigationStateImpl::CreateBrowserInitiated(
content::CommonNavigationParams(),
content::StartNavigationParams(),
content::HistoryNavigationParams()));
}
if (frame->parent() == 0) {
GURL url = ds->request().url();
if (!url.is_empty()) {
// Notify that the loading URL has changed.
Send(new CefHostMsg_LoadingURLChange(routing_id(), url));
}
}
}
bool CefBrowserImpl::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CefBrowserImpl, message)

View File

@@ -119,8 +119,6 @@ class CefBrowserImpl : public CefBrowser,
bool is_new_navigation) override;
void FrameDetached(blink::WebFrame* frame) override;
void FocusedNodeChanged(const blink::WebNode& node) override;
void DidCreateDataSource(blink::WebLocalFrame* frame,
blink::WebDataSource* ds) override;
bool OnMessageReceived(const IPC::Message& message) override;
// RenderViewObserver::OnMessageReceived message handlers.

View File

@@ -3,17 +3,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/compiler_specific.h"
#include "config.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8RecursionScope.h"
MSVC_POP_WARNING();
#undef ceil
#undef FROM_HERE
#undef LOG
#include "libcef/renderer/content_renderer_client.h"
#include "libcef/browser/context.h"
@@ -61,13 +50,11 @@ MSVC_POP_WARNING();
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebPluginParams.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 "v8/include/v8.h"
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
@@ -625,69 +612,6 @@ bool CefContentRendererClient::HandleNavigation(
return false;
}
void CefContentRendererClient::DidCreateScriptContext(
blink::WebLocalFrame* frame,
v8::Handle<v8::Context> context,
int extension_group,
int world_id) {
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->top());
DCHECK(browserPtr.get());
if (!browserPtr.get())
return;
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
v8::Context::Scope scope(context);
blink::V8RecursionScope recursion_scope(isolate);
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(isolate, context));
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler();
if (handler.get())
handler->OnContextCreated(browserPtr.get(), framePtr.get(), contextPtr);
}
}
void CefContentRendererClient::WillReleaseScriptContext(
blink::WebLocalFrame* frame,
v8::Handle<v8::Context> context,
int world_id) {
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler();
if (handler.get()) {
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->top());
DCHECK(browserPtr.get());
if (browserPtr.get()) {
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
v8::Context::Scope scope(context);
blink::V8RecursionScope recursion_scope(isolate);
CefRefPtr<CefV8Context> contextPtr(
new CefV8ContextImpl(isolate, context));
handler->OnContextReleased(browserPtr.get(), framePtr.get(),
contextPtr);
}
}
}
CefV8ReleaseContext(context);
}
void CefContentRendererClient::WillDestroyCurrentMessageLoop() {
base::AutoLock lock_scope(single_process_cleanup_lock_);
single_process_cleanup_complete_ = true;

View File

@@ -94,14 +94,6 @@ class CefContentRendererClient : public content::ContentRendererClient,
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect) override;
void DidCreateScriptContext(blink::WebLocalFrame* frame,
v8::Handle<v8::Context> context,
int extension_group,
int world_id) override;
void WillReleaseScriptContext(blink::WebLocalFrame* frame,
v8::Handle<v8::Context> context,
int world_id);
// MessageLoop::DestructionObserver implementation.
void WillDestroyCurrentMessageLoop() override;

View File

@@ -2,11 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "base/compiler_specific.h"
#include "config.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "bindings/core/v8/V8RecursionScope.h"
MSVC_POP_WARNING();
#undef FROM_HERE
#undef LOG
#include "libcef/renderer/render_frame_observer.h"
#include "libcef/common/content_client.h"
#include "libcef/renderer/content_renderer_client.h"
#include "libcef/renderer/v8_impl.h"
#include "content/public/renderer/render_frame.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebKit.h"
CefRenderFrameObserver::CefRenderFrameObserver(
content::RenderFrame* render_frame)
@@ -16,9 +30,67 @@ CefRenderFrameObserver::CefRenderFrameObserver(
CefRenderFrameObserver::~CefRenderFrameObserver() {
}
void CefRenderFrameObserver::DidCreateScriptContext(
v8::Handle<v8::Context> context,
int extension_group,
int world_id) {
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->top());
DCHECK(browserPtr.get());
if (!browserPtr.get())
return;
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
v8::Context::Scope scope(context);
blink::V8RecursionScope recursion_scope(isolate);
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(isolate, context));
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler();
if (handler.get())
handler->OnContextCreated(browserPtr.get(), framePtr.get(), contextPtr);
}
}
void CefRenderFrameObserver::WillReleaseScriptContext(
v8::Handle<v8::Context> context,
int world_id) {
CefContentRendererClient::Get()->WillReleaseScriptContext(
render_frame()->GetWebFrame(), context, world_id);
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler();
if (handler.get()) {
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->top());
DCHECK(browserPtr.get());
if (browserPtr.get()) {
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
v8::Context::Scope scope(context);
blink::V8RecursionScope recursion_scope(isolate);
CefRefPtr<CefV8Context> contextPtr(
new CefV8ContextImpl(isolate, context));
handler->OnContextReleased(browserPtr.get(), framePtr.get(),
contextPtr);
}
}
}
CefV8ReleaseContext(context);
}

View File

@@ -16,6 +16,9 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
explicit CefRenderFrameObserver(content::RenderFrame* render_frame);
~CefRenderFrameObserver() override;
void DidCreateScriptContext(v8::Handle<v8::Context> context,
int extension_group,
int world_id) override;
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
int world_id) override;

View File

@@ -83,7 +83,7 @@ class CefV8IsolateManager {
}
scoped_refptr<CefV8ContextState> GetContextState(
v8::Handle<v8::Context> context) {
v8::Local<v8::Context> context) {
DCHECK_EQ(isolate_, v8::Isolate::GetCurrent());
DCHECK(context.IsEmpty() || isolate_ == context->GetIsolate());
@@ -108,11 +108,11 @@ class CefV8IsolateManager {
return state;
} else {
v8::Handle<v8::String> key =
v8::Local<v8::String> key =
v8::String::NewFromUtf8(isolate_, kCefContextState);
v8::Handle<v8::Object> object = context->Global();
v8::Handle<v8::Value> value = object->GetHiddenValue(key);
v8::Local<v8::Object> object = context->Global();
v8::Local<v8::Value> value = object->GetHiddenValue(key);
if (!value.IsEmpty()) {
return static_cast<CefV8ContextState*>(
v8::External::Cast(*value)->Value());
@@ -128,7 +128,7 @@ class CefV8IsolateManager {
}
}
void ReleaseContext(v8::Handle<v8::Context> context) {
void ReleaseContext(v8::Local<v8::Context> context) {
DCHECK_EQ(isolate_, v8::Isolate::GetCurrent());
DCHECK_EQ(isolate_, context->GetIsolate());
@@ -143,10 +143,10 @@ class CefV8IsolateManager {
context_map_.erase(it);
}
} else {
v8::Handle<v8::String> key =
v8::Local<v8::String> key =
v8::String::NewFromUtf8(isolate_, kCefContextState);
v8::Handle<v8::Object> object = context->Global();
v8::Handle<v8::Value> value = object->GetHiddenValue(key);
v8::Local<v8::Object> object = context->Global();
v8::Local<v8::Value> value = object->GetHiddenValue(key);
if (value.IsEmpty())
return;
@@ -323,14 +323,14 @@ class V8TrackObject : public CefTrackNode {
}
// Attach this track object to the specified V8 object.
void AttachTo(v8::Handle<v8::Object> object) {
void AttachTo(v8::Local<v8::Object> object) {
object->SetHiddenValue(v8::String::NewFromUtf8(isolate_, kCefTrackObject),
v8::External::New(isolate_, this));
}
// Retrieve the track object for the specified V8 object.
static V8TrackObject* Unwrap(v8::Isolate* isolate,
v8::Handle<v8::Object> object) {
v8::Local<v8::Object> object) {
DCHECK(isolate);
v8::Local<v8::Value> value =
object->GetHiddenValue(
@@ -360,7 +360,7 @@ class V8TrackString : public CefTrackNode {
// Convert a CefString to a V8::String.
v8::Handle<v8::String> GetV8String(v8::Isolate* isolate,
v8::Local<v8::String> GetV8String(v8::Isolate* isolate,
const CefString& str) {
#if defined(CEF_STRING_TYPE_UTF16)
// Already a UTF16 string.
@@ -397,7 +397,7 @@ void v8impl_string_dtor(char* str) {
#endif
// Convert a v8::String to CefString.
void GetCefString(v8::Handle<v8::String> str, CefString& out) {
void GetCefString(v8::Local<v8::String> str, CefString& out) {
if (str.IsEmpty())
return;
@@ -481,7 +481,7 @@ void AccessorGetterCallbackImpl(
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Handle<v8::Object> obj = info.This();
v8::Local<v8::Object> obj = info.This();
CefRefPtr<CefV8Accessor> accessorPtr;
@@ -519,7 +519,7 @@ void AccessorSetterCallbackImpl(
const v8::PropertyCallbackInfo<void>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Handle<v8::Object> obj = info.This();
v8::Local<v8::Object> obj = info.This();
CefRefPtr<CefV8Accessor> accessorPtr;
@@ -541,11 +541,11 @@ void AccessorSetterCallbackImpl(
}
}
v8::Local<v8::Value> CallV8Function(v8::Handle<v8::Context> context,
v8::Handle<v8::Function> function,
v8::Handle<v8::Object> receiver,
v8::Local<v8::Value> CallV8Function(v8::Local<v8::Context> context,
v8::Local<v8::Function> function,
v8::Local<v8::Object> receiver,
int argc,
v8::Handle<v8::Value> args[],
v8::Local<v8::Value> args[],
v8::Isolate* isolate) {
v8::Local<v8::Value> func_rv;
@@ -583,7 +583,7 @@ class ExtensionWrapper : public v8::Extension {
v8::Isolate* isolate,
v8::Handle<v8::String> name) override {
if (!handler_)
return v8::Handle<v8::FunctionTemplate>();
return v8::Local<v8::FunctionTemplate>();
return v8::FunctionTemplate::New(isolate,
FunctionCallbackImpl,
@@ -596,7 +596,7 @@ class ExtensionWrapper : public v8::Extension {
class CefV8ExceptionImpl : public CefV8Exception {
public:
explicit CefV8ExceptionImpl(v8::Handle<v8::Message> message)
explicit CefV8ExceptionImpl(v8::Local<v8::Message> message)
: line_number_(0),
start_position_(0),
end_position_(0),
@@ -653,7 +653,7 @@ void MessageListenerCallbackImpl(v8::Handle<v8::Message> message,
v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8Context> context = CefV8Context::GetCurrentContext();
v8::Handle<v8::StackTrace> v8Stack = message->GetStackTrace();
v8::Local<v8::StackTrace> v8Stack = message->GetStackTrace();
DCHECK(!v8Stack.IsEmpty());
CefRefPtr<CefV8StackTrace> stackTrace =
new CefV8StackTraceImpl(isolate, v8Stack);
@@ -679,7 +679,7 @@ void CefV8IsolateDestroyed() {
g_v8_state.Pointer()->DestroyIsolateManager();
}
void CefV8ReleaseContext(v8::Handle<v8::Context> context) {
void CefV8ReleaseContext(v8::Local<v8::Context> context) {
GetIsolateManager()->ReleaseContext(context);
}
@@ -771,7 +771,7 @@ bool CefV8HandleBase::BelongsToCurrentThread() const {
}
CefV8HandleBase::CefV8HandleBase(v8::Isolate* isolate,
v8::Handle<v8::Context> context)
v8::Local<v8::Context> context)
: isolate_(isolate) {
DCHECK(isolate_);
@@ -821,7 +821,7 @@ bool CefV8Context::InContext() {
// CefV8ContextImpl
CefV8ContextImpl::CefV8ContextImpl(v8::Isolate* isolate,
v8::Handle<v8::Context> context)
v8::Local<v8::Context> context)
: handle_(new Handle(isolate, context, context))
#ifndef NDEBUG
, enter_count_(0)
@@ -879,7 +879,7 @@ CefRefPtr<CefV8Value> CefV8ContextImpl::GetGlobal() {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Context> context = GetV8Context();
v8::Local<v8::Context> context = GetV8Context();
v8::Context::Scope context_scope(context);
return new CefV8ValueImpl(isolate, context->Global());
}
@@ -946,7 +946,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
return false;
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(val);
v8::Handle<v8::Value> code_val = GetV8String(isolate, code);
v8::Local<v8::Value> code_val = GetV8String(isolate, code);
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
@@ -966,7 +966,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
return true;
}
v8::Handle<v8::Context> CefV8ContextImpl::GetV8Context() {
v8::Local<v8::Context> CefV8ContextImpl::GetV8Context() {
return handle_->GetNewV8Handle();
}
@@ -981,7 +981,7 @@ blink::WebFrame* CefV8ContextImpl::GetWebFrame() {
// CefV8ValueImpl::Handle
CefV8ValueImpl::Handle::Handle(v8::Isolate* isolate,
v8::Handle<v8::Context> context,
v8::Local<v8::Context> context,
handleType v,
CefTrackNode* tracker)
: CefV8HandleBase(isolate, context),
@@ -1271,7 +1271,7 @@ CefV8ValueImpl::CefV8ValueImpl(v8::Isolate* isolate)
}
CefV8ValueImpl::CefV8ValueImpl(v8::Isolate* isolate,
v8::Handle<v8::Value> value)
v8::Local<v8::Value> value)
: isolate_(isolate),
type_(TYPE_INVALID),
rethrow_exceptions_(false) {
@@ -1286,7 +1286,7 @@ CefV8ValueImpl::~CefV8ValueImpl() {
handle_->SetWeakIfNecessary();
}
void CefV8ValueImpl::InitFromV8Value(v8::Handle<v8::Value> value) {
void CefV8ValueImpl::InitFromV8Value(v8::Local<v8::Value> value) {
if (value->IsUndefined()) {
InitUndefined();
} else if (value->IsNull()) {
@@ -1371,13 +1371,13 @@ void CefV8ValueImpl::InitString(CefString& value) {
}
}
void CefV8ValueImpl::InitObject(v8::Handle<v8::Value> value, CefTrackNode* tracker) {
void CefV8ValueImpl::InitObject(v8::Local<v8::Value> value, CefTrackNode* tracker) {
DCHECK_EQ(type_, TYPE_INVALID);
type_ = TYPE_OBJECT;
handle_ = new Handle(isolate_, v8::Handle<v8::Context>(), value, tracker);
handle_ = new Handle(isolate_, v8::Local<v8::Context>(), value, tracker);
}
v8::Handle<v8::Value> CefV8ValueImpl::GetV8Value(bool should_persist) {
v8::Local<v8::Value> CefV8ValueImpl::GetV8Value(bool should_persist) {
switch (type_) {
case TYPE_UNDEFINED:
return v8::Undefined(isolate_);
@@ -1403,7 +1403,7 @@ v8::Handle<v8::Value> CefV8ValueImpl::GetV8Value(bool should_persist) {
}
NOTREACHED() << "Invalid type for CefV8ValueImpl";
return v8::Handle<v8::Value>();
return v8::Local<v8::Value>();
}
bool CefV8ValueImpl::IsValid() {
@@ -1568,8 +1568,8 @@ bool CefV8ValueImpl::IsUserCreated() {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj);
return (tracker != NULL);
@@ -1612,8 +1612,8 @@ bool CefV8ValueImpl::HasValue(const CefString& key) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
return obj->Has(GetV8String(isolate, key));
}
@@ -1626,8 +1626,8 @@ bool CefV8ValueImpl::HasValue(int index) {
}
v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
return obj->Has(index);
}
@@ -1636,8 +1636,8 @@ bool CefV8ValueImpl::DeleteValue(const CefString& key) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
@@ -1654,8 +1654,8 @@ bool CefV8ValueImpl::DeleteValue(int index) {
}
v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
@@ -1668,8 +1668,8 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
@@ -1689,8 +1689,8 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
@@ -1709,8 +1709,8 @@ bool CefV8ValueImpl::SetValue(const CefString& key,
if (impl && impl->IsValid()) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
@@ -1743,8 +1743,8 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr<CefV8Value> value) {
CefV8ValueImpl* impl = static_cast<CefV8ValueImpl*>(value.get());
if (impl && impl->IsValid()) {
v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
@@ -1762,8 +1762,8 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings,
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
CefRefPtr<CefV8Accessor> accessorPtr;
@@ -1793,8 +1793,8 @@ bool CefV8ValueImpl::GetKeys(std::vector<CefString>& keys) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
v8::Local<v8::Array> arr_keys = obj->GetPropertyNames();
uint32_t len = arr_keys->Length();
@@ -1812,8 +1812,8 @@ bool CefV8ValueImpl::SetUserData(CefRefPtr<CefBase> user_data) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj);
if (tracker) {
@@ -1829,8 +1829,8 @@ CefRefPtr<CefBase> CefV8ValueImpl::GetUserData() {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj);
if (tracker)
@@ -1844,8 +1844,8 @@ int CefV8ValueImpl::GetExternallyAllocatedMemory() {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj);
if (tracker)
@@ -1859,8 +1859,8 @@ int CefV8ValueImpl::AdjustExternallyAllocatedMemory(int change_in_bytes) {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj);
if (tracker)
@@ -1873,14 +1873,14 @@ int CefV8ValueImpl::GetArrayLength() {
CEF_V8_REQUIRE_OBJECT_RETURN(0);
v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsArray()) {
NOTREACHED() << "V8 value is not an array";
return 0;
}
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Array> arr = v8::Handle<v8::Array>::Cast(obj);
v8::Local<v8::Object> obj = value->ToObject();
v8::Local<v8::Array> arr = v8::Local<v8::Array>::Cast(obj);
return arr->Length();
}
@@ -1889,14 +1889,14 @@ CefString CefV8ValueImpl::GetFunctionName() {
CEF_V8_REQUIRE_OBJECT_RETURN(rv);
v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function";
return rv;
}
v8::Handle<v8::Object> obj = value->ToObject();
v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(obj);
v8::Local<v8::Object> obj = value->ToObject();
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(obj);
GetCefString(v8::Handle<v8::String>::Cast(func->GetName()), rv);
return rv;
}
@@ -1906,13 +1906,13 @@ CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function";
return 0;
}
v8::Handle<v8::Object> obj = value->ToObject();
v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj);
if (tracker)
return tracker->GetHandler();
@@ -1936,7 +1936,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function";
return 0;
@@ -1972,21 +1972,21 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
v8::Context::Scope context_scope(context_local);
v8::Handle<v8::Object> obj = value->ToObject();
v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(obj);
v8::Handle<v8::Object> recv;
v8::Local<v8::Object> obj = value->ToObject();
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(obj);
v8::Local<v8::Object> recv;
// Default to the global object if no object was provided.
if (object.get()) {
CefV8ValueImpl* recv_impl = static_cast<CefV8ValueImpl*>(object.get());
recv = v8::Handle<v8::Object>::Cast(recv_impl->GetV8Value(true));
recv = v8::Local<v8::Object>::Cast(recv_impl->GetV8Value(true));
} else {
recv = context_local->Global();
}
v8::Handle<v8::Value> *argv = NULL;
v8::Local<v8::Value> *argv = NULL;
if (argc > 0) {
argv = new v8::Handle<v8::Value>[argc];
argv = new v8::Local<v8::Value>[argc];
for (int i = 0; i < argc; ++i) {
argv[i] =
static_cast<CefV8ValueImpl*>(arguments[i].get())->GetV8Value(true);
@@ -2035,7 +2035,7 @@ CefRefPtr<CefV8StackTrace> CefV8StackTrace::GetCurrent(int frame_limit) {
v8::Isolate* isolate = GetIsolateManager()->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::StackTrace> stackTrace =
v8::Local<v8::StackTrace> stackTrace =
v8::StackTrace::CurrentStackTrace(
isolate, frame_limit, v8::StackTrace::kDetailed);
if (stackTrace.IsEmpty())
@@ -2048,7 +2048,7 @@ CefRefPtr<CefV8StackTrace> CefV8StackTrace::GetCurrent(int frame_limit) {
CefV8StackTraceImpl::CefV8StackTraceImpl(
v8::Isolate* isolate,
v8::Handle<v8::StackTrace> handle) {
v8::Local<v8::StackTrace> handle) {
int frame_count = handle->GetFrameCount();
if (frame_count > 0) {
frames_.reserve(frame_count);
@@ -2079,19 +2079,19 @@ CefRefPtr<CefV8StackFrame> CefV8StackTraceImpl::GetFrame(int index) {
CefV8StackFrameImpl::CefV8StackFrameImpl(
v8::Isolate* isolate,
v8::Handle<v8::StackFrame> handle)
v8::Local<v8::StackFrame> handle)
: line_number_(0),
column_(0),
is_eval_(false),
is_constructor_(false) {
if (handle.IsEmpty())
return;
GetCefString(v8::Handle<v8::String>::Cast(handle->GetScriptName()),
GetCefString(v8::Local<v8::String>::Cast(handle->GetScriptName()),
script_name_);
GetCefString(
v8::Handle<v8::String>::Cast(handle->GetScriptNameOrSourceURL()),
v8::Local<v8::String>::Cast(handle->GetScriptNameOrSourceURL()),
script_name_or_source_url_);
GetCefString(v8::Handle<v8::String>::Cast(handle->GetFunctionName()),
GetCefString(v8::Local<v8::String>::Cast(handle->GetFunctionName()),
function_name_);
line_number_ = handle->GetLineNumber();
column_ = handle->GetColumn();

View File

@@ -31,7 +31,7 @@ void CefV8IsolateCreated();
void CefV8IsolateDestroyed();
// Call to detach all handles associated with the specified context.
void CefV8ReleaseContext(v8::Handle<v8::Context> context);
void CefV8ReleaseContext(v8::Local<v8::Context> context);
// Set the stack size for uncaught exceptions.
void CefV8SetUncaughtExceptionStackSize(int stack_size);
@@ -117,7 +117,7 @@ class CefV8HandleBase :
// |context| is the context that owns this handle. If empty the current
// context will be used.
CefV8HandleBase(v8::Isolate* isolate,
v8::Handle<v8::Context> context);
v8::Local<v8::Context> context);
virtual ~CefV8HandleBase();
protected:
@@ -135,7 +135,7 @@ class CefV8Handle : public CefV8HandleBase {
typedef v8::Persistent<v8class> persistentType;
CefV8Handle(v8::Isolate* isolate,
v8::Handle<v8::Context> context,
v8::Local<v8::Context> context,
handleType v)
: CefV8HandleBase(isolate, context),
handle_(isolate, v) {
@@ -170,7 +170,7 @@ class CefV8Handle<v8::Value> {
class CefV8ContextImpl : public CefV8Context {
public:
CefV8ContextImpl(v8::Isolate* isolate,
v8::Handle<v8::Context> context);
v8::Local<v8::Context> context);
~CefV8ContextImpl() override;
CefRefPtr<CefTaskRunner> GetTaskRunner() override;
@@ -185,7 +185,7 @@ class CefV8ContextImpl : public CefV8Context {
CefRefPtr<CefV8Value>& retval,
CefRefPtr<CefV8Exception>& exception) override;
v8::Handle<v8::Context> GetV8Context();
v8::Local<v8::Context> GetV8Context();
blink::WebFrame* GetWebFrame();
protected:
@@ -205,12 +205,12 @@ class CefV8ValueImpl : public CefV8Value {
public:
explicit CefV8ValueImpl(v8::Isolate* isolate);
CefV8ValueImpl(v8::Isolate* isolate,
v8::Handle<v8::Value> value);
v8::Local<v8::Value> value);
~CefV8ValueImpl() override;
// Used for initializing the CefV8ValueImpl. Should be called a single time
// after the CefV8ValueImpl is created.
void InitFromV8Value(v8::Handle<v8::Value> value);
void InitFromV8Value(v8::Local<v8::Value> value);
void InitUndefined();
void InitNull();
void InitBool(bool value);
@@ -219,11 +219,11 @@ class CefV8ValueImpl : public CefV8Value {
void InitDouble(double value);
void InitDate(const CefTime& value);
void InitString(CefString& value);
void InitObject(v8::Handle<v8::Value> value, CefTrackNode* tracker);
void InitObject(v8::Local<v8::Value> value, CefTrackNode* tracker);
// Creates a new V8 value for the underlying value or returns the existing
// object handle.
v8::Handle<v8::Value> GetV8Value(bool should_persist);
v8::Local<v8::Value> GetV8Value(bool should_persist);
bool IsValid() override;
bool IsUndefined() override;
@@ -287,7 +287,7 @@ class CefV8ValueImpl : public CefV8Value {
typedef v8::Persistent<v8::Value> persistentType;
Handle(v8::Isolate* isolate,
v8::Handle<v8::Context> context,
v8::Local<v8::Context> context,
handleType v,
CefTrackNode* tracker);
@@ -356,7 +356,7 @@ class CefV8ValueImpl : public CefV8Value {
class CefV8StackTraceImpl : public CefV8StackTrace {
public:
CefV8StackTraceImpl(v8::Isolate* isolate,
v8::Handle<v8::StackTrace> handle);
v8::Local<v8::StackTrace> handle);
~CefV8StackTraceImpl() override;
bool IsValid() override;
@@ -373,7 +373,7 @@ class CefV8StackTraceImpl : public CefV8StackTrace {
class CefV8StackFrameImpl : public CefV8StackFrame {
public:
CefV8StackFrameImpl(v8::Isolate* isolate,
v8::Handle<v8::StackFrame> handle);
v8::Local<v8::StackFrame> handle);
~CefV8StackFrameImpl() override;
bool IsValid() override;

View File

@@ -328,6 +328,11 @@ need to be translated for each locale.-->
The selected printer is not available or not installed correctly. Check your printer or try selecting another printer.
</message>
<!-- Proxy settings -->
<message name="IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME" desc="The name of the utility process used for out-of-process V8 proxy resolution.">
V8 Proxy Resolver
</message>
<!-- Spell checking -->
<!-- The file name of the spellchecking dictionary without the extension (case-sensitive). -->
<message name="IDS_SPELLCHECK_DICTIONARY" use_name_for_id="true">