- Update to Chromium revision 105051.

- Enable use of clang compiler on Mac.
- Add CefSettings.threaded_compositing_enabled option.
- Begin converting NewRunnable usage to base::Bind.
- Avoid assertion when an empty message is passed to OnConsoleMessage().
- Add an "--allow-partial" option to the make_distrib tool.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@316 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-10-12 19:09:15 +00:00
parent 07e2c7d348
commit 69331e2064
33 changed files with 329 additions and 267 deletions

View File

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

View File

@ -8,12 +8,12 @@
# Directory for CEF source files.
[ 'OS=="win"', {
'cef_directory' : '<!(echo %CEF_DIRECTORY%)',
# Keep the build output in the CEF directory.
'build_dir_prefix': '..\\<!(echo %CEF_DIRECTORY%)\\',
}, { # OS!="win"
'cef_directory' : '<!(echo $CEF_DIRECTORY)',
}],
[ 'OS=="mac"', {
# Don't use clang with CEF until http://llvm.org/bugs/show_bug.cgi?id=10990 is resolved.
'clang': 0,
# Don't use the chrome style plugin with CEF.
'clang_use_chrome_plugins': 0,
}],

View File

@ -343,6 +343,12 @@ typedef struct _cef_browser_settings_t
///
bool accelerated_compositing_enabled;
///
// Set to true (1) to enable threaded compositing. This is currently only
// supported by the command buffer graphics implementation.
///
bool threaded_compositing_enabled;
///
// Set to true (1) to disable accelerated layers. This affects features like
// 3D CSS transforms.

View File

@ -377,6 +377,7 @@ struct CefBrowserSettingsTraits {
target->webgl_disabled = src->webgl_disabled;
target->accelerated_compositing_enabled =
src->accelerated_compositing_enabled;
target->threaded_compositing_enabled = src->threaded_compositing_enabled;
target->accelerated_layers_disabled = src->accelerated_layers_disabled;
target->accelerated_video_disabled = src->accelerated_video_disabled;
target->accelerated_2d_canvas_disabled =

View File

@ -8,6 +8,8 @@
#include <string>
#include <vector>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/task.h"
#include "base/synchronization/waitable_event.h"
@ -38,9 +40,10 @@ class BrowserFrontendProxy
if (!system_)
return;
if (system_->is_io_thread()) {
system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserFrontendProxy::OnCacheSelected,
host_id, info));
system_->ui_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserFrontendProxy::OnCacheSelected, this, host_id,
info));
} else if (system_->is_ui_thread()) {
system_->frontend_impl_.OnCacheSelected(host_id, info);
} else {
@ -53,8 +56,10 @@ class BrowserFrontendProxy
if (!system_)
return;
if (system_->is_io_thread())
system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserFrontendProxy::OnStatusChanged, host_ids, status));
system_->ui_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserFrontendProxy::OnStatusChanged, this, host_ids,
status));
else if (system_->is_ui_thread())
system_->frontend_impl_.OnStatusChanged(host_ids, status);
else
@ -66,8 +71,10 @@ class BrowserFrontendProxy
if (!system_)
return;
if (system_->is_io_thread())
system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserFrontendProxy::OnEventRaised, host_ids, event_id));
system_->ui_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserFrontendProxy::OnEventRaised, this, host_ids,
event_id));
else if (system_->is_ui_thread())
system_->frontend_impl_.OnEventRaised(host_ids, event_id);
else
@ -80,9 +87,10 @@ class BrowserFrontendProxy
if (!system_)
return;
if (system_->is_io_thread())
system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserFrontendProxy::OnProgressEventRaised,
host_ids, url, num_total, num_complete));
system_->ui_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserFrontendProxy::OnProgressEventRaised, this,
host_ids, url, num_total, num_complete));
else if (system_->is_ui_thread())
system_->frontend_impl_.OnProgressEventRaised(
host_ids, url, num_total, num_complete);
@ -95,9 +103,10 @@ class BrowserFrontendProxy
if (!system_)
return;
if (system_->is_io_thread())
system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserFrontendProxy::OnErrorEventRaised,
host_ids, message));
system_->ui_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserFrontendProxy::OnErrorEventRaised, this, host_ids,
message));
else if (system_->is_ui_thread())
system_->frontend_impl_.OnErrorEventRaised(
host_ids, message);
@ -111,9 +120,10 @@ class BrowserFrontendProxy
if (!system_)
return;
if (system_->is_io_thread())
system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserFrontendProxy::OnLogMessage,
host_id, log_level, message));
system_->ui_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserFrontendProxy::OnLogMessage, this, host_id,
log_level, message));
else if (system_->is_ui_thread())
system_->frontend_impl_.OnLogMessage(
host_id, log_level, message);
@ -141,18 +151,22 @@ class BrowserBackendProxy
public:
explicit BrowserBackendProxy(BrowserAppCacheSystem* appcache_system)
: system_(appcache_system), event_(true, false) {
get_status_callback_.reset(
NewCallback(this, &BrowserBackendProxy::GetStatusCallback));
start_update_callback_.reset(
NewCallback(this, &BrowserBackendProxy::StartUpdateCallback));
swap_cache_callback_.reset(
NewCallback(this, &BrowserBackendProxy::SwapCacheCallback));
get_status_callback_ =
base::Bind(&BrowserBackendProxy::GetStatusCallback,
base::Unretained(this));
start_update_callback_ =
base::Bind(&BrowserBackendProxy::StartUpdateCallback,
base::Unretained(this));
swap_cache_callback_=
base::Bind(&BrowserBackendProxy::SwapCacheCallback,
base::Unretained(this));
}
virtual void RegisterHost(int host_id) {
if (system_->is_ui_thread()) {
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::RegisterHost, host_id));
system_->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserBackendProxy::RegisterHost, this, host_id));
} else if (system_->is_io_thread()) {
system_->backend_impl_->RegisterHost(host_id);
} else {
@ -162,8 +176,9 @@ class BrowserBackendProxy
virtual void UnregisterHost(int host_id) {
if (system_->is_ui_thread()) {
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::UnregisterHost, host_id));
system_->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserBackendProxy::UnregisterHost, this, host_id));
} else if (system_->is_io_thread()) {
system_->backend_impl_->UnregisterHost(host_id);
} else {
@ -173,9 +188,10 @@ class BrowserBackendProxy
virtual void SetSpawningHostId(int host_id, int spawning_host_id) {
if (system_->is_ui_thread()) {
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::SetSpawningHostId,
host_id, spawning_host_id));
system_->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserBackendProxy::SetSpawningHostId, this, host_id,
spawning_host_id));
} else if (system_->is_io_thread()) {
system_->backend_impl_->SetSpawningHostId(host_id, spawning_host_id);
} else {
@ -188,9 +204,11 @@ class BrowserBackendProxy
const int64 cache_document_was_loaded_from,
const GURL& manifest_url) {
if (system_->is_ui_thread()) {
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::SelectCache, host_id, document_url,
cache_document_was_loaded_from, manifest_url));
system_->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserBackendProxy::SelectCache, this, host_id,
document_url, cache_document_was_loaded_from,
manifest_url));
} else if (system_->is_io_thread()) {
system_->backend_impl_->SelectCache(host_id, document_url,
cache_document_was_loaded_from,
@ -204,9 +222,10 @@ class BrowserBackendProxy
int host_id,
std::vector<appcache::AppCacheResourceInfo>* resource_infos) {
if (system_->is_ui_thread()) {
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::GetResourceList,
host_id, resource_infos));
system_->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserBackendProxy::GetResourceList, this, host_id,
resource_infos));
} else if (system_->is_io_thread()) {
system_->backend_impl_->GetResourceList(host_id, resource_infos);
} else {
@ -230,9 +249,10 @@ class BrowserBackendProxy
virtual void MarkAsForeignEntry(int host_id, const GURL& document_url,
int64 cache_document_was_loaded_from) {
if (system_->is_ui_thread()) {
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::MarkAsForeignEntry, host_id, document_url,
cache_document_was_loaded_from));
system_->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&BrowserBackendProxy::MarkAsForeignEntry, this, host_id,
document_url, cache_document_was_loaded_from));
} else if (system_->is_io_thread()) {
system_->backend_impl_->MarkAsForeignEntry(
host_id, document_url,
@ -246,12 +266,13 @@ class BrowserBackendProxy
if (system_->is_ui_thread()) {
status_result_ = appcache::UNCACHED;
event_.Reset();
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::GetStatus, host_id));
system_->io_message_loop()->PostTask(
FROM_HERE,
NewRunnableMethod(this, &BrowserBackendProxy::GetStatus, host_id));
event_.Wait();
} else if (system_->is_io_thread()) {
system_->backend_impl_->GetStatusWithCallback(
host_id, get_status_callback_.get(), NULL);
host_id, get_status_callback_, NULL);
} else {
NOTREACHED();
}
@ -262,12 +283,13 @@ class BrowserBackendProxy
if (system_->is_ui_thread()) {
bool_result_ = false;
event_.Reset();
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::StartUpdate, host_id));
system_->io_message_loop()->PostTask(
FROM_HERE,
NewRunnableMethod(this, &BrowserBackendProxy::StartUpdate, host_id));
event_.Wait();
} else if (system_->is_io_thread()) {
system_->backend_impl_->StartUpdateWithCallback(
host_id, start_update_callback_.get(), NULL);
host_id, start_update_callback_, NULL);
} else {
NOTREACHED();
}
@ -278,12 +300,13 @@ class BrowserBackendProxy
if (system_->is_ui_thread()) {
bool_result_ = false;
event_.Reset();
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &BrowserBackendProxy::SwapCache, host_id));
system_->io_message_loop()->PostTask(
FROM_HERE,
NewRunnableMethod(this, &BrowserBackendProxy::SwapCache, host_id));
event_.Wait();
} else if (system_->is_io_thread()) {
system_->backend_impl_->SwapCacheWithCallback(
host_id, swap_cache_callback_.get(), NULL);
host_id, swap_cache_callback_, NULL);
} else {
NOTREACHED();
}
@ -318,9 +341,9 @@ class BrowserBackendProxy
base::WaitableEvent event_;
bool bool_result_;
appcache::Status status_result_;
scoped_ptr<appcache::GetStatusCallback> get_status_callback_;
scoped_ptr<appcache::StartUpdateCallback> start_update_callback_;
scoped_ptr<appcache::SwapCacheCallback> swap_cache_callback_;
appcache::GetStatusCallback get_status_callback_;
appcache::StartUpdateCallback start_update_callback_;
appcache::SwapCacheCallback swap_cache_callback_;
};
@ -356,8 +379,8 @@ BrowserAppCacheSystem::~BrowserAppCacheSystem() {
// We pump a task thru the db thread to ensure any tasks previously
// scheduled on that thread have been performed prior to return.
base::WaitableEvent event(false, false);
db_thread_.message_loop()->PostTask(FROM_HERE,
NewRunnableFunction(&SignalEvent, &event));
db_thread_.message_loop()->PostTask(
FROM_HERE, base::Bind(&SignalEvent, &event));
event.Wait();
}
}

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_TOOLS_TEST_SHELL_Browser_APPCACHE_SYSTEM_H_
#ifndef _BROWSER_APPCACHE_SYSTEM_H
#define _BROWSER_APPCACHE_SYSTEM_H
#include "base/file_path.h"

View File

@ -1,9 +1,10 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "browser_devtools_agent.h"
#include "base/bind.h"
#include "base/message_loop.h"
#include "grit/webkit_chromium_resources.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h"
@ -52,7 +53,7 @@ void BrowserDevToolsAgent::DispatchMessageLoop() {
}
BrowserDevToolsAgent::BrowserDevToolsAgent()
: ALLOW_THIS_IN_INITIALIZER_LIST(call_method_factory_(this)),
: ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
dev_tools_client_(NULL) {
static int dev_tools_agent_counter;
routing_id_ = ++dev_tools_agent_counter;
@ -86,11 +87,10 @@ WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
}
void BrowserDevToolsAgent::AsyncCall(const BrowserDevToolsCallArgs &args) {
MessageLoop::current()->PostDelayedTask(
MessageLoop::current()->PostTask(
FROM_HERE,
call_method_factory_.NewRunnableMethod(&BrowserDevToolsAgent::Call,
args),
0);
base::Bind(&BrowserDevToolsAgent::Call, weak_factory_.GetWeakPtr(),
args));
}
void BrowserDevToolsAgent::Call(const BrowserDevToolsCallArgs &args) {
@ -130,11 +130,10 @@ void BrowserDevToolsAgent::detach() {
}
void BrowserDevToolsAgent::frontendLoaded() {
MessageLoop::current()->PostDelayedTask(
MessageLoop::current()->PostTask(
FROM_HERE,
call_method_factory_.NewRunnableMethod(
&BrowserDevToolsAgent::DelayedFrontendLoaded),
0);
base::Bind(&BrowserDevToolsAgent::DelayedFrontendLoaded,
weak_factory_.GetWeakPtr()));
}
bool BrowserDevToolsAgent::evaluateInWebInspector(

View File

@ -1,10 +1,11 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef _BROWSER_DEVTOOLS_AGENT_H
#define _BROWSER_DEVTOOLS_AGENT_H
#include "base/memory/weak_ptr.h"
#include "base/task.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClient.h"
@ -54,7 +55,7 @@ class BrowserDevToolsAgent : public WebKit::WebDevToolsAgentClient {
static void DispatchMessageLoop();
WebKit::WebDevToolsAgent* GetWebAgent();
ScopedRunnableMethodFactory<BrowserDevToolsAgent> call_method_factory_;
base::WeakPtrFactory<BrowserDevToolsAgent> weak_factory_;
BrowserDevToolsClient* dev_tools_client_;
int routing_id_;
WebKit::WebDevToolsAgent* web_dev_tools_agent_;

View File

@ -15,6 +15,7 @@
#include "browser_devtools_client.h"
#include "browser_impl.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop.h"
@ -26,7 +27,7 @@ using WebKit::WebView;
BrowserDevToolsClient::BrowserDevToolsClient(CefBrowserImpl* browser,
BrowserDevToolsAgent *agent)
: ALLOW_THIS_IN_INITIALIZER_LIST(call_method_factory_(this)),
: ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
browser_(browser),
dev_tools_agent_(agent),
web_view_(browser->UIT_GetWebView()) {
@ -38,7 +39,7 @@ BrowserDevToolsClient::BrowserDevToolsClient(CefBrowserImpl* browser,
BrowserDevToolsClient::~BrowserDevToolsClient() {
// It is a chance that page will be destroyed at detach step of
// dev_tools_agent_ and we should clean pending requests a bit earlier.
call_method_factory_.RevokeAll();
weak_factory_.InvalidateWeakPtrs();
if (dev_tools_agent_)
dev_tools_agent_->detach();
}
@ -76,9 +77,10 @@ void BrowserDevToolsClient::undockWindow() {
}
void BrowserDevToolsClient::AsyncCall(const BrowserDevToolsCallArgs &args) {
MessageLoop::current()->PostDelayedTask(FROM_HERE,
call_method_factory_.NewRunnableMethod(&BrowserDevToolsClient::Call,
args), 0);
MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&BrowserDevToolsClient::Call, weak_factory_.GetWeakPtr(),
args));
}
void BrowserDevToolsClient::Call(const BrowserDevToolsCallArgs &args) {

View File

@ -6,6 +6,7 @@
#define _BROWSER_DEVTOOLS_CLIENT_H
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h"
@ -47,7 +48,7 @@ class BrowserDevToolsClient: public WebKit::WebDevToolsFrontendClient {
private:
void Call(const BrowserDevToolsCallArgs& args);
ScopedRunnableMethodFactory<BrowserDevToolsClient> call_method_factory_;
base::WeakPtrFactory<BrowserDevToolsClient> weak_factory_;
CefBrowserImpl* browser_;
BrowserDevToolsAgent* dev_tools_agent_;
WebKit::WebView* web_view_;

View File

@ -5,6 +5,7 @@
#include "browser_file_writer.h"
#include "cef_thread.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "net/url_request/url_request_context.h"
@ -43,8 +44,9 @@ class BrowserFileWriter::IOThreadProxy
void Truncate(const GURL& path, int64 offset) {
if (!io_thread_->BelongsToCurrentThread()) {
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
this, &IOThreadProxy::Truncate, path, offset));
io_thread_->PostTask(
FROM_HERE,
base::Bind(&IOThreadProxy::Truncate, this, path, offset));
return;
}
DCHECK(!operation_);
@ -54,8 +56,9 @@ class BrowserFileWriter::IOThreadProxy
void Write(const GURL& path, const GURL& blob_url, int64 offset) {
if (!io_thread_->BelongsToCurrentThread()) {
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
this, &IOThreadProxy::Write, path, blob_url, offset));
io_thread_->PostTask(
FROM_HERE,
base::Bind(&IOThreadProxy::Write, this, path, blob_url, offset));
return;
}
DCHECK(request_context_);
@ -66,8 +69,9 @@ class BrowserFileWriter::IOThreadProxy
void Cancel() {
if (!io_thread_->BelongsToCurrentThread()) {
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
this, &IOThreadProxy::Cancel));
io_thread_->PostTask(
FROM_HERE,
base::Bind(&IOThreadProxy::Cancel, this));
return;
}
if (!operation_) {
@ -130,8 +134,9 @@ class BrowserFileWriter::IOThreadProxy
void DidSucceed() {
if (!main_thread_->BelongsToCurrentThread()) {
main_thread_->PostTask(FROM_HERE, NewRunnableMethod(
this, &IOThreadProxy::DidSucceed));
main_thread_->PostTask(
FROM_HERE,
base::Bind(&IOThreadProxy::DidSucceed, this));
return;
}
if (simple_writer_)
@ -140,8 +145,9 @@ class BrowserFileWriter::IOThreadProxy
void DidFail(base::PlatformFileError error_code) {
if (!main_thread_->BelongsToCurrentThread()) {
main_thread_->PostTask(FROM_HERE, NewRunnableMethod(
this, &IOThreadProxy::DidFail, error_code));
main_thread_->PostTask(
FROM_HERE,
base::Bind(&IOThreadProxy::DidFail, this, error_code));
return;
}
if (simple_writer_)
@ -150,8 +156,9 @@ class BrowserFileWriter::IOThreadProxy
void DidWrite(int64 bytes, bool complete) {
if (!main_thread_->BelongsToCurrentThread()) {
main_thread_->PostTask(FROM_HERE, NewRunnableMethod(
this, &IOThreadProxy::DidWrite, bytes, complete));
main_thread_->PostTask(
FROM_HERE,
base::Bind(&IOThreadProxy::DidWrite, this, bytes, complete));
return;
}
if (simple_writer_)

View File

@ -21,6 +21,7 @@
#include "net/base/ssl_config_service_defaults.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_server_properties_impl.h"
#include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_config_service_fixed.h"
#include "net/proxy/proxy_service.h"
@ -155,6 +156,7 @@ void BrowserRequestContext::Init(
std::string(),
false,
false));
storage_.set_http_server_properties(new net::HttpServerPropertiesImpl);
net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend(
cache_path_valid ? net::DISK_CACHE : net::MEMORY_CACHE,
@ -164,7 +166,8 @@ void BrowserRequestContext::Init(
new net::HttpCache(host_resolver(), cert_verifier(),
origin_bound_cert_service(), NULL, NULL,
proxy_service(), ssl_config_service(),
http_auth_handler_factory(), NULL, NULL, backend);
http_auth_handler_factory(), NULL,
http_server_properties(), NULL, backend);
cache->set_mode(cache_mode);
storage_.set_http_transaction_factory(cache);

View File

@ -159,8 +159,8 @@ class RequestProxy : public net::URLRequest::Delegate,
InitializeParams(params);
// proxy over to the io thread
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
this, &RequestProxy::AsyncStart, params));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&RequestProxy::AsyncStart, this, params));
}
void Cancel() {
@ -170,8 +170,8 @@ class RequestProxy : public net::URLRequest::Delegate,
}
// proxy over to the io thread
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
this, &RequestProxy::AsyncCancel));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&RequestProxy::AsyncCancel, this));
}
protected:
@ -198,8 +198,8 @@ class RequestProxy : public net::URLRequest::Delegate,
if (peer_ && peer_->OnReceivedRedirect(new_url, info,
&has_new_first_party_for_cookies,
&new_first_party_for_cookies)) {
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
this, &RequestProxy::AsyncFollowDeferredRedirect,
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&RequestProxy::AsyncFollowDeferredRedirect, this,
has_new_first_party_for_cookies, new_first_party_for_cookies));
} else {
Cancel();
@ -273,8 +273,8 @@ class RequestProxy : public net::URLRequest::Delegate,
// peer could generate new requests in response to the received data, which
// when run on the io thread, could race against this function in doing
// another InvokeLater. See bug 769249.
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
this, &RequestProxy::AsyncReadData));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&RequestProxy::AsyncReadData, this));
CefRefPtr<CefStreamReader> resourceStream;
@ -294,8 +294,8 @@ class RequestProxy : public net::URLRequest::Delegate,
if (download_handler_.get() &&
!download_handler_->ReceivedData(buf_copy.get(), bytes_read)) {
// Cancel loading by proxying over to the io thread.
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
this, &RequestProxy::AsyncCancel));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&RequestProxy::AsyncCancel, this));
}
peer_->OnReceivedData(buf_copy.get(), bytes_read, -1);
@ -306,8 +306,8 @@ class RequestProxy : public net::URLRequest::Delegate,
return;
// Continue reading more data, see the comment in NotifyReceivedData.
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
this, &RequestProxy::AsyncReadData));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&RequestProxy::AsyncReadData, this));
peer_->OnDownloadedData(bytes_read);
}
@ -332,8 +332,8 @@ class RequestProxy : public net::URLRequest::Delegate,
if (download_handler_.get() &&
!download_handler_->ReceivedData(buf.get(), size)) {
// Cancel loading by proxying over to the io thread.
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
this, &RequestProxy::AsyncCancel));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&RequestProxy::AsyncCancel, this));
}
if (peer_)
@ -610,8 +610,8 @@ class RequestProxy : public net::URLRequest::Delegate,
const ResourceResponseInfo& info,
bool* defer_redirect) {
*defer_redirect = true; // See AsyncFollowDeferredRedirect
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
this, &RequestProxy::NotifyReceivedRedirect, new_url, info));
owner_loop_->PostTask(FROM_HERE, base::Bind(
&RequestProxy::NotifyReceivedRedirect, this, new_url, info));
}
virtual void OnReceivedResponse(
@ -630,21 +630,21 @@ class RequestProxy : public net::URLRequest::Delegate,
url = simulated_url;
}
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
this, &RequestProxy::NotifyReceivedResponse, info, url,
owner_loop_->PostTask(FROM_HERE, base::Bind(
&RequestProxy::NotifyReceivedResponse, this, info, url,
allow_download));
}
virtual void OnReceivedData(int bytes_read) {
if (download_to_file_) {
file_stream_.Write(buf_->data(), bytes_read, NULL);
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
this, &RequestProxy::NotifyDownloadedData, bytes_read));
file_stream_.Write(buf_->data(), bytes_read, net::CompletionCallback());
owner_loop_->PostTask(FROM_HERE, base::Bind(
&RequestProxy::NotifyDownloadedData, this, bytes_read));
return;
}
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
this, &RequestProxy::NotifyReceivedData, bytes_read));
owner_loop_->PostTask(FROM_HERE, base::Bind(
&RequestProxy::NotifyReceivedData, this, bytes_read));
}
virtual void OnCompletedRequest(const net::URLRequestStatus& status,
@ -653,8 +653,8 @@ class RequestProxy : public net::URLRequest::Delegate,
if (download_to_file_)
file_stream_.Close();
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
this, &RequestProxy::NotifyCompletedRequest, status, security_info,
owner_loop_->PostTask(FROM_HERE, base::Bind(
&RequestProxy::NotifyCompletedRequest, this, status, security_info,
complete_time));
}
@ -707,8 +707,8 @@ class RequestProxy : public net::URLRequest::Delegate,
}
virtual void OnSSLCertificateError(net::URLRequest* request,
int cert_error,
net::X509Certificate* cert) OVERRIDE {
const net::SSLInfo& ssl_info,
bool is_hsts_host) OVERRIDE {
// Allow all certificate errors.
request->ContinueDespiteLastError();
}
@ -798,8 +798,8 @@ class RequestProxy : public net::URLRequest::Delegate,
bool too_much_time_passed = time_since_last > kOneSecond;
if (is_finished || enough_new_progress || too_much_time_passed) {
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
this, &RequestProxy::NotifyUploadProgress, position, size));
owner_loop_->PostTask(FROM_HERE, base::Bind(
&RequestProxy::NotifyUploadProgress, this, position, size));
last_upload_ticks_ = base::TimeTicks::Now();
last_upload_position_ = position;
}
@ -866,8 +866,7 @@ class SyncRequestProxy : public RequestProxy {
}
void WaitForCompletion() {
if (!event_.Wait())
NOTREACHED();
event_.Wait();
}
// --------------------------------------------------------------------------
@ -895,7 +894,7 @@ class SyncRequestProxy : public RequestProxy {
virtual void OnReceivedData(int bytes_read) {
if (download_to_file_)
file_stream_.Write(buf_->data(), bytes_read, NULL);
file_stream_.Write(buf_->data(), bytes_read, net::CompletionCallback());
else
result_->data.append(buf_->data(), bytes_read);
AsyncReadData(); // read more (may recurse)
@ -1072,8 +1071,7 @@ class CookieGetter : public base::RefCountedThreadSafe<CookieGetter> {
}
std::string GetResult() {
if (!event_.Wait())
NOTREACHED();
event_.Wait();
return result_;
}
@ -1114,8 +1112,8 @@ void BrowserResourceLoaderBridge::SetCookie(const GURL& url,
const std::string& cookie) {
// Proxy to IO thread to synchronize w/ network loading.
scoped_refptr<CookieSetter> cookie_setter = new CookieSetter();
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
cookie_setter.get(), &CookieSetter::Set, url, cookie));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&CookieSetter::Set, cookie_setter.get(), url, cookie));
}
// static
@ -1123,8 +1121,8 @@ std::string BrowserResourceLoaderBridge::GetCookies(
const GURL& url, const GURL& first_party_for_cookies) {
// Proxy to IO thread to synchronize w/ network loading.
scoped_refptr<CookieGetter> cookie_getter = new CookieGetter();
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
cookie_getter.get(), &CookieGetter::Get, url));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&CookieGetter::Get, cookie_getter.get(), url));
// Blocks until the result is available.
return cookie_getter->GetResult();
@ -1133,9 +1131,9 @@ std::string BrowserResourceLoaderBridge::GetCookies(
// static
void BrowserResourceLoaderBridge::SetAcceptAllCookies(bool accept_all_cookies) {
// Proxy to IO thread to synchronize w/ network loading.
CefThread::PostTask(CefThread::IO, FROM_HERE, NewRunnableMethod(
_Context->request_context().get(),
&BrowserRequestContext::SetAcceptAllCookies, accept_all_cookies));
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
&BrowserRequestContext::SetAcceptAllCookies,
_Context->request_context().get(), accept_all_cookies));
}
// static

View File

@ -125,6 +125,7 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web)
web.experimental_webgl_enabled = !cef.webgl_disabled;
web.show_composited_layer_borders = false;
web.accelerated_compositing_enabled = cef.accelerated_compositing_enabled;
web.threaded_compositing_enabled = cef.threaded_compositing_enabled;
web.accelerated_layers_enabled = !cef.accelerated_layers_disabled;
web.accelerated_video_enabled = !cef.accelerated_video_disabled;
web.accelerated_2d_canvas_enabled = !cef.accelerated_2d_canvas_disabled;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,6 +7,7 @@
#include "browser_socket_stream_bridge.h"
#include "base/atomicops.h"
#include "base/bind.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop.h"
#include "googleurl/src/gurl.h"
@ -48,7 +49,6 @@ class WebSocketStreamHandleBridgeImpl
const char* data, int len);
virtual void OnClose(net::SocketStream* req);
private:
virtual ~WebSocketStreamHandleBridgeImpl();
@ -95,8 +95,7 @@ void WebSocketStreamHandleBridgeImpl::Connect(const GURL& url) {
AddRef(); // Released in DoOnClose().
g_io_thread->PostTask(
FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoConnect,
url));
base::Bind(&WebSocketStreamHandleBridgeImpl::DoConnect, this, url));
if (delegate_)
delegate_->WillOpenStream(handle_, url);
}
@ -106,8 +105,8 @@ bool WebSocketStreamHandleBridgeImpl::Send(
DCHECK(g_io_thread);
g_io_thread->PostTask(
FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoSend,
new std::vector<char>(data)));
base::Bind(&WebSocketStreamHandleBridgeImpl::DoSend, this,
new std::vector<char>(data)));
return true;
}
@ -115,7 +114,7 @@ void WebSocketStreamHandleBridgeImpl::Close() {
DCHECK(g_io_thread);
g_io_thread->PostTask(
FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoClose));
base::Bind(&WebSocketStreamHandleBridgeImpl::DoClose, this));
}
void WebSocketStreamHandleBridgeImpl::OnConnected(
@ -123,8 +122,8 @@ void WebSocketStreamHandleBridgeImpl::OnConnected(
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1);
message_loop_->PostTask(
FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnConnected,
max_pending_send_allowed));
base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnConnected, this,
max_pending_send_allowed));
}
void WebSocketStreamHandleBridgeImpl::OnSentData(
@ -132,8 +131,8 @@ void WebSocketStreamHandleBridgeImpl::OnSentData(
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1);
message_loop_->PostTask(
FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnSentData,
amount_sent));
base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnSentData, this,
amount_sent));
}
void WebSocketStreamHandleBridgeImpl::OnReceivedData(
@ -141,9 +140,8 @@ void WebSocketStreamHandleBridgeImpl::OnReceivedData(
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1);
message_loop_->PostTask(
FROM_HERE,
NewRunnableMethod(this,
&WebSocketStreamHandleBridgeImpl::DoOnReceivedData,
new std::vector<char>(data, data + len)));
base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnReceivedData, this,
new std::vector<char>(data, data + len)));
}
void WebSocketStreamHandleBridgeImpl::OnClose(net::SocketStream* socket) {
@ -153,7 +151,7 @@ void WebSocketStreamHandleBridgeImpl::OnClose(net::SocketStream* socket) {
socket_id_ = kNoSocketId;
message_loop_->PostTask(
FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnClose));
base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnClose, this));
}
void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,7 +7,7 @@
namespace net {
class URLRequestContext;
}
} // namespace net
class BrowserSocketStreamBridge {
public:

View File

@ -104,21 +104,6 @@ void ClearCache()
WebCore::CrossOriginPreflightResultCache::shared().empty();
}
std::string BuildUserAgent(bool mimic_windows) {
std::string product_version;
const CefSettings& settings = _Context->settings();
if (settings.product_version.length > 0) {
product_version = CefString(&settings.product_version).ToString();
} else {
// Keep synchronized with the newest Beta Channel release announced at
// http://googlechromereleases.blogspot.com/
product_version = "Chrome/13.0.782.41";
}
return webkit_glue::BuildUserAgentHelper(mimic_windows, product_version);
}
#if defined(OS_LINUX)
int MatchFontWithFallback(const std::string& face, bool bold,
bool italic, int charset) {

View File

@ -221,10 +221,12 @@ WebKit::WebGraphicsContext3D* BrowserWebKitInit::createGraphicsContext3D() {
(settings.graphics_implementation == DESKTOP_IN_PROCESS_COMMAND_BUFFER);
#endif
if (use_command_buffer)
if (use_command_buffer) {
return new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl();
else
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
} else {
return new webkit::gpu::WebGraphicsContext3DInProcessImpl(
gfx::kNullPluginWindow);
}
}
WebKit::WebString BrowserWebKitInit::queryLocalizedString(

View File

@ -29,7 +29,7 @@
#include "media/base/filter_collection.h"
#include "media/base/media_log.h"
#include "media/base/message_loop_factory_impl.h"
#include "media/filters/audio_renderer_impl.h"
#include "media/filters/reference_audio_renderer.h"
#include "net/base/net_errors.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
@ -591,21 +591,25 @@ WebPlugin* BrowserWebViewDelegate::createPlugin(
#endif
if (force_windowless) {
bool flash = LowerCaseEqualsASCII(params.mimeType.utf8(),
WebPluginParams params_copy = params;
params_copy.mimeType = WebString::fromUTF8(mime_types.front());
bool flash = LowerCaseEqualsASCII(params_copy.mimeType.utf8(),
"application/x-shockwave-flash");
bool silverlight = StartsWithASCII(params.mimeType.utf8(),
bool silverlight = StartsWithASCII(params_copy.mimeType.utf8(),
"application/x-silverlight", false);
if (flash || silverlight) {
// Force Flash and Silverlight plugins to use windowless mode.
DCHECK(params.attributeNames.size() == params.attributeValues.size());
size_t size = params.attributeNames.size();
DCHECK(params_copy.attributeNames.size() ==
params_copy.attributeValues.size());
size_t size = params_copy.attributeNames.size();
WebVector<WebString> new_names(size+1), new_values(size+1);
for (size_t i = 0; i < size; ++i) {
new_names[i] = params.attributeNames[i];
new_values[i] = params.attributeValues[i];
new_names[i] = params_copy.attributeNames[i];
new_values[i] = params_copy.attributeValues[i];
}
if (flash) {
@ -616,18 +620,16 @@ WebPlugin* BrowserWebViewDelegate::createPlugin(
new_values[size] = "true";
}
WebPluginParams new_params = params;
new_params.attributeNames.swap(new_names);
new_params.attributeValues.swap(new_values);
params_copy.attributeNames.swap(new_names);
params_copy.attributeValues.swap(new_values);
return new webkit::npapi::WebPluginImpl(
frame, new_params, plugins.front().path, mime_types.front(),
AsWeakPtr());
frame, params_copy, plugins.front().path, AsWeakPtr());
}
}
return new webkit::npapi::WebPluginImpl(
frame, params, plugins.front().path, mime_types.front(), AsWeakPtr());
frame, params, plugins.front().path, AsWeakPtr());
}
WebWorker* BrowserWebViewDelegate::createWorker(
@ -648,7 +650,7 @@ WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer(
collection->AddVideoRenderer(video_renderer);
// Add the audio renderer.
collection->AddAudioRenderer(new media::AudioRendererImpl());
collection->AddAudioRenderer(new media::ReferenceAudioRenderer());
scoped_ptr<webkit_glue::WebMediaPlayerImpl> result(
new webkit_glue::WebMediaPlayerImpl(client,

View File

@ -21,6 +21,7 @@
#include "ui/base/ui_base_paths.h"
#include "ui/gfx/gl/gl_implementation.h"
#include "webkit/extensions/v8/gc_extension.h"
#include "webkit/glue/user_agent.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/plugin_list.h"
@ -133,8 +134,22 @@ void CefProcessUIThread::Init() {
// Create the storage context object.
_Context->set_storage_context(new DOMStorageContext(_Context->cache_path()));
if (settings.user_agent.length > 0)
webkit_glue::SetUserAgent(CefString(&settings.user_agent));
if (settings.user_agent.length > 0) {
webkit_glue::SetUserAgent(CefString(&settings.user_agent), false);
} else {
std::string product_version;
if (settings.product_version.length > 0) {
product_version = CefString(&settings.product_version).ToString();
} else {
// Keep synchronized with the newest Dev Channel release announced at
// http://googlechromereleases.blogspot.com/
product_version = "Chrome/16.0.904.0";
}
webkit_glue::SetUserAgent(
webkit_glue::BuildUserAgentFromProduct(product_version), false);
}
if (settings.extra_plugin_paths) {
cef_string_t str;

View File

@ -6,8 +6,6 @@
#include "external_popup_menu_mac.h"
#include "browser_impl.h"
#include "content/common/view_messages.h"
#include "content/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenuClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -56,9 +56,11 @@ void ClipboardReadAsciiText(ui::Clipboard::Buffer buffer, std::string* result) {
}
void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup,
GURL* url) {
GURL* url, uint32* fragment_start,
uint32* fragment_end) {
std::string url_str;
ClipboardGetClipboard()->ReadHTML(buffer, markup, url ? &url_str : NULL);
ClipboardGetClipboard()->ReadHTML(buffer, markup, url ? &url_str : NULL,
fragment_start, fragment_end);
if (url)
*url = GURL(url_str);
}

View File

@ -110,7 +110,7 @@ void PromiseWriterTask::Run() {
CHECK(file_stream_.get());
file_stream_->Write(drop_data_.file_contents.data(),
drop_data_.file_contents.length(),
NULL);
net::CompletionCallback());
// Let our destructor take care of business.
}

View File

@ -5,6 +5,7 @@
#include "webwidget_host.h"
#include "cef_thread.h"
#include "base/bind.h"
#include "base/message_loop.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h"
@ -15,7 +16,8 @@ using WebKit::WebSize;
void WebWidgetHost::ScheduleAnimation() {
MessageLoop::current()->PostDelayedTask(FROM_HERE,
factory_.NewRunnableMethod(&WebWidgetHost::ScheduleComposite), 10);
base::Bind(&WebWidgetHost::ScheduleComposite, weak_factory_.GetWeakPtr()),
10);
}
void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) {
@ -75,7 +77,7 @@ gfx::PluginWindowHandle WebWidgetHost::GetWindowedPluginAt(int x, int y)
}
void WebWidgetHost::DoPaint() {
update_task_ = NULL;
has_update_task_ = false;
if (update_rect_.IsEmpty())
return;
@ -92,8 +94,9 @@ void WebWidgetHost::DoPaint() {
Paint();
} else {
// Try again later.
update_task_ = factory_.NewRunnableMethod(&WebWidgetHost::DoPaint);
CefThread::PostTask(CefThread::UI, FROM_HERE, update_task_);
has_update_task_ = true;
CefThread::PostTask(CefThread::UI, FROM_HERE,
base::Bind(&WebWidgetHost::DoPaint, weak_factory_.GetWeakPtr()));
}
#else
NOTIMPLEMENTED();

View File

@ -9,6 +9,7 @@
#include "include/internal/cef_types.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
@ -208,7 +209,7 @@ class WebWidgetHost {
// Specifies the portion of the webwidget that has been invalidated when
// window rendering is disabled.
gfx::Rect update_rect_;
CancelableTask* update_task_;
bool has_update_task_;
// The map of windowed plugins that need to be drawn when window rendering is
// disabled.
@ -253,7 +254,7 @@ class WebWidgetHost {
#endif
private:
ScopedRunnableMethodFactory<WebWidgetHost> factory_;
base::WeakPtrFactory<WebWidgetHost> weak_factory_;
};
#endif // _WEBWIDGET_HOST_H

View File

@ -335,8 +335,8 @@ WebWidgetHost::WebWidgetHost()
popup_(false),
scroll_dx_(0),
scroll_dy_(0),
update_task_(NULL),
ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {
has_update_task_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
set_painting(false);
}
@ -381,11 +381,7 @@ void WebWidgetHost::Paint() {
}
}
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0);
#else
webwidget_->animate();
#endif
// This may result in more invalidation
webwidget_->layout();

View File

@ -123,8 +123,8 @@ WebWidgetHost::WebWidgetHost()
canvas_w_(0),
canvas_h_(0),
popup_(false),
update_task_(NULL),
ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {
has_update_task_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
set_painting(false);
}
@ -135,19 +135,30 @@ void WebWidgetHost::Paint() {
gfx::Rect client_rect(NSRectToCGRect([view_ bounds]));
gfx::Rect update_rect;
// Number of pixels that the canvas is allowed to differ from the client area.
const int kCanvasGrowSize = 128;
if (!canvas_.get() ||
canvas_w_ < client_rect.width() ||
canvas_h_ < client_rect.height() ||
canvas_w_ > client_rect.width() + kCanvasGrowSize * 2 ||
canvas_h_ > client_rect.height() + kCanvasGrowSize * 2) {
if (!webwidget_->isAcceleratedCompositingActive()) {
// Number of pixels that the canvas is allowed to differ from the client
// area.
const int kCanvasGrowSize = 128;
if (!canvas_.get() ||
canvas_w_ < client_rect.width() ||
canvas_h_ < client_rect.height() ||
canvas_w_ > client_rect.width() + kCanvasGrowSize * 2 ||
canvas_h_ > client_rect.height() + kCanvasGrowSize * 2) {
paint_rect_ = client_rect;
// Resize the canvas to be within a reasonable size of the client area.
canvas_w_ = client_rect.width() + kCanvasGrowSize;
canvas_h_ = client_rect.height() + kCanvasGrowSize;
canvas_.reset(new skia::PlatformCanvas(canvas_w_, canvas_h_, true));
}
} else if(!canvas_.get() || canvas_w_ != client_rect.width() ||
canvas_h_ != client_rect.height()) {
paint_rect_ = client_rect;
// Resize the canvas to be within a reasonable size of the client area.
canvas_w_ = client_rect.width() + kCanvasGrowSize;
canvas_h_ = client_rect.height() + kCanvasGrowSize;
// The canvas must be the exact size of the client area.
canvas_w_ = client_rect.width();
canvas_h_ = client_rect.height();
canvas_.reset(new skia::PlatformCanvas(canvas_w_, canvas_h_, true));
}
@ -161,11 +172,7 @@ void WebWidgetHost::Paint() {
[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:paint_context];
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0);
#else
webwidget_->animate();
#endif
// This may result in more invalidation
webwidget_->layout();

View File

@ -6,7 +6,7 @@
#include "webwidget_host.h"
#include "cef_thread.h"
#include "ui/gfx/rect.h"
#include "base/bind.h"
#include "base/logging.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
@ -22,6 +22,7 @@
#include "ui/base/range/range.h"
#include "ui/base/win/hwnd_util.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/rect.h"
#include <commctrl.h>
@ -320,13 +321,13 @@ WebWidgetHost::WebWidgetHost()
track_mouse_leave_(false),
scroll_dx_(0),
scroll_dy_(0),
update_task_(NULL),
has_update_task_(false),
tooltip_view_(NULL),
tooltip_showing_(false),
ime_notification_(false),
input_method_is_active_(false),
text_input_type_(WebKit::WebTextInputTypeNone),
ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
set_painting(false);
}
@ -360,7 +361,7 @@ void WebWidgetHost::Paint() {
gfx::Rect client_rect(width, height);
gfx::Rect damaged_rect;
if (view_) {
if (view_ && !webwidget_->isAcceleratedCompositingActive()) {
// Number of pixels that the canvas is allowed to differ from the client
// area.
const int kCanvasGrowSize = 128;
@ -382,19 +383,14 @@ void WebWidgetHost::Paint() {
canvas_h_ != client_rect.height()) {
ResetScrollRect();
paint_rect_ = client_rect;
// For non-window-based rendering the canvas must be the exact size of the
// client area.
// The canvas must be the exact size of the client area.
canvas_w_ = client_rect.width();
canvas_h_ = client_rect.height();
canvas_.reset(new skia::PlatformCanvas(canvas_w_, canvas_h_, true));
}
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0);
#else
webwidget_->animate();
#endif
// This may result in more invalidation
webwidget_->layout();
@ -514,9 +510,10 @@ void WebWidgetHost::InvalidateRect(const gfx::Rect& rect)
} else {
// The update rectangle will be painted by DoPaint().
update_rect_ = update_rect_.Union(rect);
if (!update_task_) {
update_task_ = factory_.NewRunnableMethod(&WebWidgetHost::DoPaint);
CefThread::PostTask(CefThread::UI, FROM_HERE, update_task_);
if (!has_update_task_) {
has_update_task_ = true;
CefThread::PostTask(CefThread::UI, FROM_HERE,
base::Bind(&WebWidgetHost::DoPaint, weak_factory_.GetWeakPtr()));
}
}
}

View File

@ -92,8 +92,7 @@ int CEF_CALLBACK display_handler_on_console_message(
{
DCHECK(self);
DCHECK(browser);
DCHECK(message);
if (!self || !browser || !message)
if (!self || !browser)
return 0;
return CefDisplayHandlerCppToC::Get(self)->OnConsoleMessage(

View File

@ -10,6 +10,10 @@
# Don't use clang with CEF binary releases due to Chromium tree structure dependency.
'clang': 0,
}],
[ 'OS=="win"', {
# Keep the build output in the root directory.
'build_dir_prefix': '..\\',
}],
]
},
'includes': [

View File

@ -1,2 +1,2 @@
@echo off
..\..\third_party\python_26\python.exe make_distrib.py --output-dir ..\binary_distrib\
..\..\third_party\python_26\python.exe make_distrib.py --output-dir ..\binary_distrib\ %*

View File

@ -95,6 +95,9 @@ This utility builds the CEF Binary Distribution.
parser = OptionParser(description=disc)
parser.add_option('--output-dir', dest='outputdir', metavar='DIR',
help='output directory [required]')
parser.add_option('--allow-partial',
action='store_true', dest='allowpartial', default=False,
help='allow creation of partial distributions')
parser.add_option('-q', '--quiet',
action='store_true', dest='quiet', default=False,
help='do not output detailed status information')
@ -187,34 +190,40 @@ if platform == 'windows':
'tests/cefclient/', cefclient_dir, options.quiet)
# transfer build/Debug files
dst_dir = os.path.join(output_dir, 'Debug')
make_dir(dst_dir, options.quiet)
copy_files(os.path.join(cef_dir, 'Debug/*.dll'), dst_dir, options.quiet)
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/cefclient.exe'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/chrome.pak'), dst_dir, options.quiet)
copy_dir(os.path.join(cef_dir, 'Debug/locales'), os.path.join(dst_dir, 'locales'), \
options.quiet)
if not options.allowpartial or path_exists(os.path.join(cef_dir, 'Debug')):
dst_dir = os.path.join(output_dir, 'Debug')
make_dir(dst_dir, options.quiet)
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
copy_files(os.path.join(cef_dir, 'Debug/*.dll'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/cefclient.exe'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/chrome.pak'), dst_dir, options.quiet)
copy_dir(os.path.join(cef_dir, 'Debug/locales'), os.path.join(dst_dir, 'locales'), \
options.quiet)
# transfer lib/Debug files
dst_dir = os.path.join(output_dir, 'lib/Debug')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/lib/libcef.lib'), dst_dir, options.quiet)
else:
sys.stderr.write("No Debug build files.\n")
# transfer build/Release files
dst_dir = os.path.join(output_dir, 'Release')
make_dir(dst_dir, options.quiet)
copy_files(os.path.join(cef_dir, 'Release/*.dll'), dst_dir, options.quiet)
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Release/cefclient.exe'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Release/chrome.pak'), dst_dir, options.quiet)
copy_dir(os.path.join(cef_dir, 'Release/locales'), os.path.join(dst_dir, 'locales'), \
options.quiet)
if not options.allowpartial or path_exists(os.path.join(cef_dir, 'Release')):
dst_dir = os.path.join(output_dir, 'Release')
make_dir(dst_dir, options.quiet)
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
copy_files(os.path.join(cef_dir, 'Release/*.dll'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Release/cefclient.exe'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Release/chrome.pak'), dst_dir, options.quiet)
copy_dir(os.path.join(cef_dir, 'Release/locales'), os.path.join(dst_dir, 'locales'), \
options.quiet)
# transfer lib/Debug files
dst_dir = os.path.join(output_dir, 'lib/Debug')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/lib/libcef.lib'), dst_dir, options.quiet)
# transfer lib/Release files
dst_dir = os.path.join(output_dir, 'lib/Release')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Release/lib/libcef.lib'), dst_dir, options.quiet)
# transfer lib/Release files
dst_dir = os.path.join(output_dir, 'lib/Release')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Release/lib/libcef.lib'), dst_dir, options.quiet)
else:
sys.stderr.write("No Release build files.\n")
# generate doc files
os.popen('make_cppdocs.bat '+cef_rev)
@ -227,7 +236,7 @@ if platform == 'windows':
# transfer additional files, if any
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/win/transfer.cfg'), \
output_dir, options.quiet)
output_dir, options.quiet)
# generate the project files
generate_msvs_projects('2005');
@ -252,16 +261,18 @@ elif platform == 'macosx':
options.quiet)
# transfer xcodebuild/Debug files
dst_dir = os.path.join(output_dir, 'Debug')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Debug/ffmpegsumo.so'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Debug/libcef.dylib'), dst_dir, options.quiet)
if not options.allowpartial or path_exists(os.path.join(cef_dir, '../xcodebuild/Debug')):
dst_dir = os.path.join(output_dir, 'Debug')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Debug/ffmpegsumo.so'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Debug/libcef.dylib'), dst_dir, options.quiet)
# transfer xcodebuild/Release files
dst_dir = os.path.join(output_dir, 'Release')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Release/ffmpegsumo.so'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Release/libcef.dylib'), dst_dir, options.quiet)
if not options.allowpartial or path_exists(os.path.join(cef_dir, '../xcodebuild/Release')):
dst_dir = os.path.join(output_dir, 'Release')
make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Release/ffmpegsumo.so'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Release/libcef.dylib'), dst_dir, options.quiet)
# transfer resource files
dst_dir = os.path.join(output_dir, 'Resources')

View File

@ -1,2 +1,2 @@
#!/bin/sh
python make_distrib.py --output-dir ../binary_distrib/
python make_distrib.py --output-dir ../binary_distrib/ $@