diff --git a/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt b/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt index bb4227851..9324c407a 100644 --- a/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '142910', + 'chromium_revision': '149431', } diff --git a/cef1/cef.gyp b/cef1/cef.gyp index faf9fce67..67124f02e 100644 --- a/cef1/cef.gyp +++ b/cef1/cef.gyp @@ -177,7 +177,7 @@ 'pak_inputs': [ '<(grit_out_dir)/devtools_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', - '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources_standard/ui_resources_standard.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', ], @@ -257,7 +257,7 @@ 'pak_inputs': [ '<(grit_out_dir)/devtools_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', - '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources_standard/ui_resources_standard.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', ], @@ -391,7 +391,7 @@ 'pak_inputs': [ '<(grit_out_dir)/devtools_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', - '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources_standard/ui_resources_standard.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', ], @@ -454,7 +454,7 @@ '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', - '<(DEPTH)/ui/ui.gyp:ui_resources_standard', + '<(DEPTH)/ui/ui.gyp:ui_resources', '<(DEPTH)/ui/ui.gyp:ui', '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', '<(DEPTH)/webkit/support/webkit_support.gyp:appcache', @@ -639,7 +639,7 @@ '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', - '<(DEPTH)/ui/ui.gyp:ui_resources_standard', + '<(DEPTH)/ui/ui.gyp:ui_resources', '<(DEPTH)/ui/ui.gyp:ui', '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', '<(DEPTH)/webkit/support/webkit_support.gyp:appcache', diff --git a/cef1/libcef/browser_dom_storage_system.cc b/cef1/libcef/browser_dom_storage_system.cc index 06bd62e1c..59d65d688 100644 --- a/cef1/libcef/browser_dom_storage_system.cc +++ b/cef1/libcef/browser_dom_storage_system.cc @@ -99,7 +99,7 @@ BrowserDomStorageSystem::NamespaceImpl::~NamespaceImpl() { namespace_id_ == kInvalidNamespaceId || !Context()) { return; } - Context()->DeleteSessionNamespace(namespace_id_); + Context()->DeleteSessionNamespace(namespace_id_, false); } WebStorageArea* BrowserDomStorageSystem::NamespaceImpl::createStorageArea( diff --git a/cef1/libcef/browser_file_system.cc b/cef1/libcef/browser_file_system.cc index 43bb4fbe2..9ac501d40 100644 --- a/cef1/libcef/browser_file_system.cc +++ b/cef1/libcef/browser_file_system.cc @@ -23,6 +23,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" #include "webkit/blob/blob_storage_controller.h" +#include "webkit/fileapi/file_system_url.h" #include "webkit/fileapi/file_system_util.h" #include "webkit/fileapi/mock_file_system_options.h" #include "webkit/glue/webkit_glue.h" @@ -43,6 +44,7 @@ using WebKit::WebVector; using webkit_blob::BlobData; using webkit_blob::BlobStorageController; +using fileapi::FileSystemURL; using fileapi::FileSystemContext; using fileapi::FileSystemOperationInterface; @@ -129,58 +131,112 @@ void BrowserFileSystem::OpenFileSystem( void BrowserFileSystem::move( const WebURL& src_path, const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(src_path)->Move(GURL(src_path), GURL(dest_path), - FinishHandler(callbacks)); + FileSystemURL src_url(src_path); + FileSystemURL dest_url(dest_path); + if (!HasFilePermission(src_url, FILE_PERMISSION_WRITE) || + !HasFilePermission(dest_url, FILE_PERMISSION_CREATE)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(src_url)->Move(src_url, dest_url, + FinishHandler(callbacks)); } void BrowserFileSystem::copy( const WebURL& src_path, const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(src_path)->Copy(GURL(src_path), GURL(dest_path), - FinishHandler(callbacks)); + FileSystemURL src_url(src_path); + FileSystemURL dest_url(dest_path); + if (!HasFilePermission(src_url, FILE_PERMISSION_READ) || + !HasFilePermission(dest_url, FILE_PERMISSION_CREATE)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(src_url)->Copy(src_url, dest_url, + FinishHandler(callbacks)); } void BrowserFileSystem::remove( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->Remove(path, false /* recursive */, - FinishHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_WRITE)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->Remove(url, false /* recursive */, + FinishHandler(callbacks)); } void BrowserFileSystem::removeRecursively( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->Remove(path, true /* recursive */, - FinishHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_WRITE)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->Remove(url, true /* recursive */, + FinishHandler(callbacks)); } void BrowserFileSystem::readMetadata( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->GetMetadata(path, GetMetadataHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_READ)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->GetMetadata(url, GetMetadataHandler(callbacks)); } void BrowserFileSystem::createFile( const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->CreateFile(path, exclusive, FinishHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_CREATE)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->CreateFile(url, exclusive, FinishHandler(callbacks)); } void BrowserFileSystem::createDirectory( const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->CreateDirectory(path, exclusive, false, - FinishHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_CREATE)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->CreateDirectory(url, exclusive, false, + FinishHandler(callbacks)); } void BrowserFileSystem::fileExists( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->FileExists(path, FinishHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_READ)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->FileExists(url, FinishHandler(callbacks)); } void BrowserFileSystem::directoryExists( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->DirectoryExists(path, FinishHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_READ)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->DirectoryExists(url, FinishHandler(callbacks)); } void BrowserFileSystem::readDirectory( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->ReadDirectory(path, ReadDirectoryHandler(callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_READ)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->ReadDirectory(url, ReadDirectoryHandler(callbacks)); } WebFileWriter* BrowserFileSystem::createFileWriter( @@ -192,8 +248,13 @@ void BrowserFileSystem::createSnapshotFileAndReadMetadata( const WebURL& blobURL, const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(path)->CreateSnapshotFile( - path, SnapshotFileHandler(blobURL, callbacks)); + FileSystemURL url(path); + if (!HasFilePermission(url, FILE_PERMISSION_READ)) { + callbacks->didFail(WebKit::WebFileErrorSecurity); + return; + } + GetNewOperation(url)->CreateSnapshotFile( + url, SnapshotFileHandler(blobURL, callbacks)); } // static @@ -209,9 +270,16 @@ void BrowserFileSystem::CleanupOnIOThread() { g_blob_storage_controller = NULL; } +bool BrowserFileSystem::HasFilePermission( + const fileapi::FileSystemURL& url, FilePermission permission) { + // Disallow writing on isolated file system, otherwise return ok. + return (url.type() != fileapi::kFileSystemTypeIsolated || + permission == FILE_PERMISSION_READ); +} + FileSystemOperationInterface* BrowserFileSystem::GetNewOperation( - const WebURL& url) { - return file_system_context_->CreateFileSystemOperation(GURL(url)); + const fileapi::FileSystemURL& url) { + return file_system_context_->CreateFileSystemOperation(url); } FileSystemOperationInterface::StatusCallback diff --git a/cef1/libcef/browser_file_system.h b/cef1/libcef/browser_file_system.h index 92be43d45..be27631f5 100644 --- a/cef1/libcef/browser_file_system.h +++ b/cef1/libcef/browser_file_system.h @@ -25,6 +25,7 @@ class WebURL; namespace fileapi { class FileSystemContext; +class FileSystemURL; } namespace webkit_blob { @@ -97,9 +98,17 @@ class BrowserFileSystem static void CleanupOnIOThread(); private: + enum FilePermission { + FILE_PERMISSION_READ, + FILE_PERMISSION_WRITE, + FILE_PERMISSION_CREATE, + }; + // Helpers. + bool HasFilePermission(const fileapi::FileSystemURL& url, + FilePermission permission); fileapi::FileSystemOperationInterface* GetNewOperation( - const WebKit::WebURL& path); + const fileapi::FileSystemURL& url); // Callback Handlers fileapi::FileSystemOperationInterface::StatusCallback FinishHandler( diff --git a/cef1/libcef/browser_file_writer.cc b/cef1/libcef/browser_file_writer.cc index 9acff66fe..2adfdeea1 100644 --- a/cef1/libcef/browser_file_writer.cc +++ b/cef1/libcef/browser_file_writer.cc @@ -6,13 +6,17 @@ #include "libcef/cef_thread.h" #include "base/bind.h" +#include "base/location.h" #include "base/logging.h" #include "base/message_loop_proxy.h" #include "net/url_request/url_request_context.h" #include "webkit/fileapi/file_system_context.h" #include "webkit/fileapi/file_system_operation_interface.h" +#include "webkit/fileapi/file_system_types.h" +#include "webkit/fileapi/file_system_url.h" #include "webkit/glue/webkit_glue.h" +using fileapi::FileSystemURL; using fileapi::FileSystemContext; using fileapi::FileSystemOperationInterface; using fileapi::WebFileWriterBase; @@ -37,30 +41,34 @@ class BrowserFileWriter::IOThreadProxy main_thread_ = base::MessageLoopProxy::current(); } - void Truncate(const GURL& path, int64 offset) { + void Truncate(const FileSystemURL& url, int64 offset) { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->PostTask( FROM_HERE, - base::Bind(&IOThreadProxy::Truncate, this, path, offset)); + base::Bind(&IOThreadProxy::Truncate, this, url, offset)); return; } + if (FailIfNotWritable(url)) + return; DCHECK(!operation_); - operation_ = GetNewOperation(path); - operation_->Truncate(path, offset, + operation_ = GetNewOperation(url); + operation_->Truncate(url, offset, base::Bind(&IOThreadProxy::DidFinish, this)); } - void Write(const GURL& path, const GURL& blob_url, int64 offset) { + void Write(const FileSystemURL& url, const GURL& blob_url, int64 offset) { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->PostTask( FROM_HERE, - base::Bind(&IOThreadProxy::Write, this, path, blob_url, offset)); + base::Bind(&IOThreadProxy::Write, this, url, blob_url, offset)); return; } + if (FailIfNotWritable(url)) + return; DCHECK(request_context_); DCHECK(!operation_); - operation_ = GetNewOperation(path); - operation_->Write(request_context_, path, blob_url, offset, + operation_ = GetNewOperation(url); + operation_->Write(request_context_, url, blob_url, offset, base::Bind(&IOThreadProxy::DidWrite, this)); } @@ -82,8 +90,18 @@ class BrowserFileWriter::IOThreadProxy friend class base::RefCountedThreadSafe; virtual ~IOThreadProxy() {} - FileSystemOperationInterface* GetNewOperation(const GURL& path) { - return file_system_context_->CreateFileSystemOperation(path); + FileSystemOperationInterface* GetNewOperation( const FileSystemURL& url) { + return file_system_context_->CreateFileSystemOperation(url); + } + + // Returns true if it is not writable. + bool FailIfNotWritable(const FileSystemURL& url) { + if (url.type() == fileapi::kFileSystemTypeIsolated) { + // Write is not allowed in isolate file system in BrowserFileWriter. + DidFailOnMainThread(base::PLATFORM_FILE_ERROR_SECURITY); + return true; + } + return false; } void DidSucceedOnMainThread() { @@ -169,12 +187,14 @@ BrowserFileWriter::~BrowserFileWriter() { } void BrowserFileWriter::DoTruncate(const GURL& path, int64 offset) { - io_thread_proxy_->Truncate(path, offset); + FileSystemURL url(path); + io_thread_proxy_->Truncate(url, offset); } void BrowserFileWriter::DoWrite( const GURL& path, const GURL& blob_url, int64 offset) { - io_thread_proxy_->Write(path, blob_url, offset); + FileSystemURL url(path); + io_thread_proxy_->Write(url, blob_url, offset); } void BrowserFileWriter::DoCancel() { diff --git a/cef1/libcef/browser_network_delegate.cc b/cef1/libcef/browser_network_delegate.cc index 547ffcb0b..43326efc3 100644 --- a/cef1/libcef/browser_network_delegate.cc +++ b/cef1/libcef/browser_network_delegate.cc @@ -115,3 +115,8 @@ int BrowserNetworkDelegate::OnBeforeSocketStreamConnect( const net::CompletionCallback& callback) { return net::OK; } + +void BrowserNetworkDelegate::OnCacheWaitStateChange( + const net::URLRequest& request, + CacheWaitState state) { +} diff --git a/cef1/libcef/browser_network_delegate.h b/cef1/libcef/browser_network_delegate.h index e076afac4..d9eb09985 100644 --- a/cef1/libcef/browser_network_delegate.h +++ b/cef1/libcef/browser_network_delegate.h @@ -56,6 +56,8 @@ class BrowserNetworkDelegate : public net::NetworkDelegate { virtual int OnBeforeSocketStreamConnect( net::SocketStream* stream, const net::CompletionCallback& callback) OVERRIDE; + virtual void OnCacheWaitStateChange(const net::URLRequest& request, + CacheWaitState state) OVERRIDE; bool accept_all_cookies_; }; diff --git a/cef1/libcef/browser_resource_loader_bridge.cc b/cef1/libcef/browser_resource_loader_bridge.cc index c279eef5a..280568ae4 100644 --- a/cef1/libcef/browser_resource_loader_bridge.cc +++ b/cef1/libcef/browser_resource_loader_bridge.cc @@ -580,7 +580,10 @@ class RequestProxy : public net::URLRequest::Delegate, ResolveBlobReferencesInUploadData(params->upload.get()); } - request_.reset(new net::URLRequest(params->url, this)); + net::URLRequestContext* context = browser_.get() ? + browser_->request_context_proxy() : _Context->request_context(); + + request_.reset(new net::URLRequest(params->url, this, context)); request_->set_priority(params->priority); request_->set_method(params->method); request_->set_first_party_for_cookies(params->first_party_for_cookies); @@ -592,8 +595,6 @@ class RequestProxy : public net::URLRequest::Delegate, request_->SetExtraRequestHeaders(headers); request_->set_load_flags(params->load_flags); request_->set_upload(params->upload.get()); - request_->set_context(browser_.get() ? browser_->request_context_proxy() : - _Context->request_context()); request_->SetUserData(kCefUserData, new ExtraRequestInfo(browser_.get(), params->request_type)); BrowserAppCacheSystem::SetExtraRequestInfo( @@ -874,7 +875,7 @@ class RequestProxy : public net::URLRequest::Delegate, // GetContentLengthSync() may perform file IO, but it's ok here, as file // IO is not prohibited in IOThread defined in the file. - uint64 size = request_->get_upload()->GetContentLengthSync(); + uint64 size = request_->get_upload_mutable()->GetContentLengthSync(); uint64 position = request_->GetUploadProgress(); if (position == last_upload_position_) return; // no progress made since last time diff --git a/cef1/libcef/browser_webkit_glue.cc b/cef1/libcef/browser_webkit_glue.cc index 3300c59da..e4505f120 100644 --- a/cef1/libcef/browser_webkit_glue.cc +++ b/cef1/libcef/browser_webkit_glue.cc @@ -150,13 +150,10 @@ WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( #endif if (use_command_buffer) { - WebKit::WebGraphicsContext3D* view_context = NULL; - if (!renderDirectlyToWebView) - view_context = web_view->graphicsContext3D(); scoped_ptr context( new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); - if (!context->Initialize(attributes, view_context)) + if (!context->Initialize(attributes, NULL)) return NULL; return context.release(); } else { diff --git a/cef1/libcef/browser_webview_delegate.cc b/cef1/libcef/browser_webview_delegate.cc index f816e9e6e..9bac62851 100644 --- a/cef1/libcef/browser_webview_delegate.cc +++ b/cef1/libcef/browser_webview_delegate.cc @@ -706,6 +706,7 @@ WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer( base::WeakPtr(), collection.release(), NULL, + NULL, message_loop_factory.release(), NULL, new media::MediaLog()); diff --git a/cef1/libcef/cef_context.cc b/cef1/libcef/cef_context.cc index 852f3749f..9b7bcd2a0 100644 --- a/cef1/libcef/cef_context.cc +++ b/cef1/libcef/cef_context.cc @@ -422,7 +422,7 @@ void CefContext::InitializeResourceBundle() { if (file_util::PathExists(pak_file)) { resource_bundle_delegate_->set_allow_pack_file_load(true); - ResourceBundle::GetSharedInstance().AddDataPack( + ResourceBundle::GetSharedInstance().AddDataPackFromPath( pak_file, ui::SCALE_FACTOR_NONE); resource_bundle_delegate_->set_allow_pack_file_load(false); } else { diff --git a/cef1/libcef/cef_process.cc b/cef1/libcef/cef_process.cc index ee9e17e50..86cd1f1d6 100644 --- a/cef1/libcef/cef_process.cc +++ b/cef1/libcef/cef_process.cc @@ -22,8 +22,9 @@ class CefMessageLoopForUI : public MessageLoopForUI { #if defined(OS_MACOSX) virtual ~CefMessageLoopForUI() { // On Mac the MessageLoop::AutoRunState scope in Run() never exits so clear - // the state_ variable to avoid an assertion in the MessageLoop destructor. - state_ = NULL; + // the run_loop_ variable to avoid an assertion in the MessageLoop + // destructor. + run_loop_ = NULL; } #endif @@ -43,11 +44,7 @@ class CefMessageLoopForUI : public MessageLoopForUI { // Do a single interation of the UI message loop. void DoMessageLoopIteration() { -#if defined(OS_MACOSX) Run(); -#else - RunWithDispatcher(NULL); -#endif } // Run the UI message loop. diff --git a/cef1/libcef/cef_thread.cc b/cef1/libcef/cef_thread.cc index 58194e02a..3e1d6a235 100644 --- a/cef1/libcef/cef_thread.cc +++ b/cef1/libcef/cef_thread.cc @@ -31,12 +31,6 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy { } // TaskRunner implementation. - virtual bool PostDelayedTask(const tracked_objects::Location& from_here, - const base::Closure& task, - int64 delay_ms) OVERRIDE { - return CefThread::PostDelayedTask(id_, from_here, task, delay_ms); - } - virtual bool PostDelayedTask(const tracked_objects::Location& from_here, const base::Closure& task, base::TimeDelta delay) OVERRIDE { @@ -44,14 +38,6 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy { } // SequencedTaskRunner implementation. - virtual bool PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - int64 delay_ms) OVERRIDE { - return CefThread::PostNonNestableDelayedTask(id_, from_here, task, - delay_ms); - } - virtual bool PostNonNestableDelayedTask( const tracked_objects::Location& from_here, const base::Closure& task, @@ -153,15 +139,7 @@ bool CefThread::CurrentlyOn(ID identifier) { bool CefThread::PostTask(ID identifier, const tracked_objects::Location& from_here, const base::Closure& task) { - return PostTaskHelper(identifier, from_here, task, 0, true); -} - -// static -bool CefThread::PostDelayedTask(ID identifier, - const tracked_objects::Location& from_here, - const base::Closure& task, - int64 delay_ms) { - return PostTaskHelper(identifier, from_here, task, delay_ms, true); + return PostTaskHelper(identifier, from_here, task, base::TimeDelta(), true); } // static @@ -169,8 +147,7 @@ bool CefThread::PostDelayedTask(ID identifier, const tracked_objects::Location& from_here, const base::Closure& task, base::TimeDelta delay) { - return PostTaskHelper(identifier, from_here, task, delay.InMilliseconds(), - true); + return PostTaskHelper(identifier, from_here, task, delay, true); } // static @@ -178,16 +155,7 @@ bool CefThread::PostNonNestableTask( ID identifier, const tracked_objects::Location& from_here, const base::Closure& task) { - return PostTaskHelper(identifier, from_here, task, 0, false); -} - -// static -bool CefThread::PostNonNestableDelayedTask( - ID identifier, - const tracked_objects::Location& from_here, - const base::Closure& task, - int64 delay_ms) { - return PostTaskHelper(identifier, from_here, task, delay_ms, false); + return PostTaskHelper(identifier, from_here, task, base::TimeDelta(), false); } // static @@ -196,8 +164,7 @@ bool CefThread::PostNonNestableDelayedTask( const tracked_objects::Location& from_here, const base::Closure& task, base::TimeDelta delay) { - return PostTaskHelper(identifier, from_here, task, delay.InMilliseconds(), - false); + return PostTaskHelper(identifier, from_here, task, delay, false); } // static @@ -227,7 +194,7 @@ bool CefThread::PostTaskHelper( ID identifier, const tracked_objects::Location& from_here, const base::Closure& task, - int64 delay_ms, + base::TimeDelta delay, bool nestable) { DCHECK(identifier >= 0 && identifier < ID_COUNT); // Optimization: to avoid unnecessary locks, we listed the ID enumeration in @@ -248,9 +215,9 @@ bool CefThread::PostTaskHelper( cef_threads_[identifier]->message_loop() : NULL; if (message_loop) { if (nestable) { - message_loop->PostDelayedTask(from_here, task, delay_ms); + message_loop->PostDelayedTask(from_here, task, delay); } else { - message_loop->PostNonNestableDelayedTask(from_here, task, delay_ms); + message_loop->PostNonNestableDelayedTask(from_here, task, delay); } } diff --git a/cef1/libcef/cef_thread.h b/cef1/libcef/cef_thread.h index 50eff6381..e85f0bbc6 100644 --- a/cef1/libcef/cef_thread.h +++ b/cef1/libcef/cef_thread.h @@ -78,10 +78,6 @@ class CefThread : public base::Thread { static bool PostTask(ID identifier, const tracked_objects::Location& from_here, const base::Closure& task); - static bool PostDelayedTask(ID identifier, - const tracked_objects::Location& from_here, - const base::Closure& task, - int64 delay_ms); static bool PostDelayedTask(ID identifier, const tracked_objects::Location& from_here, const base::Closure& task, @@ -89,11 +85,6 @@ class CefThread : public base::Thread { static bool PostNonNestableTask(ID identifier, const tracked_objects::Location& from_here, const base::Closure& task); - static bool PostNonNestableDelayedTask( - ID identifier, - const tracked_objects::Location& from_here, - const base::Closure& task, - int64 delay_ms); static bool PostNonNestableDelayedTask( ID identifier, const tracked_objects::Location& from_here, @@ -179,7 +170,7 @@ class CefThread : public base::Thread { ID identifier, const tracked_objects::Location& from_here, const base::Closure& task, - int64 delay_ms, + base::TimeDelta delay, bool nestable); // The identifier of this thread. Only one thread can exist with a given diff --git a/cef1/libcef/cookie_manager_impl.cc b/cef1/libcef/cookie_manager_impl.cc index e872110c6..500e5005a 100644 --- a/cef1/libcef/cookie_manager_impl.cc +++ b/cef1/libcef/cookie_manager_impl.cc @@ -33,7 +33,7 @@ class VisitCookiesCallback : public base::RefCounted { net::CookieList::const_iterator it = list.begin(); for (; it != list.end(); ++it, ++count) { CefCookie cookie; - const net::CookieMonster::CanonicalCookie& cc = *(it); + const net::CanonicalCookie& cc = *(it); CefString(&cookie.name).FromString(cc.Name()); CefString(&cookie.value).FromString(cc.Value()); @@ -43,7 +43,7 @@ class VisitCookiesCallback : public base::RefCounted { cookie.httponly = cc.IsHttpOnly(); cef_time_from_basetime(cc.CreationDate(), cookie.creation); cef_time_from_basetime(cc.LastAccessDate(), cookie.last_access); - cookie.has_expires = cc.DoesExpire(); + cookie.has_expires = cc.IsPersistent(); if (cookie.has_expires) cef_time_from_basetime(cc.ExpiryDate(), cookie.expires); diff --git a/cef1/libcef/request_impl.cc b/cef1/libcef/request_impl.cc index 547a069c2..80b45bb67 100644 --- a/cef1/libcef/request_impl.cc +++ b/cef1/libcef/request_impl.cc @@ -103,7 +103,7 @@ void CefRequestImpl::Set(net::URLRequest* request) { GetHeaderMap(headers, headermap_); // Transfer post data, if any - net::UploadData* data = request->get_upload(); + const net::UploadData* data = request->get_upload(); if (data) { postdata_ = CefPostData::CreatePostData(); static_cast(postdata_.get())->Set(*data); @@ -291,12 +291,12 @@ void CefPostDataImpl::RemoveElements() { elements_.clear(); } -void CefPostDataImpl::Set(net::UploadData& data) { +void CefPostDataImpl::Set(const net::UploadData& data) { AutoLock lock_scope(this); CefRefPtr postelem; - std::vector* elements = data.elements(); + const std::vector* elements = data.elements(); std::vector::const_iterator it = elements->begin(); for (; it != elements->end(); ++it) { postelem = CefPostDataElement::CreatePostDataElement(); diff --git a/cef1/libcef/request_impl.h b/cef1/libcef/request_impl.h index a4b9a0799..9761c7cf4 100644 --- a/cef1/libcef/request_impl.h +++ b/cef1/libcef/request_impl.h @@ -76,7 +76,7 @@ class CefPostDataImpl : public CefPostData { virtual bool AddElement(CefRefPtr element) OVERRIDE; virtual void RemoveElements(); - void Set(net::UploadData& data); + void Set(const net::UploadData& data); void Get(net::UploadData& data); void Set(const WebKit::WebHTTPBody& data); void Get(WebKit::WebHTTPBody& data); diff --git a/cef1/libcef/scheme_impl.cc b/cef1/libcef/scheme_impl.cc index 4d84143d1..7c009b1a6 100644 --- a/cef1/libcef/scheme_impl.cc +++ b/cef1/libcef/scheme_impl.cc @@ -107,7 +107,7 @@ class CefUrlRequestJob : public net::URLRequestJob { public: CefUrlRequestJob(net::URLRequest* request, CefRefPtr handler) - : net::URLRequestJob(request), + : net::URLRequestJob(request, request->context()->network_delegate()), handler_(handler), remaining_bytes_(0), response_cookies_save_index_(0), diff --git a/cef1/libcef/task_impl.cc b/cef1/libcef/task_impl.cc index bce6348a4..65a9045d5 100644 --- a/cef1/libcef/task_impl.cc +++ b/cef1/libcef/task_impl.cc @@ -44,5 +44,6 @@ bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, return false; return CefThread::PostDelayedTask(static_cast(id), FROM_HERE, - base::Bind(&CefTask::Execute, task, threadId), delay_ms); + base::Bind(&CefTask::Execute, task, threadId), + base::TimeDelta::FromMilliseconds(delay_ms)); } diff --git a/cef1/libcef/v8_impl.cc b/cef1/libcef/v8_impl.cc index 064c53407..5bc9910d6 100644 --- a/cef1/libcef/v8_impl.cc +++ b/cef1/libcef/v8_impl.cc @@ -571,7 +571,7 @@ bool CefV8ContextImpl::IsSame(CefRefPtr that) { bool CefV8ContextImpl::Eval(const CefString& code, CefRefPtr& retval, CefRefPtr& exception) { - CEF_REQUIRE_UI_THREAD(NULL); + CEF_REQUIRE_UI_THREAD(false); if (code.empty()) { NOTREACHED() << "invalid input parameter"; @@ -969,8 +969,8 @@ CefRefPtr CefV8ValueImpl::GetException() { } bool CefV8ValueImpl::ClearException() { - CEF_REQUIRE_UI_THREAD(NULL); - CEF_V8_REQUIRE_OBJECT_RETURN(NULL); + CEF_REQUIRE_UI_THREAD(false); + CEF_V8_REQUIRE_OBJECT_RETURN(false); last_exception_ = NULL; return true; diff --git a/cef1/libcef/web_drop_target_gtk.cc b/cef1/libcef/web_drop_target_gtk.cc index 25c8fbf55..b26a979c7 100644 --- a/cef1/libcef/web_drop_target_gtk.cc +++ b/cef1/libcef/web_drop_target_gtk.cc @@ -126,7 +126,8 @@ bool WebDropTarget::OnDragMove(GtkWidget* widget, GdkDragContext* context, } else if (data_requests_ == 0) { operation = webview->dragTargetDragOver(WebPoint(x, y), WebPoint(widget_x, widget_y), - _mask(context)); + _mask(context), + 0); gdk_drag_status(context, (GdkDragAction)DragDropTypes::DragOperationToGdkDragAction(operation), time); @@ -162,7 +163,8 @@ bool WebDropTarget::OnDragDrop(GtkWidget* widget, GdkDragContext* context, if (browser_->UIT_GetWebView()) { browser_->UIT_GetWebView()->dragTargetDrop( WebPoint(x, y), - WebPoint(widget_x, widget_y)); + WebPoint(widget_x, widget_y), + 0); } browser_->set_is_dropping(false); context_ = NULL; @@ -260,7 +262,8 @@ void WebDropTarget::OnDragDataReceived(GtkWidget* widget, operation = webview->dragTargetDragEnter(drop_data_->ToDragData(), WebPoint(x, y), WebPoint(widget_x, widget_y), - _mask(context)); + _mask(context), + 0); gdk_drag_status(context, (GdkDragAction)DragDropTypes::DragOperationToGdkDragAction(operation), time); diff --git a/cef1/libcef/web_drop_target_mac.mm b/cef1/libcef/web_drop_target_mac.mm index 9aefc196a..64145a787 100644 --- a/cef1/libcef/web_drop_target_mac.mm +++ b/cef1/libcef/web_drop_target_mac.mm @@ -119,7 +119,8 @@ using WebKit::WebView; webview->dragTargetDragEnter(drop_data.ToDragData(), WebPoint(viewPoint.x, viewPoint.y), WebPoint(screenPoint.x, screenPoint.y), - static_cast(mask)); + static_cast(mask), + 0); return static_cast(op); } @@ -164,7 +165,8 @@ using WebKit::WebView; WebDragOperation op = webview->dragTargetDragOver(WebPoint(viewPoint.x, viewPoint.y), WebPoint(screenPoint.x, screenPoint.y), - static_cast(mask)); + static_cast(mask), + 0); return static_cast(op); } @@ -198,7 +200,8 @@ using WebKit::WebView; view_.browser->set_is_dropping(true); webview->dragTargetDrop(gfx::Point(viewPoint.x, viewPoint.y), - gfx::Point(screenPoint.x, screenPoint.y)); + gfx::Point(screenPoint.x, screenPoint.y), + 0); view_.browser->set_is_dropping(false); return YES; diff --git a/cef1/libcef/web_drop_target_win.cc b/cef1/libcef/web_drop_target_win.cc index aa1b29599..0a240871b 100644 --- a/cef1/libcef/web_drop_target_win.cc +++ b/cef1/libcef/web_drop_target_win.cc @@ -110,7 +110,8 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object, drop_data.ToDragData(), WebPoint(client_pt.x, client_pt.y), WebPoint(cursor_position.x, cursor_position.y), - mask); + mask, + 0); } else { operation = WebDragOperationNone; } @@ -136,7 +137,8 @@ DWORD WebDropTarget::OnDragOver(IDataObject* data_object, operation = browser_->UIT_GetWebView()->dragTargetDragOver( WebPoint(client_pt.x, client_pt.y), WebPoint(cursor_position.x, cursor_position.y), - web_drag_utils_win::WinDragOpMaskToWebDragOpMask(effects)); + web_drag_utils_win::WinDragOpMaskToWebDragOpMask(effects), + 0); } else { operation = WebDragOperationNone; } @@ -171,7 +173,8 @@ DWORD WebDropTarget::OnDrop(IDataObject* data_object, if (browser_->UIT_GetWebView()) { browser_->UIT_GetWebView()->dragTargetDrop( WebPoint(client_pt.x, client_pt.y), - WebPoint(cursor_position.x, cursor_position.y)); + WebPoint(cursor_position.x, cursor_position.y), + 0); } browser_->set_is_dropping(false); diff --git a/cef1/libcef/webwidget_host.cc b/cef1/libcef/webwidget_host.cc index c1ae0be65..a1ddc399f 100644 --- a/cef1/libcef/webwidget_host.cc +++ b/cef1/libcef/webwidget_host.cc @@ -33,7 +33,7 @@ void WebWidgetHost::ScheduleComposite() { // Maintain the desired rate. MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&WebWidgetHost::Invalidate, weak_factory_.GetWeakPtr()), - kDesiredRate - actualRate); + base::TimeDelta::FromMilliseconds(kDesiredRate - actualRate)); } } diff --git a/cef1/libcef/webwidget_host_win.cc b/cef1/libcef/webwidget_host_win.cc index 15810f6e2..023ac1c22 100644 --- a/cef1/libcef/webwidget_host_win.cc +++ b/cef1/libcef/webwidget_host_win.cc @@ -283,7 +283,7 @@ void WebWidgetHost::DidInvalidateRect(const gfx::Rect& damaged_rect) { CefThread::PostDelayedTask(CefThread::UI, FROM_HERE, base::Bind(&WebWidgetHost::UpdateInputMethod, weak_factory_.GetWeakPtr()), - 100); + base::TimeDelta::FromMilliseconds(100)); } } diff --git a/cef1/patch/patches/base.patch b/cef1/patch/patches/base.patch index 249de41f2..e9cb9cc3a 100644 --- a/cef1/patch/patches/base.patch +++ b/cef1/patch/patches/base.patch @@ -1,8 +1,8 @@ Index: message_loop.cc =================================================================== ---- message_loop.cc (revision 140240) +--- message_loop.cc (revision 149431) +++ message_loop.cc (working copy) -@@ -369,9 +369,13 @@ +@@ -364,9 +364,13 @@ } void MessageLoop::AssertIdle() const { @@ -19,9 +19,9 @@ Index: message_loop.cc bool MessageLoop::is_running() const { Index: message_loop.h =================================================================== ---- message_loop.h (revision 140240) +--- message_loop.h (revision 149431) +++ message_loop.h (working copy) -@@ -347,6 +347,9 @@ +@@ -367,6 +367,9 @@ // Asserts that the MessageLoop is "idle". void AssertIdle() const;