- 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_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. # Directory for CEF source files.
[ 'OS=="win"', { [ 'OS=="win"', {
'cef_directory' : '<!(echo %CEF_DIRECTORY%)', 'cef_directory' : '<!(echo %CEF_DIRECTORY%)',
# Keep the build output in the CEF directory.
'build_dir_prefix': '..\\<!(echo %CEF_DIRECTORY%)\\',
}, { # OS!="win" }, { # OS!="win"
'cef_directory' : '<!(echo $CEF_DIRECTORY)', 'cef_directory' : '<!(echo $CEF_DIRECTORY)',
}], }],
[ 'OS=="mac"', { [ '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. # Don't use the chrome style plugin with CEF.
'clang_use_chrome_plugins': 0, 'clang_use_chrome_plugins': 0,
}], }],

View File

@ -343,6 +343,12 @@ typedef struct _cef_browser_settings_t
/// ///
bool accelerated_compositing_enabled; 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 // Set to true (1) to disable accelerated layers. This affects features like
// 3D CSS transforms. // 3D CSS transforms.

View File

@ -377,6 +377,7 @@ struct CefBrowserSettingsTraits {
target->webgl_disabled = src->webgl_disabled; target->webgl_disabled = src->webgl_disabled;
target->accelerated_compositing_enabled = target->accelerated_compositing_enabled =
src->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_layers_disabled = src->accelerated_layers_disabled;
target->accelerated_video_disabled = src->accelerated_video_disabled; target->accelerated_video_disabled = src->accelerated_video_disabled;
target->accelerated_2d_canvas_disabled = target->accelerated_2d_canvas_disabled =

View File

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

View File

@ -2,7 +2,7 @@
// 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.
#ifndef WEBKIT_TOOLS_TEST_SHELL_Browser_APPCACHE_SYSTEM_H_ #ifndef _BROWSER_APPCACHE_SYSTEM_H
#define _BROWSER_APPCACHE_SYSTEM_H #define _BROWSER_APPCACHE_SYSTEM_H
#include "base/file_path.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 // 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.
#include "browser_devtools_agent.h" #include "browser_devtools_agent.h"
#include "base/bind.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "grit/webkit_chromium_resources.h" #include "grit/webkit_chromium_resources.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h"
@ -52,7 +53,7 @@ void BrowserDevToolsAgent::DispatchMessageLoop() {
} }
BrowserDevToolsAgent::BrowserDevToolsAgent() BrowserDevToolsAgent::BrowserDevToolsAgent()
: ALLOW_THIS_IN_INITIALIZER_LIST(call_method_factory_(this)), : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
dev_tools_client_(NULL) { dev_tools_client_(NULL) {
static int dev_tools_agent_counter; static int dev_tools_agent_counter;
routing_id_ = ++dev_tools_agent_counter; routing_id_ = ++dev_tools_agent_counter;
@ -86,11 +87,10 @@ WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
} }
void BrowserDevToolsAgent::AsyncCall(const BrowserDevToolsCallArgs &args) { void BrowserDevToolsAgent::AsyncCall(const BrowserDevToolsCallArgs &args) {
MessageLoop::current()->PostDelayedTask( MessageLoop::current()->PostTask(
FROM_HERE, FROM_HERE,
call_method_factory_.NewRunnableMethod(&BrowserDevToolsAgent::Call, base::Bind(&BrowserDevToolsAgent::Call, weak_factory_.GetWeakPtr(),
args), args));
0);
} }
void BrowserDevToolsAgent::Call(const BrowserDevToolsCallArgs &args) { void BrowserDevToolsAgent::Call(const BrowserDevToolsCallArgs &args) {
@ -130,11 +130,10 @@ void BrowserDevToolsAgent::detach() {
} }
void BrowserDevToolsAgent::frontendLoaded() { void BrowserDevToolsAgent::frontendLoaded() {
MessageLoop::current()->PostDelayedTask( MessageLoop::current()->PostTask(
FROM_HERE, FROM_HERE,
call_method_factory_.NewRunnableMethod( base::Bind(&BrowserDevToolsAgent::DelayedFrontendLoaded,
&BrowserDevToolsAgent::DelayedFrontendLoaded), weak_factory_.GetWeakPtr()));
0);
} }
bool BrowserDevToolsAgent::evaluateInWebInspector( 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 // 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.
#ifndef _BROWSER_DEVTOOLS_AGENT_H #ifndef _BROWSER_DEVTOOLS_AGENT_H
#define _BROWSER_DEVTOOLS_AGENT_H #define _BROWSER_DEVTOOLS_AGENT_H
#include "base/memory/weak_ptr.h"
#include "base/task.h" #include "base/task.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClient.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClient.h"
@ -54,7 +55,7 @@ class BrowserDevToolsAgent : public WebKit::WebDevToolsAgentClient {
static void DispatchMessageLoop(); static void DispatchMessageLoop();
WebKit::WebDevToolsAgent* GetWebAgent(); WebKit::WebDevToolsAgent* GetWebAgent();
ScopedRunnableMethodFactory<BrowserDevToolsAgent> call_method_factory_; base::WeakPtrFactory<BrowserDevToolsAgent> weak_factory_;
BrowserDevToolsClient* dev_tools_client_; BrowserDevToolsClient* dev_tools_client_;
int routing_id_; int routing_id_;
WebKit::WebDevToolsAgent* web_dev_tools_agent_; WebKit::WebDevToolsAgent* web_dev_tools_agent_;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -125,6 +125,7 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web)
web.experimental_webgl_enabled = !cef.webgl_disabled; web.experimental_webgl_enabled = !cef.webgl_disabled;
web.show_composited_layer_borders = false; web.show_composited_layer_borders = false;
web.accelerated_compositing_enabled = cef.accelerated_compositing_enabled; 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_layers_enabled = !cef.accelerated_layers_disabled;
web.accelerated_video_enabled = !cef.accelerated_video_disabled; web.accelerated_video_enabled = !cef.accelerated_video_disabled;
web.accelerated_2d_canvas_enabled = !cef.accelerated_2d_canvas_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 // 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.
@ -7,6 +7,7 @@
#include "browser_socket_stream_bridge.h" #include "browser_socket_stream_bridge.h"
#include "base/atomicops.h" #include "base/atomicops.h"
#include "base/bind.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
@ -48,7 +49,6 @@ class WebSocketStreamHandleBridgeImpl
const char* data, int len); const char* data, int len);
virtual void OnClose(net::SocketStream* req); virtual void OnClose(net::SocketStream* req);
private: private:
virtual ~WebSocketStreamHandleBridgeImpl(); virtual ~WebSocketStreamHandleBridgeImpl();
@ -95,8 +95,7 @@ void WebSocketStreamHandleBridgeImpl::Connect(const GURL& url) {
AddRef(); // Released in DoOnClose(). AddRef(); // Released in DoOnClose().
g_io_thread->PostTask( g_io_thread->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoConnect, base::Bind(&WebSocketStreamHandleBridgeImpl::DoConnect, this, url));
url));
if (delegate_) if (delegate_)
delegate_->WillOpenStream(handle_, url); delegate_->WillOpenStream(handle_, url);
} }
@ -106,7 +105,7 @@ bool WebSocketStreamHandleBridgeImpl::Send(
DCHECK(g_io_thread); DCHECK(g_io_thread);
g_io_thread->PostTask( g_io_thread->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoSend, base::Bind(&WebSocketStreamHandleBridgeImpl::DoSend, this,
new std::vector<char>(data))); new std::vector<char>(data)));
return true; return true;
} }
@ -115,7 +114,7 @@ void WebSocketStreamHandleBridgeImpl::Close() {
DCHECK(g_io_thread); DCHECK(g_io_thread);
g_io_thread->PostTask( g_io_thread->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoClose)); base::Bind(&WebSocketStreamHandleBridgeImpl::DoClose, this));
} }
void WebSocketStreamHandleBridgeImpl::OnConnected( void WebSocketStreamHandleBridgeImpl::OnConnected(
@ -123,7 +122,7 @@ void WebSocketStreamHandleBridgeImpl::OnConnected(
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1); base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1);
message_loop_->PostTask( message_loop_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnConnected, base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnConnected, this,
max_pending_send_allowed)); max_pending_send_allowed));
} }
@ -132,7 +131,7 @@ void WebSocketStreamHandleBridgeImpl::OnSentData(
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1); base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1);
message_loop_->PostTask( message_loop_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnSentData, base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnSentData, this,
amount_sent)); amount_sent));
} }
@ -141,8 +140,7 @@ void WebSocketStreamHandleBridgeImpl::OnReceivedData(
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1); base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, 1);
message_loop_->PostTask( message_loop_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(this, base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnReceivedData, this,
&WebSocketStreamHandleBridgeImpl::DoOnReceivedData,
new std::vector<char>(data, data + len))); new std::vector<char>(data, data + len)));
} }
@ -153,7 +151,7 @@ void WebSocketStreamHandleBridgeImpl::OnClose(net::SocketStream* socket) {
socket_id_ = kNoSocketId; socket_id_ = kNoSocketId;
message_loop_->PostTask( message_loop_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnClose)); base::Bind(&WebSocketStreamHandleBridgeImpl::DoOnClose, this));
} }
void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) { 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 // 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.
@ -7,7 +7,7 @@
namespace net { namespace net {
class URLRequestContext; class URLRequestContext;
} } // namespace net
class BrowserSocketStreamBridge { class BrowserSocketStreamBridge {
public: public:

View File

@ -104,21 +104,6 @@ void ClearCache()
WebCore::CrossOriginPreflightResultCache::shared().empty(); 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) #if defined(OS_LINUX)
int MatchFontWithFallback(const std::string& face, bool bold, int MatchFontWithFallback(const std::string& face, bool bold,
bool italic, int charset) { bool italic, int charset) {

View File

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

View File

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

View File

@ -21,6 +21,7 @@
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#include "ui/gfx/gl/gl_implementation.h" #include "ui/gfx/gl/gl_implementation.h"
#include "webkit/extensions/v8/gc_extension.h" #include "webkit/extensions/v8/gc_extension.h"
#include "webkit/glue/user_agent.h"
#include "webkit/glue/webkit_glue.h" #include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/plugin_list.h" #include "webkit/plugins/npapi/plugin_list.h"
@ -133,8 +134,22 @@ void CefProcessUIThread::Init() {
// Create the storage context object. // Create the storage context object.
_Context->set_storage_context(new DOMStorageContext(_Context->cache_path())); _Context->set_storage_context(new DOMStorageContext(_Context->cache_path()));
if (settings.user_agent.length > 0) if (settings.user_agent.length > 0) {
webkit_glue::SetUserAgent(CefString(&settings.user_agent)); 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) { if (settings.extra_plugin_paths) {
cef_string_t str; cef_string_t str;

View File

@ -6,8 +6,6 @@
#include "external_popup_menu_mac.h" #include "external_popup_menu_mac.h"
#include "browser_impl.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/WebExternalPopupMenuClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.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 // 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.
@ -56,9 +56,11 @@ void ClipboardReadAsciiText(ui::Clipboard::Buffer buffer, std::string* result) {
} }
void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup, void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup,
GURL* url) { GURL* url, uint32* fragment_start,
uint32* fragment_end) {
std::string url_str; 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) if (url)
*url = GURL(url_str); *url = GURL(url_str);
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -123,8 +123,8 @@ WebWidgetHost::WebWidgetHost()
canvas_w_(0), canvas_w_(0),
canvas_h_(0), canvas_h_(0),
popup_(false), popup_(false),
update_task_(NULL), has_update_task_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
set_painting(false); set_painting(false);
} }
@ -135,7 +135,9 @@ void WebWidgetHost::Paint() {
gfx::Rect client_rect(NSRectToCGRect([view_ bounds])); gfx::Rect client_rect(NSRectToCGRect([view_ bounds]));
gfx::Rect update_rect; gfx::Rect update_rect;
// Number of pixels that the canvas is allowed to differ from the client area. if (!webwidget_->isAcceleratedCompositingActive()) {
// Number of pixels that the canvas is allowed to differ from the client
// area.
const int kCanvasGrowSize = 128; const int kCanvasGrowSize = 128;
if (!canvas_.get() || if (!canvas_.get() ||
@ -150,6 +152,15 @@ void WebWidgetHost::Paint() {
canvas_h_ = client_rect.height() + kCanvasGrowSize; canvas_h_ = client_rect.height() + kCanvasGrowSize;
canvas_.reset(new skia::PlatformCanvas(canvas_w_, canvas_h_, true)); 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;
// 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));
}
// Draw into the graphics context of the canvas instead of the view's context. // Draw into the graphics context of the canvas instead of the view's context.
// The view's context is pushed onto the context stack, to be restored below. // The view's context is pushed onto the context stack, to be restored below.
@ -161,11 +172,7 @@ void WebWidgetHost::Paint() {
[NSGraphicsContext saveGraphicsState]; [NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:paint_context]; [NSGraphicsContext setCurrentContext:paint_context];
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0); webwidget_->animate(0.0);
#else
webwidget_->animate();
#endif
// This may result in more invalidation // This may result in more invalidation
webwidget_->layout(); webwidget_->layout();

View File

@ -6,7 +6,7 @@
#include "webwidget_host.h" #include "webwidget_host.h"
#include "cef_thread.h" #include "cef_thread.h"
#include "ui/gfx/rect.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
@ -22,6 +22,7 @@
#include "ui/base/range/range.h" #include "ui/base/range/range.h"
#include "ui/base/win/hwnd_util.h" #include "ui/base/win/hwnd_util.h"
#include "ui/gfx/gdi_util.h" #include "ui/gfx/gdi_util.h"
#include "ui/gfx/rect.h"
#include <commctrl.h> #include <commctrl.h>
@ -320,13 +321,13 @@ WebWidgetHost::WebWidgetHost()
track_mouse_leave_(false), track_mouse_leave_(false),
scroll_dx_(0), scroll_dx_(0),
scroll_dy_(0), scroll_dy_(0),
update_task_(NULL), has_update_task_(false),
tooltip_view_(NULL), tooltip_view_(NULL),
tooltip_showing_(false), tooltip_showing_(false),
ime_notification_(false), ime_notification_(false),
input_method_is_active_(false), input_method_is_active_(false),
text_input_type_(WebKit::WebTextInputTypeNone), text_input_type_(WebKit::WebTextInputTypeNone),
ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
set_painting(false); set_painting(false);
} }
@ -360,7 +361,7 @@ void WebWidgetHost::Paint() {
gfx::Rect client_rect(width, height); gfx::Rect client_rect(width, height);
gfx::Rect damaged_rect; gfx::Rect damaged_rect;
if (view_) { if (view_ && !webwidget_->isAcceleratedCompositingActive()) {
// Number of pixels that the canvas is allowed to differ from the client // Number of pixels that the canvas is allowed to differ from the client
// area. // area.
const int kCanvasGrowSize = 128; const int kCanvasGrowSize = 128;
@ -383,18 +384,13 @@ void WebWidgetHost::Paint() {
ResetScrollRect(); ResetScrollRect();
paint_rect_ = client_rect; paint_rect_ = client_rect;
// For non-window-based rendering the canvas must be the exact size of the // The canvas must be the exact size of the client area.
// client area.
canvas_w_ = client_rect.width(); canvas_w_ = client_rect.width();
canvas_h_ = client_rect.height(); canvas_h_ = client_rect.height();
canvas_.reset(new skia::PlatformCanvas(canvas_w_, canvas_h_, true)); canvas_.reset(new skia::PlatformCanvas(canvas_w_, canvas_h_, true));
} }
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0); webwidget_->animate(0.0);
#else
webwidget_->animate();
#endif
// This may result in more invalidation // This may result in more invalidation
webwidget_->layout(); webwidget_->layout();
@ -514,9 +510,10 @@ void WebWidgetHost::InvalidateRect(const gfx::Rect& rect)
} else { } else {
// The update rectangle will be painted by DoPaint(). // The update rectangle will be painted by DoPaint().
update_rect_ = update_rect_.Union(rect); update_rect_ = update_rect_.Union(rect);
if (!update_task_) { if (!has_update_task_) {
update_task_ = factory_.NewRunnableMethod(&WebWidgetHost::DoPaint); has_update_task_ = true;
CefThread::PostTask(CefThread::UI, FROM_HERE, update_task_); 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(self);
DCHECK(browser); DCHECK(browser);
DCHECK(message); if (!self || !browser)
if (!self || !browser || !message)
return 0; return 0;
return CefDisplayHandlerCppToC::Get(self)->OnConsoleMessage( 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. # Don't use clang with CEF binary releases due to Chromium tree structure dependency.
'clang': 0, 'clang': 0,
}], }],
[ 'OS=="win"', {
# Keep the build output in the root directory.
'build_dir_prefix': '..\\',
}],
] ]
}, },
'includes': [ 'includes': [

View File

@ -1,2 +1,2 @@
@echo off @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 = OptionParser(description=disc)
parser.add_option('--output-dir', dest='outputdir', metavar='DIR', parser.add_option('--output-dir', dest='outputdir', metavar='DIR',
help='output directory [required]') 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', parser.add_option('-q', '--quiet',
action='store_true', dest='quiet', default=False, action='store_true', dest='quiet', default=False,
help='do not output detailed status information') help='do not output detailed status information')
@ -187,34 +190,40 @@ if platform == 'windows':
'tests/cefclient/', cefclient_dir, options.quiet) 'tests/cefclient/', cefclient_dir, options.quiet)
# transfer build/Debug files # transfer build/Debug files
if not options.allowpartial or path_exists(os.path.join(cef_dir, 'Debug')):
dst_dir = os.path.join(output_dir, 'Debug') dst_dir = os.path.join(output_dir, 'Debug')
make_dir(dst_dir, options.quiet) 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_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/cefclient.exe'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/chrome.pak'), 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'), \ copy_dir(os.path.join(cef_dir, 'Debug/locales'), os.path.join(dst_dir, 'locales'), \
options.quiet) options.quiet)
# 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)
# transfer lib/Debug files # transfer lib/Debug files
dst_dir = os.path.join(output_dir, 'lib/Debug') dst_dir = os.path.join(output_dir, 'lib/Debug')
make_dir(dst_dir, options.quiet) make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Debug/lib/libcef.lib'), 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
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/Release files # transfer lib/Release files
dst_dir = os.path.join(output_dir, 'lib/Release') dst_dir = os.path.join(output_dir, 'lib/Release')
make_dir(dst_dir, options.quiet) make_dir(dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, 'Release/lib/libcef.lib'), 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 # generate doc files
os.popen('make_cppdocs.bat '+cef_rev) os.popen('make_cppdocs.bat '+cef_rev)
@ -252,12 +261,14 @@ elif platform == 'macosx':
options.quiet) options.quiet)
# transfer xcodebuild/Debug files # transfer xcodebuild/Debug files
if not options.allowpartial or path_exists(os.path.join(cef_dir, '../xcodebuild/Debug')):
dst_dir = os.path.join(output_dir, 'Debug') dst_dir = os.path.join(output_dir, 'Debug')
make_dir(dst_dir, options.quiet) 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/ffmpegsumo.so'), dst_dir, options.quiet)
copy_file(os.path.join(cef_dir, '../xcodebuild/Debug/libcef.dylib'), dst_dir, options.quiet) copy_file(os.path.join(cef_dir, '../xcodebuild/Debug/libcef.dylib'), dst_dir, options.quiet)
# transfer xcodebuild/Release files # transfer xcodebuild/Release files
if not options.allowpartial or path_exists(os.path.join(cef_dir, '../xcodebuild/Release')):
dst_dir = os.path.join(output_dir, 'Release') dst_dir = os.path.join(output_dir, 'Release')
make_dir(dst_dir, options.quiet) 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/ffmpegsumo.so'), dst_dir, options.quiet)

View File

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