diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 064abe146..b4d4942fd 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '228917', + 'chromium_revision': '231322', } diff --git a/cef.gyp b/cef.gyp index 215275221..801189c02 100644 --- a/cef.gyp +++ b/cef.gyp @@ -137,15 +137,6 @@ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' ], }, - { - 'postbuild_name': 'Copy WebCore Resources', - 'action': [ - 'cp', - '-Rf', - '${BUILT_PRODUCTS_DIR}/../../third_party/WebKit/public/resources/', - '${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/' - ], - }, { 'postbuild_name': 'Copy locale Resources', 'action': [ @@ -364,15 +355,6 @@ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' ], }, - { - 'postbuild_name': 'Copy WebCore Resources', - 'action': [ - 'cp', - '-Rf', - '${BUILT_PRODUCTS_DIR}/../../third_party/WebKit/public/resources/', - '${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/' - ], - }, { 'postbuild_name': 'Copy locale Resources', 'action': [ @@ -1027,6 +1009,8 @@ '<(DEPTH)/chrome/browser/printing/print_job_worker_owner.h', '<(DEPTH)/chrome/browser/printing/printer_query.cc', '<(DEPTH)/chrome/browser/printing/printer_query.h', + '<(DEPTH)/chrome/browser/printing/printing_ui_web_contents_observer.cc', + '<(DEPTH)/chrome/browser/printing/printing_ui_web_contents_observer.h', '<(DEPTH)/chrome/common/prerender_messages.h', '<(DEPTH)/chrome/common/print_messages.cc', '<(DEPTH)/chrome/common/print_messages.h', diff --git a/include/cef_trace_event.h b/include/cef_trace_event.h index 54162b236..b679433cc 100644 --- a/include/cef_trace_event.h +++ b/include/cef_trace_event.h @@ -201,13 +201,20 @@ CEF_EXPORT void cef_trace_event_async_begin(const char* category, const char* arg2_name, uint64 arg2_val, int copy); -CEF_EXPORT void cef_trace_event_async_step(const char* category, - const char* name, - uint64 id, - uint64 step, - const char* arg1_name, - uint64 arg1_val, - int copy); +CEF_EXPORT void cef_trace_event_async_step_into(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy); +CEF_EXPORT void cef_trace_event_async_step_past(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy); CEF_EXPORT void cef_trace_event_async_end(const char* category, const char* name, uint64 id, @@ -409,23 +416,43 @@ CEF_EXPORT void cef_trace_event_async_end(const char* category, cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ arg2_name, arg2_val, true) -// Records a single ASYNC_STEP event for |step| immediately. If the category -// is not enabled, then this does nothing. The |name| and |id| must match the -// ASYNC_BEGIN event above. The |step| param identifies this step within the -// async event. This should be called at the beginning of the next phase of an -// asynchronous operation. -#define CEF_TRACE_EVENT_ASYNC_STEP0(category, name, id, step) \ - cef_trace_event_async_step(category, name, id, step, NULL, 0, false) -#define CEF_TRACE_EVENT_ASYNC_STEP1(category, name, id, step, \ +// Records a single ASYNC_STEP_INTO event for |step| immediately. If the +// category is not enabled, then this does nothing. The |name| and |id| must +// match the ASYNC_BEGIN event above. The |step| param identifies this step +// within the async event. This should be called at the beginning of the next +// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any +// ASYNC_STEP_PAST events. +#define CEF_TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \ + cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false) +#define CEF_TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, \ arg1_name, arg1_val) \ - cef_trace_event_async_step(category, name, id, step, arg1_name, arg1_val, \ - false) -#define CEF_TRACE_EVENT_COPY_ASYNC_STEP0(category, name, id, step) \ - cef_trace_event_async_step(category, name, id, step, NULL, 0, true) -#define CEF_TRACE_EVENT_COPY_ASYNC_STEP1(category, name, id, step, \ + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, false) +#define CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \ + cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true) +#define CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, \ arg1_name, arg1_val) \ - cef_trace_event_async_step(category, name, id, step, arg1_name, arg1_val, \ - true) + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, true) + +// Records a single ASYNC_STEP_PAST event for |step| immediately. If the +// category is not enabled, then this does nothing. The |name| and |id| must +// match the ASYNC_BEGIN event above. The |step| param identifies this step +// within the async event. This should be called at the beginning of the next +// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any +// ASYNC_STEP_INTO events. +#define CEF_TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \ + cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false) +#define CEF_TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, false) +#define CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \ + cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true) +#define CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, true) // Records a single ASYNC_END event for "name" immediately. If the category // is not enabled, then this does nothing. diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 57b07a55c..7054d241c 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -1896,6 +1896,7 @@ void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) { void CefBrowserHostImpl::DidCommitProvisionalLoadForFrame( int64 frame_id, + const string16& frame_unique_name, bool is_main_frame, const GURL& url, content::PageTransition transition_type, @@ -1909,6 +1910,7 @@ void CefBrowserHostImpl::DidCommitProvisionalLoadForFrame( void CefBrowserHostImpl::DidFailProvisionalLoad( int64 frame_id, + const string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 14aac4a58..d32de2d48 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -345,12 +345,14 @@ class CefBrowserHostImpl : public CefBrowserHost, virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; virtual void DidCommitProvisionalLoadForFrame( int64 frame_id, + const string16& frame_unique_name, bool is_main_frame, const GURL& url, content::PageTransition transition_type, content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidFailProvisionalLoad( int64 frame_id, + const string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, diff --git a/libcef/browser/browser_urlrequest_impl.cc b/libcef/browser/browser_urlrequest_impl.cc index d52b07deb..a2c75642e 100644 --- a/libcef/browser/browser_urlrequest_impl.cc +++ b/libcef/browser/browser_urlrequest_impl.cc @@ -18,11 +18,14 @@ #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "content/public/common/url_fetcher.h" +#include "net/base/io_buffer.h" #include "net/base/load_flags.h" +#include "net/base/net_errors.h" #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_response_writer.h" #include "net/url_request/url_request_status.h" @@ -38,10 +41,6 @@ class CefURLFetcherDelegate : public net::URLFetcherDelegate { virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, int64 current, int64 total) OVERRIDE; - virtual void OnURLFetchDownloadData(const net::URLFetcher* source, - scoped_ptr download_data) - OVERRIDE; - virtual bool ShouldSendDownloadData() OVERRIDE; virtual void OnURLFetchUploadProgress(const net::URLFetcher* source, int64 current, int64 total) OVERRIDE; @@ -51,6 +50,70 @@ class CefURLFetcherDelegate : public net::URLFetcherDelegate { int request_flags_; }; +class NET_EXPORT CefURLFetcherResponseWriter : + public net::URLFetcherResponseWriter { + public: + CefURLFetcherResponseWriter( + CefRefPtr url_request, + scoped_refptr message_loop_proxy) + : url_request_(url_request), + message_loop_proxy_(message_loop_proxy) { + } + virtual ~CefURLFetcherResponseWriter() { + } + + // net::URLFetcherResponseWriter methods. + virtual int Initialize(const net::CompletionCallback& callback) OVERRIDE { + return net::OK; + } + + virtual int Write(net::IOBuffer* buffer, + int num_bytes, + const net::CompletionCallback& callback) OVERRIDE { + if (url_request_) { + message_loop_proxy_->PostTask(FROM_HERE, + base::Bind(&CefURLFetcherResponseWriter::WriteOnClientThread, + url_request_, buffer, num_bytes, callback, + base::MessageLoop::current()->message_loop_proxy())); + return net::ERR_IO_PENDING; + } + return num_bytes; + } + + virtual int Finish(const net::CompletionCallback& callback) OVERRIDE { + if (url_request_) + url_request_ = NULL; + return net::OK; + } + + private: + static void WriteOnClientThread( + CefRefPtr url_request, + net::IOBuffer* buffer, + int num_bytes, + const net::CompletionCallback& callback, + scoped_refptr source_message_loop_proxy) { + CefRefPtr client = url_request->GetClient(); + if (client) + client->OnDownloadData(url_request.get(), buffer->data(), num_bytes); + + source_message_loop_proxy->PostTask(FROM_HERE, + base::Bind(&CefURLFetcherResponseWriter::ContinueOnSourceThread, + num_bytes, callback)); + } + + static void ContinueOnSourceThread( + int num_bytes, + const net::CompletionCallback& callback) { + callback.Run(num_bytes); + } + + CefRefPtr url_request_; + scoped_refptr message_loop_proxy_; + + DISALLOW_COPY_AND_ASSIGN(CefURLFetcherResponseWriter); +}; + base::SupportsUserData::Data* CreateURLRequestUserData( CefRefPtr client) { return new CefURLRequestUserData(client); @@ -219,6 +282,15 @@ class CefBrowserURLRequest::Context CefURLRequestUserData::kUserDataKey, base::Bind(&CreateURLRequestUserData, client_)); + scoped_ptr response_writer; + if (cef_flags & UR_FLAG_NO_DOWNLOAD_DATA) { + response_writer.reset(new CefURLFetcherResponseWriter(NULL, NULL)); + } else { + response_writer.reset( + new CefURLFetcherResponseWriter(url_request_, message_loop_proxy_)); + } + fetcher_->SaveResponseWithWriter(response_writer.Pass()); + fetcher_->Start(); return true; @@ -384,16 +456,6 @@ void CefURLFetcherDelegate::OnURLFetchDownloadProgress( context_->OnDownloadProgress(current, total); } -void CefURLFetcherDelegate::OnURLFetchDownloadData( - const net::URLFetcher* source, - scoped_ptr download_data) { - context_->OnDownloadData(download_data.Pass()); -} - -bool CefURLFetcherDelegate::ShouldSendDownloadData() { - return !(request_flags_ & UR_FLAG_NO_DOWNLOAD_DATA); -} - void CefURLFetcherDelegate::OnURLFetchUploadProgress( const net::URLFetcher* source, int64 current, int64 total) { diff --git a/libcef/browser/devtools_delegate.cc b/libcef/browser/devtools_delegate.cc index 852765279..f2bce89db 100644 --- a/libcef/browser/devtools_delegate.cc +++ b/libcef/browser/devtools_delegate.cc @@ -139,7 +139,8 @@ std::string CefDevToolsDelegate::GetPageThumbnailData(const GURL& url) { return std::string(); } -scoped_ptr CefDevToolsDelegate::CreateNewTarget() { +scoped_ptr CefDevToolsDelegate::CreateNewTarget( + const GURL& url) { return scoped_ptr(); } diff --git a/libcef/browser/devtools_delegate.h b/libcef/browser/devtools_delegate.h index cd6d4192c..8a5378ec4 100644 --- a/libcef/browser/devtools_delegate.h +++ b/libcef/browser/devtools_delegate.h @@ -33,7 +33,8 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate { virtual bool BundlesFrontendResources() OVERRIDE; virtual base::FilePath GetDebugFrontendDir() OVERRIDE; virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE; - virtual scoped_ptr CreateNewTarget() OVERRIDE; + virtual scoped_ptr CreateNewTarget(const GURL& url) + OVERRIDE; virtual scoped_ptr CreateTargetForId( const std::string& id) OVERRIDE; virtual void EnumerateTargets(TargetCallback callback) OVERRIDE; diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index 7a6254d2c..f34aa6875 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -9,12 +9,12 @@ #include "base/bind.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/printer_query.h" +#include "chrome/browser/printing/printing_ui_web_contents_observer.h" #include "chrome/browser/printing/print_job_manager.h" #include "chrome/common/print_messages.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" -#include "content/public/browser/web_contents_view.h" #if defined(OS_CHROMEOS) #include @@ -75,7 +75,6 @@ void RenderParamsFromPrintSettings(const printing::PrintSettings& settings, params->supports_alpha_blend = settings.supports_alpha_blend(); params->should_print_backgrounds = settings.should_print_backgrounds; params->display_header_footer = settings.display_header_footer; - params->date = settings.date; params->title = settings.title; params->url = settings.url; } @@ -261,10 +260,12 @@ void PrintingMessageFilter::GetPrintSettingsForRenderView( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); content::WebContents* wc = GetWebContentsForRenderView(render_view_id); if (wc) { + scoped_ptr wc_observer( + new PrintingUIWebContentsObserver(wc)); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&printing::PrinterQuery::GetSettings, printer_query, - params.ask_user_for_settings, wc->GetView()->GetNativeView(), + params.ask_user_for_settings, base::Passed(&wc_observer), params.expected_page_count, params.has_selection, params.margin_type, callback)); } else { diff --git a/libcef/browser/text_input_client_osr_mac.mm b/libcef/browser/text_input_client_osr_mac.mm index 9dc31ee5c..b899e8237 100644 --- a/libcef/browser/text_input_client_osr_mac.mm +++ b/libcef/browser/text_input_client_osr_mac.mm @@ -12,9 +12,6 @@ namespace { -// Maximum number of characters we allow in a tooltip. -const size_t kMaxTooltipLength = 1024; - // TODO(suzhe): Upstream this function. WebKit::WebColor WebColorFromNSColor(NSColor *color) { CGFloat r, g, b, a; diff --git a/libcef/browser/trace_impl.cc b/libcef/browser/trace_impl.cc index 45ac975e3..766ff99a2 100644 --- a/libcef/browser/trace_impl.cc +++ b/libcef/browser/trace_impl.cc @@ -266,13 +266,13 @@ CEF_EXPORT void cef_trace_event_async_begin(const char* category, } } -CEF_EXPORT void cef_trace_event_async_step(const char* category, - const char* name, - uint64 id, - uint64 step, - const char* arg1_name, - uint64 arg1_val, - int copy) { +CEF_EXPORT void cef_trace_event_async_step_into(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy) { DCHECK(category); DCHECK(name); if (!category || !name) @@ -280,17 +280,50 @@ CEF_EXPORT void cef_trace_event_async_step(const char* category, if (copy) { if (arg1_name == NULL) { - TRACE_EVENT_COPY_ASYNC_STEP0(category, name, id, step); + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step); } else { - TRACE_EVENT_COPY_ASYNC_STEP1(category, name, id, step, - arg1_name, arg1_val); + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, + arg1_name, arg1_val); } } else { if (arg1_name == NULL) { - TRACE_EVENT_ASYNC_STEP0(category, name, id, step); + TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step); } else { - TRACE_EVENT_ASYNC_STEP1(category, name, id, step, - arg1_name, arg1_val); + TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, + arg1_name, arg1_val); + } + } +} + +CEF_EXPORT void cef_trace_event_async_step_past(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy) { + DCHECK(category); + DCHECK(name); + if (!category || !name) + return; + + if (copy) { + if (arg1_name == NULL) { + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step); + } else { + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, + arg1_name, arg1_val); + } + } else { + if (arg1_name == NULL) { + TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step); + } else { + TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, + arg1_name, arg1_val); } } } diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index 5095e4b1e..f40f794e5 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -47,7 +47,6 @@ using WebKit::WebView; namespace { -const int64 kInvalidBrowserId = -1; const int64 kInvalidFrameId = -1; WebKit::WebString FilePathStringToWebString( @@ -698,7 +697,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { response = web_frame->contentAsMarkup().utf8(); success = true; } else if (LowerCaseEqualsASCII(command, "gettext")) { - response = UTF16ToUTF8(webkit_glue::DumpDocumentText(web_frame)); + response = webkit_glue::DumpDocumentText(web_frame); success = true; } else if (web_frame->executeCommand(UTF8ToUTF16(command))) { success = true; diff --git a/libcef/renderer/dom_node_impl.cc b/libcef/renderer/dom_node_impl.cc index c4d86b2f8..3f4dc47e7 100644 --- a/libcef/renderer/dom_node_impl.cc +++ b/libcef/renderer/dom_node_impl.cc @@ -8,6 +8,7 @@ #include "libcef/renderer/dom_document_impl.h" #include "libcef/renderer/dom_event_impl.h" #include "libcef/renderer/thread_util.h" +#include "libcef/renderer/webkit_glue.h" #include "base/logging.h" #include "base/strings/string_util.h" @@ -272,7 +273,7 @@ bool CefDOMNodeImpl::SetValue(const CefString& value) { if (node_.isElementNode()) return false; - return node_.setNodeValue(string16(value)); + return webkit_glue::SetNodeValue(node_, string16(value)); } CefString CefDOMNodeImpl::GetAsMarkup() { diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 9bd6f901e..c722ae2cd 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -591,8 +591,8 @@ v8::Local CallV8Function(v8::Handle context, RefPtr frame = WebCore::toFrameIfNotDetached(context); DCHECK(frame); if (frame && - frame->script()->canExecuteScripts(WebCore::AboutToExecuteScript)) { - func_rv = frame->script()->callFunction(function, receiver, argc, args); + frame->script().canExecuteScripts(WebCore::AboutToExecuteScript)) { + func_rv = frame->script().callFunction(function, receiver, argc, args); } } else { WebCore::WorkerScriptController* controller = @@ -600,7 +600,7 @@ v8::Local CallV8Function(v8::Handle context, DCHECK(controller); if (controller) { func_rv = WebCore::ScriptController::callFunction( - controller->workerGlobalScope()->executionContext(), + controller->workerGlobalScope().executionContext(), function, receiver, argc, args, isolate); } } diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index ca12585f2..3f058f5b3 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -7,20 +7,31 @@ // Otherwise there will be compile errors in wtf/MathExtras.h. #define _USE_MATH_DEFINES +// Defines required to access Blink internals (unwrap WebNode). +#undef BLINK_IMPLEMENTATION +#define BLINK_IMPLEMENTATION 1 +#undef INSIDE_BLINK +#define INSIDE_BLINK 1 + #include "libcef/renderer/webkit_glue.h" #include "base/compiler_specific.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebElement.h" +#include "v8/include/v8.h" #include "config.h" MSVC_PUSH_WARNING_LEVEL(0); +#include "third_party/WebKit/public/platform/WebString.h" +#include "third_party/WebKit/public/web/WebDocument.h" +#include "third_party/WebKit/public/web/WebElement.h" +#include "third_party/WebKit/public/web/WebNode.h" +#include "third_party/WebKit/public/web/WebViewClient.h" + #include "bindings/v8/V8Binding.h" #include "bindings/v8/ScriptController.h" -#include "core/history/BackForwardController.h" -#include "core/page/Page.h" +#include "third_party/WebKit/Source/core/dom/Node.h" #include "third_party/WebKit/Source/web/WebFrameImpl.h" #include "third_party/WebKit/Source/web/WebViewImpl.h" +#include "third_party/WebKit/Source/wtf/PassRefPtr.h" MSVC_POP_WARNING(); #undef LOG @@ -30,32 +41,30 @@ bool CanGoBack(WebKit::WebView* view) { if (!view) return false; WebKit::WebViewImpl* impl = reinterpret_cast(view); - return (impl->page()->backForward().backCount() > 0); + return (impl->client()->historyBackListCount() > 0); } bool CanGoForward(WebKit::WebView* view) { if (!view) return false; WebKit::WebViewImpl* impl = reinterpret_cast(view); - return (impl->page()->backForward().forwardCount() > 0); + return (impl->client()->historyForwardListCount() > 0); } void GoBack(WebKit::WebView* view) { if (!view) return; WebKit::WebViewImpl* impl = reinterpret_cast(view); - WebCore::BackForwardController& controller = impl->page()->backForward(); - if (controller.backCount() > 0) - controller.goBack(); + if (impl->client()->historyBackListCount() > 0) + impl->client()->navigateBackForwardSoon(-1); } void GoForward(WebKit::WebView* view) { if (!view) return; WebKit::WebViewImpl* impl = reinterpret_cast(view); - WebCore::BackForwardController& controller = impl->page()->backForward(); - if (controller.forwardCount() > 0) - controller.goForward(); + if (impl->client()->historyForwardListCount() > 0) + impl->client()->navigateBackForwardSoon(1); } v8::Isolate* GetV8Isolate(WebKit::WebFrame* frame) { @@ -68,14 +77,20 @@ v8::Handle GetV8Context(WebKit::WebFrame* frame) { return WebCore::ScriptController::mainWorldContext(impl->frame()); } -base::string16 DumpDocumentText(WebKit::WebFrame* frame) { +std::string DumpDocumentText(WebKit::WebFrame* frame) { // We use the document element's text instead of the body text here because // not all documents have a body, such as XML documents. WebKit::WebElement document_element = frame->document().documentElement(); if (document_element.isNull()) - return base::string16(); + return std::string(); - return document_element.innerText(); + return document_element.innerText().utf8(); +} + +bool SetNodeValue(WebKit::WebNode& node, const WebKit::WebString& value) { + WebCore::Node* web_node = node.unwrap(); + web_node->setNodeValue(value); + return true; } } // webkit_glue diff --git a/libcef/renderer/webkit_glue.h b/libcef/renderer/webkit_glue.h index 71b8adbcf..585dcbc98 100644 --- a/libcef/renderer/webkit_glue.h +++ b/libcef/renderer/webkit_glue.h @@ -7,11 +7,17 @@ #define CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ #include -#include "base/strings/string16.h" -#include "v8/include/v8.h" + +namespace v8 { +class Context; +template class Handle; +class Isolate; +} namespace WebKit { class WebFrame; +class WebNode; +class WebString; class WebView; } @@ -29,7 +35,9 @@ v8::Isolate* GetV8Isolate(WebKit::WebFrame* frame); v8::Handle GetV8Context(WebKit::WebFrame* frame); // Returns the text of the document element. -base::string16 DumpDocumentText(WebKit::WebFrame* frame); +std::string DumpDocumentText(WebKit::WebFrame* frame); + +bool SetNodeValue(WebKit::WebNode& node, const WebKit::WebString& value); } // webkit_glue diff --git a/patch/patches/devtools_target.patch b/patch/patches/devtools_target.patch index ec3538a4b..5391df3ff 100644 --- a/patch/patches/devtools_target.patch +++ b/patch/patches/devtools_target.patch @@ -1,35 +1,33 @@ Index: browser/devtools/devtools_http_handler_impl.cc =================================================================== ---- browser/devtools/devtools_http_handler_impl.cc (revision 228917) +--- browser/devtools/devtools_http_handler_impl.cc (revision 231322) +++ browser/devtools/devtools_http_handler_impl.cc (working copy) -@@ -542,9 +542,17 @@ +@@ -550,9 +550,16 @@ DevToolsTarget* DevToolsHttpHandlerImpl::GetTarget(const std::string& id) { TargetMap::const_iterator it = target_map_.find(id); - if (it == target_map_.end()) -- return NULL; -- return it->second; + if (it != target_map_.end()) + return it->second; + + scoped_ptr target(delegate_->CreateTargetForId(id)); -+ if (target) { -+ DCHECK_EQ(id, target->GetId()); -+ target_map_[id] = target.release(); -+ return target_map_[id]; -+ } ++ if (!target) + return NULL; +- return it->second; + -+ return NULL; ++ DCHECK_EQ(id, target->GetId()); ++ target_map_[id] = target.release(); ++ return target_map_[id]; } void DevToolsHttpHandlerImpl::OnThumbnailRequestUI( Index: public/browser/devtools_http_handler_delegate.h =================================================================== ---- public/browser/devtools_http_handler_delegate.h (revision 228917) +--- public/browser/devtools_http_handler_delegate.h (revision 231322) +++ public/browser/devtools_http_handler_delegate.h (working copy) @@ -39,6 +39,13 @@ // Creates new inspectable target. - virtual scoped_ptr CreateNewTarget() = 0; + virtual scoped_ptr CreateNewTarget(const GURL& url) = 0; + // Creates an inspectable target for the specified |id|. Called in cases where + // the target has not been enumerated (for example, direct URL access where diff --git a/patch/patches/gyp_331.patch b/patch/patches/gyp_331.patch index 09d6b6b00..f4b9e5178 100644 --- a/patch/patches/gyp_331.patch +++ b/patch/patches/gyp_331.patch @@ -1,8 +1,8 @@ Index: gyp/generator/ninja.py =================================================================== ---- gyp/generator/ninja.py (revision 1735) +--- gyp/generator/ninja.py (revision 1769) +++ gyp/generator/ninja.py (working copy) -@@ -722,7 +722,16 @@ +@@ -723,7 +723,16 @@ for path in copy['files']: # Normalize the path so trailing slashes don't confuse us. path = os.path.normpath(path) diff --git a/patch/patches/spi_webcore_364.patch b/patch/patches/spi_webcore_364.patch index 66c526451..e2381b9fd 100644 --- a/patch/patches/spi_webcore_364.patch +++ b/patch/patches/spi_webcore_364.patch @@ -1,8 +1,8 @@ Index: frame/FrameView.cpp =================================================================== ---- frame/FrameView.cpp (revision 159695) +--- frame/FrameView.cpp (revision 160715) +++ frame/FrameView.cpp (working copy) -@@ -198,8 +198,10 @@ +@@ -200,8 +200,10 @@ if (!isMainFrame()) return; @@ -15,23 +15,20 @@ Index: frame/FrameView.cpp PassRefPtr FrameView::create(Frame* frame) Index: platform/mac/NSScrollerImpDetails.mm =================================================================== ---- platform/mac/NSScrollerImpDetails.mm (revision 159695) +--- platform/mac/NSScrollerImpDetails.mm (revision 160715) +++ platform/mac/NSScrollerImpDetails.mm (working copy) -@@ -33,6 +33,7 @@ +@@ -73,10 +73,14 @@ bool isScrollbarOverlayAPIAvailable() { +#if 0 - static bool apiAvailable; - static bool shouldInitialize = true; - if (shouldInitialize) { -@@ -43,6 +44,9 @@ - && [scrollerImpPairClass instancesRespondToSelector:@selector(scrollerStyle)]; - } + static bool apiAvailable = + [NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)] + && [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(scrollerStyle)]; return apiAvailable; +#else + return false; +#endif } - NSScrollerStyle recommendedScrollerStyle() { + NSScrollerStyle recommendedScrollerStyle() diff --git a/patch/patches/webkit_933.patch b/patch/patches/webkit_933.patch index 18b01f968..8f5271f1b 100644 --- a/patch/patches/webkit_933.patch +++ b/patch/patches/webkit_933.patch @@ -1,8 +1,8 @@ Index: WebNode.cpp =================================================================== ---- WebNode.cpp (revision 158192) +--- WebNode.cpp (revision 160715) +++ WebNode.cpp (working copy) -@@ -175,7 +175,7 @@ +@@ -169,7 +169,7 @@ void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture) { // Please do not add more eventTypes to this list without an API review. diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 90da8bba0..e2a0aa4cd 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ Index: public/web/WebView.h =================================================================== ---- public/web/WebView.h (revision 159695) +--- public/web/WebView.h (revision 160715) +++ public/web/WebView.h (working copy) -@@ -447,6 +447,7 @@ +@@ -441,6 +441,7 @@ // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void setUseExternalPopupMenus(bool); @@ -12,9 +12,9 @@ Index: public/web/WebView.h // Visited link state -------------------------------------------------- Index: Source/web/ChromeClientImpl.cpp =================================================================== ---- Source/web/ChromeClientImpl.cpp (revision 159695) +--- Source/web/ChromeClientImpl.cpp (revision 160715) +++ Source/web/ChromeClientImpl.cpp (working copy) -@@ -875,7 +875,7 @@ +@@ -871,7 +871,7 @@ PassRefPtr ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const { @@ -25,9 +25,9 @@ Index: Source/web/ChromeClientImpl.cpp return adoptRef(new PopupMenuChromium(frame, client)); Index: Source/web/WebViewImpl.cpp =================================================================== ---- Source/web/WebViewImpl.cpp (revision 159695) +--- Source/web/WebViewImpl.cpp (revision 160715) +++ Source/web/WebViewImpl.cpp (working copy) -@@ -411,6 +411,7 @@ +@@ -402,6 +402,7 @@ , m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationUseAnchor(false) , m_contextMenuAllowed(false) @@ -35,7 +35,7 @@ Index: Source/web/WebViewImpl.cpp , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_compositorDeviceScaleFactorOverride(0) -@@ -3751,9 +3752,14 @@ +@@ -3643,9 +3644,14 @@ updateLayerTreeViewport(); } @@ -53,9 +53,9 @@ Index: Source/web/WebViewImpl.cpp void WebViewImpl::startDragging(Frame* frame, Index: Source/web/WebViewImpl.h =================================================================== ---- Source/web/WebViewImpl.h (revision 159695) +--- Source/web/WebViewImpl.h (revision 160715) +++ Source/web/WebViewImpl.h (working copy) -@@ -424,7 +424,8 @@ +@@ -409,7 +409,8 @@ // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -65,7 +65,7 @@ Index: Source/web/WebViewImpl.h bool contextMenuAllowed() const { -@@ -727,6 +728,8 @@ +@@ -702,6 +703,8 @@ bool m_contextMenuAllowed; diff --git a/tests/unittests/request_unittest.cc b/tests/unittests/request_unittest.cc index 00836a9ab..bf5357b3f 100644 --- a/tests/unittests/request_unittest.cc +++ b/tests/unittests/request_unittest.cc @@ -200,7 +200,6 @@ TEST(RequestTest, SendRecv) { namespace { -const char kTypeTestCompleteMsg[] = "RequestTest.Type"; const char kTypeTestOrigin[] = "http://tests-requesttt.com/"; static struct TypeExpected { diff --git a/tests/unittests/tracing_unittest.cc b/tests/unittests/tracing_unittest.cc index a9dba2fe1..1723ac25c 100644 --- a/tests/unittests/tracing_unittest.cc +++ b/tests/unittests/tracing_unittest.cc @@ -45,10 +45,14 @@ enum TracingTestType { CEF_TRACE_EVENT_COPY_ASYNC_BEGIN0, CEF_TRACE_EVENT_COPY_ASYNC_BEGIN1, CEF_TRACE_EVENT_COPY_ASYNC_BEGIN2, - CEF_TRACE_EVENT_ASYNC_STEP0, - CEF_TRACE_EVENT_ASYNC_STEP1, - CEF_TRACE_EVENT_COPY_ASYNC_STEP0, - CEF_TRACE_EVENT_COPY_ASYNC_STEP1, + CEF_TRACE_EVENT_ASYNC_STEP_INTO0, + CEF_TRACE_EVENT_ASYNC_STEP_INTO1, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO0, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO1, + CEF_TRACE_EVENT_ASYNC_STEP_PAST0, + CEF_TRACE_EVENT_ASYNC_STEP_PAST1, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST0, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST1, CEF_TRACE_EVENT_ASYNC_END0, CEF_TRACE_EVENT_ASYNC_END1, CEF_TRACE_EVENT_ASYNC_END2, @@ -267,25 +271,43 @@ class TracingTestHandler : public CefTraceClient { "CEF_TRACE_EVENT_COPY_ASYNC_BEGIN2", 100, "arg1", 1, "arg2", 2); break; - case CEF_TRACE_EVENT_ASYNC_STEP0: - CEF_TRACE_EVENT_ASYNC_STEP0(kTraceTestCategory, - "CEF_TRACE_EVENT_ASYNC_STEP0", 100, - 1000); + case CEF_TRACE_EVENT_ASYNC_STEP_INTO0: + CEF_TRACE_EVENT_ASYNC_STEP_INTO0( + kTraceTestCategory, "CEF_TRACE_EVENT_ASYNC_STEP_INTO0", 100, 1000); break; - case CEF_TRACE_EVENT_ASYNC_STEP1: - CEF_TRACE_EVENT_ASYNC_STEP1(kTraceTestCategory, - "CEF_TRACE_EVENT_ASYNC_STEP1", 100, - 1000, "arg1", 1); + case CEF_TRACE_EVENT_ASYNC_STEP_INTO1: + CEF_TRACE_EVENT_ASYNC_STEP_INTO1( + kTraceTestCategory, "CEF_TRACE_EVENT_ASYNC_STEP_INTO1", 100, 1000, + "arg1", 1); break; - case CEF_TRACE_EVENT_COPY_ASYNC_STEP0: - CEF_TRACE_EVENT_COPY_ASYNC_STEP0(kTraceTestCategory, - "CEF_TRACE_EVENT_COPY_ASYNC_STEP0", - 100, 1000); + case CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO0: + CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO0( + kTraceTestCategory, "CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO0", 100, + 1000); break; - case CEF_TRACE_EVENT_COPY_ASYNC_STEP1: - CEF_TRACE_EVENT_COPY_ASYNC_STEP1(kTraceTestCategory, - "CEF_TRACE_EVENT_COPY_ASYNC_STEP1", - 100, 1000, "arg1", 1); + case CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO1: + CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO1( + kTraceTestCategory, "CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO1", 100, + 1000, "arg1", 1); + break; + case CEF_TRACE_EVENT_ASYNC_STEP_PAST0: + CEF_TRACE_EVENT_ASYNC_STEP_PAST0( + kTraceTestCategory, "CEF_TRACE_EVENT_ASYNC_STEP_PAST0", 100, 1000); + break; + case CEF_TRACE_EVENT_ASYNC_STEP_PAST1: + CEF_TRACE_EVENT_ASYNC_STEP_PAST1( + kTraceTestCategory, "CEF_TRACE_EVENT_ASYNC_STEP_PAST1", 100, 1000, + "arg1", 1); + break; + case CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST0: + CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST0( + kTraceTestCategory, "CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST0", 100, + 1000); + break; + case CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST1: + CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST1( + kTraceTestCategory, "CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST1", 100, + 1000, "arg1", 1); break; case CEF_TRACE_EVENT_ASYNC_END0: CEF_TRACE_EVENT_ASYNC_END0(kTraceTestCategory, @@ -381,19 +403,31 @@ TRACING_TEST(TraceCounterId1, CEF_TRACE_COUNTER_ID1); TRACING_TEST(TraceCopyCounterId1, CEF_TRACE_COPY_COUNTER_ID1); TRACING_TEST(TraceCounterId2, CEF_TRACE_COUNTER_ID2); TRACING_TEST(TraceCopyCounterId2, CEF_TRACE_COPY_COUNTER_ID1); -TRACING_TEST(TraceTraceEventAsyncBegin0, CEF_TRACE_EVENT_ASYNC_BEGIN0); -TRACING_TEST(TraceTraceEventAsyncBegin1, CEF_TRACE_EVENT_ASYNC_BEGIN1); -TRACING_TEST(TraceTraceEventAsyncBegin2, CEF_TRACE_EVENT_ASYNC_BEGIN2); -TRACING_TEST(TraceTraceEventCopyAsyncBegin0, +TRACING_TEST(TraceEventAsyncBegin0, CEF_TRACE_EVENT_ASYNC_BEGIN0); +TRACING_TEST(TraceEventAsyncBegin1, CEF_TRACE_EVENT_ASYNC_BEGIN1); +TRACING_TEST(TraceEventAsyncBegin2, CEF_TRACE_EVENT_ASYNC_BEGIN2); +TRACING_TEST(TraceEventCopyAsyncBegin0, CEF_TRACE_EVENT_COPY_ASYNC_BEGIN0); -TRACING_TEST(TraceTraceEventCopyAsyncBegin1, +TRACING_TEST(TraceEventCopyAsyncBegin1, CEF_TRACE_EVENT_COPY_ASYNC_BEGIN1); -TRACING_TEST(TraceTraceEventCopyAsyncBegin2, +TRACING_TEST(TraceEventCopyAsyncBegin2, CEF_TRACE_EVENT_COPY_ASYNC_BEGIN2); -TRACING_TEST(TraceTraceEventAsyncStep0, CEF_TRACE_EVENT_ASYNC_STEP0); -TRACING_TEST(TraceTraceEventAsyncStep1, CEF_TRACE_EVENT_ASYNC_STEP1); -TRACING_TEST(TraceEventCopyAsyncStep0, CEF_TRACE_EVENT_COPY_ASYNC_STEP0); -TRACING_TEST(TraceEventCopyAsyncStep1, CEF_TRACE_EVENT_COPY_ASYNC_STEP1); +TRACING_TEST(TraceEventAsyncStepInto0, + CEF_TRACE_EVENT_ASYNC_STEP_INTO0); +TRACING_TEST(TraceEventAsyncStepInto1, + CEF_TRACE_EVENT_ASYNC_STEP_INTO1); +TRACING_TEST(TraceEventCopyAsyncStepInto0, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO0); +TRACING_TEST(TraceEventCopyAsyncStepInto1, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_INTO1); +TRACING_TEST(TraceEventAsyncStepPast0, + CEF_TRACE_EVENT_ASYNC_STEP_PAST0); +TRACING_TEST(TraceEventAsyncStepPast1, + CEF_TRACE_EVENT_ASYNC_STEP_PAST1); +TRACING_TEST(TraceEventCopyAsyncStepPast0, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST0); +TRACING_TEST(TraceEventCopyAsyncStepPast1, + CEF_TRACE_EVENT_COPY_ASYNC_STEP_PAST1); TRACING_TEST(TraceEventAsyncEnd0, CEF_TRACE_EVENT_ASYNC_END0); TRACING_TEST(TraceEventAsyncEnd1, CEF_TRACE_EVENT_ASYNC_END1); TRACING_TEST(TraceEventAsyncEnd2, CEF_TRACE_EVENT_ASYNC_END2); diff --git a/tests/unittests/v8_unittest.cc b/tests/unittests/v8_unittest.cc index 5053622ca..efd9e24ca 100644 --- a/tests/unittests/v8_unittest.cc +++ b/tests/unittests/v8_unittest.cc @@ -27,8 +27,6 @@ const char kV8ContextChildTestUrl[] = "http://tests/V8Test.ContextChildTest"; const char kV8NavTestUrl[] = "http://tests/V8Test.NavTest"; const char kV8OnUncaughtExceptionTestUrl[] = "http://tests/V8Test.OnUncaughtException"; -const char kV8WorkerParentTestUrl[] = "http://tests/V8Test.WorkerParent"; -const char kV8WorkerTestUrl[] = "http://tests/V8Test.Worker.js"; const char kV8TestMsg[] = "V8Test.Test"; const char kV8TestCmdArg[] = "v8-test"; const char kV8RunTestMsg[] = "V8Test.RunTest"; diff --git a/tools/distrib/mac/README.redistrib.txt b/tools/distrib/mac/README.redistrib.txt index 516886dc8..1524ee113 100644 --- a/tools/distrib/mac/README.redistrib.txt +++ b/tools/distrib/mac/README.redistrib.txt @@ -11,9 +11,8 @@ Required components: * CEF core library libcef.dylib -* Cursor resources - Resources/*.png - Resources/*.tiff +* Plugin support library + libplugin_carbon_interpose.dylib Optional components: