Update to Chromium revision 129376.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@579 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-04-04 22:32:24 +00:00
parent f94336aade
commit 0930631a5f
39 changed files with 404 additions and 140 deletions

View File

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

View File

@ -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',

View File

@ -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.

View File

@ -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 =

View File

@ -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();

View File

@ -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;

View File

@ -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<std::string> 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<webkit_blob::ShareableFileReference>& 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);
}

View File

@ -27,6 +27,10 @@ namespace fileapi {
class FileSystemContext;
}
namespace webkit_blob {
class BlobStorageController;
}
class BrowserFileSystem
: public WebKit::WebFileSystem,
public base::SupportsWeakPtr<BrowserFileSystem> {
@ -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<webkit_blob::ShareableFileReference>& file_ref);
// A temporary directory for FileSystem API.
ScopedTempDir file_system_dir_;

View File

@ -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<net::HttpResponseHeaders>*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;
}

View File

@ -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<net::HttpResponseHeaders>*
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

View File

@ -5,6 +5,7 @@
#include "libcef/browser_persistent_cookie_store.h"
#include <algorithm>
#include <list>
#include <map>
#include <set>
@ -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.

View File

@ -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;

View File

@ -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();

View File

@ -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<net::URLSecurityManager> url_security_manager_;
scoped_ptr<net::URLRequest::Interceptor> url_request_interceptor_;
FilePath cookie_store_path_;
bool accept_all_cookies_;
};
#endif // CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_H_

View File

@ -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());

View File

@ -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<DeletableFileReference> downloaded_file_;
scoped_refptr<ShareableFileReference> downloaded_file_;
// Size of our async IO data buffers. Limited by the sanity check in
// URLRequestJob::Read().

View File

@ -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;

View File

@ -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;

View File

@ -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<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
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);
}
}

View File

@ -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

View File

@ -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(

View File

@ -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<media::MessageLoopFactory> message_loop_factory(
new media::MessageLoopFactoryImpl());
new media::MessageLoopFactory());
scoped_ptr<media::FilterCollection> collection(
new media::FilterCollection());
@ -884,7 +891,8 @@ void BrowserWebViewDelegate::didCommitProvisionalLoad(
}
void BrowserWebViewDelegate::didCreateScriptContext(
WebFrame* frame, v8::Handle<v8::Context> context, int worldId) {
WebFrame* frame, v8::Handle<v8::Context> context, int extensionGroup,
int worldId) {
CefRefPtr<CefClient> client = browser_->GetClient();
if (!client.get())
return;

View File

@ -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<v8::Context>, int worldId) OVERRIDE;
WebKit::WebFrame*, v8::Handle<v8::Context>, int extensionGroup,
int worldId) OVERRIDE;
virtual void willReleaseScriptContext(
WebKit::WebFrame*, v8::Handle<v8::Context>, int worldId) OVERRIDE;
virtual void didReceiveTitle(

View File

@ -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();

View File

@ -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<BrowserRequestContext> request_context_;
scoped_ptr<net::NetworkDelegate> network_delegate_;
DISALLOW_COPY_AND_ASSIGN(CefProcessIOThread);
};

View File

@ -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();

View File

@ -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 <class T>
static bool DeleteSoon(ID identifier,

View File

@ -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 {

View File

@ -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;

View File

@ -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),

View File

@ -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;

View File

@ -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<string16>* types,
bool* contains_filenames) {

View File

@ -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<string16>* types,
bool* contains_filenames) OVERRIDE;

View File

@ -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',

View File

@ -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);
}

View File

@ -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 =

View File

@ -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";

View File

@ -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[];

View File

@ -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.