From 0930631a5f207cb69ff946891243276bc6e921ca Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 4 Apr 2012 22:32:24 +0000 Subject: [PATCH] Update to Chromium revision 129376. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@579 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- cef1/CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- cef1/cef.gyp | 2 + cef1/include/internal/cef_types.h | 6 -- cef1/include/internal/cef_types_wrappers.h | 1 - cef1/libcef/browser_database_system.cc | 2 +- cef1/libcef/browser_drag_delegate_win.cc | 2 +- cef1/libcef/browser_file_system.cc | 78 +++++++++++++- cef1/libcef/browser_file_system.h | 22 ++++ cef1/libcef/browser_network_delegate.cc | 100 ++++++++++++++++++ cef1/libcef/browser_network_delegate.h | 57 ++++++++++ .../libcef/browser_persistent_cookie_store.cc | 30 ++---- cef1/libcef/browser_persistent_cookie_store.h | 2 +- cef1/libcef/browser_request_context.cc | 28 ++--- cef1/libcef/browser_request_context.h | 4 - cef1/libcef/browser_request_context_proxy.cc | 2 +- cef1/libcef/browser_resource_loader_bridge.cc | 39 ++----- cef1/libcef/browser_settings.cc | 1 - cef1/libcef/browser_webcookiejar_impl.cc | 2 +- cef1/libcef/browser_webkit_glue.cc | 9 +- cef1/libcef/browser_webkit_glue.h | 1 + cef1/libcef/browser_webkit_init.cc | 12 ++- cef1/libcef/browser_webview_delegate.cc | 22 ++-- cef1/libcef/browser_webview_delegate.h | 10 +- cef1/libcef/cef_process_io_thread.cc | 11 ++ cef1/libcef/cef_process_io_thread.h | 5 + cef1/libcef/cef_thread.cc | 35 +++++- cef1/libcef/cef_thread.h | 9 ++ cef1/libcef/cookie_manager_impl.h | 2 +- cef1/libcef/cookie_store_proxy.h | 2 +- cef1/libcef/printing/print_settings.cc | 2 +- cef1/libcef/scheme_impl.cc | 12 ++- cef1/libcef/simple_clipboard_impl.cc | 4 + cef1/libcef/simple_clipboard_impl.h | 1 + cef1/patch/patch.cfg | 5 - .../patches/webcore_cachedresource.patch | 14 --- cef1/tests/cefclient/cefclient.cpp | 2 - cef1/tests/cefclient/cefclient_switches.cpp | 1 - cef1/tests/cefclient/cefclient_switches.h | 1 - cef1/tools/distrib/win/README.txt | 4 +- 39 files changed, 404 insertions(+), 140 deletions(-) create mode 100644 cef1/libcef/browser_network_delegate.cc create mode 100644 cef1/libcef/browser_network_delegate.h delete mode 100644 cef1/patch/patches/webcore_cachedresource.patch diff --git a/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt b/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt index 9bdc0002e..279ecab4f 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': '122508', + 'chromium_revision': '129376', } diff --git a/cef1/cef.gyp b/cef1/cef.gyp index b39dd4faa..6312bebb2 100644 --- a/cef1/cef.gyp +++ b/cef1/cef.gyp @@ -675,6 +675,8 @@ 'libcef/browser_impl.h', 'libcef/browser_navigation_controller.cc', 'libcef/browser_navigation_controller.h', + 'libcef/browser_network_delegate.cc', + 'libcef/browser_network_delegate.h', 'libcef/browser_persistent_cookie_store.cc', 'libcef/browser_persistent_cookie_store.h', 'libcef/browser_request_context.cc', diff --git a/cef1/include/internal/cef_types.h b/cef1/include/internal/cef_types.h index 951bd79a7..1cecb5e63 100644 --- a/cef1/include/internal/cef_types.h +++ b/cef1/include/internal/cef_types.h @@ -397,12 +397,6 @@ typedef struct _cef_browser_settings_t { /// bool accelerated_compositing_enabled; - /// - // Set to true (1) to enable threaded compositing. This is currently only - // supported by the command buffer graphics implementation. - /// - bool threaded_compositing_enabled; - /// // Set to true (1) to disable accelerated layers. This affects features like // 3D CSS transforms. diff --git a/cef1/include/internal/cef_types_wrappers.h b/cef1/include/internal/cef_types_wrappers.h index 2f1cbd9c5..10e37346e 100644 --- a/cef1/include/internal/cef_types_wrappers.h +++ b/cef1/include/internal/cef_types_wrappers.h @@ -395,7 +395,6 @@ struct CefBrowserSettingsTraits { target->webgl_disabled = src->webgl_disabled; target->accelerated_compositing_enabled = src->accelerated_compositing_enabled; - target->threaded_compositing_enabled = src->threaded_compositing_enabled; target->accelerated_layers_disabled = src->accelerated_layers_disabled; target->accelerated_video_disabled = src->accelerated_video_disabled; target->accelerated_2d_canvas_disabled = diff --git a/cef1/libcef/browser_database_system.cc b/cef1/libcef/browser_database_system.cc index 06cee2fb0..634627a3c 100644 --- a/cef1/libcef/browser_database_system.cc +++ b/cef1/libcef/browser_database_system.cc @@ -39,7 +39,7 @@ BrowserDatabaseSystem::BrowserDatabaseSystem() instance_ = this; CHECK(temp_dir_.CreateUniqueTempDir()); db_tracker_ = - new DatabaseTracker(temp_dir_.path(), false, false, NULL, NULL, NULL); + new DatabaseTracker(temp_dir_.path(), false, NULL, NULL, NULL); db_tracker_->AddObserver(this); db_thread_.Start(); db_thread_proxy_ = db_thread_.message_loop_proxy(); diff --git a/cef1/libcef/browser_drag_delegate_win.cc b/cef1/libcef/browser_drag_delegate_win.cc index 51c48228a..8f12b2874 100644 --- a/cef1/libcef/browser_drag_delegate_win.cc +++ b/cef1/libcef/browser_drag_delegate_win.cc @@ -25,7 +25,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" -#include "ui/views/drag_utils.h" +#include "ui/base/dragdrop/drag_utils.h" #include "webkit/glue/webdropdata.h" using WebKit::WebDragOperationsMask; diff --git a/cef1/libcef/browser_file_system.cc b/cef1/libcef/browser_file_system.cc index 5f813b5d0..8a188fd3c 100644 --- a/cef1/libcef/browser_file_system.cc +++ b/cef1/libcef/browser_file_system.cc @@ -13,6 +13,7 @@ #include "base/time.h" #include "base/utf_string_conversions.h" #include "googleurl/src/gurl.h" +#include "net/base/mime_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h" @@ -21,9 +22,9 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" #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/mock_file_system_options.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/tools/test_shell/simple_file_writer.h" using base::WeakPtr; @@ -39,19 +40,41 @@ using WebKit::WebString; using WebKit::WebURL; using WebKit::WebVector; +using webkit_blob::BlobData; +using webkit_blob::BlobStorageController; using fileapi::FileSystemContext; using fileapi::FileSystemOperationInterface; -BrowserFileSystem::BrowserFileSystem() { +namespace { +MessageLoop* g_io_thread; +webkit_blob::BlobStorageController* g_blob_storage_controller; + +void RegisterBlob(const GURL& blob_url, const FilePath& file_path) { + DCHECK(g_blob_storage_controller); + + FilePath::StringType extension = file_path.Extension(); + if (!extension.empty()) + extension = extension.substr(1); // Strip leading ".". + + // This may fail, but then we'll be just setting the empty mime type. + std::string mime_type; + net::GetWellKnownMimeTypeFromExtension(extension, &mime_type); + + BlobData::Item item; + item.SetToFile(file_path, 0, -1, base::Time()); + g_blob_storage_controller->StartBuildingBlob(blob_url); + g_blob_storage_controller->AppendBlobDataItem(blob_url, item); + g_blob_storage_controller->FinishBuildingBlob(blob_url, mime_type); } -BrowserFileSystem::~BrowserFileSystem() { +} // namespace + +BrowserFileSystem::BrowserFileSystem() { } void BrowserFileSystem::CreateContext() { if (file_system_context_.get()) return; - if (file_system_dir_.CreateUniqueTempDir()) { std::vector additional_allowed_schemes; additional_allowed_schemes.push_back("file"); @@ -71,6 +94,9 @@ void BrowserFileSystem::CreateContext() { } } +BrowserFileSystem::~BrowserFileSystem() { +} + void BrowserFileSystem::OpenFileSystem( WebFrame* frame, WebFileSystem::Type web_filesystem_type, long long, bool create, // NOLINT(runtime/int) @@ -161,6 +187,27 @@ WebFileWriter* BrowserFileSystem::createFileWriter( return new BrowserFileWriter(path, client, file_system_context_.get()); } +void BrowserFileSystem::createSnapshotFileAndReadMetadata( + const WebURL& blobURL, + const WebURL& path, + WebFileSystemCallbacks* callbacks) { + GetNewOperation(path)->CreateSnapshotFile( + path, SnapshotFileHandler(blobURL, callbacks)); +} + +// static +void BrowserFileSystem::InitializeOnIOThread( + webkit_blob::BlobStorageController* blob_storage_controller) { + g_io_thread = MessageLoop::current(); + g_blob_storage_controller = blob_storage_controller; +} + +// static +void BrowserFileSystem::CleanupOnIOThread() { + g_io_thread = NULL; + g_blob_storage_controller = NULL; +} + FileSystemOperationInterface* BrowserFileSystem::GetNewOperation( const WebURL& url) { return file_system_context_->CreateFileSystemOperation( @@ -192,6 +239,13 @@ BrowserFileSystem::OpenFileSystemHandler(WebFileSystemCallbacks* callbacks) { AsWeakPtr(), base::Unretained(callbacks)); } +FileSystemOperationInterface::SnapshotFileCallback +BrowserFileSystem::SnapshotFileHandler(const GURL& blob_url, + WebFileSystemCallbacks* callbacks) { + return base::Bind(&BrowserFileSystem::DidCreateSnapshotFile, + AsWeakPtr(), blob_url, base::Unretained(callbacks)); +} + void BrowserFileSystem::DidFinish(WebFileSystemCallbacks* callbacks, base::PlatformFileError result) { if (result == base::PLATFORM_FILE_OK) @@ -252,3 +306,19 @@ void BrowserFileSystem::DidOpenFileSystem( callbacks->didFail(webkit_glue::PlatformFileErrorToWebFileError(result)); } } + +void BrowserFileSystem::DidCreateSnapshotFile( + const GURL& blob_url, + WebFileSystemCallbacks* callbacks, + base::PlatformFileError result, + const base::PlatformFileInfo& info, + const FilePath& platform_path, + const scoped_refptr& file_ref) { + DCHECK(g_io_thread); + if (result == base::PLATFORM_FILE_OK) { + g_io_thread->PostTask( + FROM_HERE, + base::Bind(&RegisterBlob, blob_url, platform_path)); + } + DidGetMetadata(callbacks, result, info, platform_path); +} diff --git a/cef1/libcef/browser_file_system.h b/cef1/libcef/browser_file_system.h index 1cd10152b..92be43d45 100644 --- a/cef1/libcef/browser_file_system.h +++ b/cef1/libcef/browser_file_system.h @@ -27,6 +27,10 @@ namespace fileapi { class FileSystemContext; } +namespace webkit_blob { +class BlobStorageController; +} + class BrowserFileSystem : public WebKit::WebFileSystem, public base::SupportsWeakPtr { @@ -83,6 +87,14 @@ class BrowserFileSystem WebKit::WebFileSystemCallbacks*) OVERRIDE; virtual WebKit::WebFileWriter* createFileWriter( const WebKit::WebURL& path, WebKit::WebFileWriterClient*) OVERRIDE; + virtual void createSnapshotFileAndReadMetadata( + const WebKit::WebURL& blobURL, + const WebKit::WebURL& path, + WebKit::WebFileSystemCallbacks* callbacks) OVERRIDE; + + static void InitializeOnIOThread( + webkit_blob::BlobStorageController* blob_storage_controller); + static void CleanupOnIOThread(); private: // Helpers. @@ -98,6 +110,9 @@ class BrowserFileSystem ReadDirectoryHandler(WebKit::WebFileSystemCallbacks* callbacks); fileapi::FileSystemContext::OpenFileSystemCallback OpenFileSystemHandler( WebKit::WebFileSystemCallbacks* callbacks); + fileapi::FileSystemOperationInterface::SnapshotFileCallback + SnapshotFileHandler(const GURL& blob_url, + WebKit::WebFileSystemCallbacks* callbacks); void DidFinish(WebKit::WebFileSystemCallbacks* callbacks, base::PlatformFileError result); void DidGetMetadata(WebKit::WebFileSystemCallbacks* callbacks, @@ -112,6 +127,13 @@ class BrowserFileSystem void DidOpenFileSystem(WebKit::WebFileSystemCallbacks* callbacks, base::PlatformFileError result, const std::string& name, const GURL& root); + void DidCreateSnapshotFile( + const GURL& blob_url, + WebKit::WebFileSystemCallbacks* callbacks, + base::PlatformFileError result, + const base::PlatformFileInfo& info, + const FilePath& platform_path, + const scoped_refptr& file_ref); // A temporary directory for FileSystem API. ScopedTempDir file_system_dir_; diff --git a/cef1/libcef/browser_network_delegate.cc b/cef1/libcef/browser_network_delegate.cc new file mode 100644 index 000000000..dde9bc20b --- /dev/null +++ b/cef1/libcef/browser_network_delegate.cc @@ -0,0 +1,100 @@ +// Copyright (c) 2012 The Chromium Embedded Framework Authors. +// Portions copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "libcef/browser_network_delegate.h" + +#include "net/base/net_errors.h" +#include "net/base/static_cookie_policy.h" +#include "net/urL_request/urL_request.h" + +BrowserNetworkDelegate::BrowserNetworkDelegate() + : accept_all_cookies_(true) { +} + +BrowserNetworkDelegate::~BrowserNetworkDelegate() { +} + +int BrowserNetworkDelegate::OnBeforeURLRequest( + net::URLRequest* request, + const net::CompletionCallback& callback, + GURL* new_url) { + return net::OK; +} + +int BrowserNetworkDelegate::OnBeforeSendHeaders( + net::URLRequest* request, + const net::CompletionCallback& callback, + net::HttpRequestHeaders* headers) { + return net::OK; +} + +void BrowserNetworkDelegate::OnSendHeaders( + net::URLRequest* request, + const net::HttpRequestHeaders& headers) { +} + +int BrowserNetworkDelegate::OnHeadersReceived( + net::URLRequest* request, + const net::CompletionCallback& callback, + net::HttpResponseHeaders* original_response_headers, + scoped_refptr*override_response_headers) { + return net::OK; +} + +void BrowserNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, + const GURL& new_location) { +} + +void BrowserNetworkDelegate::OnResponseStarted(net::URLRequest* request) { +} + +void BrowserNetworkDelegate::OnRawBytesRead(const net::URLRequest& request, + int bytes_read) { +} +void BrowserNetworkDelegate::OnCompleted(net::URLRequest* request, + bool started) { +} + +void BrowserNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) { +} + +void BrowserNetworkDelegate::OnPACScriptError(int line_number, + const string16& error) { +} + +net::NetworkDelegate::AuthRequiredResponse + BrowserNetworkDelegate::OnAuthRequired( + net::URLRequest* request, + const net::AuthChallengeInfo& auth_info, + const AuthCallback& callback, + net::AuthCredentials* credentials) { + return AUTH_REQUIRED_RESPONSE_NO_ACTION; +} + +bool BrowserNetworkDelegate::CanGetCookies( + const net::URLRequest* request, + const net::CookieList& cookie_list) { + net::StaticCookiePolicy::Type policy_type = accept_all_cookies_ ? + net::StaticCookiePolicy::ALLOW_ALL_COOKIES : + net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; + + net::StaticCookiePolicy policy(policy_type); + int rv = policy.CanGetCookies( + request->url(), request->first_party_for_cookies()); + return rv == net::OK; +} + +bool BrowserNetworkDelegate::CanSetCookie(const net::URLRequest* request, + const std::string& cookie_line, + net::CookieOptions* options) { + net::StaticCookiePolicy::Type policy_type = accept_all_cookies_ ? + net::StaticCookiePolicy::ALLOW_ALL_COOKIES : + net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; + + net::StaticCookiePolicy policy(policy_type); + int rv = policy.CanSetCookie( + request->url(), request->first_party_for_cookies()); + return rv == net::OK; +} diff --git a/cef1/libcef/browser_network_delegate.h b/cef1/libcef/browser_network_delegate.h new file mode 100644 index 000000000..149d2db39 --- /dev/null +++ b/cef1/libcef/browser_network_delegate.h @@ -0,0 +1,57 @@ +// Copyright (c) 2012 The Chromium Embedded Framework Authors. +// Portions copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CEF_LIBCEF_BROWSER_NETWORK_DELEGATE_H +#define CEF_LIBCEF_BROWSER_NETWORK_DELEGATE_H +#pragma once + +#include "net/base/network_delegate.h" + +class BrowserNetworkDelegate : public net::NetworkDelegate { + public: + BrowserNetworkDelegate(); + virtual ~BrowserNetworkDelegate(); + + private: + // net::NetworkDelegate implementation. + virtual int OnBeforeURLRequest(net::URLRequest* request, + const net::CompletionCallback& callback, + GURL* new_url) OVERRIDE; + virtual int OnBeforeSendHeaders(net::URLRequest* request, + const net::CompletionCallback& callback, + net::HttpRequestHeaders* headers) OVERRIDE; + virtual void OnSendHeaders(net::URLRequest* request, + const net::HttpRequestHeaders& headers) OVERRIDE; + virtual int OnHeadersReceived( + net::URLRequest* request, + const net::CompletionCallback& callback, + net::HttpResponseHeaders* original_response_headers, + scoped_refptr* + override_response_headers) OVERRIDE; + virtual void OnBeforeRedirect(net::URLRequest* request, + const GURL& new_location) OVERRIDE; + virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; + virtual void OnRawBytesRead(const net::URLRequest& request, + int bytes_read) OVERRIDE; + virtual void OnCompleted(net::URLRequest* request, bool started) OVERRIDE; + virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; + virtual void OnPACScriptError(int line_number, + const string16& error) OVERRIDE; + virtual AuthRequiredResponse OnAuthRequired( + net::URLRequest* request, + const net::AuthChallengeInfo& auth_info, + const AuthCallback& callback, + net::AuthCredentials* credentials) OVERRIDE; + virtual bool CanGetCookies( + const net::URLRequest* request, + const net::CookieList& cookie_list) OVERRIDE; + virtual bool CanSetCookie(const net::URLRequest* request, + const std::string& cookie_line, + net::CookieOptions* options) OVERRIDE; + + bool accept_all_cookies_; +}; + +#endif // CEF_LIBCEF_BROWSER_NETWORK_DELEGATE_H diff --git a/cef1/libcef/browser_persistent_cookie_store.cc b/cef1/libcef/browser_persistent_cookie_store.cc index 01b3052f4..4bbf6d48d 100644 --- a/cef1/libcef/browser_persistent_cookie_store.cc +++ b/cef1/libcef/browser_persistent_cookie_store.cc @@ -5,6 +5,7 @@ #include "libcef/browser_persistent_cookie_store.h" +#include #include #include #include @@ -227,12 +228,10 @@ bool InitTable(sql::Connection* db) { return false; } - // Try to create the index every time. Older versions did not have this index, - // so we want those people to get it. - if (!db->Execute("CREATE INDEX IF NOT EXISTS cookie_times ON cookies" - " (creation_utc)")) { + // Older code created an index on creation_utc, which is already + // primary key for the table. + if (!db->Execute("DROP INDEX IF EXISTS cookie_times")) return false; - } if (!db->Execute("CREATE INDEX IF NOT EXISTS domain ON cookies(host_key)")) return false; @@ -346,7 +345,6 @@ bool BrowserPersistentCookieStore::Backend::InitializeDatabase() { "SELECT DISTINCT host_key FROM cookies")); if (!smt.is_valid()) { - NOTREACHED() << "select statement prep failed"; smt.Clear(); // Disconnect smt_ref from db_. db_.reset(); return false; @@ -594,7 +592,8 @@ void BrowserPersistentCookieStore::Backend::BatchOperation( // We've gotten our first entry for this batch, fire off the timer. CefThread::PostDelayedTask( CefThread::FILE, FROM_HERE, - base::Bind(&Backend::Commit, this), kCommitIntervalMs); + base::Bind(&Backend::Commit, this), + base::TimeDelta::FromMilliseconds(kCommitIntervalMs)); } else if (num_pending == kCommitAfterBatchSize) { // We've reached a big enough batch, fire off a commit now. CefThread::PostTask( @@ -622,30 +621,23 @@ void BrowserPersistentCookieStore::Backend::Commit() { "expires_utc, secure, httponly, last_access_utc, has_expires, " "persistent) " "VALUES (?,?,?,?,?,?,?,?,?,?,?)")); - if (!add_smt) { - NOTREACHED(); + if (!add_smt.is_valid()) return; - } sql::Statement update_access_smt(db_->GetCachedStatement(SQL_FROM_HERE, "UPDATE cookies SET last_access_utc=? WHERE creation_utc=?")); - if (!update_access_smt) { - NOTREACHED(); + if (!update_access_smt.is_valid()) return; - } sql::Statement del_smt(db_->GetCachedStatement(SQL_FROM_HERE, "DELETE FROM cookies WHERE creation_utc=?")); - if (!del_smt) { - NOTREACHED(); + if (!del_smt.is_valid()) return; - } sql::Transaction transaction(db_.get()); - if (!transaction.Begin()) { - NOTREACHED(); + if (!transaction.Begin()) return; - } + for (PendingOperationsList::iterator it = ops.begin(); it != ops.end(); ++it) { // Free the cookies as we commit them to the database. diff --git a/cef1/libcef/browser_persistent_cookie_store.h b/cef1/libcef/browser_persistent_cookie_store.h index 61fafa5bc..4f3d77179 100644 --- a/cef1/libcef/browser_persistent_cookie_store.h +++ b/cef1/libcef/browser_persistent_cookie_store.h @@ -19,7 +19,7 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "net/base/cookie_monster.h" +#include "net/cookies/cookie_monster.h" class FilePath; class Task; diff --git a/cef1/libcef/browser_request_context.cc b/cef1/libcef/browser_request_context.cc index 12cab888f..e503aa8e9 100644 --- a/cef1/libcef/browser_request_context.cc +++ b/cef1/libcef/browser_request_context.cc @@ -20,10 +20,10 @@ #include "base/file_util.h" #include "build/build_config.h" #include "net/base/cert_verifier.h" -#include "net/base/cookie_monster.h" -#include "net/base/default_origin_bound_cert_store.h" +#include "net/cookies/cookie_monster.h" +#include "net/base/default_server_bound_cert_store.h" #include "net/base/host_resolver.h" -#include "net/base/origin_bound_cert_service.h" +#include "net/base/server_bound_cert_service.h" #include "net/base/ssl_config_service_defaults.h" #include "net/ftp/ftp_network_layer.h" #include "net/http/http_auth_handler_factory.h" @@ -129,8 +129,7 @@ net::ProxyConfigService* CreateProxyConfigService() { BrowserRequestContext::BrowserRequestContext() - : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)), - accept_all_cookies_(true) { + : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { Init(FilePath(), net::HttpCache::NORMAL, false); } @@ -138,8 +137,7 @@ BrowserRequestContext::BrowserRequestContext( const FilePath& cache_path, net::HttpCache::Mode cache_mode, bool no_proxy) - : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)), - accept_all_cookies_(true) { + : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { Init(cache_path, cache_mode, no_proxy); } @@ -158,8 +156,8 @@ void BrowserRequestContext::Init( SetCookieStoragePath(cache_path); - storage_.set_origin_bound_cert_service(new net::OriginBoundCertService( - new net::DefaultOriginBoundCertStore(NULL))); + storage_.set_server_bound_cert_service(new net::ServerBoundCertService( + new net::DefaultServerBoundCertStore(NULL))); // hard-code A-L and A-C for test shells set_accept_language("en-us,en"); @@ -216,7 +214,7 @@ void BrowserRequestContext::Init( net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, net::HostResolver::kDefaultRetryAttempts, NULL)); - storage_.set_cert_verifier(new net::CertVerifier); + storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); // Add support for single sign-on. @@ -244,7 +242,7 @@ void BrowserRequestContext::Init( net::HttpCache* cache = new net::HttpCache(host_resolver(), cert_verifier(), - origin_bound_cert_service(), + server_bound_cert_service(), NULL, // transport_security_state proxy_service(), "", // ssl_session_cache_shard @@ -290,14 +288,6 @@ void BrowserRequestContext::Init( BrowserRequestContext::~BrowserRequestContext() { } -void BrowserRequestContext::SetAcceptAllCookies(bool accept_all_cookies) { - accept_all_cookies_ = accept_all_cookies; -} - -bool BrowserRequestContext::AcceptAllCookies() { - return accept_all_cookies_; -} - void BrowserRequestContext::SetCookieStoragePath(const FilePath& path) { REQUIRE_IOT(); diff --git a/cef1/libcef/browser_request_context.h b/cef1/libcef/browser_request_context.h index 69eead3d8..e8b05a21a 100644 --- a/cef1/libcef/browser_request_context.h +++ b/cef1/libcef/browser_request_context.h @@ -36,9 +36,6 @@ class BrowserRequestContext : public net::URLRequestContext { virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE; - void SetAcceptAllCookies(bool accept_all_cookies); - bool AcceptAllCookies(); - // Set the path used for cookie storage. If |path| is empty memory only // storage will be used. If the old cookie data is being stored on disk it // will be flushed and closed. @@ -57,7 +54,6 @@ class BrowserRequestContext : public net::URLRequestContext { scoped_ptr url_security_manager_; scoped_ptr url_request_interceptor_; FilePath cookie_store_path_; - bool accept_all_cookies_; }; #endif // CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_H_ diff --git a/cef1/libcef/browser_request_context_proxy.cc b/cef1/libcef/browser_request_context_proxy.cc index 444464ab2..996964ee0 100644 --- a/cef1/libcef/browser_request_context_proxy.cc +++ b/cef1/libcef/browser_request_context_proxy.cc @@ -21,7 +21,7 @@ BrowserRequestContextProxy::BrowserRequestContextProxy( set_net_log(context->net_log()); set_host_resolver(context->host_resolver()); set_cert_verifier(context->cert_verifier()); - set_origin_bound_cert_service(context->origin_bound_cert_service()); + set_server_bound_cert_service(context->server_bound_cert_service()); set_fraudulent_certificate_reporter( context->fraudulent_certificate_reporter()); set_proxy_service(context->proxy_service()); diff --git a/cef1/libcef/browser_resource_loader_bridge.cc b/cef1/libcef/browser_resource_loader_bridge.cc index cdb77f20b..4940676c3 100644 --- a/cef1/libcef/browser_resource_loader_bridge.cc +++ b/cef1/libcef/browser_resource_loader_bridge.cc @@ -68,7 +68,7 @@ #include "net/url_request/url_request_redirect_job.h" #include "webkit/appcache/appcache_interfaces.h" #include "webkit/blob/blob_storage_controller.h" -#include "webkit/blob/deletable_file_reference.h" +#include "webkit/blob/shareable_file_reference.h" #include "webkit/fileapi/file_system_context.h" #include "webkit/fileapi/file_system_dir_url_request_job.h" #include "webkit/fileapi/file_system_url_request_job.h" @@ -81,7 +81,7 @@ using net::HttpResponseHeaders; using net::StaticCookiePolicy; using net::URLRequestStatus; -using webkit_blob::DeletableFileReference; +using webkit_blob::ShareableFileReference; using webkit_glue::ResourceLoaderBridge; using webkit_glue::ResourceResponseInfo; @@ -578,8 +578,9 @@ class RequestProxy : public net::URLRequest::Delegate, if (download_to_file_) { FilePath path; if (file_util::CreateTemporaryFile(&path)) { - downloaded_file_ = DeletableFileReference::GetOrCreate( - path, base::MessageLoopProxy::current()); + downloaded_file_ = ShareableFileReference::GetOrCreate( + path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, + base::MessageLoopProxy::current()); file_stream_.OpenSync( path, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE); } @@ -778,34 +779,6 @@ class RequestProxy : public net::URLRequest::Delegate, request->ContinueDespiteLastError(); } - virtual bool CanGetCookies( - const net::URLRequest* request, - const net::CookieList& cookie_list) const OVERRIDE { - StaticCookiePolicy::Type policy_type = - _Context->request_context()->AcceptAllCookies() ? - StaticCookiePolicy::ALLOW_ALL_COOKIES : - StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; - - StaticCookiePolicy policy(policy_type); - int rv = policy.CanGetCookies( - request->url(), request->first_party_for_cookies()); - return rv == net::OK; - } - - virtual bool CanSetCookie(const net::URLRequest* request, - const std::string& cookie_line, - net::CookieOptions* options) const OVERRIDE { - StaticCookiePolicy::Type policy_type = - _Context->request_context()->AcceptAllCookies() ? - StaticCookiePolicy::ALLOW_ALL_COOKIES : - StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; - - StaticCookiePolicy policy(policy_type); - int rv = policy.CanSetCookie( - request->url(), request->first_party_for_cookies()); - return rv == net::OK; - } - virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) OVERRIDE { if (request->status().is_success() && bytes_read > 0) { @@ -894,7 +867,7 @@ class RequestProxy : public net::URLRequest::Delegate, // Support for request.download_to_file behavior. bool download_to_file_; net::FileStream file_stream_; - scoped_refptr downloaded_file_; + scoped_refptr downloaded_file_; // Size of our async IO data buffers. Limited by the sanity check in // URLRequestJob::Read(). diff --git a/cef1/libcef/browser_settings.cc b/cef1/libcef/browser_settings.cc index 49641116f..ea0da05a7 100644 --- a/cef1/libcef/browser_settings.cc +++ b/cef1/libcef/browser_settings.cc @@ -125,7 +125,6 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) { web.experimental_webgl_enabled = !cef.webgl_disabled; web.show_composited_layer_borders = false; web.accelerated_compositing_enabled = cef.accelerated_compositing_enabled; - web.threaded_compositing_enabled = cef.threaded_compositing_enabled; web.accelerated_layers_enabled = !cef.accelerated_layers_disabled; web.accelerated_animation_enabled = !cef.accelerated_layers_disabled; web.accelerated_video_enabled = !cef.accelerated_video_disabled; diff --git a/cef1/libcef/browser_webcookiejar_impl.cc b/cef1/libcef/browser_webcookiejar_impl.cc index d929de6d4..9a99fe1e3 100644 --- a/cef1/libcef/browser_webcookiejar_impl.cc +++ b/cef1/libcef/browser_webcookiejar_impl.cc @@ -14,7 +14,7 @@ #include "libcef/cef_thread.h" #include "base/synchronization/waitable_event.h" -#include "net/base/cookie_store.h" +#include "net/cookies/cookie_store.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" using WebKit::WebString; diff --git a/cef1/libcef/browser_webkit_glue.cc b/cef1/libcef/browser_webkit_glue.cc index c27cebea3..3300c59da 100644 --- a/cef1/libcef/browser_webkit_glue.cc +++ b/cef1/libcef/browser_webkit_glue.cc @@ -20,6 +20,7 @@ MSVC_POP_WARNING(); #include "base/string_util.h" #include "net/base/mime_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" #include "webkit/glue/user_agent.h" #include "webkit/glue/webkit_glue.h" @@ -137,6 +138,7 @@ bool IsPluginEnabled(const webkit::WebPluginInfo& plugin) { WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( cef_graphics_implementation_t graphics_implementation, const WebKit::WebGraphicsContext3D::Attributes& attributes, + WebKit::WebView* web_view, bool renderDirectlyToWebView) { #if defined(OS_WIN) bool use_command_buffer = @@ -148,15 +150,18 @@ 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, NULL, renderDirectlyToWebView)) + if (!context->Initialize(attributes, view_context)) return NULL; return context.release(); } else { return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( - attributes, NULL, renderDirectlyToWebView); + attributes, renderDirectlyToWebView); } } diff --git a/cef1/libcef/browser_webkit_glue.h b/cef1/libcef/browser_webkit_glue.h index 412bfb5e1..146b4e7e8 100644 --- a/cef1/libcef/browser_webkit_glue.h +++ b/cef1/libcef/browser_webkit_glue.h @@ -58,6 +58,7 @@ bool IsPluginEnabled(const webkit::WebPluginInfo& plugin); WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( cef_graphics_implementation_t graphics_implementation, const WebKit::WebGraphicsContext3D::Attributes& attributes, + WebKit::WebView* web_view, bool renderDirectlyToWebView); } // namespace webkit_glue diff --git a/cef1/libcef/browser_webkit_init.cc b/cef1/libcef/browser_webkit_init.cc index ddfec887d..2463329c0 100644 --- a/cef1/libcef/browser_webkit_init.cc +++ b/cef1/libcef/browser_webkit_init.cc @@ -198,14 +198,22 @@ WebKit::WebString BrowserWebKitInit::defaultLocale() { WebKit::WebStorageNamespace* BrowserWebKitInit::createLocalStorageNamespace( const WebKit::WebString& path, unsigned quota) { +#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND + NOTREACHED(); +#else return new BrowserWebStorageNamespaceImpl(DOM_STORAGE_LOCAL); +#endif } void BrowserWebKitInit::dispatchStorageEvent(const WebKit::WebString& key, const WebKit::WebString& old_value, const WebKit::WebString& new_value, const WebKit::WebString& origin, const WebKit::WebURL& url, bool is_local_storage) { - // The event is dispatched by the proxy. + // All events are dispatched by the WebCore::StorageAreaProxy in the + // simple single process case. +#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND + NOTREACHED(); +#endif } WebKit::WebIDBFactory* BrowserWebKitInit::idbFactory() { @@ -238,7 +246,7 @@ BrowserWebKitInit::createOffscreenGraphicsContext3D( const WebKit::WebGraphicsContext3D::Attributes& attributes) { const CefSettings& settings = _Context->settings(); return webkit_glue::CreateGraphicsContext3D(settings.graphics_implementation, - attributes, false); + attributes, NULL, false); } void BrowserWebKitInit::GetPlugins( diff --git a/cef1/libcef/browser_webview_delegate.cc b/cef1/libcef/browser_webview_delegate.cc index 31ef72c32..41feaa4ce 100644 --- a/cef1/libcef/browser_webview_delegate.cc +++ b/cef1/libcef/browser_webview_delegate.cc @@ -32,7 +32,7 @@ #include "base/stringprintf.h" #include "media/base/filter_collection.h" #include "media/base/media_log.h" -#include "media/base/message_loop_factory_impl.h" +#include "media/base/message_loop_factory.h" #include "media/filters/null_audio_renderer.h" #include "net/base/net_errors.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" @@ -168,7 +168,7 @@ void TranslatePopupFeatures(const WebWindowFeatures& webKitFeatures, WebView* BrowserWebViewDelegate::createView(WebFrame* creator, const WebURLRequest& request, const WebWindowFeatures& features, - const WebString& name) { + const WebString& name, WebKit::WebNavigationPolicy policy) { CefString url; if (!request.isNull()) url = request.url().spec().utf16(); @@ -187,17 +187,24 @@ WebWidget* BrowserWebViewDelegate::createPopupMenu(WebPopupType popup_type) { WebStorageNamespace* BrowserWebViewDelegate::createSessionStorageNamespace( unsigned quota) { +#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND + NOTREACHED(); +#else // Ignore the quota parameter from WebCore as in Chrome. return new BrowserWebStorageNamespaceImpl(DOM_STORAGE_SESSION, kLocalStorageNamespaceId + 1); +#endif } WebKit::WebGraphicsContext3D* BrowserWebViewDelegate::createGraphicsContext3D( - const WebKit::WebGraphicsContext3D::Attributes& attributes, - bool renderDirectlyToWebView) { + const WebKit::WebGraphicsContext3D::Attributes& attributes) { + WebKit::WebView* web_view = browser_->UIT_GetWebView(); + if (!web_view) + return NULL; + const CefSettings& settings = _Context->settings(); return webkit_glue::CreateGraphicsContext3D(settings.graphics_implementation, - attributes, renderDirectlyToWebView); + attributes, web_view, true); } void BrowserWebViewDelegate::didAddMessageToConsole( @@ -663,7 +670,7 @@ WebPlugin* BrowserWebViewDelegate::createPlugin( WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer( WebFrame* frame, WebMediaPlayerClient* client) { scoped_ptr message_loop_factory( - new media::MessageLoopFactoryImpl()); + new media::MessageLoopFactory()); scoped_ptr collection( new media::FilterCollection()); @@ -884,7 +891,8 @@ void BrowserWebViewDelegate::didCommitProvisionalLoad( } void BrowserWebViewDelegate::didCreateScriptContext( - WebFrame* frame, v8::Handle context, int worldId) { + WebFrame* frame, v8::Handle context, int extensionGroup, + int worldId) { CefRefPtr client = browser_->GetClient(); if (!client.get()) return; diff --git a/cef1/libcef/browser_webview_delegate.h b/cef1/libcef/browser_webview_delegate.h index 89a4e546a..11e71abbe 100644 --- a/cef1/libcef/browser_webview_delegate.h +++ b/cef1/libcef/browser_webview_delegate.h @@ -66,8 +66,8 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, // WebKit::WebViewClient virtual WebKit::WebView* createView( WebKit::WebFrame* creator, const WebKit::WebURLRequest& request, - const WebKit::WebWindowFeatures& features, const WebKit::WebString& name) - OVERRIDE; + const WebKit::WebWindowFeatures& features, const WebKit::WebString& name, + WebKit::WebNavigationPolicy policy) OVERRIDE; virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type) OVERRIDE; virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu( @@ -76,8 +76,7 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, virtual WebKit::WebStorageNamespace* createSessionStorageNamespace( unsigned quota) OVERRIDE; virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D( - const WebKit::WebGraphicsContext3D::Attributes& attributes, - bool renderDirectlyToWebView) OVERRIDE; + const WebKit::WebGraphicsContext3D::Attributes& attributes) OVERRIDE; virtual void didAddMessageToConsole( const WebKit::WebConsoleMessage& message, const WebKit::WebString& source_name, unsigned source_line) OVERRIDE; @@ -183,7 +182,8 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, virtual void didCommitProvisionalLoad( WebKit::WebFrame*, bool is_new_navigation) OVERRIDE; virtual void didCreateScriptContext( - WebKit::WebFrame*, v8::Handle, int worldId) OVERRIDE; + WebKit::WebFrame*, v8::Handle, int extensionGroup, + int worldId) OVERRIDE; virtual void willReleaseScriptContext( WebKit::WebFrame*, v8::Handle, int worldId) OVERRIDE; virtual void didReceiveTitle( diff --git a/cef1/libcef/cef_process_io_thread.cc b/cef1/libcef/cef_process_io_thread.cc index 17838d5b3..4195239ca 100644 --- a/cef1/libcef/cef_process_io_thread.cc +++ b/cef1/libcef/cef_process_io_thread.cc @@ -8,6 +8,7 @@ #include "libcef/cef_context.h" #include "libcef/browser_appcache_system.h" #include "libcef/browser_file_writer.h" +#include "libcef/browser_network_delegate.h" #include "libcef/browser_resource_loader_bridge.h" #include "libcef/browser_socket_stream_bridge.h" #include "libcef/browser_webblobregistry_impl.h" @@ -40,8 +41,13 @@ void CefProcessIOThread::Init() { net::HttpCache::NORMAL, false); _Context->set_request_context(request_context_); + network_delegate_.reset(new BrowserNetworkDelegate()); + request_context_->set_network_delegate(network_delegate_.get()); + BrowserAppCacheSystem::InitializeOnIOThread(request_context_); BrowserFileWriter::InitializeOnIOThread(request_context_); + BrowserFileSystem::InitializeOnIOThread( + request_context_->blob_storage_controller()); BrowserSocketStreamBridge::InitializeOnIOThread(request_context_); BrowserWebBlobRegistryImpl::InitializeOnIOThread( request_context_->blob_storage_controller()); @@ -56,10 +62,15 @@ void CefProcessIOThread::CleanUp() { // In reverse order of initialization. BrowserWebBlobRegistryImpl::Cleanup(); BrowserSocketStreamBridge::Cleanup(); + BrowserFileSystem::CleanupOnIOThread(); BrowserFileWriter::CleanupOnIOThread(); BrowserAppCacheSystem::CleanupOnIOThread(); _Context->set_request_context(NULL); + + request_context_->set_network_delegate(NULL); + network_delegate_.reset(NULL); + request_context_ = NULL; CefThread::Cleanup(); diff --git a/cef1/libcef/cef_process_io_thread.h b/cef1/libcef/cef_process_io_thread.h index 0d87fb40e..7d971cb94 100644 --- a/cef1/libcef/cef_process_io_thread.h +++ b/cef1/libcef/cef_process_io_thread.h @@ -12,6 +12,10 @@ #include "base/basictypes.h" +namespace net { +class NetworkDelegate; +} + // ---------------------------------------------------------------------------- // CefProcessIOThread // @@ -36,6 +40,7 @@ class CefProcessIOThread : public CefThread { virtual void CleanUp(); scoped_refptr request_context_; + scoped_ptr network_delegate_; DISALLOW_COPY_AND_ASSIGN(CefProcessIOThread); }; diff --git a/cef1/libcef/cef_thread.cc b/cef1/libcef/cef_thread.cc index 95c1b80be..58194e02a 100644 --- a/cef1/libcef/cef_thread.cc +++ b/cef1/libcef/cef_thread.cc @@ -30,13 +30,20 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy { : id_(identifier) { } - // MessageLoopProxy implementation. + // 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 { + return CefThread::PostDelayedTask(id_, from_here, task, delay); + } + + // SequencedTaskRunner implementation. virtual bool PostNonNestableDelayedTask( const tracked_objects::Location& from_here, const base::Closure& task, @@ -45,6 +52,13 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy { delay_ms); } + virtual bool PostNonNestableDelayedTask( + const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) OVERRIDE { + return CefThread::PostNonNestableDelayedTask(id_, from_here, task, delay); + } + virtual bool RunsTasksOnCurrentThread() const OVERRIDE { return CefThread::CurrentlyOn(id_); } @@ -150,6 +164,15 @@ bool CefThread::PostDelayedTask(ID identifier, return PostTaskHelper(identifier, from_here, task, delay_ms, true); } +// static +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); +} + // static bool CefThread::PostNonNestableTask( ID identifier, @@ -167,6 +190,16 @@ bool CefThread::PostNonNestableDelayedTask( return PostTaskHelper(identifier, from_here, task, delay_ms, false); } +// static +bool CefThread::PostNonNestableDelayedTask( + ID identifier, + const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) { + return PostTaskHelper(identifier, from_here, task, delay.InMilliseconds(), + false); +} + // static bool CefThread::GetCurrentThreadIdentifier(ID* identifier) { MessageLoop* cur_message_loop = MessageLoop::current(); diff --git a/cef1/libcef/cef_thread.h b/cef1/libcef/cef_thread.h index 2e1ec9756..50eff6381 100644 --- a/cef1/libcef/cef_thread.h +++ b/cef1/libcef/cef_thread.h @@ -82,6 +82,10 @@ class CefThread : public base::Thread { 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, + base::TimeDelta delay); static bool PostNonNestableTask(ID identifier, const tracked_objects::Location& from_here, const base::Closure& task); @@ -90,6 +94,11 @@ class CefThread : public base::Thread { const tracked_objects::Location& from_here, const base::Closure& task, int64 delay_ms); + static bool PostNonNestableDelayedTask( + ID identifier, + const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay); template static bool DeleteSoon(ID identifier, diff --git a/cef1/libcef/cookie_manager_impl.h b/cef1/libcef/cookie_manager_impl.h index 85d1164f5..643309610 100644 --- a/cef1/libcef/cookie_manager_impl.h +++ b/cef1/libcef/cookie_manager_impl.h @@ -7,7 +7,7 @@ #include "include/cef_cookie.h" #include "base/file_path.h" -#include "net/base/cookie_monster.h" +#include "net/cookies/cookie_monster.h" // Implementation of the CefCookieManager interface. class CefCookieManagerImpl : public CefCookieManager { diff --git a/cef1/libcef/cookie_store_proxy.h b/cef1/libcef/cookie_store_proxy.h index 8bcfac50d..0b1b215d8 100644 --- a/cef1/libcef/cookie_store_proxy.h +++ b/cef1/libcef/cookie_store_proxy.h @@ -6,7 +6,7 @@ #define CEF_LIBCEF_COOKIE_STORE_PROXY_H_ #pragma once -#include "net/base/cookie_store.h" +#include "net/cookies/cookie_store.h" class CefBrowserImpl; diff --git a/cef1/libcef/printing/print_settings.cc b/cef1/libcef/printing/print_settings.cc index e306eac75..216b2e287 100644 --- a/cef1/libcef/printing/print_settings.cc +++ b/cef1/libcef/printing/print_settings.cc @@ -11,7 +11,7 @@ namespace printing { // Global SequenceNumber used for generating unique cookie values. -static base::AtomicSequenceNumber cookie_seq(base::LINKER_INITIALIZED); +static base::AtomicSequenceNumber cookie_seq; PageMeasurements::PageMeasurements() : page_type(PT_LETTER), diff --git a/cef1/libcef/scheme_impl.cc b/cef1/libcef/scheme_impl.cc index 5fda6d30b..b99ac5736 100644 --- a/cef1/libcef/scheme_impl.cc +++ b/cef1/libcef/scheme_impl.cc @@ -22,7 +22,8 @@ #include "base/synchronization/lock.h" #include "googleurl/src/url_util.h" #include "net/base/completion_callback.h" -#include "net/base/cookie_monster.h" +#include "net/base/load_flags.h" +#include "net/cookies/cookie_monster.h" #include "net/base/io_buffer.h" #include "net/base/upload_data.h" #include "net/http/http_response_headers.h" @@ -178,7 +179,8 @@ class CefUrlRequestJob : public net::URLRequestJob { net::CookieStore* cookie_store = request_->context()->cookie_store(); - if (cookie_store) { + if (cookie_store && + !(request_->load_flags() & net::LOAD_DO_NOT_SEND_COOKIES)) { net::CookieMonster* cookie_monster = cookie_store->GetCookieMonster(); if (cookie_monster) { cookie_monster->GetAllCookiesForURLAsync( @@ -388,6 +390,12 @@ class CefUrlRequestJob : public net::URLRequestJob { } void SaveCookiesAndNotifyHeadersComplete() { + if (request_->load_flags() & net::LOAD_DO_NOT_SAVE_COOKIES) { + SetStatus(URLRequestStatus()); // Clear the IO_PENDING status + NotifyHeadersComplete(); + return; + } + response_cookies_.clear(); response_cookies_save_index_ = 0; diff --git a/cef1/libcef/simple_clipboard_impl.cc b/cef1/libcef/simple_clipboard_impl.cc index 1643f3b9a..bd042b326 100644 --- a/cef1/libcef/simple_clipboard_impl.cc +++ b/cef1/libcef/simple_clipboard_impl.cc @@ -46,6 +46,10 @@ bool SimpleClipboardClient::IsFormatAvailable( return GetClipboard()->IsFormatAvailable(format, buffer); } +void SimpleClipboardClient::Clear(ui::Clipboard::Buffer buffer) { + GetClipboard()->Clear(buffer); +} + void SimpleClipboardClient::ReadAvailableTypes(ui::Clipboard::Buffer buffer, std::vector* types, bool* contains_filenames) { diff --git a/cef1/libcef/simple_clipboard_impl.h b/cef1/libcef/simple_clipboard_impl.h index ec8445f25..e39e11f13 100644 --- a/cef1/libcef/simple_clipboard_impl.h +++ b/cef1/libcef/simple_clipboard_impl.h @@ -21,6 +21,7 @@ class SimpleClipboardClient : public webkit_glue::ClipboardClient { virtual uint64 GetSequenceNumber(ui::Clipboard::Buffer buffer) OVERRIDE; virtual bool IsFormatAvailable(const ui::Clipboard::FormatType& format, ui::Clipboard::Buffer buffer) OVERRIDE; + virtual void Clear(ui::Clipboard::Buffer buffer) OVERRIDE; virtual void ReadAvailableTypes(ui::Clipboard::Buffer buffer, std::vector* types, bool* contains_filenames) OVERRIDE; diff --git a/cef1/patch/patch.cfg b/cef1/patch/patch.cfg index b83254fc9..f4122f7ec 100644 --- a/cef1/patch/patch.cfg +++ b/cef1/patch/patch.cfg @@ -21,11 +21,6 @@ patches = [ 'name': 'tools_gyp', 'path': '../tools/gyp/', }, - { - # https://bugs.webkit.org/show_bug.cgi?id=73760 - 'name': 'webcore_cachedresource', - 'path': '../third_party/WebKit/Source/WebCore/loader/cache/', - }, { # http://code.google.com/p/chromiumembedded/issues/detail?id=364 'name': 'spi_webcore_364', diff --git a/cef1/patch/patches/webcore_cachedresource.patch b/cef1/patch/patches/webcore_cachedresource.patch deleted file mode 100644 index 79fc57dad..000000000 --- a/cef1/patch/patches/webcore_cachedresource.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: CachedResource.cpp -=================================================================== ---- CachedResource.cpp (revision 103399) -+++ CachedResource.cpp (working copy) -@@ -366,6 +366,9 @@ - - void CachedResource::addClient(CachedResourceClient* client) - { -+ if (isPurgeable()) -+ makePurgeable(false); -+ - addClientToSet(client); - didAddClient(client); - } diff --git a/cef1/tests/cefclient/cefclient.cpp b/cef1/tests/cefclient/cefclient.cpp index bea19f45e..7a953066a 100644 --- a/cef1/tests/cefclient/cefclient.cpp +++ b/cef1/tests/cefclient/cefclient.cpp @@ -321,8 +321,6 @@ void AppGetBrowserSettings(CefBrowserSettings& settings) { g_command_line->HasSwitch(cefclient::kWebglDisabled); settings.accelerated_compositing_enabled = g_command_line->HasSwitch(cefclient::kAcceleratedCompositingEnabled); - settings.threaded_compositing_enabled = - g_command_line->HasSwitch(cefclient::kThreadedCompositingEnabled); settings.accelerated_layers_disabled = g_command_line->HasSwitch(cefclient::kAcceleratedLayersDisabled); settings.accelerated_video_disabled = diff --git a/cef1/tests/cefclient/cefclient_switches.cpp b/cef1/tests/cefclient/cefclient_switches.cpp index 40c420e55..806a8967f 100644 --- a/cef1/tests/cefclient/cefclient_switches.cpp +++ b/cef1/tests/cefclient/cefclient_switches.cpp @@ -73,7 +73,6 @@ const char kDatabasesDisabled[] = "databases-disabled"; const char kApplicationCacheDisabled[] = "application-cache-disabled"; const char kWebglDisabled[] = "webgl-disabled"; const char kAcceleratedCompositingEnabled[] = "accelerated-compositing-enabled"; -const char kThreadedCompositingEnabled[] = "threaded-compositing-enabled"; const char kAcceleratedLayersDisabled[] = "accelerated-layers-disabled"; const char kAcceleratedVideoDisabled[] = "accelerated-video-disabled"; const char kAcceledated2dCanvasDisabled[] = "accelerated-2d-canvas-disabled"; diff --git a/cef1/tests/cefclient/cefclient_switches.h b/cef1/tests/cefclient/cefclient_switches.h index da1edeb81..335ebd7fc 100644 --- a/cef1/tests/cefclient/cefclient_switches.h +++ b/cef1/tests/cefclient/cefclient_switches.h @@ -70,7 +70,6 @@ extern const char kDatabasesDisabled[]; extern const char kApplicationCacheDisabled[]; extern const char kWebglDisabled[]; extern const char kAcceleratedCompositingEnabled[]; -extern const char kThreadedCompositingEnabled[]; extern const char kAcceleratedLayersDisabled[]; extern const char kAcceleratedVideoDisabled[]; extern const char kAcceledated2dCanvasDisabled[]; diff --git a/cef1/tools/distrib/win/README.txt b/cef1/tools/distrib/win/README.txt index dcadeb134..c51bf9f3b 100644 --- a/cef1/tools/distrib/win/README.txt +++ b/cef1/tools/distrib/win/README.txt @@ -86,8 +86,8 @@ Required components: Optional components: * FFmpeg audio and video support - avcodec-53.dll - avformat-53.dll + avcodec-54.dll + avformat-54.dll avutil-51.dll Note: Without these components HTML5 audio and video will not function.