Update to Chromium revision 224895.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1460 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-10-16 00:25:38 +00:00
parent 901528b4a5
commit 4c3bd0b724
31 changed files with 157 additions and 134 deletions

View File

@@ -17,5 +17,5 @@
{ {
'chromium_url': 'http://src.chromium.org/svn/trunk/src', 'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '220934', 'chromium_revision': '224895',
} }

View File

@@ -4,6 +4,8 @@
{ {
'variables': { 'variables': {
'use_ash': 0,
'use_aura': 0,
'conditions': [ 'conditions': [
# Directory for CEF source files. # Directory for CEF source files.
[ 'OS=="win"', { [ 'OS=="win"', {

View File

@@ -26,8 +26,8 @@
#include "third_party/WebKit/public/web/WebInputEvent.h" #include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/mac/WebInputEventFactory.h" #include "third_party/WebKit/public/web/mac/WebInputEventFactory.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/base/keycodes/keyboard_codes_posix.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
#include "ui/gfx/rect.h" #include "ui/gfx/rect.h"
// Wrapper NSView for the native view. Necessary to destroy the browser when // Wrapper NSView for the native view. Necessary to destroy the browser when

View File

@@ -27,7 +27,7 @@
#include "third_party/WebKit/public/web/WebInputEvent.h" #include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/win/WebInputEventFactory.h" #include "third_party/WebKit/public/web/win/WebInputEventFactory.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/win/hwnd_util.h" #include "ui/gfx/win/hwnd_util.h"
#pragma comment(lib, "dwmapi.lib") #pragma comment(lib, "dwmapi.lib")
@@ -458,7 +458,7 @@ LPCTSTR CefBrowserHostImpl::GetWndClass() {
LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message, LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) { WPARAM wParam, LPARAM lParam) {
CefBrowserHostImpl* browser = CefBrowserHostImpl* browser =
static_cast<CefBrowserHostImpl*>(ui::GetWindowUserData(hwnd)); static_cast<CefBrowserHostImpl*>(gfx::GetWindowUserData(hwnd));
switch (message) { switch (message) {
case WM_CLOSE: case WM_CLOSE:
@@ -479,7 +479,7 @@ LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message,
case WM_DESTROY: case WM_DESTROY:
if (browser) { if (browser) {
// Clear the user data pointer. // Clear the user data pointer.
ui::SetWindowUserData(hwnd, NULL); gfx::SetWindowUserData(hwnd, NULL);
// Force the browser to be destroyed and release the reference added in // Force the browser to be destroyed and release the reference added in
// PlatformCreateWindow(). // PlatformCreateWindow().
@@ -542,7 +542,7 @@ bool CefBrowserHostImpl::PlatformCreateWindow() {
// Set window user data to this object for future reference from the window // Set window user data to this object for future reference from the window
// procedure. // procedure.
ui::SetWindowUserData(window_info_.window, this); gfx::SetWindowUserData(window_info_.window, this);
// Add a reference that will be released in the WM_DESTROY handler. // Add a reference that will be released in the WM_DESTROY handler.
AddRef(); AddRef();

View File

@@ -623,6 +623,7 @@ content::AccessTokenStore* CefContentBrowserClient::CreateAccessTokenStore() {
bool CefContentBrowserClient::CanCreateWindow( bool CefContentBrowserClient::CanCreateWindow(
const GURL& opener_url, const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin, const GURL& source_origin,
WindowContainerType container_type, WindowContainerType container_type,
const GURL& target_url, const GURL& target_url,

View File

@@ -110,6 +110,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::CertificateRequestResultType* result) OVERRIDE; content::CertificateRequestResultType* result) OVERRIDE;
virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
virtual bool CanCreateWindow(const GURL& opener_url, virtual bool CanCreateWindow(const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin, const GURL& source_origin,
WindowContainerType container_type, WindowContainerType container_type,
const GURL& target_url, const GURL& target_url,

View File

@@ -18,6 +18,7 @@
#include "content/public/browser/devtools_http_handler.h" #include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "grit/cef_resources.h" #include "grit/cef_resources.h"
@@ -60,13 +61,13 @@ content::DevToolsAgentHost* CefDevToolsBindingHandler::ForIdentifier(
if (!render_process_host->HasConnection()) if (!render_process_host->HasConnection())
continue; continue;
content::RenderWidgetHost::List widgets = scoped_ptr<content::RenderWidgetHostIterator> widgets(
content::RenderWidgetHost::GetRenderWidgetHosts(); content::RenderWidgetHost::GetRenderWidgetHosts());
for (size_t i = 0; i < widgets.size(); ++i) { while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
if (!widgets[i]->IsRenderView()) if (!widget->IsRenderView())
continue; continue;
content::RenderViewHost* host = content::RenderViewHost::From(widgets[i]); content::RenderViewHost* host = content::RenderViewHost::From(widget);
if (GetIdentifier(host) == identifier) { if (GetIdentifier(host) == identifier) {
// May create a new agent host. // May create a new agent host.
scoped_refptr<content::DevToolsAgentHost> agent_host( scoped_refptr<content::DevToolsAgentHost> agent_host(
@@ -163,11 +164,11 @@ std::string CefDevToolsDelegate::GetViewDescription(content::RenderViewHost*) {
return std::string(); return std::string();
} }
scoped_refptr<net::StreamListenSocket> scoped_ptr<net::StreamListenSocket>
CefDevToolsDelegate::CreateSocketForTethering( CefDevToolsDelegate::CreateSocketForTethering(
net::StreamListenSocket::Delegate* delegate, net::StreamListenSocket::Delegate* delegate,
std::string* name) { std::string* name) {
return NULL; return scoped_ptr<net::StreamListenSocket>();
} }
std::string CefDevToolsDelegate::GetDevToolsURL(content::RenderViewHost* rvh, std::string CefDevToolsDelegate::GetDevToolsURL(content::RenderViewHost* rvh,

View File

@@ -63,7 +63,7 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
virtual content::RenderViewHost* CreateNewTarget() OVERRIDE; virtual content::RenderViewHost* CreateNewTarget() OVERRIDE;
virtual TargetType GetTargetType(content::RenderViewHost*) OVERRIDE; virtual TargetType GetTargetType(content::RenderViewHost*) OVERRIDE;
virtual std::string GetViewDescription(content::RenderViewHost*) OVERRIDE; virtual std::string GetViewDescription(content::RenderViewHost*) OVERRIDE;
virtual scoped_refptr<net::StreamListenSocket> CreateSocketForTethering( virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering(
net::StreamListenSocket::Delegate* delegate, net::StreamListenSocket::Delegate* delegate,
std::string* name) OVERRIDE; std::string* name) OVERRIDE;

View File

@@ -4,7 +4,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "ui/base/events/event.h" #include "ui/events/event.h"
// This file includes a selection of methods copied from // This file includes a selection of methods copied from
// chrome/browser/ui/gtk/gtk_util.cc. // chrome/browser/ui/gtk/gtk_util.cc.

View File

@@ -81,7 +81,6 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog(
content::JavaScriptMessageType message_type, content::JavaScriptMessageType message_type,
const string16& message_text, const string16& message_text,
const string16& default_prompt_text, const string16& default_prompt_text,
bool user_gesture,
const DialogClosedCallback& callback, const DialogClosedCallback& callback,
bool* did_suppress_message) { bool* did_suppress_message) {
CefRefPtr<CefClient> client = browser_->GetClient(); CefRefPtr<CefClient> client = browser_->GetClient();

View File

@@ -29,7 +29,6 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
content::JavaScriptMessageType message_type, content::JavaScriptMessageType message_type,
const string16& message_text, const string16& message_text,
const string16& default_prompt_text, const string16& default_prompt_text,
bool user_gesture,
const DialogClosedCallback& callback, const DialogClosedCallback& callback,
bool* did_suppress_message) OVERRIDE; bool* did_suppress_message) OVERRIDE;

View File

@@ -206,15 +206,15 @@ void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) {
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
void CefRenderWidgetHostViewOSR::TextInputTypeChanged( void CefRenderWidgetHostViewOSR::TextInputTypeChanged(
ui::TextInputType type, ui::TextInputType type,
bool can_compose_inline, ui::TextInputMode mode,
ui::TextInputMode mode) { bool can_compose_inline) {
} }
void CefRenderWidgetHostViewOSR::ImeCancelComposition() { void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
} }
void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged( void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged(
const ui::Range& range, const gfx::Range& range,
const std::vector<gfx::Rect>& character_bounds) { const std::vector<gfx::Rect>& character_bounds) {
} }
#endif // !defined(OS_MACOSX) #endif // !defined(OS_MACOSX)
@@ -292,8 +292,8 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
return gfx::Rect(); return gfx::Rect();
} }
void CefRenderWidgetHostViewOSR::OnAccessibilityNotifications( void CefRenderWidgetHostViewOSR::OnAccessibilityEvents(
const std::vector<AccessibilityHostMsg_NotificationParams>& params) { const std::vector<AccessibilityHostMsg_EventParams>& params) {
} }
void CefRenderWidgetHostViewOSR::Destroy() { void CefRenderWidgetHostViewOSR::Destroy() {

View File

@@ -48,26 +48,26 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
void HandleKeyEventBeforeTextInputClient(CefEventHandle keyEvent); void HandleKeyEventBeforeTextInputClient(CefEventHandle keyEvent);
void HandleKeyEventAfterTextInputClient(CefEventHandle keyEvent); void HandleKeyEventAfterTextInputClient(CefEventHandle keyEvent);
bool GetCachedFirstRectForCharacterRange(ui::Range range, gfx::Rect* rect, bool GetCachedFirstRectForCharacterRange(gfx::Range range, gfx::Rect* rect,
ui::Range* actual_range) const; gfx::Range* actual_range) const;
private: private:
// Returns composition character boundary rectangle. The |range| is // Returns composition character boundary rectangle. The |range| is
// composition based range. Also stores |actual_range| which is corresponding // composition based range. Also stores |actual_range| which is corresponding
// to actually used range for returned rectangle. // to actually used range for returned rectangle.
gfx::Rect GetFirstRectForCompositionRange(const ui::Range& range, gfx::Rect GetFirstRectForCompositionRange(const gfx::Range& range,
ui::Range* actual_range) const; gfx::Range* actual_range) const;
// Converts from given whole character range to composition oriented range. If // Converts from given whole character range to composition oriented range. If
// the conversion failed, return ui::Range::InvalidRange. // the conversion failed, return gfx::Range::InvalidRange.
ui::Range ConvertCharacterRangeToCompositionRange( gfx::Range ConvertCharacterRangeToCompositionRange(
const ui::Range& request_range) const; const gfx::Range& request_range) const;
// Returns true if there is line break in |range| and stores line breaking // Returns true if there is line break in |range| and stores line breaking
// point to |line_breaking_point|. The |line_break_point| is valid only if // point to |line_breaking_point|. The |line_break_point| is valid only if
// this function returns true. // this function returns true.
static bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds, static bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds,
const ui::Range& range, const gfx::Range& range,
size_t* line_break_point); size_t* line_break_point);
void DestroyNSTextInputOSR(); void DestroyNSTextInputOSR();
@@ -119,11 +119,11 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE;
virtual void SetIsLoading(bool is_loading) OVERRIDE; virtual void SetIsLoading(bool is_loading) OVERRIDE;
virtual void TextInputTypeChanged(ui::TextInputType type, virtual void TextInputTypeChanged(ui::TextInputType type,
bool can_compose_inline, ui::TextInputMode mode,
ui::TextInputMode mode) OVERRIDE; bool can_compose_inline) OVERRIDE;
virtual void ImeCancelComposition() OVERRIDE; virtual void ImeCancelComposition() OVERRIDE;
virtual void ImeCompositionRangeChanged( virtual void ImeCompositionRangeChanged(
const ui::Range& range, const gfx::Range& range,
const std::vector<gfx::Rect>& character_bounds) OVERRIDE; const std::vector<gfx::Rect>& character_bounds) OVERRIDE;
virtual void DidUpdateBackingStore( virtual void DidUpdateBackingStore(
const gfx::Rect& scroll_rect, const gfx::Rect& scroll_rect,
@@ -137,8 +137,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
#endif #endif
virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE;
virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;
void OnAccessibilityNotifications( virtual void OnAccessibilityEvents(
const std::vector<AccessibilityHostMsg_NotificationParams>& params) const std::vector<AccessibilityHostMsg_EventParams>& params)
OVERRIDE; OVERRIDE;
virtual void Destroy() OVERRIDE; virtual void Destroy() OVERRIDE;
virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE;

View File

@@ -55,7 +55,7 @@ void CefRenderWidgetHostViewOSR::DestroyNSTextInputOSR() {
} }
void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged( void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged(
const ui::Range& range, const gfx::Range& range,
const std::vector<gfx::Rect>& character_bounds) { const std::vector<gfx::Rect>& character_bounds) {
CefTextInputClientOSRMac* client = GetInputClientFromContext( CefTextInputClientOSRMac* client = GetInputClientFromContext(
text_input_context_osr_mac_); text_input_context_osr_mac_);
@@ -76,14 +76,14 @@ void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
void CefRenderWidgetHostViewOSR::TextInputTypeChanged( void CefRenderWidgetHostViewOSR::TextInputTypeChanged(
ui::TextInputType type, ui::TextInputType type,
bool can_compose_inline, ui::TextInputMode mode,
ui::TextInputMode mode) { bool can_compose_inline) {
[NSApp updateWindows]; [NSApp updateWindows];
} }
bool CefRenderWidgetHostViewOSR::GetLineBreakIndex( bool CefRenderWidgetHostViewOSR::GetLineBreakIndex(
const std::vector<gfx::Rect>& bounds, const std::vector<gfx::Rect>& bounds,
const ui::Range& range, const gfx::Range& range,
size_t* line_break_point) { size_t* line_break_point) {
DCHECK(line_break_point); DCHECK(line_break_point);
if (range.start() >= bounds.size() || range.is_reversed() || range.is_empty()) if (range.start() >= bounds.size() || range.is_reversed() || range.is_empty())
@@ -111,7 +111,7 @@ bool CefRenderWidgetHostViewOSR::GetLineBreakIndex(
} }
gfx::Rect CefRenderWidgetHostViewOSR::GetFirstRectForCompositionRange( gfx::Rect CefRenderWidgetHostViewOSR::GetFirstRectForCompositionRange(
const ui::Range& range, ui::Range* actual_range) const { const gfx::Range& range, gfx::Range* actual_range) const {
CefTextInputClientOSRMac* client = GetInputClientFromContext( CefTextInputClientOSRMac* client = GetInputClientFromContext(
text_input_context_osr_mac_); text_input_context_osr_mac_);
@@ -141,7 +141,7 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetFirstRectForCompositionRange(
range, &end_idx)) { range, &end_idx)) {
end_idx = range.end(); end_idx = range.end();
} }
*actual_range = ui::Range(range.start(), end_idx); *actual_range = gfx::Range(range.start(), end_idx);
gfx::Rect rect = client->composition_bounds_[range.start()]; gfx::Rect rect = client->composition_bounds_[range.start()];
for (size_t i = range.start() + 1; i < end_idx; ++i) { for (size_t i = range.start() + 1; i < end_idx; ++i) {
rect.Union(client->composition_bounds_[i]); rect.Union(client->composition_bounds_[i]);
@@ -149,44 +149,44 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetFirstRectForCompositionRange(
return rect; return rect;
} }
ui::Range CefRenderWidgetHostViewOSR::ConvertCharacterRangeToCompositionRange( gfx::Range CefRenderWidgetHostViewOSR::ConvertCharacterRangeToCompositionRange(
const ui::Range& request_range) const { const gfx::Range& request_range) const {
CefTextInputClientOSRMac* client = GetInputClientFromContext( CefTextInputClientOSRMac* client = GetInputClientFromContext(
text_input_context_osr_mac_); text_input_context_osr_mac_);
DCHECK(client); DCHECK(client);
if (client->composition_range_.is_empty()) if (client->composition_range_.is_empty())
return ui::Range::InvalidRange(); return gfx::Range::InvalidRange();
if (request_range.is_reversed()) if (request_range.is_reversed())
return ui::Range::InvalidRange(); return gfx::Range::InvalidRange();
if (request_range.start() < client->composition_range_.start() if (request_range.start() < client->composition_range_.start()
|| request_range.start() > client->composition_range_.end() || request_range.start() > client->composition_range_.end()
|| request_range.end() > client->composition_range_.end()) || request_range.end() > client->composition_range_.end())
return ui::Range::InvalidRange(); return gfx::Range::InvalidRange();
return ui::Range(request_range.start() - client->composition_range_.start(), return gfx::Range(request_range.start() - client->composition_range_.start(),
request_range.end() - client->composition_range_.start()); request_range.end() - client->composition_range_.start());
} }
bool CefRenderWidgetHostViewOSR::GetCachedFirstRectForCharacterRange( bool CefRenderWidgetHostViewOSR::GetCachedFirstRectForCharacterRange(
ui::Range range, gfx::Rect* rect, ui::Range* actual_range) const { gfx::Range range, gfx::Rect* rect, gfx::Range* actual_range) const {
DCHECK(rect); DCHECK(rect);
CefTextInputClientOSRMac* client = GetInputClientFromContext( CefTextInputClientOSRMac* client = GetInputClientFromContext(
text_input_context_osr_mac_); text_input_context_osr_mac_);
// If requested range is same as caret location, we can just return it. // If requested range is same as caret location, we can just return it.
if (selection_range_.is_empty() && ui::Range(range) == selection_range_) { if (selection_range_.is_empty() && gfx::Range(range) == selection_range_) {
if (actual_range) if (actual_range)
*actual_range = range; *actual_range = range;
*rect = client->caret_rect_; *rect = client->caret_rect_;
return true; return true;
} }
const ui::Range request_range_in_composition = const gfx::Range request_range_in_composition =
ConvertCharacterRangeToCompositionRange(ui::Range(range)); ConvertCharacterRangeToCompositionRange(gfx::Range(range));
if (request_range_in_composition == ui::Range::InvalidRange()) if (request_range_in_composition == gfx::Range::InvalidRange())
return false; return false;
// If firstRectForCharacterRange in WebFrame is failed in renderer, // If firstRectForCharacterRange in WebFrame is failed in renderer,
@@ -197,11 +197,11 @@ bool CefRenderWidgetHostViewOSR::GetCachedFirstRectForCharacterRange(
DCHECK_EQ(client->composition_bounds_.size(), DCHECK_EQ(client->composition_bounds_.size(),
client->composition_range_.length()); client->composition_range_.length());
ui::Range ui_actual_range; gfx::Range ui_actual_range;
*rect = GetFirstRectForCompositionRange(request_range_in_composition, *rect = GetFirstRectForCompositionRange(request_range_in_composition,
&ui_actual_range); &ui_actual_range);
if (actual_range) { if (actual_range) {
*actual_range = ui::Range( *actual_range = gfx::Range(
client->composition_range_.start() + ui_actual_range.start(), client->composition_range_.start() + ui_actual_range.start(),
client->composition_range_.start() + ui_actual_range.end()).ToNSRange(); client->composition_range_.start() + ui_actual_range.end()).ToNSRange();
} }

View File

@@ -28,7 +28,7 @@
NSRange markedRange_; NSRange markedRange_;
// The current composition character range and its bounds. // The current composition character range and its bounds.
ui::Range composition_range_; gfx::Range composition_range_;
std::vector<gfx::Rect> composition_bounds_; std::vector<gfx::Rect> composition_bounds_;
// The current caret bounds. // The current caret bounds.

View File

@@ -97,7 +97,7 @@ extern "C" {
if (handlingKeyDown_) { if (handlingKeyDown_) {
textToBeInserted_.append(base::SysNSStringToUTF16(im_text)); textToBeInserted_.append(base::SysNSStringToUTF16(im_text));
} else { } else {
ui::Range replacement_range(replacementRange); gfx::Range replacement_range(replacementRange);
renderWidgetHostView_->get_render_widget_host_impl()->ImeConfirmComposition( renderWidgetHostView_->get_render_widget_host_impl()->ImeConfirmComposition(
base::SysNSStringToUTF16(im_text), replacement_range, false); base::SysNSStringToUTF16(im_text), replacement_range, false);
@@ -185,7 +185,7 @@ extern "C" {
// called in keyEvent: method. // called in keyEvent: method.
if (!handlingKeyDown_) { if (!handlingKeyDown_) {
renderWidgetHostView_->get_render_widget_host_impl()-> renderWidgetHostView_->get_render_widget_host_impl()->
ImeConfirmComposition(string16(), ui::Range::InvalidRange(), false); ImeConfirmComposition(string16(), gfx::Range::InvalidRange(), false);
} else { } else {
unmarkTextCalled_ = YES; unmarkTextCalled_ = YES;
} }
@@ -205,8 +205,8 @@ extern "C" {
actualRange:(NSRangePointer)actualRange { actualRange:(NSRangePointer)actualRange {
NSRect rect; NSRect rect;
gfx::Rect gfxRect; gfx::Rect gfxRect;
ui::Range range(theRange); gfx::Range range(theRange);
ui::Range actual_range; gfx::Range actual_range;
if (!renderWidgetHostView_->GetCachedFirstRectForCharacterRange(range, if (!renderWidgetHostView_->GetCachedFirstRectForCharacterRange(range,
&gfxRect, &actual_range)) { &gfxRect, &actual_range)) {
rect = content::TextInputClientMac::GetInstance()-> rect = content::TextInputClientMac::GetInstance()->
@@ -319,7 +319,7 @@ extern "C" {
if (textToBeInserted_.length() > if (textToBeInserted_.length() >
((hasMarkedText_ || oldHasMarkedText_) ? 0u : 1u)) { ((hasMarkedText_ || oldHasMarkedText_) ? 0u : 1u)) {
renderWidgetHostView_->get_render_widget_host_impl()->ImeConfirmComposition( renderWidgetHostView_->get_render_widget_host_impl()->ImeConfirmComposition(
textToBeInserted_, ui::Range::InvalidRange(), false); textToBeInserted_, gfx::Range::InvalidRange(), false);
textToBeInserted_ = YES; textToBeInserted_ = YES;
} }
@@ -336,7 +336,7 @@ extern "C" {
} else if (oldHasMarkedText_ && !hasMarkedText_ && !textInserted) { } else if (oldHasMarkedText_ && !hasMarkedText_ && !textInserted) {
if (unmarkTextCalled_) { if (unmarkTextCalled_) {
renderWidgetHostView_->get_render_widget_host_impl()-> renderWidgetHostView_->get_render_widget_host_impl()->
ImeConfirmComposition(string16(), ui::Range::InvalidRange(), false); ImeConfirmComposition(string16(), gfx::Range::InvalidRange(), false);
} else { } else {
renderWidgetHostView_->get_render_widget_host_impl()-> renderWidgetHostView_->get_render_widget_host_impl()->
ImeCancelComposition(); ImeCancelComposition();

View File

@@ -26,6 +26,7 @@ MSVC_POP_WARNING();
#include "libcef/renderer/render_process_observer.h" #include "libcef/renderer/render_process_observer.h"
#include "libcef/renderer/thread_util.h" #include "libcef/renderer/thread_util.h"
#include "libcef/renderer/v8_impl.h" #include "libcef/renderer/v8_impl.h"
#include "libcef/renderer/webkit_glue.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/path_service.h" #include "base/path_service.h"
@@ -542,7 +543,7 @@ void CefContentRendererClient::DidCreateScriptContext(
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame); CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(webkit_glue::GetV8Isolate(frame));
v8::Context::Scope scope(context); v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope( WebCore::V8RecursionScope recursion_scope(
WebCore::getScriptExecutionContext()); WebCore::getScriptExecutionContext());
@@ -575,7 +576,7 @@ void CefContentRendererClient::WillReleaseScriptContext(
if (browserPtr.get()) { if (browserPtr.get()) {
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame); CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(webkit_glue::GetV8Isolate(frame));
v8::Context::Scope scope(context); v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope( WebCore::V8RecursionScope recursion_scope(
WebCore::getScriptExecutionContext()); WebCore::getScriptExecutionContext());

View File

@@ -238,7 +238,7 @@ CefRefPtr<CefV8Context> CefFrameImpl::GetV8Context() {
CEF_REQUIRE_RT_RETURN(NULL); CEF_REQUIRE_RT_RETURN(NULL);
if (frame_) { if (frame_) {
v8::HandleScope handle_scope; v8::HandleScope handle_scope(webkit_glue::GetV8Isolate(frame_));
return new CefV8ContextImpl(webkit_glue::GetV8Context(frame_)); return new CefV8ContextImpl(webkit_glue::GetV8Context(frame_));
} else { } else {
return NULL; return NULL;

View File

@@ -46,7 +46,8 @@ class CefWebURLLoaderClient : public WebKit::WebURLLoaderClient {
WebURLLoader* loader, WebURLLoader* loader,
const WebURLResponse& response) OVERRIDE; const WebURLResponse& response) OVERRIDE;
virtual void didDownloadData(WebURLLoader* loader, virtual void didDownloadData(WebURLLoader* loader,
int dataLength) OVERRIDE; int dataLength,
int encodedDataLength) OVERRIDE;
virtual void didReceiveData(WebURLLoader* loader, virtual void didReceiveData(WebURLLoader* loader,
const char* data, const char* data,
int dataLength, int dataLength,
@@ -278,7 +279,8 @@ void CefWebURLLoaderClient::didReceiveResponse(
} }
void CefWebURLLoaderClient::didDownloadData(WebURLLoader* loader, void CefWebURLLoaderClient::didDownloadData(WebURLLoader* loader,
int dataLength) { int dataLength,
int encodedDataLength) {
} }
void CefWebURLLoaderClient::didReceiveData(WebURLLoader* loader, void CefWebURLLoaderClient::didReceiveData(WebURLLoader* loader,

View File

@@ -2,6 +2,10 @@
// reserved. Use of this source code is governed by a BSD-style license that // reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file. // can be found in the LICENSE file.
// MSVC++ requires this to be set before any other includes to get M_PI.
// Otherwise there will be compile errors in wtf/MathExtras.h.
#define _USE_MATH_DEFINES
#include <map> #include <map>
#include <string> #include <string>
@@ -395,7 +399,7 @@ void TrackDestructor(v8::Isolate* isolate,
if (parameter) if (parameter)
delete parameter; delete parameter;
object->Dispose(isolate); object->Reset();
object->Clear(); object->Clear();
} }
@@ -577,7 +581,8 @@ v8::Local<v8::Value> CallV8Function(v8::Handle<v8::Context> context,
v8::Handle<v8::Function> function, v8::Handle<v8::Function> function,
v8::Handle<v8::Object> receiver, v8::Handle<v8::Object> receiver,
int argc, int argc,
v8::Handle<v8::Value> args[]) { v8::Handle<v8::Value> args[],
v8::Isolate* isolate) {
v8::Local<v8::Value> func_rv; v8::Local<v8::Value> func_rv;
// Execute the function call using the ScriptController so that inspector // Execute the function call using the ScriptController so that inspector
@@ -596,7 +601,7 @@ v8::Local<v8::Value> CallV8Function(v8::Handle<v8::Context> context,
if (controller) { if (controller) {
func_rv = WebCore::ScriptController::callFunctionWithInstrumentation( func_rv = WebCore::ScriptController::callFunctionWithInstrumentation(
controller->workerGlobalScope()->scriptExecutionContext(), controller->workerGlobalScope()->scriptExecutionContext(),
function, receiver, argc, args); function, receiver, argc, args, isolate);
} }
} }
@@ -813,7 +818,7 @@ CefRefPtr<CefV8Context> CefV8Context::GetCurrentContext() {
CefRefPtr<CefV8Context> context; CefRefPtr<CefV8Context> context;
CEF_V8_REQUIRE_ISOLATE_RETURN(context); CEF_V8_REQUIRE_ISOLATE_RETURN(context);
if (v8::Context::InContext()) { if (v8::Context::InContext()) {
v8::HandleScope handle_scope; v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
context = new CefV8ContextImpl(v8::Context::GetCurrent()); context = new CefV8ContextImpl(v8::Context::GetCurrent());
} }
return context; return context;
@@ -824,7 +829,7 @@ CefRefPtr<CefV8Context> CefV8Context::GetEnteredContext() {
CefRefPtr<CefV8Context> context; CefRefPtr<CefV8Context> context;
CEF_V8_REQUIRE_ISOLATE_RETURN(context); CEF_V8_REQUIRE_ISOLATE_RETURN(context);
if (v8::Context::InContext()) { if (v8::Context::InContext()) {
v8::HandleScope handle_scope; v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
context = new CefV8ContextImpl(v8::Context::GetEntered()); context = new CefV8ContextImpl(v8::Context::GetEntered());
} }
return context; return context;
@@ -895,7 +900,7 @@ CefRefPtr<CefFrame> CefV8ContextImpl::GetFrame() {
CefRefPtr<CefV8Value> CefV8ContextImpl::GetGlobal() { CefRefPtr<CefV8Value> CefV8ContextImpl::GetGlobal() {
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(NULL); CEF_V8_REQUIRE_VALID_HANDLE_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Context> context = GetV8Context(); v8::Handle<v8::Context> context = GetV8Context();
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
return new CefV8ValueImpl(context->Global()); return new CefV8ValueImpl(context->Global());
@@ -904,7 +909,7 @@ CefRefPtr<CefV8Value> CefV8ContextImpl::GetGlobal() {
bool CefV8ContextImpl::Enter() { bool CefV8ContextImpl::Enter() {
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
WebCore::V8PerIsolateData::current()->incrementRecursionLevel(); WebCore::V8PerIsolateData::current()->incrementRecursionLevel();
handle_->GetNewV8Handle()->Enter(); handle_->GetNewV8Handle()->Enter();
@@ -917,7 +922,7 @@ bool CefV8ContextImpl::Enter() {
bool CefV8ContextImpl::Exit() { bool CefV8ContextImpl::Exit() {
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
DLOG_ASSERT(enter_count_ > 0); DLOG_ASSERT(enter_count_ > 0);
handle_->GetNewV8Handle()->Exit(); handle_->GetNewV8Handle()->Exit();
@@ -949,7 +954,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
return false; return false;
} }
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Local<v8::Context> context = GetV8Context(); v8::Local<v8::Context> context = GetV8Context();
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
v8::Local<v8::Object> obj = context->Global(); v8::Local<v8::Object> obj = context->Global();
@@ -969,7 +974,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
exception = NULL; exception = NULL;
v8::Local<v8::Value> func_rv = v8::Local<v8::Value> func_rv =
CallV8Function(context, func, obj, 1, &code_val); CallV8Function(context, func, obj, 1, &code_val, handle_->isolate());
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
exception = new CefV8ExceptionImpl(try_catch.Message()); exception = new CefV8ExceptionImpl(try_catch.Message());
@@ -986,7 +991,7 @@ v8::Handle<v8::Context> CefV8ContextImpl::GetV8Context() {
WebKit::WebFrame* CefV8ContextImpl::GetWebFrame() { WebKit::WebFrame* CefV8ContextImpl::GetWebFrame() {
CEF_REQUIRE_RT(); CEF_REQUIRE_RT();
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Context::Scope context_scope(GetV8Context()); v8::Context::Scope context_scope(GetV8Context());
WebKit::WebFrame* frame = WebKit::WebFrame::frameForCurrentContext(); WebKit::WebFrame* frame = WebKit::WebFrame::frameForCurrentContext();
return frame; return frame;
@@ -1005,7 +1010,7 @@ CefV8ValueImpl::Handle::~Handle() {
(tracker_ ? new CefV8MakeWeakParam(context_state_, tracker_) : NULL), (tracker_ ? new CefV8MakeWeakParam(context_state_, tracker_) : NULL),
TrackDestructor); TrackDestructor);
} else { } else {
handle_.Dispose(isolate()); handle_.Reset();
handle_.Clear(); handle_.Clear();
if (tracker_) if (tracker_)
@@ -1087,7 +1092,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
CefRefPtr<CefV8Accessor> accessor) { CefRefPtr<CefV8Accessor> accessor) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Local<v8::Context> context = v8::Context::GetCurrent(); v8::Local<v8::Context> context = v8::Context::GetCurrent();
if (context.IsEmpty()) { if (context.IsEmpty()) {
@@ -1115,7 +1120,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) { CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Local<v8::Context> context = v8::Context::GetCurrent(); v8::Local<v8::Context> context = v8::Context::GetCurrent();
if (context.IsEmpty()) { if (context.IsEmpty()) {
@@ -1149,7 +1154,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
return NULL; return NULL;
} }
v8::HandleScope handle_scope; v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Local<v8::Context> context = v8::Context::GetCurrent(); v8::Local<v8::Context> context = v8::Context::GetCurrent();
if (context.IsEmpty()) { if (context.IsEmpty()) {
@@ -1385,7 +1390,7 @@ bool CefV8ValueImpl::IsObject() {
bool CefV8ValueImpl::IsArray() { bool CefV8ValueImpl::IsArray() {
CEF_V8_REQUIRE_MLT_RETURN(false); CEF_V8_REQUIRE_MLT_RETURN(false);
if (type_ == TYPE_OBJECT) { if (type_ == TYPE_OBJECT) {
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
return handle_->GetNewV8Handle(false)->IsArray(); return handle_->GetNewV8Handle(false)->IsArray();
} else { } else {
return false; return false;
@@ -1395,7 +1400,7 @@ bool CefV8ValueImpl::IsArray() {
bool CefV8ValueImpl::IsFunction() { bool CefV8ValueImpl::IsFunction() {
CEF_V8_REQUIRE_MLT_RETURN(false); CEF_V8_REQUIRE_MLT_RETURN(false);
if (type_ == TYPE_OBJECT) { if (type_ == TYPE_OBJECT) {
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
return handle_->GetNewV8Handle(false)->IsFunction(); return handle_->GetNewV8Handle(false)->IsFunction();
} else { } else {
return false; return false;
@@ -1488,7 +1493,7 @@ CefString CefV8ValueImpl::GetStringValue() {
bool CefV8ValueImpl::IsUserCreated() { bool CefV8ValueImpl::IsUserCreated() {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1531,7 +1536,7 @@ bool CefV8ValueImpl::SetRethrowExceptions(bool rethrow) {
bool CefV8ValueImpl::HasValue(const CefString& key) { bool CefV8ValueImpl::HasValue(const CefString& key) {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
return obj->Has(GetV8String(key)); return obj->Has(GetV8String(key));
@@ -1545,7 +1550,7 @@ bool CefV8ValueImpl::HasValue(int index) {
return false; return false;
} }
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
return obj->Has(index); return obj->Has(index);
@@ -1554,7 +1559,7 @@ bool CefV8ValueImpl::HasValue(int index) {
bool CefV8ValueImpl::DeleteValue(const CefString& key) { bool CefV8ValueImpl::DeleteValue(const CefString& key) {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1572,7 +1577,7 @@ bool CefV8ValueImpl::DeleteValue(int index) {
return false; return false;
} }
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1585,7 +1590,7 @@ bool CefV8ValueImpl::DeleteValue(int index) {
CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) { CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1605,7 +1610,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) {
return NULL; return NULL;
} }
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1624,7 +1629,7 @@ bool CefV8ValueImpl::SetValue(const CefString& key,
CefV8ValueImpl* impl = static_cast<CefV8ValueImpl*>(value.get()); CefV8ValueImpl* impl = static_cast<CefV8ValueImpl*>(value.get());
if (impl && impl->IsValid()) { if (impl && impl->IsValid()) {
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1649,7 +1654,7 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr<CefV8Value> value) {
CefV8ValueImpl* impl = static_cast<CefV8ValueImpl*>(value.get()); CefV8ValueImpl* impl = static_cast<CefV8ValueImpl*>(value.get());
if (impl && impl->IsValid()) { if (impl && impl->IsValid()) {
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1667,7 +1672,7 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings,
PropertyAttribute attribute) { PropertyAttribute attribute) {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1697,7 +1702,7 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings,
bool CefV8ValueImpl::GetKeys(std::vector<CefString>& keys) { bool CefV8ValueImpl::GetKeys(std::vector<CefString>& keys) {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1715,7 +1720,7 @@ bool CefV8ValueImpl::GetKeys(std::vector<CefString>& keys) {
bool CefV8ValueImpl::SetUserData(CefRefPtr<CefBase> user_data) { bool CefV8ValueImpl::SetUserData(CefRefPtr<CefBase> user_data) {
CEF_V8_REQUIRE_OBJECT_RETURN(false); CEF_V8_REQUIRE_OBJECT_RETURN(false);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1731,7 +1736,7 @@ bool CefV8ValueImpl::SetUserData(CefRefPtr<CefBase> user_data) {
CefRefPtr<CefBase> CefV8ValueImpl::GetUserData() { CefRefPtr<CefBase> CefV8ValueImpl::GetUserData() {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1745,7 +1750,7 @@ CefRefPtr<CefBase> CefV8ValueImpl::GetUserData() {
int CefV8ValueImpl::GetExternallyAllocatedMemory() { int CefV8ValueImpl::GetExternallyAllocatedMemory() {
CEF_V8_REQUIRE_OBJECT_RETURN(0); CEF_V8_REQUIRE_OBJECT_RETURN(0);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1759,7 +1764,7 @@ int CefV8ValueImpl::GetExternallyAllocatedMemory() {
int CefV8ValueImpl::AdjustExternallyAllocatedMemory(int change_in_bytes) { int CefV8ValueImpl::AdjustExternallyAllocatedMemory(int change_in_bytes) {
CEF_V8_REQUIRE_OBJECT_RETURN(0); CEF_V8_REQUIRE_OBJECT_RETURN(0);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Handle<v8::Object> obj = value->ToObject(); v8::Handle<v8::Object> obj = value->ToObject();
@@ -1773,7 +1778,7 @@ int CefV8ValueImpl::AdjustExternallyAllocatedMemory(int change_in_bytes) {
int CefV8ValueImpl::GetArrayLength() { int CefV8ValueImpl::GetArrayLength() {
CEF_V8_REQUIRE_OBJECT_RETURN(0); CEF_V8_REQUIRE_OBJECT_RETURN(0);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsArray()) { if (!value->IsArray()) {
NOTREACHED() << "V8 value is not an array"; NOTREACHED() << "V8 value is not an array";
@@ -1789,7 +1794,7 @@ CefString CefV8ValueImpl::GetFunctionName() {
CefString rv; CefString rv;
CEF_V8_REQUIRE_OBJECT_RETURN(rv); CEF_V8_REQUIRE_OBJECT_RETURN(rv);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) { if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function"; NOTREACHED() << "V8 value is not a function";
@@ -1805,7 +1810,7 @@ CefString CefV8ValueImpl::GetFunctionName() {
CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() { CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) { if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function"; NOTREACHED() << "V8 value is not a function";
@@ -1834,7 +1839,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
const CefV8ValueList& arguments) { const CefV8ValueList& arguments) {
CEF_V8_REQUIRE_OBJECT_RETURN(NULL); CEF_V8_REQUIRE_OBJECT_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(handle_->isolate());
v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false); v8::Handle<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) { if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function"; NOTREACHED() << "V8 value is not a function";
@@ -1899,7 +1904,8 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
v8::Local<v8::Value> func_rv = v8::Local<v8::Value> func_rv =
CallV8Function(context_local, func, recv, argc, argv); CallV8Function(context_local, func, recv, argc, argv,
handle_->isolate());
if (!HasCaught(try_catch) && !func_rv.IsEmpty()) if (!HasCaught(try_catch) && !func_rv.IsEmpty())
retval = new CefV8ValueImpl(func_rv); retval = new CefV8ValueImpl(func_rv);
@@ -1931,7 +1937,7 @@ bool CefV8ValueImpl::HasCaught(v8::TryCatch& try_catch) {
CefRefPtr<CefV8StackTrace> CefV8StackTrace::GetCurrent(int frame_limit) { CefRefPtr<CefV8StackTrace> CefV8StackTrace::GetCurrent(int frame_limit) {
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL); CEF_V8_REQUIRE_ISOLATE_RETURN(NULL);
v8::HandleScope handle_scope; v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Handle<v8::StackTrace> stackTrace = v8::Handle<v8::StackTrace> stackTrace =
v8::StackTrace::CurrentStackTrace( v8::StackTrace::CurrentStackTrace(
frame_limit, v8::StackTrace::kDetailed); frame_limit, v8::StackTrace::kDetailed);

View File

@@ -131,7 +131,7 @@ class CefV8Handle : public CefV8HandleBase {
handle_(isolate(), v) { handle_(isolate(), v) {
} }
virtual ~CefV8Handle() { virtual ~CefV8Handle() {
handle_.Dispose(isolate()); handle_.Reset();
handle_.Clear(); handle_.Clear();
} }

View File

@@ -3,6 +3,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// MSVC++ requires this to be set before any other includes to get M_PI.
// Otherwise there will be compile errors in wtf/MathExtras.h.
#define _USE_MATH_DEFINES
#include "libcef/renderer/webkit_glue.h" #include "libcef/renderer/webkit_glue.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
@@ -11,6 +15,7 @@
#include "config.h" #include "config.h"
MSVC_PUSH_WARNING_LEVEL(0); MSVC_PUSH_WARNING_LEVEL(0);
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/ScriptController.h" #include "bindings/v8/ScriptController.h"
#include "core/history/BackForwardController.h" #include "core/history/BackForwardController.h"
#include "core/page/Page.h" #include "core/page/Page.h"
@@ -53,6 +58,11 @@ void GoForward(WebKit::WebView* view) {
controller.goForward(); controller.goForward();
} }
v8::Isolate* GetV8Isolate(WebKit::WebFrame* frame) {
WebKit::WebFrameImpl* impl = static_cast<WebKit::WebFrameImpl*>(frame);
return WebCore::toIsolate(impl->frame());
}
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame) { v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame) {
WebKit::WebFrameImpl* impl = static_cast<WebKit::WebFrameImpl*>(frame); WebKit::WebFrameImpl* impl = static_cast<WebKit::WebFrameImpl*>(frame);
return WebCore::ScriptController::mainWorldContext(impl->frame()); return WebCore::ScriptController::mainWorldContext(impl->frame());

View File

@@ -22,6 +22,9 @@ bool CanGoForward(WebKit::WebView* view);
void GoBack(WebKit::WebView* view); void GoBack(WebKit::WebView* view);
void GoForward(WebKit::WebView* view); void GoForward(WebKit::WebView* view);
// Retrieve the V8 isolate associated with the frame.
v8::Isolate* GetV8Isolate(WebKit::WebFrame* frame);
// Retrieve the V8 context associated with the frame. // Retrieve the V8 context associated with the frame.
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame); v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame);

View File

@@ -1,8 +1,8 @@
Index: gyp/generator/ninja.py Index: gyp/generator/ninja.py
=================================================================== ===================================================================
--- gyp/generator/ninja.py (revision 1693) --- gyp/generator/ninja.py (revision 1735)
+++ gyp/generator/ninja.py (working copy) +++ gyp/generator/ninja.py (working copy)
@@ -705,7 +705,16 @@ @@ -722,7 +722,16 @@
for path in copy['files']: for path in copy['files']:
# Normalize the path so trailing slashes don't confuse us. # Normalize the path so trailing slashes don't confuse us.
path = os.path.normpath(path) path = os.path.normpath(path)

View File

@@ -1,8 +1,8 @@
Index: message_loop.cc Index: message_loop.cc
=================================================================== ===================================================================
--- message_loop.cc (revision 217791) --- message_loop.cc (revision 224845)
+++ message_loop.cc (working copy) +++ message_loop.cc (working copy)
@@ -197,7 +197,7 @@ @@ -201,7 +201,7 @@
MessageLoop::~MessageLoop() { MessageLoop::~MessageLoop() {
DCHECK_EQ(this, current()); DCHECK_EQ(this, current());

View File

@@ -1,25 +1,23 @@
Index: page/FrameView.cpp Index: page/FrameView.cpp
=================================================================== ===================================================================
--- page/FrameView.cpp (revision 157102) --- page/FrameView.cpp (revision 158192)
+++ page/FrameView.cpp (working copy) +++ page/FrameView.cpp (working copy)
@@ -187,10 +187,12 @@ @@ -189,8 +189,10 @@
if (!page) if (!isMainFrame())
return; return;
+#if 0 +#if 0
if (m_frame == page->mainFrame()) {
ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed); ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed); ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
}
+#endif +#endif
} }
PassRefPtr<FrameView> FrameView::create(Frame* frame) PassRefPtr<FrameView> FrameView::create(Frame* frame)
Index: platform/mac/NSScrollerImpDetails.mm Index: platform/mac/NSScrollerImpDetails.mm
=================================================================== ===================================================================
--- platform/mac/NSScrollerImpDetails.mm (revision 157102) --- platform/mac/NSScrollerImpDetails.mm (revision 158192)
+++ platform/mac/NSScrollerImpDetails.mm (working copy) +++ platform/mac/NSScrollerImpDetails.mm (working copy)
@@ -33,6 +33,7 @@ @@ -34,6 +34,7 @@
bool isScrollbarOverlayAPIAvailable() bool isScrollbarOverlayAPIAvailable()
{ {
@@ -27,7 +25,7 @@ Index: platform/mac/NSScrollerImpDetails.mm
static bool apiAvailable; static bool apiAvailable;
static bool shouldInitialize = true; static bool shouldInitialize = true;
if (shouldInitialize) { if (shouldInitialize) {
@@ -43,6 +44,9 @@ @@ -44,6 +45,9 @@
&& [scrollerImpPairClass instancesRespondToSelector:@selector(scrollerStyle)]; && [scrollerImpPairClass instancesRespondToSelector:@selector(scrollerStyle)];
} }
return apiAvailable; return apiAvailable;

View File

@@ -1,8 +1,8 @@
Index: WebNode.cpp Index: WebNode.cpp
=================================================================== ===================================================================
--- WebNode.cpp (revision 156144) --- WebNode.cpp (revision 158192)
+++ WebNode.cpp (working copy) +++ WebNode.cpp (working copy)
@@ -176,7 +176,7 @@ @@ -175,7 +175,7 @@
void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture) void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{ {
// Please do not add more eventTypes to this list without an API review. // Please do not add more eventTypes to this list without an API review.

View File

@@ -1,6 +1,6 @@
Index: public/web/WebView.h Index: public/web/WebView.h
=================================================================== ===================================================================
--- public/web/WebView.h (revision 157102) --- public/web/WebView.h (revision 158192)
+++ public/web/WebView.h (working copy) +++ public/web/WebView.h (working copy)
@@ -444,6 +444,7 @@ @@ -444,6 +444,7 @@
@@ -12,9 +12,9 @@ Index: public/web/WebView.h
// Visited link state -------------------------------------------------- // Visited link state --------------------------------------------------
Index: Source/web/ChromeClientImpl.cpp Index: Source/web/ChromeClientImpl.cpp
=================================================================== ===================================================================
--- Source/web/ChromeClientImpl.cpp (revision 157102) --- Source/web/ChromeClientImpl.cpp (revision 158192)
+++ Source/web/ChromeClientImpl.cpp (working copy) +++ Source/web/ChromeClientImpl.cpp (working copy)
@@ -887,7 +887,7 @@ @@ -878,7 +878,7 @@
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const
{ {
@@ -25,9 +25,9 @@ Index: Source/web/ChromeClientImpl.cpp
return adoptRef(new PopupMenuChromium(frame, client)); return adoptRef(new PopupMenuChromium(frame, client));
Index: Source/web/WebViewImpl.cpp Index: Source/web/WebViewImpl.cpp
=================================================================== ===================================================================
--- Source/web/WebViewImpl.cpp (revision 157102) --- Source/web/WebViewImpl.cpp (revision 158192)
+++ Source/web/WebViewImpl.cpp (working copy) +++ Source/web/WebViewImpl.cpp (working copy)
@@ -394,6 +394,7 @@ @@ -397,6 +397,7 @@
, m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false) , m_fakePageScaleAnimationUseAnchor(false)
, m_contextMenuAllowed(false) , m_contextMenuAllowed(false)
@@ -35,7 +35,7 @@ Index: Source/web/WebViewImpl.cpp
, m_doingDragAndDrop(false) , m_doingDragAndDrop(false)
, m_ignoreInputEvents(false) , m_ignoreInputEvents(false)
, m_suppressNextKeypressEvent(false) , m_suppressNextKeypressEvent(false)
@@ -3671,9 +3672,14 @@ @@ -3709,9 +3710,14 @@
updateLayerTreeViewport(); updateLayerTreeViewport();
} }
@@ -53,7 +53,7 @@ Index: Source/web/WebViewImpl.cpp
void WebViewImpl::startDragging(Frame* frame, void WebViewImpl::startDragging(Frame* frame,
Index: Source/web/WebViewImpl.h Index: Source/web/WebViewImpl.h
=================================================================== ===================================================================
--- Source/web/WebViewImpl.h (revision 157102) --- Source/web/WebViewImpl.h (revision 158192)
+++ Source/web/WebViewImpl.h (working copy) +++ Source/web/WebViewImpl.h (working copy)
@@ -422,7 +422,8 @@ @@ -422,7 +422,8 @@
@@ -65,7 +65,7 @@ Index: Source/web/WebViewImpl.h
bool contextMenuAllowed() const bool contextMenuAllowed() const
{ {
@@ -720,6 +721,8 @@ @@ -723,6 +724,8 @@
bool m_contextMenuAllowed; bool m_contextMenuAllowed;

View File

@@ -11,8 +11,8 @@
#include "tests/unittests/test_handler.h" #include "tests/unittests/test_handler.h"
#include "base/logging.h" #include "base/logging.h"
#include "ui/base/keycodes/keyboard_codes.h" #include "ui/events/keycodes/keyboard_codes.h"
#include "ui/base/keycodes/keyboard_code_conversion.h" #include "ui/events/keycodes/keyboard_code_conversion.h"
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "tests/unittests/os_rendering_unittest_mac.h" #include "tests/unittests/os_rendering_unittest_mac.h"

View File

@@ -6,7 +6,7 @@
#define CEF_TESTS_UNITTESTS_OS_RENDERING_UNITTEST_MAC_H_ #define CEF_TESTS_UNITTESTS_OS_RENDERING_UNITTEST_MAC_H_
#include "include/cef_base.h" #include "include/cef_base.h"
#include "ui/base/keycodes/keyboard_codes.h" #include "ui/events/keycodes/keyboard_codes.h"
namespace osr_unittests { namespace osr_unittests {

View File

@@ -7,7 +7,7 @@
#include "os_rendering_unittest_mac.h" #include "os_rendering_unittest_mac.h"
#include "ui/base/keycodes/keyboard_code_conversion_mac.h" #include "ui/events/keycodes/keyboard_code_conversion_mac.h"
#include "include/cef_base.h" #include "include/cef_base.h"