mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-03-16 12:00:13 +01:00
Update to Chromium revision 194165.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1232 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
62290279d5
commit
3a801af61d
@ -17,5 +17,5 @@
|
||||
|
||||
{
|
||||
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
||||
'chromium_revision': '190564',
|
||||
'chromium_revision': '194165',
|
||||
}
|
||||
|
@ -735,10 +735,8 @@
|
||||
'libcef/xml_reader_impl.h',
|
||||
'libcef/zip_reader_impl.cc',
|
||||
'libcef/zip_reader_impl.h',
|
||||
'<(DEPTH)/chrome/browser/net/clear_on_exit_policy.cc',
|
||||
'<(DEPTH)/chrome/browser/net/clear_on_exit_policy.h',
|
||||
'<(DEPTH)/chrome/browser/net/sqlite_persistent_cookie_store.cc',
|
||||
'<(DEPTH)/chrome/browser/net/sqlite_persistent_cookie_store.h',
|
||||
'<(DEPTH)/content/browser/net/sqlite_persistent_cookie_store.cc',
|
||||
'<(DEPTH)/content/browser/net/sqlite_persistent_cookie_store.h',
|
||||
# DevTools resource IDs generated by grit
|
||||
'<(grit_out_dir)/grit/devtools_resources_map.cc',
|
||||
# Geolocation implementation
|
||||
|
@ -481,11 +481,6 @@ typedef struct _cef_browser_settings_t {
|
||||
///
|
||||
bool accelerated_plugins_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable developer tools (WebKit inspector).
|
||||
///
|
||||
bool developer_tools_disabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to enable fullscreen mode.
|
||||
///
|
||||
@ -1085,9 +1080,7 @@ enum cef_dom_event_category_t {
|
||||
DOM_EVENT_CATEGORY_POPSTATE = 0x2000,
|
||||
DOM_EVENT_CATEGORY_PROGRESS = 0x4000,
|
||||
DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000,
|
||||
DOM_EVENT_CATEGORY_WEBKIT_ANIMATION = 0x10000,
|
||||
DOM_EVENT_CATEGORY_WEBKIT_TRANSITION = 0x20000,
|
||||
DOM_EVENT_CATEGORY_BEFORE_LOAD = 0x40000,
|
||||
DOM_EVENT_CATEGORY_BEFORE_LOAD = 0x10000,
|
||||
};
|
||||
|
||||
///
|
||||
|
@ -405,7 +405,6 @@ struct CefBrowserSettingsTraits {
|
||||
src->accelerated_2d_canvas_disabled;
|
||||
target->accelerated_filters_disabled = src->accelerated_filters_disabled;
|
||||
target->accelerated_plugins_disabled = src->accelerated_plugins_disabled;
|
||||
target->developer_tools_disabled = src->developer_tools_disabled;
|
||||
target->fullscreen_enabled = src->fullscreen_enabled;
|
||||
}
|
||||
};
|
||||
|
@ -393,7 +393,7 @@ BrowserAppCacheSystem::~BrowserAppCacheSystem() {
|
||||
void BrowserAppCacheSystem::InitOnUIThread(
|
||||
const base::FilePath& cache_directory) {
|
||||
DCHECK(!ui_message_loop_);
|
||||
ui_message_loop_ = MessageLoop::current();
|
||||
ui_message_loop_ = base::MessageLoop::current();
|
||||
cache_directory_ = cache_directory;
|
||||
}
|
||||
|
||||
@ -403,7 +403,7 @@ void BrowserAppCacheSystem::InitOnIOThread(
|
||||
return;
|
||||
|
||||
DCHECK(!io_message_loop_);
|
||||
io_message_loop_ = MessageLoop::current();
|
||||
io_message_loop_ = base::MessageLoop::current();
|
||||
|
||||
if (!db_thread_.IsRunning())
|
||||
db_thread_.Start();
|
||||
|
@ -99,10 +99,14 @@ class BrowserAppCacheSystem {
|
||||
GURL* manifest_url);
|
||||
|
||||
// Helpers
|
||||
MessageLoop* io_message_loop() { return io_message_loop_; }
|
||||
MessageLoop* ui_message_loop() { return ui_message_loop_; }
|
||||
bool is_io_thread() { return MessageLoop::current() == io_message_loop_; }
|
||||
bool is_ui_thread() { return MessageLoop::current() == ui_message_loop_; }
|
||||
base::MessageLoop* io_message_loop() { return io_message_loop_; }
|
||||
base::MessageLoop* ui_message_loop() { return ui_message_loop_; }
|
||||
bool is_io_thread() {
|
||||
return base::MessageLoop::current() == io_message_loop_;
|
||||
}
|
||||
bool is_ui_thread() {
|
||||
return base::MessageLoop::current() == ui_message_loop_;
|
||||
}
|
||||
bool is_initialized() {
|
||||
return io_message_loop_ && is_initailized_on_ui_thread();
|
||||
}
|
||||
@ -111,8 +115,8 @@ class BrowserAppCacheSystem {
|
||||
}
|
||||
|
||||
base::FilePath cache_directory_;
|
||||
MessageLoop* io_message_loop_;
|
||||
MessageLoop* ui_message_loop_;
|
||||
base::MessageLoop* io_message_loop_;
|
||||
base::MessageLoop* ui_message_loop_;
|
||||
scoped_refptr<BrowserBackendProxy> backend_proxy_;
|
||||
scoped_refptr<BrowserFrontendProxy> frontend_proxy_;
|
||||
appcache::AppCacheFrontendImpl frontend_impl_;
|
||||
|
@ -24,7 +24,8 @@ namespace {
|
||||
class WebKitClientMessageLoopImpl
|
||||
: public WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop {
|
||||
public:
|
||||
WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { }
|
||||
WebKitClientMessageLoopImpl()
|
||||
: message_loop_(base::MessageLoop::current()) { }
|
||||
virtual ~WebKitClientMessageLoopImpl() {
|
||||
message_loop_ = NULL;
|
||||
}
|
||||
@ -38,7 +39,7 @@ class WebKitClientMessageLoopImpl
|
||||
message_loop_->QuitNow();
|
||||
}
|
||||
private:
|
||||
MessageLoop* message_loop_;
|
||||
base::MessageLoop* message_loop_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@ -79,7 +80,7 @@ WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
|
||||
}
|
||||
|
||||
void BrowserDevToolsAgent::AsyncCall(const BrowserDevToolsCallArgs &args) {
|
||||
MessageLoop::current()->PostTask(
|
||||
base::MessageLoop::current()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&BrowserDevToolsAgent::Call, weak_factory_.GetWeakPtr(),
|
||||
args));
|
||||
|
@ -68,7 +68,7 @@ void BrowserDevToolsClient::undockWindow() {
|
||||
}
|
||||
|
||||
void BrowserDevToolsClient::AsyncCall(const BrowserDevToolsCallArgs &args) {
|
||||
MessageLoop::current()->PostTask(
|
||||
base::MessageLoop::current()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&BrowserDevToolsClient::Call, weak_factory_.GetWeakPtr(),
|
||||
args));
|
||||
|
@ -140,7 +140,7 @@ void BrowserDragDelegate::StartDragging(const WebDropData& drop_data,
|
||||
DCHECK(!drag_drop_thread_.get());
|
||||
drag_drop_thread_.reset(new DragDropThread(this));
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_UI;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
if (drag_drop_thread_->StartWithOptions(options)) {
|
||||
drag_drop_thread_->message_loop()->PostTask(
|
||||
FROM_HERE,
|
||||
@ -304,7 +304,8 @@ void BrowserDragDelegate::DoDragging(const WebDropData& drop_data,
|
||||
// updates while in the system DoDragDrop loop.
|
||||
DWORD effect;
|
||||
{
|
||||
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
base::MessageLoop::current());
|
||||
DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
|
||||
drag_source_,
|
||||
web_drag_utils_win::WebDragOpMaskToWinDragOpMask(ops),
|
||||
|
@ -55,7 +55,7 @@ using fileapi::FileSystemTaskRunners;
|
||||
using fileapi::FileSystemURL;
|
||||
|
||||
namespace {
|
||||
MessageLoop* g_io_thread;
|
||||
base::MessageLoop* g_io_thread;
|
||||
webkit_blob::BlobStorageController* g_blob_storage_controller;
|
||||
|
||||
void RegisterBlob(const GURL& blob_url, const base::FilePath& file_path) {
|
||||
@ -281,7 +281,7 @@ void BrowserFileSystem::createSnapshotFileAndReadMetadata(
|
||||
// static
|
||||
void BrowserFileSystem::InitializeOnIOThread(
|
||||
webkit_blob::BlobStorageController* blob_storage_controller) {
|
||||
g_io_thread = MessageLoop::current();
|
||||
g_io_thread = base::MessageLoop::current();
|
||||
g_blob_storage_controller = blob_storage_controller;
|
||||
}
|
||||
|
||||
|
@ -748,7 +748,7 @@ void CefBrowserImpl::UIT_DestroyBrowser() {
|
||||
if (is_modal_) {
|
||||
// Exit our own internal modal message loop now.
|
||||
if (internal_modal_message_loop_is_active_) {
|
||||
MessageLoop* message_loop = MessageLoop::current();
|
||||
base::MessageLoop* message_loop = base::MessageLoop::current();
|
||||
message_loop->QuitNow();
|
||||
}
|
||||
}
|
||||
|
@ -196,8 +196,7 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) {
|
||||
paint_delegate_.reset(new PaintDelegate(this));
|
||||
}
|
||||
|
||||
if (!settings_.developer_tools_disabled)
|
||||
dev_tools_agent_.reset(new BrowserDevToolsAgent());
|
||||
dev_tools_agent_.reset(new BrowserDevToolsAgent());
|
||||
|
||||
// Add a reference that will be released in UIT_DestroyBrowser().
|
||||
AddRef();
|
||||
@ -217,8 +216,7 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) {
|
||||
if (window_info_.m_bTransparentPainting)
|
||||
webviewhost_->webview()->setIsTransparent(true);
|
||||
|
||||
if (!settings_.developer_tools_disabled)
|
||||
dev_tools_agent_->SetWebView(webviewhost_->webview());
|
||||
dev_tools_agent_->SetWebView(webviewhost_->webview());
|
||||
|
||||
webviewhost_->SetFrameRate(settings_.animation_frame_rate);
|
||||
|
||||
@ -533,8 +531,8 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) {
|
||||
page_count = frame->printBegin(printParams);
|
||||
|
||||
if (page_count) {
|
||||
bool old_state = MessageLoop::current()->NestableTasksAllowed();
|
||||
MessageLoop::current()->SetNestableTasksAllowed(false);
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
base::MessageLoop::current());
|
||||
|
||||
if (print_context_.NewDocument(title_) == printing::PrintingContext::OK) {
|
||||
if (settings.ranges.size() > 0) {
|
||||
@ -549,8 +547,6 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) {
|
||||
}
|
||||
print_context_.DocumentDone();
|
||||
}
|
||||
|
||||
MessageLoop::current()->SetNestableTasksAllowed(old_state);
|
||||
}
|
||||
|
||||
frame->printEnd();
|
||||
|
@ -20,8 +20,8 @@
|
||||
#include "base/thread_task_runner_handle.h"
|
||||
#include "base/threading/worker_pool.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/net/sqlite_persistent_cookie_store.h"
|
||||
#include "net/base/cert_verifier.h"
|
||||
#include "content/browser/net/sqlite_persistent_cookie_store.h"
|
||||
#include "net/cert/cert_verifier.h"
|
||||
#include "net/cookies/cookie_monster.h"
|
||||
#include "net/dns/host_resolver.h"
|
||||
#include "net/ftp/ftp_network_layer.h"
|
||||
@ -304,7 +304,7 @@ void BrowserRequestContext::SetCookieStoragePath(const base::FilePath& path) {
|
||||
|
||||
base::FilePath new_path = path;
|
||||
|
||||
scoped_refptr<SQLitePersistentCookieStore> persistent_store;
|
||||
scoped_refptr<content::SQLitePersistentCookieStore> persistent_store;
|
||||
if (!new_path.empty()) {
|
||||
if (!file_util::PathExists(new_path) &&
|
||||
!file_util::CreateDirectory(new_path)) {
|
||||
@ -314,7 +314,7 @@ void BrowserRequestContext::SetCookieStoragePath(const base::FilePath& path) {
|
||||
base::FilePath cookie_path =
|
||||
new_path.Append(FILE_PATH_LITERAL("Cookies"));
|
||||
persistent_store =
|
||||
new SQLitePersistentCookieStore(
|
||||
new content::SQLitePersistentCookieStore(
|
||||
cookie_path,
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::IO),
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE),
|
||||
|
@ -214,13 +214,13 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
}
|
||||
|
||||
void DropPeer() {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
peer_ = NULL;
|
||||
}
|
||||
|
||||
void Start(ResourceLoaderBridge::Peer* peer, RequestParams* params) {
|
||||
peer_ = peer;
|
||||
owner_loop_ = MessageLoop::current();
|
||||
owner_loop_ = base::MessageLoop::current();
|
||||
|
||||
InitializeParams(params);
|
||||
|
||||
@ -230,7 +230,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
}
|
||||
|
||||
void Cancel() {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
if (download_handler_.get()) {
|
||||
// WebKit will try to cancel the download but we won't allow it.
|
||||
@ -243,7 +243,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
}
|
||||
|
||||
void SetDefersLoading(bool defer) {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
CefThread::PostTask(CefThread::IO, FROM_HERE, base::Bind(
|
||||
&RequestProxy::AsyncSetDefersLoading, this, defer));
|
||||
@ -268,7 +268,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
|
||||
void NotifyReceivedRedirect(const GURL& new_url,
|
||||
const ResourceResponseInfo& info) {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
bool has_new_first_party_for_cookies = false;
|
||||
GURL new_first_party_for_cookies;
|
||||
@ -285,7 +285,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
|
||||
void NotifyReceivedResponse(const ResourceResponseInfo& info,
|
||||
const GURL& url, bool allow_download) {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
if (browser_.get() && info.headers.get()) {
|
||||
CefRefPtr<CefClient> client = browser_->GetClient();
|
||||
@ -337,7 +337,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
}
|
||||
|
||||
void NotifyReceivedData(int bytes_read) {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
if (!peer_)
|
||||
return;
|
||||
@ -382,7 +382,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
}
|
||||
|
||||
void NotifyDownloadedData(int bytes_read) {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
if (!peer_)
|
||||
return;
|
||||
@ -397,7 +397,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
void NotifyCompletedRequest(int error_code,
|
||||
const std::string& security_info,
|
||||
const base::TimeTicks& complete_time) {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
// Drain the content filter of all remaining data
|
||||
if (content_filter_.get()) {
|
||||
@ -438,7 +438,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
}
|
||||
|
||||
void NotifyUploadProgress(uint64 position, uint64 size) {
|
||||
DCHECK(MessageLoop::current() == owner_loop_);
|
||||
DCHECK(base::MessageLoop::current() == owner_loop_);
|
||||
|
||||
if (peer_)
|
||||
peer_->OnUploadProgress(position, size);
|
||||
@ -598,7 +598,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
request_->SetPriority(params->priority);
|
||||
request_->set_method(params->method);
|
||||
request_->set_first_party_for_cookies(params->first_party_for_cookies);
|
||||
request_->set_referrer(params->referrer.spec());
|
||||
request_->SetReferrer(params->referrer.spec());
|
||||
webkit_glue::ConfigureURLRequestForReferrerPolicy(
|
||||
request_.get(), params->referrer_policy);
|
||||
net::HttpRequestHeaders headers;
|
||||
@ -947,7 +947,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||
|
||||
CefRefPtr<CefBrowserImpl> browser_;
|
||||
|
||||
MessageLoop* owner_loop_;
|
||||
base::MessageLoop* owner_loop_;
|
||||
|
||||
// This is our peer in WebKit (implemented as ResourceHandleInternal). We do
|
||||
// not manage its lifetime, and we may only access it from the owner's
|
||||
|
@ -109,7 +109,6 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) {
|
||||
web.loads_images_automatically = !cef.image_load_disabled;
|
||||
web.plugins_enabled = !cef.plugins_disabled;
|
||||
web.dom_paste_enabled = !cef.dom_paste_disabled;
|
||||
web.developer_extras_enabled = !cef.developer_tools_disabled;
|
||||
web.inspector_settings.clear();
|
||||
web.site_specific_quirks_enabled = !cef.site_specific_quirks_disabled;
|
||||
web.shrinks_standalone_images_to_fit = cef.shrink_standalone_images_to_fit;
|
||||
|
@ -24,7 +24,7 @@ const int kNoSocketId = 0;
|
||||
|
||||
namespace {
|
||||
|
||||
MessageLoop* g_io_thread;
|
||||
base::MessageLoop* g_io_thread;
|
||||
net::URLRequestContext* g_request_context;
|
||||
|
||||
class WebSocketStreamHandleBridgeImpl
|
||||
@ -64,7 +64,7 @@ class WebSocketStreamHandleBridgeImpl
|
||||
void DoOnClose();
|
||||
|
||||
int socket_id_;
|
||||
MessageLoop* message_loop_;
|
||||
base::MessageLoop* message_loop_;
|
||||
WebKit::WebSocketStreamHandle* handle_;
|
||||
webkit_glue::WebSocketStreamHandleDelegate* delegate_;
|
||||
|
||||
@ -79,7 +79,7 @@ WebSocketStreamHandleBridgeImpl::WebSocketStreamHandleBridgeImpl(
|
||||
WebKit::WebSocketStreamHandle* handle,
|
||||
webkit_glue::WebSocketStreamHandleDelegate* delegate)
|
||||
: socket_id_(kNoSocketId),
|
||||
message_loop_(MessageLoop::current()),
|
||||
message_loop_(base::MessageLoop::current()),
|
||||
handle_(handle),
|
||||
delegate_(delegate),
|
||||
num_pending_tasks_(0) {
|
||||
@ -155,7 +155,7 @@ void WebSocketStreamHandleBridgeImpl::OnClose(net::SocketStream* socket) {
|
||||
}
|
||||
|
||||
void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) {
|
||||
DCHECK(MessageLoop::current() == g_io_thread);
|
||||
DCHECK(base::MessageLoop::current() == g_io_thread);
|
||||
socket_ = net::SocketStreamJob::CreateSocketStreamJob(
|
||||
url, this, g_request_context->transport_security_state(),
|
||||
g_request_context->ssl_config_service());
|
||||
@ -164,7 +164,7 @@ void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) {
|
||||
}
|
||||
|
||||
void WebSocketStreamHandleBridgeImpl::DoSend(std::vector<char>* data) {
|
||||
DCHECK(MessageLoop::current() == g_io_thread);
|
||||
DCHECK(base::MessageLoop::current() == g_io_thread);
|
||||
scoped_ptr<std::vector<char> > scoped_data(data);
|
||||
if (!socket_)
|
||||
return;
|
||||
@ -173,7 +173,7 @@ void WebSocketStreamHandleBridgeImpl::DoSend(std::vector<char>* data) {
|
||||
}
|
||||
|
||||
void WebSocketStreamHandleBridgeImpl::DoClose() {
|
||||
DCHECK(MessageLoop::current() == g_io_thread);
|
||||
DCHECK(base::MessageLoop::current() == g_io_thread);
|
||||
if (!socket_)
|
||||
return;
|
||||
socket_->Close();
|
||||
@ -181,14 +181,14 @@ void WebSocketStreamHandleBridgeImpl::DoClose() {
|
||||
|
||||
void WebSocketStreamHandleBridgeImpl::DoOnConnected(
|
||||
int max_pending_send_allowed) {
|
||||
DCHECK(MessageLoop::current() == message_loop_);
|
||||
DCHECK(base::MessageLoop::current() == message_loop_);
|
||||
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, -1);
|
||||
if (delegate_)
|
||||
delegate_->DidOpenStream(handle_, max_pending_send_allowed);
|
||||
}
|
||||
|
||||
void WebSocketStreamHandleBridgeImpl::DoOnSentData(int amount_sent) {
|
||||
DCHECK(MessageLoop::current() == message_loop_);
|
||||
DCHECK(base::MessageLoop::current() == message_loop_);
|
||||
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, -1);
|
||||
if (delegate_)
|
||||
delegate_->DidSendData(handle_, amount_sent);
|
||||
@ -196,7 +196,7 @@ void WebSocketStreamHandleBridgeImpl::DoOnSentData(int amount_sent) {
|
||||
|
||||
void WebSocketStreamHandleBridgeImpl::DoOnReceivedData(
|
||||
std::vector<char>* data) {
|
||||
DCHECK(MessageLoop::current() == message_loop_);
|
||||
DCHECK(base::MessageLoop::current() == message_loop_);
|
||||
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, -1);
|
||||
scoped_ptr<std::vector<char> > scoped_data(data);
|
||||
if (delegate_)
|
||||
@ -204,7 +204,7 @@ void WebSocketStreamHandleBridgeImpl::DoOnReceivedData(
|
||||
}
|
||||
|
||||
void WebSocketStreamHandleBridgeImpl::DoOnClose() {
|
||||
DCHECK(MessageLoop::current() == message_loop_);
|
||||
DCHECK(base::MessageLoop::current() == message_loop_);
|
||||
base::subtle::NoBarrier_AtomicIncrement(&num_pending_tasks_, -1);
|
||||
// Don't handle OnClose if there are pending tasks.
|
||||
DCHECK_EQ(num_pending_tasks_, 0);
|
||||
@ -222,7 +222,7 @@ void WebSocketStreamHandleBridgeImpl::DoOnClose() {
|
||||
/* static */
|
||||
void BrowserSocketStreamBridge::InitializeOnIOThread(
|
||||
net::URLRequestContext* request_context) {
|
||||
g_io_thread = MessageLoop::current();
|
||||
g_io_thread = base::MessageLoop::current();
|
||||
g_request_context = request_context;
|
||||
}
|
||||
|
||||
|
@ -65,4 +65,20 @@ bool BrowserThread::CurrentlyOn(ID identifier) {
|
||||
return CefThread::CurrentlyOn(static_cast<CefThread::ID>(cef_id));
|
||||
}
|
||||
|
||||
// static
|
||||
scoped_refptr<base::MessageLoopProxy>
|
||||
BrowserThread::GetMessageLoopProxyForThread(ID identifier) {
|
||||
int cef_id = GetCefId(identifier);
|
||||
if (cef_id < 0)
|
||||
return NULL;
|
||||
|
||||
return CefThread::GetMessageLoopProxyForThread(
|
||||
static_cast<CefThread::ID>(cef_id));
|
||||
}
|
||||
|
||||
// static
|
||||
base::SequencedWorkerPool* BrowserThread::GetBlockingPool() {
|
||||
return CefThread::GetBlockingPool();
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -19,7 +19,7 @@ using webkit_blob::BlobData;
|
||||
|
||||
namespace {
|
||||
|
||||
MessageLoop* g_io_thread;
|
||||
base::MessageLoop* g_io_thread;
|
||||
webkit_blob::BlobStorageController* g_blob_storage_controller;
|
||||
|
||||
// Creates a new BlobData from WebBlobData.
|
||||
@ -67,7 +67,7 @@ BlobData* NewBlobData(const WebBlobData& data) {
|
||||
/* static */
|
||||
void BrowserWebBlobRegistryImpl::InitializeOnIOThread(
|
||||
webkit_blob::BlobStorageController* blob_storage_controller) {
|
||||
g_io_thread = MessageLoop::current();
|
||||
g_io_thread = base::MessageLoop::current();
|
||||
g_blob_storage_controller = blob_storage_controller;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "third_party/WebKit/Source/WebCore/config.h"
|
||||
MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "ApplicationCacheStorage.h" // NOLINT(build/include)
|
||||
#include "CrossOriginPreflightResultCache.h" // NOLINT(build/include)
|
||||
#include "DocumentLoader.h" // NOLINT(build/include)
|
||||
#include "MemoryCache.h" // NOLINT(build/include)
|
||||
@ -149,12 +148,7 @@ WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
|
||||
#endif
|
||||
|
||||
if (use_command_buffer) {
|
||||
scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||
context(
|
||||
new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl());
|
||||
if (!context->Initialize(attributes, NULL))
|
||||
return NULL;
|
||||
return context.release();
|
||||
return new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl(attributes);
|
||||
} else {
|
||||
return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
|
||||
attributes, renderDirectlyToWebView);
|
||||
|
@ -39,7 +39,6 @@ BrowserWebKitInit::BrowserWebKitInit()
|
||||
|
||||
WebKit::initialize(this);
|
||||
WebKit::setLayoutTestMode(false);
|
||||
WebKit::WebRuntimeFeatures::enableSockets(true);
|
||||
WebKit::WebRuntimeFeatures::enableApplicationCache(true);
|
||||
WebKit::WebRuntimeFeatures::enableDatabase(true);
|
||||
WebKit::WebRuntimeFeatures::enableIndexedDatabase(true);
|
||||
|
@ -273,7 +273,8 @@ void BrowserWebViewDelegate::showContextMenu(WebKit::WebFrame* frame,
|
||||
int type_flags = 0;
|
||||
|
||||
// Make sure events can be pumped while the menu is up.
|
||||
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
base::MessageLoop::current());
|
||||
|
||||
// Give the client a chance to handle the menu.
|
||||
if (OnBeforeMenu(data, mouse_pt.x, mouse_pt.y, edit_flags, type_flags))
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/sys_string_conversions.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "base/utf_string_conversions.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "skia/ext/skia_utils_mac.h"
|
||||
@ -182,7 +182,8 @@ void BrowserWebViewDelegate::showContextMenu(
|
||||
NSMenu* menu = nil;
|
||||
|
||||
// Make sure events can be pumped while the menu is up.
|
||||
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow
|
||||
base::MessageLoop::current());
|
||||
|
||||
// Give the client a chance to handle the menu.
|
||||
if (OnBeforeMenu(data, mouse_pt.x, mouse_pt.y, edit_flags, type_flags))
|
||||
@ -409,7 +410,8 @@ void BrowserWebViewDelegate::startDragging(
|
||||
|
||||
// The drag invokes a nested event loop, arrange to continue
|
||||
// processing events.
|
||||
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
base::MessageLoop::current());
|
||||
|
||||
NSImage* ns_image = nil;
|
||||
if (!image.isNull()) {
|
||||
|
@ -551,7 +551,7 @@ void BrowserWebViewDelegate::runModal() {
|
||||
browser_->set_internal_modal_message_loop_is_active(true);
|
||||
|
||||
// Start a new message loop here and return when this window closes.
|
||||
MessageLoop* message_loop = MessageLoop::current();
|
||||
base::MessageLoop* message_loop = base::MessageLoop::current();
|
||||
bool old_state = message_loop->NestableTasksAllowed();
|
||||
message_loop->SetNestableTasksAllowed(true);
|
||||
message_loop->Run();
|
||||
@ -677,7 +677,8 @@ void BrowserWebViewDelegate::showContextMenu(
|
||||
std::list<std::wstring> label_list;
|
||||
|
||||
// Make sure events can be pumped while the menu is up.
|
||||
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
base::MessageLoop::current());
|
||||
|
||||
// Give the client a chance to handle the menu.
|
||||
if (OnBeforeMenu(data, mouse_pt.x, mouse_pt.y, edit_flags, type_flags))
|
||||
@ -737,14 +738,14 @@ void BrowserWebViewDelegate::showContextMenu(
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
MessageLoop::current()->set_os_modal_loop(true);
|
||||
base::MessageLoop::current()->set_os_modal_loop(true);
|
||||
|
||||
// Show the context menu
|
||||
int selected_id = TrackPopupMenu(menu,
|
||||
TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD | TPM_RECURSE,
|
||||
screenX, screenY, 0, browser_->UIT_GetMainWndHandle(), NULL);
|
||||
|
||||
MessageLoop::current()->set_os_modal_loop(false);
|
||||
base::MessageLoop::current()->set_os_modal_loop(false);
|
||||
|
||||
if (selected_id != 0) {
|
||||
// An action was chosen
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#import "base/memory/scoped_ptr.h"
|
||||
#import "base/string_util.h"
|
||||
#import "base/sys_string_conversions.h"
|
||||
#import "base/strings/sys_string_conversions.h"
|
||||
#import "third_party/WebKit/Source/WebKit/chromium/public/mac/WebInputEventFactory.h"
|
||||
#import "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSubstringUtil.h"
|
||||
#import "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
|
||||
|
@ -36,11 +36,11 @@ namespace {
|
||||
|
||||
// Used in multi-threaded message loop mode to observe shutdown of the UI
|
||||
// thread.
|
||||
class DestructionObserver : public MessageLoop::DestructionObserver {
|
||||
class DestructionObserver : public base::MessageLoop::DestructionObserver {
|
||||
public:
|
||||
explicit DestructionObserver(base::WaitableEvent *event) : event_(event) {}
|
||||
virtual void WillDestroyCurrentMessageLoop() {
|
||||
MessageLoop::current()->RemoveDestructionObserver(this);
|
||||
base::MessageLoop::current()->RemoveDestructionObserver(this);
|
||||
event_->Signal();
|
||||
delete this;
|
||||
}
|
||||
@ -225,7 +225,7 @@ void CefSetOSModalLoop(bool osModalLoop) {
|
||||
}
|
||||
|
||||
if (CefThread::CurrentlyOn(CefThread::UI)) {
|
||||
MessageLoop::current()->set_os_modal_loop(osModalLoop);
|
||||
base::MessageLoop::current()->set_os_modal_loop(osModalLoop);
|
||||
} else {
|
||||
CefThread::PostTask(CefThread::UI, FROM_HERE,
|
||||
base::Bind(CefSetOSModalLoop, osModalLoop));
|
||||
@ -589,7 +589,7 @@ void CefContext::UIT_FinishShutdown(
|
||||
if (uithread_shutdown_event) {
|
||||
// The destruction observer will signal the UI thread shutdown event when
|
||||
// the UI thread has been destroyed.
|
||||
MessageLoop::current()->AddDestructionObserver(
|
||||
base::MessageLoop::current()->AddDestructionObserver(
|
||||
new DestructionObserver(uithread_shutdown_event));
|
||||
|
||||
// Signal the browser shutdown event now.
|
||||
|
@ -13,8 +13,8 @@
|
||||
#include "base/threading/thread.h"
|
||||
|
||||
// Class used to process events on the current message loop.
|
||||
class CefMessageLoopForUI : public MessageLoopForUI {
|
||||
typedef MessageLoopForUI inherited;
|
||||
class CefMessageLoopForUI : public base::MessageLoopForUI {
|
||||
typedef base::MessageLoopForUI inherited;
|
||||
|
||||
public:
|
||||
CefMessageLoopForUI() {
|
||||
@ -22,8 +22,8 @@ class CefMessageLoopForUI : public MessageLoopForUI {
|
||||
|
||||
// Returns the MessageLoopForUI of the current thread.
|
||||
static CefMessageLoopForUI* current() {
|
||||
MessageLoop* loop = MessageLoop::current();
|
||||
DCHECK_EQ(MessageLoop::TYPE_UI, loop->type());
|
||||
base::MessageLoop* loop = base::MessageLoop::current();
|
||||
DCHECK_EQ(base::MessageLoop::TYPE_UI, loop->type());
|
||||
return static_cast<CefMessageLoopForUI*>(loop);
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ void CefProcess::CreateUIThread() {
|
||||
// Create the message loop on a new thread.
|
||||
thread.reset(new CefProcessUIThread());
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_UI;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
if (!thread->StartWithOptions(options))
|
||||
return;
|
||||
} else {
|
||||
@ -114,7 +114,7 @@ void CefProcess::CreateIOThread() {
|
||||
|
||||
scoped_ptr<CefProcessIOThread> thread(new CefProcessIOThread());
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_IO;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
if (!thread->StartWithOptions(options))
|
||||
return;
|
||||
io_thread_.swap(thread);
|
||||
@ -126,7 +126,7 @@ void CefProcess::CreateFileThread() {
|
||||
|
||||
scoped_ptr<base::Thread> thread(new CefProcessSubThread(CefThread::FILE));
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_IO;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
if (!thread->StartWithOptions(options))
|
||||
return;
|
||||
file_thread_.swap(thread);
|
||||
|
@ -24,7 +24,7 @@
|
||||
CefProcessIOThread::CefProcessIOThread()
|
||||
: CefThread(CefThread::IO), request_context_(NULL) {}
|
||||
|
||||
CefProcessIOThread::CefProcessIOThread(MessageLoop* message_loop)
|
||||
CefProcessIOThread::CefProcessIOThread(base::MessageLoop* message_loop)
|
||||
: CefThread(CefThread::IO, message_loop), request_context_(NULL) {}
|
||||
|
||||
CefProcessIOThread::~CefProcessIOThread() {
|
||||
@ -57,7 +57,7 @@ void CefProcessIOThread::CleanUp() {
|
||||
// Flush any remaining messages. This ensures that any accumulated
|
||||
// Task objects get destroyed before we exit, which avoids noise in
|
||||
// purify leak-test results.
|
||||
MessageLoop::current()->RunUntilIdle();
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
|
||||
// In reverse order of initialization.
|
||||
BrowserWebBlobRegistryImpl::Cleanup();
|
||||
|
@ -28,7 +28,7 @@ class NetworkDelegate;
|
||||
class CefProcessIOThread : public CefThread {
|
||||
public:
|
||||
CefProcessIOThread();
|
||||
explicit CefProcessIOThread(MessageLoop* message_loop);
|
||||
explicit CefProcessIOThread(base::MessageLoop* message_loop);
|
||||
virtual ~CefProcessIOThread();
|
||||
|
||||
BrowserRequestContext* request_context() { return request_context_.get(); }
|
||||
|
@ -12,7 +12,7 @@ CefProcessSubThread::CefProcessSubThread(CefThread::ID identifier)
|
||||
: CefThread(identifier) {}
|
||||
|
||||
CefProcessSubThread::CefProcessSubThread(CefThread::ID identifier,
|
||||
MessageLoop* message_loop)
|
||||
base::MessageLoop* message_loop)
|
||||
: CefThread(identifier, message_loop) {}
|
||||
|
||||
CefProcessSubThread::~CefProcessSubThread() {
|
||||
@ -25,7 +25,7 @@ void CefProcessSubThread::CleanUp() {
|
||||
// Flush any remaining messages. This ensures that any accumulated
|
||||
// Task objects get destroyed before we exit, which avoids noise in
|
||||
// purify leak-test results.
|
||||
MessageLoop::current()->RunUntilIdle();
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
|
||||
CefThread::Cleanup();
|
||||
}
|
||||
|
@ -23,7 +23,8 @@
|
||||
class CefProcessSubThread : public CefThread {
|
||||
public:
|
||||
explicit CefProcessSubThread(CefThread::ID identifier);
|
||||
CefProcessSubThread(CefThread::ID identifier, MessageLoop* message_loop);
|
||||
CefProcessSubThread(CefThread::ID identifier,
|
||||
base::MessageLoop* message_loop);
|
||||
virtual ~CefProcessSubThread();
|
||||
|
||||
protected:
|
||||
|
@ -53,7 +53,7 @@ base::StringPiece ResourceProvider(int resource_id) {
|
||||
CefProcessUIThread::CefProcessUIThread()
|
||||
: CefThread(CefThread::UI), statstable_(NULL), webkit_init_(NULL) {}
|
||||
|
||||
CefProcessUIThread::CefProcessUIThread(MessageLoop* message_loop)
|
||||
CefProcessUIThread::CefProcessUIThread(base::MessageLoop* message_loop)
|
||||
: CefThread(CefThread::UI, message_loop), statstable_(NULL),
|
||||
webkit_init_(NULL) {}
|
||||
|
||||
@ -67,6 +67,9 @@ void CefProcessUIThread::Init() {
|
||||
// Initialize the global CommandLine object.
|
||||
CommandLine::Init(0, NULL);
|
||||
|
||||
// Create the blocking I/O pool before other threads.
|
||||
CefThread::CreateThreadPool();
|
||||
|
||||
const CefSettings& settings = _Context->settings();
|
||||
|
||||
// Initialize logging.
|
||||
@ -212,7 +215,7 @@ void CefProcessUIThread::CleanUp() {
|
||||
// Flush any remaining messages. This ensures that any accumulated
|
||||
// Task objects get destroyed before we exit, which avoids noise in
|
||||
// purify leak-test results.
|
||||
MessageLoop::current()->RunUntilIdle();
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
|
||||
// Tear down the shared StatsTable.
|
||||
base::StatsTable::set_current(NULL);
|
||||
@ -235,6 +238,14 @@ void CefProcessUIThread::CleanUp() {
|
||||
PlatformCleanUp();
|
||||
|
||||
_Context->CleanupResourceBundle();
|
||||
|
||||
// Close the blocking I/O pool after the other threads. Other threads such
|
||||
// as the I/O thread may need to schedule work like closing files or flushing
|
||||
// data during shutdown, so the blocking pool needs to be available. There
|
||||
// may also be slow operations pending that will blcok shutdown, so closing
|
||||
// it here (which will block until required operations are complete) gives
|
||||
// more head start for those operations to finish.
|
||||
CefThread::ShutdownThreadPool();
|
||||
}
|
||||
|
||||
void CefProcessUIThread::OnConnectionTypeChanged(
|
||||
|
@ -33,7 +33,7 @@ class CefProcessUIThread
|
||||
public CefThread {
|
||||
public:
|
||||
CefProcessUIThread();
|
||||
explicit CefProcessUIThread(MessageLoop* message_loop);
|
||||
explicit CefProcessUIThread(base::MessageLoop* message_loop);
|
||||
virtual ~CefProcessUIThread();
|
||||
|
||||
virtual void Init();
|
||||
|
@ -6,8 +6,10 @@
|
||||
#include "libcef/cef_thread.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/message_loop_proxy.h"
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <Objbase.h> // NOLINT(build/include_order)
|
||||
@ -15,6 +17,8 @@
|
||||
|
||||
using base::MessageLoopProxy;
|
||||
|
||||
namespace {
|
||||
|
||||
// Friendly names for the well-known threads.
|
||||
static const char* cef_thread_names[CefThread::ID_COUNT] = {
|
||||
"Cef_UIThread", // UI
|
||||
@ -22,6 +26,27 @@ static const char* cef_thread_names[CefThread::ID_COUNT] = {
|
||||
"Cef_IOThread", // IO
|
||||
};
|
||||
|
||||
struct CefThreadGlobals {
|
||||
CefThreadGlobals() {
|
||||
memset(threads, 0, CefThread::ID_COUNT * sizeof(threads[0]));
|
||||
}
|
||||
|
||||
// This lock protects |threads|. Do not read or modify that array
|
||||
// without holding this lock. Do not block while holding this lock.
|
||||
base::Lock lock;
|
||||
|
||||
// This array is protected by |lock|. The threads are not owned by this
|
||||
// array. Typically, the threads are owned on the UI thread by
|
||||
// BrowserMainLoop. BrowserThreadImpl objects remove themselves from this
|
||||
// array upon destruction.
|
||||
CefThread* threads[CefThread::ID_COUNT];
|
||||
|
||||
scoped_refptr<base::SequencedWorkerPool> blocking_pool;
|
||||
};
|
||||
|
||||
base::LazyInstance<CefThreadGlobals>::Leaky
|
||||
g_globals = LAZY_INSTANCE_INITIALIZER;
|
||||
|
||||
// An implementation of MessageLoopProxy to be used in conjunction
|
||||
// with CefThread.
|
||||
class CefThreadMessageLoopProxy : public MessageLoopProxy {
|
||||
@ -54,10 +79,7 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy {
|
||||
DISALLOW_COPY_AND_ASSIGN(CefThreadMessageLoopProxy);
|
||||
};
|
||||
|
||||
|
||||
base::Lock CefThread::lock_;
|
||||
|
||||
CefThread* CefThread::cef_threads_[ID_COUNT];
|
||||
} // namespace
|
||||
|
||||
CefThread::CefThread(CefThread::ID identifier)
|
||||
: Thread(cef_thread_names[identifier]),
|
||||
@ -73,6 +95,25 @@ CefThread::CefThread(ID identifier, MessageLoop* message_loop)
|
||||
Initialize();
|
||||
}
|
||||
|
||||
// static
|
||||
void CefThread::CreateThreadPool() {
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
DCHECK(!globals.blocking_pool.get());
|
||||
globals.blocking_pool = new base::SequencedWorkerPool(3, "BrowserBlocking");
|
||||
}
|
||||
|
||||
// static
|
||||
void CefThread::ShutdownThreadPool() {
|
||||
// The goal is to make it impossible for chrome to 'infinite loop' during
|
||||
// shutdown, but to reasonably expect that all BLOCKING_SHUTDOWN tasks queued
|
||||
// during shutdown get run. There's nothing particularly scientific about the
|
||||
// number chosen.
|
||||
const int kMaxNewShutdownBlockingTasks = 1000;
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
globals.blocking_pool->Shutdown(kMaxNewShutdownBlockingTasks);
|
||||
globals.blocking_pool = NULL;
|
||||
}
|
||||
|
||||
void CefThread::Init() {
|
||||
#if defined(OS_WIN)
|
||||
// Initializes the COM library on the current thread.
|
||||
@ -97,10 +138,11 @@ void CefThread::Cleanup() {
|
||||
}
|
||||
|
||||
void CefThread::Initialize() {
|
||||
base::AutoLock lock(lock_);
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
base::AutoLock lock(globals.lock);
|
||||
DCHECK(identifier_ >= 0 && identifier_ < ID_COUNT);
|
||||
DCHECK(cef_threads_[identifier_] == NULL);
|
||||
cef_threads_[identifier_] = this;
|
||||
DCHECK(globals.threads[identifier_] == NULL);
|
||||
globals.threads[identifier_] = this;
|
||||
}
|
||||
|
||||
CefThread::~CefThread() {
|
||||
@ -109,30 +151,41 @@ CefThread::~CefThread() {
|
||||
// correct CefThread succeeds.
|
||||
Stop();
|
||||
|
||||
base::AutoLock lock(lock_);
|
||||
cef_threads_[identifier_] = NULL;
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
base::AutoLock lock(globals.lock);
|
||||
globals.threads[identifier_] = NULL;
|
||||
#ifndef NDEBUG
|
||||
// Double check that the threads are ordererd correctly in the enumeration.
|
||||
for (int i = identifier_ + 1; i < ID_COUNT; ++i) {
|
||||
DCHECK(!cef_threads_[i]) <<
|
||||
DCHECK(!globals.threads[i]) <<
|
||||
"Threads must be listed in the reverse order that they die";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// static
|
||||
base::SequencedWorkerPool* CefThread::GetBlockingPool() {
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
DCHECK(globals.blocking_pool.get());
|
||||
return globals.blocking_pool;
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::IsWellKnownThread(ID identifier) {
|
||||
base::AutoLock lock(lock_);
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
base::AutoLock lock(globals.lock);
|
||||
return (identifier >= 0 && identifier < ID_COUNT &&
|
||||
cef_threads_[identifier]);
|
||||
globals.threads[identifier]);
|
||||
}
|
||||
|
||||
// static
|
||||
bool CefThread::CurrentlyOn(ID identifier) {
|
||||
base::AutoLock lock(lock_);
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
base::AutoLock lock(globals.lock);
|
||||
DCHECK(identifier >= 0 && identifier < ID_COUNT);
|
||||
return cef_threads_[identifier] &&
|
||||
cef_threads_[identifier]->message_loop() == MessageLoop::current();
|
||||
return globals.threads[identifier] &&
|
||||
globals.threads[identifier]->message_loop() ==
|
||||
base::MessageLoop::current();
|
||||
}
|
||||
|
||||
// static
|
||||
@ -169,11 +222,12 @@ bool CefThread::PostNonNestableDelayedTask(
|
||||
|
||||
// static
|
||||
bool CefThread::GetCurrentThreadIdentifier(ID* identifier) {
|
||||
MessageLoop* cur_message_loop = MessageLoop::current();
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
base::MessageLoop* cur_message_loop = base::MessageLoop::current();
|
||||
for (int i = 0; i < ID_COUNT; ++i) {
|
||||
if (cef_threads_[i] &&
|
||||
cef_threads_[i]->message_loop() == cur_message_loop) {
|
||||
*identifier = cef_threads_[i]->identifier_;
|
||||
if (globals.threads[i] &&
|
||||
globals.threads[i]->message_loop() == cur_message_loop) {
|
||||
*identifier = globals.threads[i]->identifier_;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -208,11 +262,13 @@ bool CefThread::PostTaskHelper(
|
||||
GetCurrentThreadIdentifier(¤t_thread) &&
|
||||
current_thread >= identifier;
|
||||
|
||||
if (!guaranteed_to_outlive_target_thread)
|
||||
lock_.Acquire();
|
||||
CefThreadGlobals& globals = g_globals.Get();
|
||||
|
||||
MessageLoop* message_loop = cef_threads_[identifier] ?
|
||||
cef_threads_[identifier]->message_loop() : NULL;
|
||||
if (!guaranteed_to_outlive_target_thread)
|
||||
globals.lock.Acquire();
|
||||
|
||||
base::MessageLoop* message_loop = globals.threads[identifier] ?
|
||||
globals.threads[identifier]->message_loop() : NULL;
|
||||
if (message_loop) {
|
||||
if (nestable) {
|
||||
message_loop->PostDelayedTask(from_here, task, delay);
|
||||
@ -222,7 +278,7 @@ bool CefThread::PostTaskHelper(
|
||||
}
|
||||
|
||||
if (!guaranteed_to_outlive_target_thread)
|
||||
lock_.Release();
|
||||
globals.lock.Release();
|
||||
|
||||
return !!message_loop;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
namespace base {
|
||||
class MessageLoopProxy;
|
||||
class SequencedWorkerPool;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -66,7 +67,10 @@ class CefThread : public base::Thread {
|
||||
|
||||
// Special constructor for the main (UI) thread and unittests. We use a dummy
|
||||
// thread here since the main thread already exists.
|
||||
CefThread(ID identifier, MessageLoop* message_loop);
|
||||
CefThread(ID identifier, base::MessageLoop* message_loop);
|
||||
|
||||
static void CreateThreadPool();
|
||||
static void ShutdownThreadPool();
|
||||
|
||||
virtual ~CefThread();
|
||||
|
||||
@ -107,6 +111,11 @@ class CefThread : public base::Thread {
|
||||
from_here, object);
|
||||
}
|
||||
|
||||
// Returns the thread pool used for blocking file I/O. Use this object to
|
||||
// perform random blocking operations such as file writes or querying the
|
||||
// Windows registry.
|
||||
static base::SequencedWorkerPool* GetBlockingPool();
|
||||
|
||||
// Callable on any thread. Returns whether the given ID corresponds to a well
|
||||
// known thread.
|
||||
static bool IsWellKnownThread(ID identifier);
|
||||
@ -177,16 +186,6 @@ class CefThread : public base::Thread {
|
||||
// identifier at a given time.
|
||||
ID identifier_;
|
||||
|
||||
// This lock protects |cef_threads_|. Do not read or modify that array
|
||||
// without holding this lock. Do not block while holding this lock.
|
||||
static base::Lock lock_;
|
||||
|
||||
// An array of the CefThread objects. This array is protected by |lock_|.
|
||||
// The threads are not owned by this array. Typically, the threads are owned
|
||||
// on the UI thread by the g_browser_process object. CefThreads remove
|
||||
// themselves from this array upon destruction.
|
||||
static CefThread* cef_threads_[ID_COUNT];
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_;
|
||||
#endif
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "chrome/browser/net/sqlite_persistent_cookie_store.h"
|
||||
#include "content/browser/net/sqlite_persistent_cookie_store.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -225,7 +225,7 @@ bool CefCookieManagerImpl::SetStoragePath(const CefString& path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
scoped_refptr<SQLitePersistentCookieStore> persistent_store;
|
||||
scoped_refptr<content::SQLitePersistentCookieStore> persistent_store;
|
||||
if (!new_path.empty()) {
|
||||
if (!file_util::PathExists(new_path) &&
|
||||
!file_util::CreateDirectory(new_path)) {
|
||||
@ -234,7 +234,7 @@ bool CefCookieManagerImpl::SetStoragePath(const CefString& path) {
|
||||
} else {
|
||||
base::FilePath cookie_path = new_path.Append(FILE_PATH_LITERAL("Cookies"));
|
||||
persistent_store =
|
||||
new SQLitePersistentCookieStore(
|
||||
new content::SQLitePersistentCookieStore(
|
||||
cookie_path,
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::IO),
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE),
|
||||
|
@ -75,10 +75,6 @@ CefDOMEventImpl::Category CefDOMEventImpl::GetCategory() {
|
||||
flags |= DOM_EVENT_CATEGORY_PROGRESS;
|
||||
if (event_.isXMLHttpRequestProgressEvent())
|
||||
flags |= DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS;
|
||||
if (event_.isWebKitAnimationEvent())
|
||||
flags |= DOM_EVENT_CATEGORY_WEBKIT_ANIMATION;
|
||||
if (event_.isWebKitTransitionEvent())
|
||||
flags |= DOM_EVENT_CATEGORY_WEBKIT_TRANSITION;
|
||||
if (event_.isBeforeLoadEvent())
|
||||
flags |= DOM_EVENT_CATEGORY_BEFORE_LOAD;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/string16.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/sys_string_conversions.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "base/utf_string_conversions.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
|
@ -24,7 +24,7 @@ DragDownloadFile::DragDownloadFile(
|
||||
referrer_(referrer),
|
||||
referrer_encoding_(referrer_encoding),
|
||||
view_(view),
|
||||
drag_message_loop_(MessageLoop::current()),
|
||||
drag_message_loop_(base::MessageLoop::current()),
|
||||
is_started_(false),
|
||||
is_successful_(false) {
|
||||
#if defined(OS_WIN)
|
||||
@ -109,7 +109,7 @@ void DragDownloadFile::InitiateDownload() {
|
||||
void DragDownloadFile::DownloadCompleted(bool is_successful) {
|
||||
#if defined(OS_WIN)
|
||||
// If not in drag-and-drop thread, defer the running to it.
|
||||
if (drag_message_loop_ != MessageLoop::current()) {
|
||||
if (drag_message_loop_ != base::MessageLoop::current()) {
|
||||
drag_message_loop_->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&DragDownloadFile::DownloadCompleted, this, is_successful));
|
||||
@ -126,7 +126,7 @@ void DragDownloadFile::DownloadCompleted(bool is_successful) {
|
||||
void DragDownloadFile::AssertCurrentlyOnDragThread() {
|
||||
// Only do the check on Windows where two threads are involved.
|
||||
#if defined(OS_WIN)
|
||||
DCHECK(drag_message_loop_ == MessageLoop::current());
|
||||
DCHECK(drag_message_loop_ == base::MessageLoop::current());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ class DragDownloadFile : public ui::DownloadFileProvider {
|
||||
GURL referrer_;
|
||||
std::string referrer_encoding_;
|
||||
BrowserWebViewDelegate* view_;
|
||||
MessageLoop* drag_message_loop_;
|
||||
base::MessageLoop* drag_message_loop_;
|
||||
base::FilePath temp_dir_path_;
|
||||
|
||||
// Accessed on drag-and-drop thread (Windows).
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include "libcef/cef_context.h"
|
||||
#include "libcef/cef_thread.h"
|
||||
|
||||
// Allow access to content internals.
|
||||
#define CONTENT_IMPLEMENTATION 1
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "content/browser/geolocation/geolocation_observer.h"
|
||||
@ -149,8 +152,8 @@ void CefGeolocationClient::InitializeEnvironment() {
|
||||
if (!content::GetContentClient()) {
|
||||
static CefContentClient content_client;
|
||||
static CefContentBrowserClient browser_client;
|
||||
content_client.set_browser_for_testing(&browser_client);
|
||||
content::SetContentClient(&content_client);
|
||||
content::SetBrowserClientForTesting(&browser_client);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ PrintingContext::Result PrintingContext::NewDocument(
|
||||
return OnError();
|
||||
}
|
||||
|
||||
DCHECK_EQ(MessageLoop::current()->NestableTasksAllowed(), false);
|
||||
DCHECK_EQ(base::MessageLoop::current()->NestableTasksAllowed(), false);
|
||||
// Begin a print job by calling the StartDoc function.
|
||||
// NOTE: StartDoc() starts a message loop. That causes a lot of problems with
|
||||
// IPC. Make sure recursive task processing is disabled.
|
||||
|
@ -141,8 +141,9 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
||||
|
||||
net::HttpRequestHeaders headers = request->extra_request_headers();
|
||||
|
||||
// Ensure that we do not send username and password fields in the referrer.
|
||||
GURL referrer(request->GetSanitizedReferrer());
|
||||
// URLRequest::SetReferrer ensures that we do not send username and password
|
||||
// fields in the referrer.
|
||||
GURL referrer(request->referrer());
|
||||
|
||||
// Strip Referer from request_info_.extra_headers to prevent, e.g., plugins
|
||||
// from overriding headers that are controlled using other means. Otherwise a
|
||||
|
@ -11,7 +11,6 @@
|
||||
MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "Frame.h" // NOLINT(build/include)
|
||||
#include "ScriptController.h" // NOLINT(build/include)
|
||||
#include "ScriptControllerBase.h" // NOLINT(build/include)
|
||||
#include "V8Binding.h" // NOLINT(build/include)
|
||||
#include "V8RecursionScope.h" // NOLINT(build/include)
|
||||
MSVC_POP_WARNING();
|
||||
|
@ -72,7 +72,7 @@ WebDragSource::~WebDragSource() {
|
||||
if (drop_data_.get()) {
|
||||
gtk_grab_add(drag_widget_);
|
||||
gtk_grab_remove(drag_widget_);
|
||||
MessageLoopForUI::current()->RemoveObserver(this);
|
||||
base::MessageLoopForUI::current()->RemoveObserver(this);
|
||||
drop_data_.reset();
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ void WebDragSource::StartDragging(const WebDropData& drop_data,
|
||||
return;
|
||||
}
|
||||
|
||||
MessageLoopForUI::current()->AddObserver(this);
|
||||
base::MessageLoopForUI::current()->AddObserver(this);
|
||||
}
|
||||
|
||||
WebKit::WebView* WebDragSource::getView() {
|
||||
@ -378,7 +378,7 @@ void WebDragSource::OnDragEnd(GtkWidget* sender,
|
||||
drag_pixbuf_ = NULL;
|
||||
}
|
||||
|
||||
MessageLoopForUI::current()->RemoveObserver(this);
|
||||
base::MessageLoopForUI::current()->RemoveObserver(this);
|
||||
|
||||
if (!download_url_.is_empty()) {
|
||||
gdk_property_delete(drag_context->source_window,
|
||||
|
@ -29,7 +29,7 @@ class WebView;
|
||||
}
|
||||
|
||||
class WebDragSource : public base::RefCounted<WebDragSource>,
|
||||
public MessageLoopForUI::Observer {
|
||||
public base::MessageLoopForUI::Observer {
|
||||
public:
|
||||
explicit WebDragSource(CefBrowserImpl* browser);
|
||||
virtual ~WebDragSource();
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/sys_string_conversions.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/utf_string_conversions.h"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/sys_string_conversions.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "googleurl/src/gurl.h"
|
||||
#include "net/base/mime_util.h"
|
||||
#include "net/base/net_util.h"
|
||||
|
@ -287,7 +287,7 @@ void WebDropTarget::OnDragLeave(GtkWidget* sender, GdkDragContext* context,
|
||||
// preceded by a drag-leave. The renderer doesn't like getting the signals
|
||||
// in this order so delay telling it about the drag-leave till we are sure
|
||||
// we are not getting a drop as well.
|
||||
MessageLoop::current()->PostTask(FROM_HERE,
|
||||
base::MessageLoop::current()->PostTask(FROM_HERE,
|
||||
base::Bind(&WebDropTarget::DragLeave, method_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#import "libcef/web_drag_utils_mac.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/sys_string_conversions.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#import "third_party/mozilla/NSPasteboard+Utils.h"
|
||||
#include "third_party/WebKit/Source/Platform/chromium/public/WebDragData.h"
|
||||
#include "third_party/WebKit/Source/Platform/chromium/public/WebPoint.h"
|
||||
|
@ -17,7 +17,7 @@ MSVC_POP_WARNING();
|
||||
|
||||
#include "base/bind.h"
|
||||
#import "base/logging.h"
|
||||
#import "base/sys_string_conversions.h"
|
||||
#import "base/strings/sys_string_conversions.h"
|
||||
#import "skia/ext/platform_canvas.h"
|
||||
#import "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
|
||||
#import "third_party/WebKit/Source/WebKit/chromium/public/mac/WebInputEventFactory.h"
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: message_loop.cc
|
||||
===================================================================
|
||||
--- message_loop.cc (revision 181864)
|
||||
+++ message_loop.cc (working copy)
|
||||
@@ -193,7 +193,7 @@
|
||||
Index: message_loop.cc
|
||||
===================================================================
|
||||
--- message_loop.cc (revision 194165)
|
||||
+++ message_loop.cc (working copy)
|
||||
@@ -191,7 +191,7 @@
|
||||
MessageLoop::~MessageLoop() {
|
||||
DCHECK_EQ(this, current());
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: page/FrameView.cpp
|
||||
===================================================================
|
||||
--- page/FrameView.cpp (revision 146842)
|
||||
--- page/FrameView.cpp (revision 148366)
|
||||
+++ page/FrameView.cpp (working copy)
|
||||
@@ -209,10 +209,12 @@
|
||||
@@ -198,10 +198,12 @@
|
||||
if (!page)
|
||||
return;
|
||||
|
||||
@ -17,17 +17,17 @@ Index: page/FrameView.cpp
|
||||
PassRefPtr<FrameView> FrameView::create(Frame* frame)
|
||||
Index: platform/mac/NSScrollerImpDetails.mm
|
||||
===================================================================
|
||||
--- platform/mac/NSScrollerImpDetails.mm (revision 146842)
|
||||
--- platform/mac/NSScrollerImpDetails.mm (revision 148366)
|
||||
+++ platform/mac/NSScrollerImpDetails.mm (working copy)
|
||||
@@ -34,6 +34,7 @@
|
||||
#if PLATFORM(CHROMIUM)
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
bool isScrollbarOverlayAPIAvailable()
|
||||
{
|
||||
+#if 0
|
||||
static bool apiAvailable;
|
||||
static bool shouldInitialize = true;
|
||||
if (shouldInitialize) {
|
||||
@@ -44,6 +45,9 @@
|
||||
@@ -43,6 +44,9 @@
|
||||
&& [scrollerImpPairClass instancesRespondToSelector:@selector(scrollerStyle)];
|
||||
}
|
||||
return apiAvailable;
|
||||
@ -35,5 +35,5 @@ Index: platform/mac/NSScrollerImpDetails.mm
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
NSScrollerStyle recommendedScrollerStyle() {
|
||||
|
@ -389,8 +389,6 @@ void AppGetBrowserSettings(CefBrowserSettings& settings) {
|
||||
g_command_line->HasSwitch(cefclient::kAcceleratedFiltersDisabled);
|
||||
settings.accelerated_plugins_disabled =
|
||||
g_command_line->HasSwitch(cefclient::kAcceleratedPluginsDisabled);
|
||||
settings.developer_tools_disabled =
|
||||
g_command_line->HasSwitch(cefclient::kDeveloperToolsDisabled);
|
||||
settings.fullscreen_enabled =
|
||||
g_command_line->HasSwitch(cefclient::kFullscreenEnabled);
|
||||
}
|
||||
|
@ -84,7 +84,6 @@ const char kAcceleratedVideoDisabled[] = "accelerated-video-disabled";
|
||||
const char kAcceledated2dCanvasDisabled[] = "accelerated-2d-canvas-disabled";
|
||||
const char kAcceleratedFiltersDisabled[] = "accelerated-filters-disabled";
|
||||
const char kAcceleratedPluginsDisabled[] = "accelerated-plugins-disabled";
|
||||
const char kDeveloperToolsDisabled[] = "developer-tools-disabled";
|
||||
const char kFullscreenEnabled[] = "fullscreen-enabled";
|
||||
|
||||
// Other attributes.
|
||||
|
@ -81,7 +81,6 @@ extern const char kAcceleratedVideoDisabled[];
|
||||
extern const char kAcceledated2dCanvasDisabled[];
|
||||
extern const char kAcceleratedFiltersDisabled[];
|
||||
extern const char kAcceleratedPluginsDisabled[];
|
||||
extern const char kDeveloperToolsDisabled[];
|
||||
extern const char kFullscreenEnabled[];
|
||||
|
||||
// Other attributes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user