mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@ -17,5 +17,5 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
||||||
'chromium_revision': '122508',
|
'chromium_revision': '129376',
|
||||||
}
|
}
|
||||||
|
@ -675,6 +675,8 @@
|
|||||||
'libcef/browser_impl.h',
|
'libcef/browser_impl.h',
|
||||||
'libcef/browser_navigation_controller.cc',
|
'libcef/browser_navigation_controller.cc',
|
||||||
'libcef/browser_navigation_controller.h',
|
'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.cc',
|
||||||
'libcef/browser_persistent_cookie_store.h',
|
'libcef/browser_persistent_cookie_store.h',
|
||||||
'libcef/browser_request_context.cc',
|
'libcef/browser_request_context.cc',
|
||||||
|
@ -397,12 +397,6 @@ typedef struct _cef_browser_settings_t {
|
|||||||
///
|
///
|
||||||
bool accelerated_compositing_enabled;
|
bool accelerated_compositing_enabled;
|
||||||
|
|
||||||
///
|
|
||||||
// Set to true (1) to enable threaded compositing. This is currently only
|
|
||||||
// supported by the command buffer graphics implementation.
|
|
||||||
///
|
|
||||||
bool threaded_compositing_enabled;
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set to true (1) to disable accelerated layers. This affects features like
|
// Set to true (1) to disable accelerated layers. This affects features like
|
||||||
// 3D CSS transforms.
|
// 3D CSS transforms.
|
||||||
|
@ -395,7 +395,6 @@ struct CefBrowserSettingsTraits {
|
|||||||
target->webgl_disabled = src->webgl_disabled;
|
target->webgl_disabled = src->webgl_disabled;
|
||||||
target->accelerated_compositing_enabled =
|
target->accelerated_compositing_enabled =
|
||||||
src->accelerated_compositing_enabled;
|
src->accelerated_compositing_enabled;
|
||||||
target->threaded_compositing_enabled = src->threaded_compositing_enabled;
|
|
||||||
target->accelerated_layers_disabled = src->accelerated_layers_disabled;
|
target->accelerated_layers_disabled = src->accelerated_layers_disabled;
|
||||||
target->accelerated_video_disabled = src->accelerated_video_disabled;
|
target->accelerated_video_disabled = src->accelerated_video_disabled;
|
||||||
target->accelerated_2d_canvas_disabled =
|
target->accelerated_2d_canvas_disabled =
|
||||||
|
@ -39,7 +39,7 @@ BrowserDatabaseSystem::BrowserDatabaseSystem()
|
|||||||
instance_ = this;
|
instance_ = this;
|
||||||
CHECK(temp_dir_.CreateUniqueTempDir());
|
CHECK(temp_dir_.CreateUniqueTempDir());
|
||||||
db_tracker_ =
|
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_tracker_->AddObserver(this);
|
||||||
db_thread_.Start();
|
db_thread_.Start();
|
||||||
db_thread_proxy_ = db_thread_.message_loop_proxy();
|
db_thread_proxy_ = db_thread_.message_loop_proxy();
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
|
#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/WebFrame.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.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"
|
#include "webkit/glue/webdropdata.h"
|
||||||
|
|
||||||
using WebKit::WebDragOperationsMask;
|
using WebKit::WebDragOperationsMask;
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "base/time.h"
|
#include "base/time.h"
|
||||||
#include "base/utf_string_conversions.h"
|
#include "base/utf_string_conversions.h"
|
||||||
#include "googleurl/src/gurl.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/WebDocument.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.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/WebSecurityOrigin.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.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/fileapi/mock_file_system_options.h"
|
||||||
#include "webkit/glue/webkit_glue.h"
|
#include "webkit/glue/webkit_glue.h"
|
||||||
#include "webkit/tools/test_shell/simple_file_writer.h"
|
|
||||||
|
|
||||||
using base::WeakPtr;
|
using base::WeakPtr;
|
||||||
|
|
||||||
@ -39,19 +40,41 @@ using WebKit::WebString;
|
|||||||
using WebKit::WebURL;
|
using WebKit::WebURL;
|
||||||
using WebKit::WebVector;
|
using WebKit::WebVector;
|
||||||
|
|
||||||
|
using webkit_blob::BlobData;
|
||||||
|
using webkit_blob::BlobStorageController;
|
||||||
using fileapi::FileSystemContext;
|
using fileapi::FileSystemContext;
|
||||||
using fileapi::FileSystemOperationInterface;
|
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() {
|
void BrowserFileSystem::CreateContext() {
|
||||||
if (file_system_context_.get())
|
if (file_system_context_.get())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (file_system_dir_.CreateUniqueTempDir()) {
|
if (file_system_dir_.CreateUniqueTempDir()) {
|
||||||
std::vector<std::string> additional_allowed_schemes;
|
std::vector<std::string> additional_allowed_schemes;
|
||||||
additional_allowed_schemes.push_back("file");
|
additional_allowed_schemes.push_back("file");
|
||||||
@ -71,6 +94,9 @@ void BrowserFileSystem::CreateContext() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BrowserFileSystem::~BrowserFileSystem() {
|
||||||
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::OpenFileSystem(
|
void BrowserFileSystem::OpenFileSystem(
|
||||||
WebFrame* frame, WebFileSystem::Type web_filesystem_type,
|
WebFrame* frame, WebFileSystem::Type web_filesystem_type,
|
||||||
long long, bool create, // NOLINT(runtime/int)
|
long long, bool create, // NOLINT(runtime/int)
|
||||||
@ -161,6 +187,27 @@ WebFileWriter* BrowserFileSystem::createFileWriter(
|
|||||||
return new BrowserFileWriter(path, client, file_system_context_.get());
|
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(
|
FileSystemOperationInterface* BrowserFileSystem::GetNewOperation(
|
||||||
const WebURL& url) {
|
const WebURL& url) {
|
||||||
return file_system_context_->CreateFileSystemOperation(
|
return file_system_context_->CreateFileSystemOperation(
|
||||||
@ -192,6 +239,13 @@ BrowserFileSystem::OpenFileSystemHandler(WebFileSystemCallbacks* callbacks) {
|
|||||||
AsWeakPtr(), base::Unretained(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,
|
void BrowserFileSystem::DidFinish(WebFileSystemCallbacks* callbacks,
|
||||||
base::PlatformFileError result) {
|
base::PlatformFileError result) {
|
||||||
if (result == base::PLATFORM_FILE_OK)
|
if (result == base::PLATFORM_FILE_OK)
|
||||||
@ -252,3 +306,19 @@ void BrowserFileSystem::DidOpenFileSystem(
|
|||||||
callbacks->didFail(webkit_glue::PlatformFileErrorToWebFileError(result));
|
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);
|
||||||
|
}
|
||||||
|
@ -27,6 +27,10 @@ namespace fileapi {
|
|||||||
class FileSystemContext;
|
class FileSystemContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace webkit_blob {
|
||||||
|
class BlobStorageController;
|
||||||
|
}
|
||||||
|
|
||||||
class BrowserFileSystem
|
class BrowserFileSystem
|
||||||
: public WebKit::WebFileSystem,
|
: public WebKit::WebFileSystem,
|
||||||
public base::SupportsWeakPtr<BrowserFileSystem> {
|
public base::SupportsWeakPtr<BrowserFileSystem> {
|
||||||
@ -83,6 +87,14 @@ class BrowserFileSystem
|
|||||||
WebKit::WebFileSystemCallbacks*) OVERRIDE;
|
WebKit::WebFileSystemCallbacks*) OVERRIDE;
|
||||||
virtual WebKit::WebFileWriter* createFileWriter(
|
virtual WebKit::WebFileWriter* createFileWriter(
|
||||||
const WebKit::WebURL& path, WebKit::WebFileWriterClient*) OVERRIDE;
|
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:
|
private:
|
||||||
// Helpers.
|
// Helpers.
|
||||||
@ -98,6 +110,9 @@ class BrowserFileSystem
|
|||||||
ReadDirectoryHandler(WebKit::WebFileSystemCallbacks* callbacks);
|
ReadDirectoryHandler(WebKit::WebFileSystemCallbacks* callbacks);
|
||||||
fileapi::FileSystemContext::OpenFileSystemCallback OpenFileSystemHandler(
|
fileapi::FileSystemContext::OpenFileSystemCallback OpenFileSystemHandler(
|
||||||
WebKit::WebFileSystemCallbacks* callbacks);
|
WebKit::WebFileSystemCallbacks* callbacks);
|
||||||
|
fileapi::FileSystemOperationInterface::SnapshotFileCallback
|
||||||
|
SnapshotFileHandler(const GURL& blob_url,
|
||||||
|
WebKit::WebFileSystemCallbacks* callbacks);
|
||||||
void DidFinish(WebKit::WebFileSystemCallbacks* callbacks,
|
void DidFinish(WebKit::WebFileSystemCallbacks* callbacks,
|
||||||
base::PlatformFileError result);
|
base::PlatformFileError result);
|
||||||
void DidGetMetadata(WebKit::WebFileSystemCallbacks* callbacks,
|
void DidGetMetadata(WebKit::WebFileSystemCallbacks* callbacks,
|
||||||
@ -112,6 +127,13 @@ class BrowserFileSystem
|
|||||||
void DidOpenFileSystem(WebKit::WebFileSystemCallbacks* callbacks,
|
void DidOpenFileSystem(WebKit::WebFileSystemCallbacks* callbacks,
|
||||||
base::PlatformFileError result,
|
base::PlatformFileError result,
|
||||||
const std::string& name, const GURL& root);
|
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.
|
// A temporary directory for FileSystem API.
|
||||||
ScopedTempDir file_system_dir_;
|
ScopedTempDir file_system_dir_;
|
||||||
|
100
cef1/libcef/browser_network_delegate.cc
Normal file
100
cef1/libcef/browser_network_delegate.cc
Normal 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;
|
||||||
|
}
|
57
cef1/libcef/browser_network_delegate.h
Normal file
57
cef1/libcef/browser_network_delegate.h
Normal 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
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "libcef/browser_persistent_cookie_store.h"
|
#include "libcef/browser_persistent_cookie_store.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -227,12 +228,10 @@ bool InitTable(sql::Connection* db) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to create the index every time. Older versions did not have this index,
|
// Older code created an index on creation_utc, which is already
|
||||||
// so we want those people to get it.
|
// primary key for the table.
|
||||||
if (!db->Execute("CREATE INDEX IF NOT EXISTS cookie_times ON cookies"
|
if (!db->Execute("DROP INDEX IF EXISTS cookie_times"))
|
||||||
" (creation_utc)")) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if (!db->Execute("CREATE INDEX IF NOT EXISTS domain ON cookies(host_key)"))
|
if (!db->Execute("CREATE INDEX IF NOT EXISTS domain ON cookies(host_key)"))
|
||||||
return false;
|
return false;
|
||||||
@ -346,7 +345,6 @@ bool BrowserPersistentCookieStore::Backend::InitializeDatabase() {
|
|||||||
"SELECT DISTINCT host_key FROM cookies"));
|
"SELECT DISTINCT host_key FROM cookies"));
|
||||||
|
|
||||||
if (!smt.is_valid()) {
|
if (!smt.is_valid()) {
|
||||||
NOTREACHED() << "select statement prep failed";
|
|
||||||
smt.Clear(); // Disconnect smt_ref from db_.
|
smt.Clear(); // Disconnect smt_ref from db_.
|
||||||
db_.reset();
|
db_.reset();
|
||||||
return false;
|
return false;
|
||||||
@ -594,7 +592,8 @@ void BrowserPersistentCookieStore::Backend::BatchOperation(
|
|||||||
// We've gotten our first entry for this batch, fire off the timer.
|
// We've gotten our first entry for this batch, fire off the timer.
|
||||||
CefThread::PostDelayedTask(
|
CefThread::PostDelayedTask(
|
||||||
CefThread::FILE, FROM_HERE,
|
CefThread::FILE, FROM_HERE,
|
||||||
base::Bind(&Backend::Commit, this), kCommitIntervalMs);
|
base::Bind(&Backend::Commit, this),
|
||||||
|
base::TimeDelta::FromMilliseconds(kCommitIntervalMs));
|
||||||
} else if (num_pending == kCommitAfterBatchSize) {
|
} else if (num_pending == kCommitAfterBatchSize) {
|
||||||
// We've reached a big enough batch, fire off a commit now.
|
// We've reached a big enough batch, fire off a commit now.
|
||||||
CefThread::PostTask(
|
CefThread::PostTask(
|
||||||
@ -622,30 +621,23 @@ void BrowserPersistentCookieStore::Backend::Commit() {
|
|||||||
"expires_utc, secure, httponly, last_access_utc, has_expires, "
|
"expires_utc, secure, httponly, last_access_utc, has_expires, "
|
||||||
"persistent) "
|
"persistent) "
|
||||||
"VALUES (?,?,?,?,?,?,?,?,?,?,?)"));
|
"VALUES (?,?,?,?,?,?,?,?,?,?,?)"));
|
||||||
if (!add_smt) {
|
if (!add_smt.is_valid())
|
||||||
NOTREACHED();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
sql::Statement update_access_smt(db_->GetCachedStatement(SQL_FROM_HERE,
|
sql::Statement update_access_smt(db_->GetCachedStatement(SQL_FROM_HERE,
|
||||||
"UPDATE cookies SET last_access_utc=? WHERE creation_utc=?"));
|
"UPDATE cookies SET last_access_utc=? WHERE creation_utc=?"));
|
||||||
if (!update_access_smt) {
|
if (!update_access_smt.is_valid())
|
||||||
NOTREACHED();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
sql::Statement del_smt(db_->GetCachedStatement(SQL_FROM_HERE,
|
sql::Statement del_smt(db_->GetCachedStatement(SQL_FROM_HERE,
|
||||||
"DELETE FROM cookies WHERE creation_utc=?"));
|
"DELETE FROM cookies WHERE creation_utc=?"));
|
||||||
if (!del_smt) {
|
if (!del_smt.is_valid())
|
||||||
NOTREACHED();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
sql::Transaction transaction(db_.get());
|
sql::Transaction transaction(db_.get());
|
||||||
if (!transaction.Begin()) {
|
if (!transaction.Begin())
|
||||||
NOTREACHED();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
for (PendingOperationsList::iterator it = ops.begin();
|
for (PendingOperationsList::iterator it = ops.begin();
|
||||||
it != ops.end(); ++it) {
|
it != ops.end(); ++it) {
|
||||||
// Free the cookies as we commit them to the database.
|
// Free the cookies as we commit them to the database.
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "net/base/cookie_monster.h"
|
#include "net/cookies/cookie_monster.h"
|
||||||
|
|
||||||
class FilePath;
|
class FilePath;
|
||||||
class Task;
|
class Task;
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "net/base/cert_verifier.h"
|
#include "net/base/cert_verifier.h"
|
||||||
#include "net/base/cookie_monster.h"
|
#include "net/cookies/cookie_monster.h"
|
||||||
#include "net/base/default_origin_bound_cert_store.h"
|
#include "net/base/default_server_bound_cert_store.h"
|
||||||
#include "net/base/host_resolver.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/base/ssl_config_service_defaults.h"
|
||||||
#include "net/ftp/ftp_network_layer.h"
|
#include "net/ftp/ftp_network_layer.h"
|
||||||
#include "net/http/http_auth_handler_factory.h"
|
#include "net/http/http_auth_handler_factory.h"
|
||||||
@ -129,8 +129,7 @@ net::ProxyConfigService* CreateProxyConfigService() {
|
|||||||
|
|
||||||
|
|
||||||
BrowserRequestContext::BrowserRequestContext()
|
BrowserRequestContext::BrowserRequestContext()
|
||||||
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)),
|
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
|
||||||
accept_all_cookies_(true) {
|
|
||||||
Init(FilePath(), net::HttpCache::NORMAL, false);
|
Init(FilePath(), net::HttpCache::NORMAL, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,8 +137,7 @@ BrowserRequestContext::BrowserRequestContext(
|
|||||||
const FilePath& cache_path,
|
const FilePath& cache_path,
|
||||||
net::HttpCache::Mode cache_mode,
|
net::HttpCache::Mode cache_mode,
|
||||||
bool no_proxy)
|
bool no_proxy)
|
||||||
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)),
|
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
|
||||||
accept_all_cookies_(true) {
|
|
||||||
Init(cache_path, cache_mode, no_proxy);
|
Init(cache_path, cache_mode, no_proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +156,8 @@ void BrowserRequestContext::Init(
|
|||||||
|
|
||||||
SetCookieStoragePath(cache_path);
|
SetCookieStoragePath(cache_path);
|
||||||
|
|
||||||
storage_.set_origin_bound_cert_service(new net::OriginBoundCertService(
|
storage_.set_server_bound_cert_service(new net::ServerBoundCertService(
|
||||||
new net::DefaultOriginBoundCertStore(NULL)));
|
new net::DefaultServerBoundCertStore(NULL)));
|
||||||
|
|
||||||
// hard-code A-L and A-C for test shells
|
// hard-code A-L and A-C for test shells
|
||||||
set_accept_language("en-us,en");
|
set_accept_language("en-us,en");
|
||||||
@ -216,7 +214,7 @@ void BrowserRequestContext::Init(
|
|||||||
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
|
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
|
||||||
net::HostResolver::kDefaultRetryAttempts,
|
net::HostResolver::kDefaultRetryAttempts,
|
||||||
NULL));
|
NULL));
|
||||||
storage_.set_cert_verifier(new net::CertVerifier);
|
storage_.set_cert_verifier(net::CertVerifier::CreateDefault());
|
||||||
storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults);
|
storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults);
|
||||||
|
|
||||||
// Add support for single sign-on.
|
// Add support for single sign-on.
|
||||||
@ -244,7 +242,7 @@ void BrowserRequestContext::Init(
|
|||||||
net::HttpCache* cache =
|
net::HttpCache* cache =
|
||||||
new net::HttpCache(host_resolver(),
|
new net::HttpCache(host_resolver(),
|
||||||
cert_verifier(),
|
cert_verifier(),
|
||||||
origin_bound_cert_service(),
|
server_bound_cert_service(),
|
||||||
NULL, // transport_security_state
|
NULL, // transport_security_state
|
||||||
proxy_service(),
|
proxy_service(),
|
||||||
"", // ssl_session_cache_shard
|
"", // ssl_session_cache_shard
|
||||||
@ -290,14 +288,6 @@ void BrowserRequestContext::Init(
|
|||||||
BrowserRequestContext::~BrowserRequestContext() {
|
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) {
|
void BrowserRequestContext::SetCookieStoragePath(const FilePath& path) {
|
||||||
REQUIRE_IOT();
|
REQUIRE_IOT();
|
||||||
|
|
||||||
|
@ -36,9 +36,6 @@ class BrowserRequestContext : public net::URLRequestContext {
|
|||||||
|
|
||||||
virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE;
|
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
|
// 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
|
// storage will be used. If the old cookie data is being stored on disk it
|
||||||
// will be flushed and closed.
|
// will be flushed and closed.
|
||||||
@ -57,7 +54,6 @@ class BrowserRequestContext : public net::URLRequestContext {
|
|||||||
scoped_ptr<net::URLSecurityManager> url_security_manager_;
|
scoped_ptr<net::URLSecurityManager> url_security_manager_;
|
||||||
scoped_ptr<net::URLRequest::Interceptor> url_request_interceptor_;
|
scoped_ptr<net::URLRequest::Interceptor> url_request_interceptor_;
|
||||||
FilePath cookie_store_path_;
|
FilePath cookie_store_path_;
|
||||||
bool accept_all_cookies_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_H_
|
#endif // CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_H_
|
||||||
|
@ -21,7 +21,7 @@ BrowserRequestContextProxy::BrowserRequestContextProxy(
|
|||||||
set_net_log(context->net_log());
|
set_net_log(context->net_log());
|
||||||
set_host_resolver(context->host_resolver());
|
set_host_resolver(context->host_resolver());
|
||||||
set_cert_verifier(context->cert_verifier());
|
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(
|
set_fraudulent_certificate_reporter(
|
||||||
context->fraudulent_certificate_reporter());
|
context->fraudulent_certificate_reporter());
|
||||||
set_proxy_service(context->proxy_service());
|
set_proxy_service(context->proxy_service());
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
#include "net/url_request/url_request_redirect_job.h"
|
#include "net/url_request/url_request_redirect_job.h"
|
||||||
#include "webkit/appcache/appcache_interfaces.h"
|
#include "webkit/appcache/appcache_interfaces.h"
|
||||||
#include "webkit/blob/blob_storage_controller.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_context.h"
|
||||||
#include "webkit/fileapi/file_system_dir_url_request_job.h"
|
#include "webkit/fileapi/file_system_dir_url_request_job.h"
|
||||||
#include "webkit/fileapi/file_system_url_request_job.h"
|
#include "webkit/fileapi/file_system_url_request_job.h"
|
||||||
@ -81,7 +81,7 @@
|
|||||||
using net::HttpResponseHeaders;
|
using net::HttpResponseHeaders;
|
||||||
using net::StaticCookiePolicy;
|
using net::StaticCookiePolicy;
|
||||||
using net::URLRequestStatus;
|
using net::URLRequestStatus;
|
||||||
using webkit_blob::DeletableFileReference;
|
using webkit_blob::ShareableFileReference;
|
||||||
using webkit_glue::ResourceLoaderBridge;
|
using webkit_glue::ResourceLoaderBridge;
|
||||||
using webkit_glue::ResourceResponseInfo;
|
using webkit_glue::ResourceResponseInfo;
|
||||||
|
|
||||||
@ -578,8 +578,9 @@ class RequestProxy : public net::URLRequest::Delegate,
|
|||||||
if (download_to_file_) {
|
if (download_to_file_) {
|
||||||
FilePath path;
|
FilePath path;
|
||||||
if (file_util::CreateTemporaryFile(&path)) {
|
if (file_util::CreateTemporaryFile(&path)) {
|
||||||
downloaded_file_ = DeletableFileReference::GetOrCreate(
|
downloaded_file_ = ShareableFileReference::GetOrCreate(
|
||||||
path, base::MessageLoopProxy::current());
|
path, ShareableFileReference::DELETE_ON_FINAL_RELEASE,
|
||||||
|
base::MessageLoopProxy::current());
|
||||||
file_stream_.OpenSync(
|
file_stream_.OpenSync(
|
||||||
path, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE);
|
path, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE);
|
||||||
}
|
}
|
||||||
@ -778,34 +779,6 @@ class RequestProxy : public net::URLRequest::Delegate,
|
|||||||
request->ContinueDespiteLastError();
|
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,
|
virtual void OnReadCompleted(net::URLRequest* request,
|
||||||
int bytes_read) OVERRIDE {
|
int bytes_read) OVERRIDE {
|
||||||
if (request->status().is_success() && bytes_read > 0) {
|
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.
|
// Support for request.download_to_file behavior.
|
||||||
bool download_to_file_;
|
bool download_to_file_;
|
||||||
net::FileStream file_stream_;
|
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
|
// Size of our async IO data buffers. Limited by the sanity check in
|
||||||
// URLRequestJob::Read().
|
// URLRequestJob::Read().
|
||||||
|
@ -125,7 +125,6 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) {
|
|||||||
web.experimental_webgl_enabled = !cef.webgl_disabled;
|
web.experimental_webgl_enabled = !cef.webgl_disabled;
|
||||||
web.show_composited_layer_borders = false;
|
web.show_composited_layer_borders = false;
|
||||||
web.accelerated_compositing_enabled = cef.accelerated_compositing_enabled;
|
web.accelerated_compositing_enabled = cef.accelerated_compositing_enabled;
|
||||||
web.threaded_compositing_enabled = cef.threaded_compositing_enabled;
|
|
||||||
web.accelerated_layers_enabled = !cef.accelerated_layers_disabled;
|
web.accelerated_layers_enabled = !cef.accelerated_layers_disabled;
|
||||||
web.accelerated_animation_enabled = !cef.accelerated_layers_disabled;
|
web.accelerated_animation_enabled = !cef.accelerated_layers_disabled;
|
||||||
web.accelerated_video_enabled = !cef.accelerated_video_disabled;
|
web.accelerated_video_enabled = !cef.accelerated_video_disabled;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "libcef/cef_thread.h"
|
#include "libcef/cef_thread.h"
|
||||||
|
|
||||||
#include "base/synchronization/waitable_event.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"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
|
||||||
|
|
||||||
using WebKit::WebString;
|
using WebKit::WebString;
|
||||||
|
@ -20,6 +20,7 @@ MSVC_POP_WARNING();
|
|||||||
#include "base/string_util.h"
|
#include "base/string_util.h"
|
||||||
#include "net/base/mime_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/WebFrame.h"
|
||||||
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
|
||||||
#include "webkit/glue/user_agent.h"
|
#include "webkit/glue/user_agent.h"
|
||||||
#include "webkit/glue/webkit_glue.h"
|
#include "webkit/glue/webkit_glue.h"
|
||||||
@ -137,6 +138,7 @@ bool IsPluginEnabled(const webkit::WebPluginInfo& plugin) {
|
|||||||
WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
|
WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
|
||||||
cef_graphics_implementation_t graphics_implementation,
|
cef_graphics_implementation_t graphics_implementation,
|
||||||
const WebKit::WebGraphicsContext3D::Attributes& attributes,
|
const WebKit::WebGraphicsContext3D::Attributes& attributes,
|
||||||
|
WebKit::WebView* web_view,
|
||||||
bool renderDirectlyToWebView) {
|
bool renderDirectlyToWebView) {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
bool use_command_buffer =
|
bool use_command_buffer =
|
||||||
@ -148,15 +150,18 @@ WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (use_command_buffer) {
|
if (use_command_buffer) {
|
||||||
|
WebKit::WebGraphicsContext3D* view_context = NULL;
|
||||||
|
if (!renderDirectlyToWebView)
|
||||||
|
view_context = web_view->graphicsContext3D();
|
||||||
scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
|
scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||||
context(
|
context(
|
||||||
new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl());
|
new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl());
|
||||||
if (!context->initialize(attributes, NULL, renderDirectlyToWebView))
|
if (!context->Initialize(attributes, view_context))
|
||||||
return NULL;
|
return NULL;
|
||||||
return context.release();
|
return context.release();
|
||||||
} else {
|
} else {
|
||||||
return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
|
return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
|
||||||
attributes, NULL, renderDirectlyToWebView);
|
attributes, renderDirectlyToWebView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ bool IsPluginEnabled(const webkit::WebPluginInfo& plugin);
|
|||||||
WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
|
WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
|
||||||
cef_graphics_implementation_t graphics_implementation,
|
cef_graphics_implementation_t graphics_implementation,
|
||||||
const WebKit::WebGraphicsContext3D::Attributes& attributes,
|
const WebKit::WebGraphicsContext3D::Attributes& attributes,
|
||||||
|
WebKit::WebView* web_view,
|
||||||
bool renderDirectlyToWebView);
|
bool renderDirectlyToWebView);
|
||||||
|
|
||||||
} // namespace webkit_glue
|
} // namespace webkit_glue
|
||||||
|
@ -198,14 +198,22 @@ WebKit::WebString BrowserWebKitInit::defaultLocale() {
|
|||||||
|
|
||||||
WebKit::WebStorageNamespace* BrowserWebKitInit::createLocalStorageNamespace(
|
WebKit::WebStorageNamespace* BrowserWebKitInit::createLocalStorageNamespace(
|
||||||
const WebKit::WebString& path, unsigned quota) {
|
const WebKit::WebString& path, unsigned quota) {
|
||||||
|
#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
|
||||||
|
NOTREACHED();
|
||||||
|
#else
|
||||||
return new BrowserWebStorageNamespaceImpl(DOM_STORAGE_LOCAL);
|
return new BrowserWebStorageNamespaceImpl(DOM_STORAGE_LOCAL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebKitInit::dispatchStorageEvent(const WebKit::WebString& key,
|
void BrowserWebKitInit::dispatchStorageEvent(const WebKit::WebString& key,
|
||||||
const WebKit::WebString& old_value, const WebKit::WebString& new_value,
|
const WebKit::WebString& old_value, const WebKit::WebString& new_value,
|
||||||
const WebKit::WebString& origin, const WebKit::WebURL& url,
|
const WebKit::WebString& origin, const WebKit::WebURL& url,
|
||||||
bool is_local_storage) {
|
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() {
|
WebKit::WebIDBFactory* BrowserWebKitInit::idbFactory() {
|
||||||
@ -238,7 +246,7 @@ BrowserWebKitInit::createOffscreenGraphicsContext3D(
|
|||||||
const WebKit::WebGraphicsContext3D::Attributes& attributes) {
|
const WebKit::WebGraphicsContext3D::Attributes& attributes) {
|
||||||
const CefSettings& settings = _Context->settings();
|
const CefSettings& settings = _Context->settings();
|
||||||
return webkit_glue::CreateGraphicsContext3D(settings.graphics_implementation,
|
return webkit_glue::CreateGraphicsContext3D(settings.graphics_implementation,
|
||||||
attributes, false);
|
attributes, NULL, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebKitInit::GetPlugins(
|
void BrowserWebKitInit::GetPlugins(
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "base/stringprintf.h"
|
#include "base/stringprintf.h"
|
||||||
#include "media/base/filter_collection.h"
|
#include "media/base/filter_collection.h"
|
||||||
#include "media/base/media_log.h"
|
#include "media/base/media_log.h"
|
||||||
#include "media/base/message_loop_factory_impl.h"
|
#include "media/base/message_loop_factory.h"
|
||||||
#include "media/filters/null_audio_renderer.h"
|
#include "media/filters/null_audio_renderer.h"
|
||||||
#include "net/base/net_errors.h"
|
#include "net/base/net_errors.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
|
||||||
@ -168,7 +168,7 @@ void TranslatePopupFeatures(const WebWindowFeatures& webKitFeatures,
|
|||||||
|
|
||||||
WebView* BrowserWebViewDelegate::createView(WebFrame* creator,
|
WebView* BrowserWebViewDelegate::createView(WebFrame* creator,
|
||||||
const WebURLRequest& request, const WebWindowFeatures& features,
|
const WebURLRequest& request, const WebWindowFeatures& features,
|
||||||
const WebString& name) {
|
const WebString& name, WebKit::WebNavigationPolicy policy) {
|
||||||
CefString url;
|
CefString url;
|
||||||
if (!request.isNull())
|
if (!request.isNull())
|
||||||
url = request.url().spec().utf16();
|
url = request.url().spec().utf16();
|
||||||
@ -187,17 +187,24 @@ WebWidget* BrowserWebViewDelegate::createPopupMenu(WebPopupType popup_type) {
|
|||||||
|
|
||||||
WebStorageNamespace* BrowserWebViewDelegate::createSessionStorageNamespace(
|
WebStorageNamespace* BrowserWebViewDelegate::createSessionStorageNamespace(
|
||||||
unsigned quota) {
|
unsigned quota) {
|
||||||
|
#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
|
||||||
|
NOTREACHED();
|
||||||
|
#else
|
||||||
// Ignore the quota parameter from WebCore as in Chrome.
|
// Ignore the quota parameter from WebCore as in Chrome.
|
||||||
return new BrowserWebStorageNamespaceImpl(DOM_STORAGE_SESSION,
|
return new BrowserWebStorageNamespaceImpl(DOM_STORAGE_SESSION,
|
||||||
kLocalStorageNamespaceId + 1);
|
kLocalStorageNamespaceId + 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
WebKit::WebGraphicsContext3D* BrowserWebViewDelegate::createGraphicsContext3D(
|
WebKit::WebGraphicsContext3D* BrowserWebViewDelegate::createGraphicsContext3D(
|
||||||
const WebKit::WebGraphicsContext3D::Attributes& attributes,
|
const WebKit::WebGraphicsContext3D::Attributes& attributes) {
|
||||||
bool renderDirectlyToWebView) {
|
WebKit::WebView* web_view = browser_->UIT_GetWebView();
|
||||||
|
if (!web_view)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
const CefSettings& settings = _Context->settings();
|
const CefSettings& settings = _Context->settings();
|
||||||
return webkit_glue::CreateGraphicsContext3D(settings.graphics_implementation,
|
return webkit_glue::CreateGraphicsContext3D(settings.graphics_implementation,
|
||||||
attributes, renderDirectlyToWebView);
|
attributes, web_view, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebViewDelegate::didAddMessageToConsole(
|
void BrowserWebViewDelegate::didAddMessageToConsole(
|
||||||
@ -663,7 +670,7 @@ WebPlugin* BrowserWebViewDelegate::createPlugin(
|
|||||||
WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer(
|
WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer(
|
||||||
WebFrame* frame, WebMediaPlayerClient* client) {
|
WebFrame* frame, WebMediaPlayerClient* client) {
|
||||||
scoped_ptr<media::MessageLoopFactory> message_loop_factory(
|
scoped_ptr<media::MessageLoopFactory> message_loop_factory(
|
||||||
new media::MessageLoopFactoryImpl());
|
new media::MessageLoopFactory());
|
||||||
|
|
||||||
scoped_ptr<media::FilterCollection> collection(
|
scoped_ptr<media::FilterCollection> collection(
|
||||||
new media::FilterCollection());
|
new media::FilterCollection());
|
||||||
@ -884,7 +891,8 @@ void BrowserWebViewDelegate::didCommitProvisionalLoad(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebViewDelegate::didCreateScriptContext(
|
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();
|
CefRefPtr<CefClient> client = browser_->GetClient();
|
||||||
if (!client.get())
|
if (!client.get())
|
||||||
return;
|
return;
|
||||||
|
@ -66,8 +66,8 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient,
|
|||||||
// WebKit::WebViewClient
|
// WebKit::WebViewClient
|
||||||
virtual WebKit::WebView* createView(
|
virtual WebKit::WebView* createView(
|
||||||
WebKit::WebFrame* creator, const WebKit::WebURLRequest& request,
|
WebKit::WebFrame* creator, const WebKit::WebURLRequest& request,
|
||||||
const WebKit::WebWindowFeatures& features, const WebKit::WebString& name)
|
const WebKit::WebWindowFeatures& features, const WebKit::WebString& name,
|
||||||
OVERRIDE;
|
WebKit::WebNavigationPolicy policy) OVERRIDE;
|
||||||
virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type)
|
virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type)
|
||||||
OVERRIDE;
|
OVERRIDE;
|
||||||
virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu(
|
virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu(
|
||||||
@ -76,8 +76,7 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient,
|
|||||||
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(
|
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(
|
||||||
unsigned quota) OVERRIDE;
|
unsigned quota) OVERRIDE;
|
||||||
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(
|
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(
|
||||||
const WebKit::WebGraphicsContext3D::Attributes& attributes,
|
const WebKit::WebGraphicsContext3D::Attributes& attributes) OVERRIDE;
|
||||||
bool renderDirectlyToWebView) OVERRIDE;
|
|
||||||
virtual void didAddMessageToConsole(
|
virtual void didAddMessageToConsole(
|
||||||
const WebKit::WebConsoleMessage& message,
|
const WebKit::WebConsoleMessage& message,
|
||||||
const WebKit::WebString& source_name, unsigned source_line) OVERRIDE;
|
const WebKit::WebString& source_name, unsigned source_line) OVERRIDE;
|
||||||
@ -183,7 +182,8 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient,
|
|||||||
virtual void didCommitProvisionalLoad(
|
virtual void didCommitProvisionalLoad(
|
||||||
WebKit::WebFrame*, bool is_new_navigation) OVERRIDE;
|
WebKit::WebFrame*, bool is_new_navigation) OVERRIDE;
|
||||||
virtual void didCreateScriptContext(
|
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(
|
virtual void willReleaseScriptContext(
|
||||||
WebKit::WebFrame*, v8::Handle<v8::Context>, int worldId) OVERRIDE;
|
WebKit::WebFrame*, v8::Handle<v8::Context>, int worldId) OVERRIDE;
|
||||||
virtual void didReceiveTitle(
|
virtual void didReceiveTitle(
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "libcef/cef_context.h"
|
#include "libcef/cef_context.h"
|
||||||
#include "libcef/browser_appcache_system.h"
|
#include "libcef/browser_appcache_system.h"
|
||||||
#include "libcef/browser_file_writer.h"
|
#include "libcef/browser_file_writer.h"
|
||||||
|
#include "libcef/browser_network_delegate.h"
|
||||||
#include "libcef/browser_resource_loader_bridge.h"
|
#include "libcef/browser_resource_loader_bridge.h"
|
||||||
#include "libcef/browser_socket_stream_bridge.h"
|
#include "libcef/browser_socket_stream_bridge.h"
|
||||||
#include "libcef/browser_webblobregistry_impl.h"
|
#include "libcef/browser_webblobregistry_impl.h"
|
||||||
@ -40,8 +41,13 @@ void CefProcessIOThread::Init() {
|
|||||||
net::HttpCache::NORMAL, false);
|
net::HttpCache::NORMAL, false);
|
||||||
_Context->set_request_context(request_context_);
|
_Context->set_request_context(request_context_);
|
||||||
|
|
||||||
|
network_delegate_.reset(new BrowserNetworkDelegate());
|
||||||
|
request_context_->set_network_delegate(network_delegate_.get());
|
||||||
|
|
||||||
BrowserAppCacheSystem::InitializeOnIOThread(request_context_);
|
BrowserAppCacheSystem::InitializeOnIOThread(request_context_);
|
||||||
BrowserFileWriter::InitializeOnIOThread(request_context_);
|
BrowserFileWriter::InitializeOnIOThread(request_context_);
|
||||||
|
BrowserFileSystem::InitializeOnIOThread(
|
||||||
|
request_context_->blob_storage_controller());
|
||||||
BrowserSocketStreamBridge::InitializeOnIOThread(request_context_);
|
BrowserSocketStreamBridge::InitializeOnIOThread(request_context_);
|
||||||
BrowserWebBlobRegistryImpl::InitializeOnIOThread(
|
BrowserWebBlobRegistryImpl::InitializeOnIOThread(
|
||||||
request_context_->blob_storage_controller());
|
request_context_->blob_storage_controller());
|
||||||
@ -56,10 +62,15 @@ void CefProcessIOThread::CleanUp() {
|
|||||||
// In reverse order of initialization.
|
// In reverse order of initialization.
|
||||||
BrowserWebBlobRegistryImpl::Cleanup();
|
BrowserWebBlobRegistryImpl::Cleanup();
|
||||||
BrowserSocketStreamBridge::Cleanup();
|
BrowserSocketStreamBridge::Cleanup();
|
||||||
|
BrowserFileSystem::CleanupOnIOThread();
|
||||||
BrowserFileWriter::CleanupOnIOThread();
|
BrowserFileWriter::CleanupOnIOThread();
|
||||||
BrowserAppCacheSystem::CleanupOnIOThread();
|
BrowserAppCacheSystem::CleanupOnIOThread();
|
||||||
|
|
||||||
_Context->set_request_context(NULL);
|
_Context->set_request_context(NULL);
|
||||||
|
|
||||||
|
request_context_->set_network_delegate(NULL);
|
||||||
|
network_delegate_.reset(NULL);
|
||||||
|
|
||||||
request_context_ = NULL;
|
request_context_ = NULL;
|
||||||
|
|
||||||
CefThread::Cleanup();
|
CefThread::Cleanup();
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
|
|
||||||
|
namespace net {
|
||||||
|
class NetworkDelegate;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// CefProcessIOThread
|
// CefProcessIOThread
|
||||||
//
|
//
|
||||||
@ -36,6 +40,7 @@ class CefProcessIOThread : public CefThread {
|
|||||||
virtual void CleanUp();
|
virtual void CleanUp();
|
||||||
|
|
||||||
scoped_refptr<BrowserRequestContext> request_context_;
|
scoped_refptr<BrowserRequestContext> request_context_;
|
||||||
|
scoped_ptr<net::NetworkDelegate> network_delegate_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefProcessIOThread);
|
DISALLOW_COPY_AND_ASSIGN(CefProcessIOThread);
|
||||||
};
|
};
|
||||||
|
@ -30,13 +30,20 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy {
|
|||||||
: id_(identifier) {
|
: id_(identifier) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MessageLoopProxy implementation.
|
// TaskRunner implementation.
|
||||||
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
|
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
|
||||||
const base::Closure& task,
|
const base::Closure& task,
|
||||||
int64 delay_ms) OVERRIDE {
|
int64 delay_ms) OVERRIDE {
|
||||||
return CefThread::PostDelayedTask(id_, from_here, task, delay_ms);
|
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(
|
virtual bool PostNonNestableDelayedTask(
|
||||||
const tracked_objects::Location& from_here,
|
const tracked_objects::Location& from_here,
|
||||||
const base::Closure& task,
|
const base::Closure& task,
|
||||||
@ -45,6 +52,13 @@ class CefThreadMessageLoopProxy : public MessageLoopProxy {
|
|||||||
delay_ms);
|
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 {
|
virtual bool RunsTasksOnCurrentThread() const OVERRIDE {
|
||||||
return CefThread::CurrentlyOn(id_);
|
return CefThread::CurrentlyOn(id_);
|
||||||
}
|
}
|
||||||
@ -150,6 +164,15 @@ bool CefThread::PostDelayedTask(ID identifier,
|
|||||||
return PostTaskHelper(identifier, from_here, task, delay_ms, true);
|
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
|
// static
|
||||||
bool CefThread::PostNonNestableTask(
|
bool CefThread::PostNonNestableTask(
|
||||||
ID identifier,
|
ID identifier,
|
||||||
@ -167,6 +190,16 @@ bool CefThread::PostNonNestableDelayedTask(
|
|||||||
return PostTaskHelper(identifier, from_here, task, delay_ms, false);
|
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
|
// static
|
||||||
bool CefThread::GetCurrentThreadIdentifier(ID* identifier) {
|
bool CefThread::GetCurrentThreadIdentifier(ID* identifier) {
|
||||||
MessageLoop* cur_message_loop = MessageLoop::current();
|
MessageLoop* cur_message_loop = MessageLoop::current();
|
||||||
|
@ -82,6 +82,10 @@ class CefThread : public base::Thread {
|
|||||||
const tracked_objects::Location& from_here,
|
const tracked_objects::Location& from_here,
|
||||||
const base::Closure& task,
|
const base::Closure& task,
|
||||||
int64 delay_ms);
|
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,
|
static bool PostNonNestableTask(ID identifier,
|
||||||
const tracked_objects::Location& from_here,
|
const tracked_objects::Location& from_here,
|
||||||
const base::Closure& task);
|
const base::Closure& task);
|
||||||
@ -90,6 +94,11 @@ class CefThread : public base::Thread {
|
|||||||
const tracked_objects::Location& from_here,
|
const tracked_objects::Location& from_here,
|
||||||
const base::Closure& task,
|
const base::Closure& task,
|
||||||
int64 delay_ms);
|
int64 delay_ms);
|
||||||
|
static bool PostNonNestableDelayedTask(
|
||||||
|
ID identifier,
|
||||||
|
const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay);
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
static bool DeleteSoon(ID identifier,
|
static bool DeleteSoon(ID identifier,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "include/cef_cookie.h"
|
#include "include/cef_cookie.h"
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
#include "net/base/cookie_monster.h"
|
#include "net/cookies/cookie_monster.h"
|
||||||
|
|
||||||
// Implementation of the CefCookieManager interface.
|
// Implementation of the CefCookieManager interface.
|
||||||
class CefCookieManagerImpl : public CefCookieManager {
|
class CefCookieManagerImpl : public CefCookieManager {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#define CEF_LIBCEF_COOKIE_STORE_PROXY_H_
|
#define CEF_LIBCEF_COOKIE_STORE_PROXY_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "net/base/cookie_store.h"
|
#include "net/cookies/cookie_store.h"
|
||||||
|
|
||||||
class CefBrowserImpl;
|
class CefBrowserImpl;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
namespace printing {
|
namespace printing {
|
||||||
|
|
||||||
// Global SequenceNumber used for generating unique cookie values.
|
// Global SequenceNumber used for generating unique cookie values.
|
||||||
static base::AtomicSequenceNumber cookie_seq(base::LINKER_INITIALIZED);
|
static base::AtomicSequenceNumber cookie_seq;
|
||||||
|
|
||||||
PageMeasurements::PageMeasurements()
|
PageMeasurements::PageMeasurements()
|
||||||
: page_type(PT_LETTER),
|
: page_type(PT_LETTER),
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "googleurl/src/url_util.h"
|
#include "googleurl/src/url_util.h"
|
||||||
#include "net/base/completion_callback.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/io_buffer.h"
|
||||||
#include "net/base/upload_data.h"
|
#include "net/base/upload_data.h"
|
||||||
#include "net/http/http_response_headers.h"
|
#include "net/http/http_response_headers.h"
|
||||||
@ -178,7 +179,8 @@ class CefUrlRequestJob : public net::URLRequestJob {
|
|||||||
|
|
||||||
net::CookieStore* cookie_store =
|
net::CookieStore* cookie_store =
|
||||||
request_->context()->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();
|
net::CookieMonster* cookie_monster = cookie_store->GetCookieMonster();
|
||||||
if (cookie_monster) {
|
if (cookie_monster) {
|
||||||
cookie_monster->GetAllCookiesForURLAsync(
|
cookie_monster->GetAllCookiesForURLAsync(
|
||||||
@ -388,6 +390,12 @@ class CefUrlRequestJob : public net::URLRequestJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SaveCookiesAndNotifyHeadersComplete() {
|
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_.clear();
|
||||||
response_cookies_save_index_ = 0;
|
response_cookies_save_index_ = 0;
|
||||||
|
|
||||||
|
@ -46,6 +46,10 @@ bool SimpleClipboardClient::IsFormatAvailable(
|
|||||||
return GetClipboard()->IsFormatAvailable(format, buffer);
|
return GetClipboard()->IsFormatAvailable(format, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SimpleClipboardClient::Clear(ui::Clipboard::Buffer buffer) {
|
||||||
|
GetClipboard()->Clear(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void SimpleClipboardClient::ReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
void SimpleClipboardClient::ReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
||||||
std::vector<string16>* types,
|
std::vector<string16>* types,
|
||||||
bool* contains_filenames) {
|
bool* contains_filenames) {
|
||||||
|
@ -21,6 +21,7 @@ class SimpleClipboardClient : public webkit_glue::ClipboardClient {
|
|||||||
virtual uint64 GetSequenceNumber(ui::Clipboard::Buffer buffer) OVERRIDE;
|
virtual uint64 GetSequenceNumber(ui::Clipboard::Buffer buffer) OVERRIDE;
|
||||||
virtual bool IsFormatAvailable(const ui::Clipboard::FormatType& format,
|
virtual bool IsFormatAvailable(const ui::Clipboard::FormatType& format,
|
||||||
ui::Clipboard::Buffer buffer) OVERRIDE;
|
ui::Clipboard::Buffer buffer) OVERRIDE;
|
||||||
|
virtual void Clear(ui::Clipboard::Buffer buffer) OVERRIDE;
|
||||||
virtual void ReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
virtual void ReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
||||||
std::vector<string16>* types,
|
std::vector<string16>* types,
|
||||||
bool* contains_filenames) OVERRIDE;
|
bool* contains_filenames) OVERRIDE;
|
||||||
|
@ -21,11 +21,6 @@ patches = [
|
|||||||
'name': 'tools_gyp',
|
'name': 'tools_gyp',
|
||||||
'path': '../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
|
# http://code.google.com/p/chromiumembedded/issues/detail?id=364
|
||||||
'name': 'spi_webcore_364',
|
'name': 'spi_webcore_364',
|
||||||
|
@ -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);
|
|
||||||
}
|
|
@ -321,8 +321,6 @@ void AppGetBrowserSettings(CefBrowserSettings& settings) {
|
|||||||
g_command_line->HasSwitch(cefclient::kWebglDisabled);
|
g_command_line->HasSwitch(cefclient::kWebglDisabled);
|
||||||
settings.accelerated_compositing_enabled =
|
settings.accelerated_compositing_enabled =
|
||||||
g_command_line->HasSwitch(cefclient::kAcceleratedCompositingEnabled);
|
g_command_line->HasSwitch(cefclient::kAcceleratedCompositingEnabled);
|
||||||
settings.threaded_compositing_enabled =
|
|
||||||
g_command_line->HasSwitch(cefclient::kThreadedCompositingEnabled);
|
|
||||||
settings.accelerated_layers_disabled =
|
settings.accelerated_layers_disabled =
|
||||||
g_command_line->HasSwitch(cefclient::kAcceleratedLayersDisabled);
|
g_command_line->HasSwitch(cefclient::kAcceleratedLayersDisabled);
|
||||||
settings.accelerated_video_disabled =
|
settings.accelerated_video_disabled =
|
||||||
|
@ -73,7 +73,6 @@ const char kDatabasesDisabled[] = "databases-disabled";
|
|||||||
const char kApplicationCacheDisabled[] = "application-cache-disabled";
|
const char kApplicationCacheDisabled[] = "application-cache-disabled";
|
||||||
const char kWebglDisabled[] = "webgl-disabled";
|
const char kWebglDisabled[] = "webgl-disabled";
|
||||||
const char kAcceleratedCompositingEnabled[] = "accelerated-compositing-enabled";
|
const char kAcceleratedCompositingEnabled[] = "accelerated-compositing-enabled";
|
||||||
const char kThreadedCompositingEnabled[] = "threaded-compositing-enabled";
|
|
||||||
const char kAcceleratedLayersDisabled[] = "accelerated-layers-disabled";
|
const char kAcceleratedLayersDisabled[] = "accelerated-layers-disabled";
|
||||||
const char kAcceleratedVideoDisabled[] = "accelerated-video-disabled";
|
const char kAcceleratedVideoDisabled[] = "accelerated-video-disabled";
|
||||||
const char kAcceledated2dCanvasDisabled[] = "accelerated-2d-canvas-disabled";
|
const char kAcceledated2dCanvasDisabled[] = "accelerated-2d-canvas-disabled";
|
||||||
|
@ -70,7 +70,6 @@ extern const char kDatabasesDisabled[];
|
|||||||
extern const char kApplicationCacheDisabled[];
|
extern const char kApplicationCacheDisabled[];
|
||||||
extern const char kWebglDisabled[];
|
extern const char kWebglDisabled[];
|
||||||
extern const char kAcceleratedCompositingEnabled[];
|
extern const char kAcceleratedCompositingEnabled[];
|
||||||
extern const char kThreadedCompositingEnabled[];
|
|
||||||
extern const char kAcceleratedLayersDisabled[];
|
extern const char kAcceleratedLayersDisabled[];
|
||||||
extern const char kAcceleratedVideoDisabled[];
|
extern const char kAcceleratedVideoDisabled[];
|
||||||
extern const char kAcceledated2dCanvasDisabled[];
|
extern const char kAcceledated2dCanvasDisabled[];
|
||||||
|
@ -86,8 +86,8 @@ Required components:
|
|||||||
Optional components:
|
Optional components:
|
||||||
|
|
||||||
* FFmpeg audio and video support
|
* FFmpeg audio and video support
|
||||||
avcodec-53.dll
|
avcodec-54.dll
|
||||||
avformat-53.dll
|
avformat-54.dll
|
||||||
avutil-51.dll
|
avutil-51.dll
|
||||||
Note: Without these components HTML5 audio and video will not function.
|
Note: Without these components HTML5 audio and video will not function.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user