Update to Chromium revision 80310.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@213 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
029fbc8865
commit
71a6f6548b
|
@ -63,3 +63,4 @@ Date | CEF Revision | Chromium Revision
|
||||||
2011-01-07 | /trunk@159 | /trunk@70742
|
2011-01-07 | /trunk@159 | /trunk@70742
|
||||||
2011-01-11 | /trunk@162 | /trunk@71081
|
2011-01-11 | /trunk@162 | /trunk@71081
|
||||||
2011-02-15 | /trunk@186 | /trunk@74933
|
2011-02-15 | /trunk@186 | /trunk@74933
|
||||||
|
2011-04-05 | /trunk@213 | /trunk@80310
|
||||||
|
|
10
cef.gyp
10
cef.gyp
|
@ -267,14 +267,15 @@
|
||||||
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:inspector_resources',
|
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:inspector_resources',
|
||||||
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
|
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
|
||||||
'../third_party/zlib/zlib.gyp:zlib',
|
'../third_party/zlib/zlib.gyp:zlib',
|
||||||
'../ui/gfx/gfx.gyp:gfx',
|
'../ui/ui.gyp:gfx_resources',
|
||||||
'../ui/gfx/gfx.gyp:gfx_resources',
|
|
||||||
'../ui/ui.gyp:ui_base',
|
'../ui/ui.gyp:ui_base',
|
||||||
|
'../ui/ui.gyp:ui_gfx',
|
||||||
'../webkit/support/webkit_support.gyp:appcache',
|
'../webkit/support/webkit_support.gyp:appcache',
|
||||||
'../webkit/support/webkit_support.gyp:blob',
|
'../webkit/support/webkit_support.gyp:blob',
|
||||||
'../webkit/support/webkit_support.gyp:database',
|
'../webkit/support/webkit_support.gyp:database',
|
||||||
'../webkit/support/webkit_support.gyp:fileapi',
|
'../webkit/support/webkit_support.gyp:fileapi',
|
||||||
'../webkit/support/webkit_support.gyp:glue',
|
'../webkit/support/webkit_support.gyp:glue',
|
||||||
|
'../webkit/support/webkit_support.gyp:quota',
|
||||||
'../webkit/support/webkit_support.gyp:webkit_gpu',
|
'../webkit/support/webkit_support.gyp:webkit_gpu',
|
||||||
'../webkit/support/webkit_support.gyp:webkit_resources',
|
'../webkit/support/webkit_support.gyp:webkit_resources',
|
||||||
'../webkit/support/webkit_support.gyp:webkit_strings',
|
'../webkit/support/webkit_support.gyp:webkit_strings',
|
||||||
|
@ -511,14 +512,15 @@
|
||||||
'../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore',
|
'../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore',
|
||||||
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
|
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
|
||||||
'../third_party/zlib/zlib.gyp:zlib',
|
'../third_party/zlib/zlib.gyp:zlib',
|
||||||
'../ui/gfx/gfx.gyp:gfx',
|
'../ui/ui.gyp:gfx_resources',
|
||||||
'../ui/gfx/gfx.gyp:gfx_resources',
|
|
||||||
'../ui/ui.gyp:ui_base',
|
'../ui/ui.gyp:ui_base',
|
||||||
|
'../ui/ui.gyp:ui_gfx',
|
||||||
'../webkit/support/webkit_support.gyp:appcache',
|
'../webkit/support/webkit_support.gyp:appcache',
|
||||||
'../webkit/support/webkit_support.gyp:blob',
|
'../webkit/support/webkit_support.gyp:blob',
|
||||||
'../webkit/support/webkit_support.gyp:database',
|
'../webkit/support/webkit_support.gyp:database',
|
||||||
'../webkit/support/webkit_support.gyp:fileapi',
|
'../webkit/support/webkit_support.gyp:fileapi',
|
||||||
'../webkit/support/webkit_support.gyp:glue',
|
'../webkit/support/webkit_support.gyp:glue',
|
||||||
|
'../webkit/support/webkit_support.gyp:quota',
|
||||||
'../webkit/support/webkit_support.gyp:webkit_gpu',
|
'../webkit/support/webkit_support.gyp:webkit_gpu',
|
||||||
'../webkit/support/webkit_support.gyp:webkit_resources',
|
'../webkit/support/webkit_support.gyp:webkit_resources',
|
||||||
'../webkit/support/webkit_support.gyp:webkit_strings',
|
'../webkit/support/webkit_support.gyp:webkit_strings',
|
||||||
|
|
|
@ -197,6 +197,18 @@ class BrowserBackendProxy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void SetSpawningHostId(int host_id, int spawning_host_id) {
|
||||||
|
if (system_->is_ui_thread()) {
|
||||||
|
system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
|
||||||
|
this, &BrowserBackendProxy::SetSpawningHostId,
|
||||||
|
host_id, spawning_host_id));
|
||||||
|
} else if (system_->is_io_thread()) {
|
||||||
|
system_->backend_impl_->SetSpawningHostId(host_id, spawning_host_id);
|
||||||
|
} else {
|
||||||
|
NOTREACHED();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void SelectCache(int host_id,
|
virtual void SelectCache(int host_id,
|
||||||
const GURL& document_url,
|
const GURL& document_url,
|
||||||
const int64 cache_document_was_loaded_from,
|
const int64 cache_document_was_loaded_from,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
||||||
#include "base/auto_reset.h"
|
#include "base/auto_reset.h"
|
||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
|
#include "base/message_loop_proxy.h"
|
||||||
|
#include "base/synchronization/waitable_event.h"
|
||||||
#include "base/threading/platform_thread.h"
|
#include "base/threading/platform_thread.h"
|
||||||
#include "base/utf_string_conversions.h"
|
#include "base/utf_string_conversions.h"
|
||||||
#include "third_party/sqlite/sqlite3.h"
|
#include "third_party/sqlite/sqlite3.h"
|
||||||
|
@ -27,91 +29,138 @@ BrowserDatabaseSystem* BrowserDatabaseSystem::GetInstance() {
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserDatabaseSystem::BrowserDatabaseSystem()
|
BrowserDatabaseSystem::BrowserDatabaseSystem()
|
||||||
: waiting_for_dbs_to_close_(false) {
|
: db_thread_("SimpleDBThread"),
|
||||||
CHECK(temp_dir_.CreateUniqueTempDir());
|
open_connections_(new webkit_database::DatabaseConnectionsWrapper) {
|
||||||
db_tracker_ = new DatabaseTracker(temp_dir_.path(), false);
|
|
||||||
db_tracker_->AddObserver(this);
|
|
||||||
DCHECK(!instance_);
|
DCHECK(!instance_);
|
||||||
instance_ = this;
|
instance_ = this;
|
||||||
|
CHECK(temp_dir_.CreateUniqueTempDir());
|
||||||
|
db_tracker_ = new DatabaseTracker(temp_dir_.path(), false, NULL);
|
||||||
|
db_tracker_->AddObserver(this);
|
||||||
|
db_thread_.Start();
|
||||||
|
db_thread_proxy_ = db_thread_.message_loop_proxy();
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserDatabaseSystem::~BrowserDatabaseSystem() {
|
BrowserDatabaseSystem::~BrowserDatabaseSystem() {
|
||||||
db_tracker_->RemoveObserver(this);
|
base::WaitableEvent done_event(false, false);
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::ThreadCleanup,
|
||||||
|
&done_event));
|
||||||
|
done_event.Wait();
|
||||||
instance_ = NULL;
|
instance_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BrowserDatabaseSystem::databaseOpened(const WebKit::WebDatabase& database) {
|
||||||
|
string16 origin_identifier = database.securityOrigin().databaseIdentifier();
|
||||||
|
string16 database_name = database.name();
|
||||||
|
open_connections_->AddOpenConnection(origin_identifier, database_name);
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::DatabaseOpened,
|
||||||
|
origin_identifier,
|
||||||
|
database_name, database.displayName(),
|
||||||
|
database.estimatedSize()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void BrowserDatabaseSystem::databaseModified(
|
||||||
|
const WebKit::WebDatabase& database) {
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::DatabaseModified,
|
||||||
|
database.securityOrigin().databaseIdentifier(),
|
||||||
|
database.name()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void BrowserDatabaseSystem::databaseClosed(const WebKit::WebDatabase& database) {
|
||||||
|
string16 origin_identifier = database.securityOrigin().databaseIdentifier();
|
||||||
|
string16 database_name = database.name();
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::DatabaseClosed,
|
||||||
|
origin_identifier, database_name));
|
||||||
|
}
|
||||||
|
|
||||||
base::PlatformFile BrowserDatabaseSystem::OpenFile(
|
base::PlatformFile BrowserDatabaseSystem::OpenFile(
|
||||||
const string16& vfs_file_name, int desired_flags) {
|
const string16& vfs_file_name, int desired_flags) {
|
||||||
base::PlatformFile file_handle = base::kInvalidPlatformFileValue;
|
base::PlatformFile result = base::kInvalidPlatformFileValue;
|
||||||
FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
|
base::WaitableEvent done_event(false, false);
|
||||||
if (file_name.empty()) {
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
VfsBackend::OpenTempFileInDirectory(
|
NewRunnableMethod(this, &BrowserDatabaseSystem::VfsOpenFile,
|
||||||
db_tracker_->DatabaseDirectory(), desired_flags, &file_handle);
|
vfs_file_name, desired_flags,
|
||||||
} else {
|
&result, &done_event));
|
||||||
VfsBackend::OpenFile(file_name, desired_flags, &file_handle);
|
done_event.Wait();
|
||||||
}
|
return result;
|
||||||
|
|
||||||
return file_handle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int BrowserDatabaseSystem::DeleteFile(
|
int BrowserDatabaseSystem::DeleteFile(
|
||||||
const string16& vfs_file_name, bool sync_dir) {
|
const string16& vfs_file_name, bool sync_dir) {
|
||||||
// We try to delete the file multiple times, because that's what the default
|
int result = SQLITE_OK;
|
||||||
// VFS does (apparently deleting a file can sometimes fail on Windows).
|
base::WaitableEvent done_event(false, false);
|
||||||
// We sleep for 10ms between retries for the same reason.
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
const int kNumDeleteRetries = 3;
|
NewRunnableMethod(this, &BrowserDatabaseSystem::VfsDeleteFile,
|
||||||
int num_retries = 0;
|
vfs_file_name, sync_dir,
|
||||||
int error_code = SQLITE_OK;
|
&result, &done_event));
|
||||||
FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
|
done_event.Wait();
|
||||||
do {
|
return result;
|
||||||
error_code = VfsBackend::DeleteFile(file_name, sync_dir);
|
|
||||||
} while ((++num_retries < kNumDeleteRetries) &&
|
|
||||||
(error_code == SQLITE_IOERR_DELETE) &&
|
|
||||||
(base::PlatformThread::Sleep(10), 1));
|
|
||||||
|
|
||||||
return error_code;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long BrowserDatabaseSystem::GetFileAttributes(const string16& vfs_file_name) {
|
uint32 BrowserDatabaseSystem::GetFileAttributes(const string16& vfs_file_name) {
|
||||||
return VfsBackend::GetFileAttributes(
|
uint32 result = 0;
|
||||||
GetFullFilePathForVfsFile(vfs_file_name));
|
base::WaitableEvent done_event(false, false);
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::VfsGetFileAttributes,
|
||||||
|
vfs_file_name, &result, &done_event));
|
||||||
|
done_event.Wait();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
long long BrowserDatabaseSystem::GetFileSize(const string16& vfs_file_name) {
|
int64 BrowserDatabaseSystem::GetFileSize(const string16& vfs_file_name) {
|
||||||
return VfsBackend::GetFileSize(GetFullFilePathForVfsFile(vfs_file_name));
|
int64 result = 0;
|
||||||
|
base::WaitableEvent done_event(false, false);
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::VfsGetFileSize,
|
||||||
|
vfs_file_name, &result, &done_event));
|
||||||
|
done_event.Wait();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BrowserDatabaseSystem::ClearAllDatabases() {
|
||||||
|
open_connections_->WaitForAllDatabasesToClose();
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::ResetTracker));
|
||||||
|
}
|
||||||
|
|
||||||
|
void BrowserDatabaseSystem::SetDatabaseQuota(int64 quota) {
|
||||||
|
if (!db_thread_proxy_->BelongsToCurrentThread()) {
|
||||||
|
db_thread_proxy_->PostTask(FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &BrowserDatabaseSystem::SetDatabaseQuota,
|
||||||
|
quota));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
db_tracker_->SetDefaultQuota(quota);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::DatabaseOpened(const string16& origin_identifier,
|
void BrowserDatabaseSystem::DatabaseOpened(const string16& origin_identifier,
|
||||||
const string16& database_name,
|
const string16& database_name,
|
||||||
const string16& description,
|
const string16& description,
|
||||||
int64 estimated_size) {
|
int64 estimated_size) {
|
||||||
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
int64 database_size = 0;
|
int64 database_size = 0;
|
||||||
int64 space_available = 0;
|
int64 space_available = 0;
|
||||||
database_connections_.AddConnection(origin_identifier, database_name);
|
db_tracker_->DatabaseOpened(
|
||||||
db_tracker_->DatabaseOpened(origin_identifier, database_name, description,
|
origin_identifier, database_name, description,
|
||||||
estimated_size, &database_size, &space_available);
|
estimated_size, &database_size, &space_available);
|
||||||
SetFullFilePathsForVfsFile(origin_identifier, database_name);
|
|
||||||
|
|
||||||
OnDatabaseSizeChanged(origin_identifier, database_name,
|
OnDatabaseSizeChanged(origin_identifier, database_name,
|
||||||
database_size, space_available);
|
database_size, space_available);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::DatabaseModified(const string16& origin_identifier,
|
void BrowserDatabaseSystem::DatabaseModified(const string16& origin_identifier,
|
||||||
const string16& database_name) {
|
const string16& database_name) {
|
||||||
DCHECK(database_connections_.IsDatabaseOpened(
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
origin_identifier, database_name));
|
|
||||||
db_tracker_->DatabaseModified(origin_identifier, database_name);
|
db_tracker_->DatabaseModified(origin_identifier, database_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::DatabaseClosed(const string16& origin_identifier,
|
void BrowserDatabaseSystem::DatabaseClosed(const string16& origin_identifier,
|
||||||
const string16& database_name) {
|
const string16& database_name) {
|
||||||
DCHECK(database_connections_.IsDatabaseOpened(
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
origin_identifier, database_name));
|
|
||||||
db_tracker_->DatabaseClosed(origin_identifier, database_name);
|
db_tracker_->DatabaseClosed(origin_identifier, database_name);
|
||||||
database_connections_.RemoveConnection(origin_identifier, database_name);
|
open_connections_->RemoveOpenConnection(origin_identifier, database_name);
|
||||||
|
|
||||||
if (waiting_for_dbs_to_close_ && database_connections_.IsEmpty())
|
|
||||||
MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::OnDatabaseSizeChanged(
|
void BrowserDatabaseSystem::OnDatabaseSizeChanged(
|
||||||
|
@ -119,83 +168,95 @@ void BrowserDatabaseSystem::OnDatabaseSizeChanged(
|
||||||
const string16& database_name,
|
const string16& database_name,
|
||||||
int64 database_size,
|
int64 database_size,
|
||||||
int64 space_available) {
|
int64 space_available) {
|
||||||
if (database_connections_.IsOriginUsed(origin_identifier)) {
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
|
// We intentionally call into webkit on our background db_thread_
|
||||||
|
// to better emulate what happens in chrome where this method is
|
||||||
|
// invoked on the background ipc thread.
|
||||||
WebKit::WebDatabase::updateDatabaseSize(
|
WebKit::WebDatabase::updateDatabaseSize(
|
||||||
origin_identifier, database_name, database_size, space_available);
|
origin_identifier, database_name, database_size, space_available);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void BrowserDatabaseSystem::OnDatabaseScheduledForDeletion(
|
void BrowserDatabaseSystem::OnDatabaseScheduledForDeletion(
|
||||||
const string16& origin_identifier,
|
const string16& origin_identifier,
|
||||||
const string16& database_name) {
|
const string16& database_name) {
|
||||||
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
|
// We intentionally call into webkit on our background db_thread_
|
||||||
|
// to better emulate what happens in chrome where this method is
|
||||||
|
// invoked on the background ipc thread.
|
||||||
WebKit::WebDatabase::closeDatabaseImmediately(
|
WebKit::WebDatabase::closeDatabaseImmediately(
|
||||||
origin_identifier, database_name);
|
origin_identifier, database_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::databaseOpened(const WebKit::WebDatabase& database) {
|
void BrowserDatabaseSystem::VfsOpenFile(
|
||||||
DatabaseOpened(database.securityOrigin().databaseIdentifier(),
|
const string16& vfs_file_name, int desired_flags,
|
||||||
database.name(), database.displayName(),
|
base::PlatformFile* file_handle, base::WaitableEvent* done_event ) {
|
||||||
database.estimatedSize());
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
|
FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
|
||||||
|
if (file_name.empty()) {
|
||||||
|
VfsBackend::OpenTempFileInDirectory(
|
||||||
|
db_tracker_->DatabaseDirectory(), desired_flags, file_handle);
|
||||||
|
} else {
|
||||||
|
VfsBackend::OpenFile(file_name, desired_flags, file_handle);
|
||||||
|
}
|
||||||
|
done_event->Signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::databaseModified(
|
void BrowserDatabaseSystem::VfsDeleteFile(
|
||||||
const WebKit::WebDatabase& database) {
|
const string16& vfs_file_name, bool sync_dir,
|
||||||
DatabaseModified(database.securityOrigin().databaseIdentifier(),
|
int* result, base::WaitableEvent* done_event) {
|
||||||
database.name());
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
|
// We try to delete the file multiple times, because that's what the default
|
||||||
|
// VFS does (apparently deleting a file can sometimes fail on Windows).
|
||||||
|
// We sleep for 10ms between retries for the same reason.
|
||||||
|
const int kNumDeleteRetries = 3;
|
||||||
|
int num_retries = 0;
|
||||||
|
*result = SQLITE_OK;
|
||||||
|
FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
|
||||||
|
do {
|
||||||
|
*result = VfsBackend::DeleteFile(file_name, sync_dir);
|
||||||
|
} while ((++num_retries < kNumDeleteRetries) &&
|
||||||
|
(*result == SQLITE_IOERR_DELETE) &&
|
||||||
|
(base::PlatformThread::Sleep(10), 1));
|
||||||
|
|
||||||
|
done_event->Signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::databaseClosed(const WebKit::WebDatabase& database) {
|
void BrowserDatabaseSystem::VfsGetFileAttributes(
|
||||||
DatabaseClosed(database.securityOrigin().databaseIdentifier(),
|
const string16& vfs_file_name,
|
||||||
database.name());
|
uint32* result, base::WaitableEvent* done_event) {
|
||||||
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
|
*result = VfsBackend::GetFileAttributes(
|
||||||
|
GetFullFilePathForVfsFile(vfs_file_name));
|
||||||
|
done_event->Signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDatabaseSystem::ClearAllDatabases() {
|
void BrowserDatabaseSystem::VfsGetFileSize(
|
||||||
// Wait for all databases to be closed.
|
const string16& vfs_file_name,
|
||||||
if (!database_connections_.IsEmpty()) {
|
int64* result, base::WaitableEvent* done_event) {
|
||||||
AutoReset<bool> waiting_for_dbs_auto_reset(
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
&waiting_for_dbs_to_close_, true);
|
*result = VfsBackend::GetFileSize(GetFullFilePathForVfsFile(vfs_file_name));
|
||||||
MessageLoop::ScopedNestableTaskAllower nestable(MessageLoop::current());
|
done_event->Signal();
|
||||||
MessageLoop::current()->Run();
|
|
||||||
}
|
|
||||||
|
|
||||||
db_tracker_->CloseTrackerDatabaseAndClearCaches();
|
|
||||||
file_util::Delete(db_tracker_->DatabaseDirectory(), true);
|
|
||||||
file_names_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BrowserDatabaseSystem::SetDatabaseQuota(int64 quota) {
|
|
||||||
db_tracker_->SetDefaultQuota(quota);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BrowserDatabaseSystem::SetFullFilePathsForVfsFile(
|
|
||||||
const string16& origin_identifier,
|
|
||||||
const string16& database_name) {
|
|
||||||
string16 vfs_file_name = origin_identifier + ASCIIToUTF16("/") +
|
|
||||||
database_name + ASCIIToUTF16("#");
|
|
||||||
FilePath file_name =
|
|
||||||
DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_, vfs_file_name);
|
|
||||||
|
|
||||||
base::AutoLock file_names_auto_lock(file_names_lock_);
|
|
||||||
file_names_[vfs_file_name] = file_name;
|
|
||||||
file_names_[vfs_file_name + ASCIIToUTF16("-journal")] =
|
|
||||||
FilePath::FromWStringHack(file_name.ToWStringHack() +
|
|
||||||
ASCIIToWide("-journal"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePath BrowserDatabaseSystem::GetFullFilePathForVfsFile(
|
FilePath BrowserDatabaseSystem::GetFullFilePathForVfsFile(
|
||||||
const string16& vfs_file_name) {
|
const string16& vfs_file_name) {
|
||||||
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
if (vfs_file_name.empty()) // temp file, used for vacuuming
|
if (vfs_file_name.empty()) // temp file, used for vacuuming
|
||||||
return FilePath();
|
return FilePath();
|
||||||
|
return DatabaseUtil::GetFullFilePathForVfsFile(
|
||||||
base::AutoLock file_names_auto_lock(file_names_lock_);
|
db_tracker_.get(), vfs_file_name);
|
||||||
if(file_names_.find(vfs_file_name) != file_names_.end())
|
|
||||||
return file_names_[vfs_file_name];
|
|
||||||
|
|
||||||
// This method is getting called when an empty localStorage database is
|
|
||||||
// deleted. In that case, just return the path.
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
return FilePath(vfs_file_name);
|
|
||||||
#else
|
|
||||||
return FilePath(UTF16ToUTF8(vfs_file_name));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BrowserDatabaseSystem::ResetTracker() {
|
||||||
|
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
|
||||||
|
db_tracker_->CloseTrackerDatabaseAndClearCaches();
|
||||||
|
file_util::Delete(db_tracker_->DatabaseDirectory(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BrowserDatabaseSystem::ThreadCleanup(base::WaitableEvent* done_event) {
|
||||||
|
ResetTracker();
|
||||||
|
db_tracker_->RemoveObserver(this);
|
||||||
|
db_tracker_ = NULL;
|
||||||
|
done_event->Signal();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -7,29 +7,50 @@
|
||||||
|
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
#include "base/hash_tables.h"
|
#include "base/hash_tables.h"
|
||||||
|
#include "base/memory/ref_counted.h"
|
||||||
|
#include "base/memory/scoped_temp_dir.h"
|
||||||
#include "base/platform_file.h"
|
#include "base/platform_file.h"
|
||||||
#include "base/ref_counted.h"
|
|
||||||
#include "base/scoped_temp_dir.h"
|
|
||||||
#include "base/string16.h"
|
#include "base/string16.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
|
#include "base/task.h"
|
||||||
|
#include "base/threading/thread.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabaseObserver.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabaseObserver.h"
|
||||||
#include "webkit/database/database_connections.h"
|
#include "webkit/database/database_connections.h"
|
||||||
#include "webkit/database/database_tracker.h"
|
#include "webkit/database/database_tracker.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
class MessageLoopProxy;
|
||||||
|
class WaitableEvent;
|
||||||
|
}
|
||||||
|
|
||||||
class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
|
class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
|
||||||
public WebKit::WebDatabaseObserver {
|
public WebKit::WebDatabaseObserver {
|
||||||
public:
|
public:
|
||||||
static BrowserDatabaseSystem* GetInstance();
|
static BrowserDatabaseSystem* GetInstance();
|
||||||
|
|
||||||
BrowserDatabaseSystem();
|
BrowserDatabaseSystem();
|
||||||
~BrowserDatabaseSystem();
|
~BrowserDatabaseSystem();
|
||||||
|
|
||||||
// VFS functions
|
// WebDatabaseObserver implementation, these are called on the script
|
||||||
|
// execution context thread on which the database is opened. This may be
|
||||||
|
// the main thread or background WebWorker threads.
|
||||||
|
virtual void databaseOpened(const WebKit::WebDatabase& database);
|
||||||
|
virtual void databaseModified(const WebKit::WebDatabase& database);
|
||||||
|
virtual void databaseClosed(const WebKit::WebDatabase& database);
|
||||||
|
|
||||||
|
// SQLite VFS related methods, these are called on webcore's
|
||||||
|
// background database threads via the WebKitClient impl.
|
||||||
base::PlatformFile OpenFile(const string16& vfs_file_name, int desired_flags);
|
base::PlatformFile OpenFile(const string16& vfs_file_name, int desired_flags);
|
||||||
int DeleteFile(const string16& vfs_file_name, bool sync_dir);
|
int DeleteFile(const string16& vfs_file_name, bool sync_dir);
|
||||||
long GetFileAttributes(const string16& vfs_file_name);
|
uint32 GetFileAttributes(const string16& vfs_file_name);
|
||||||
long long GetFileSize(const string16& vfs_file_name);
|
int64 GetFileSize(const string16& vfs_file_name);
|
||||||
|
|
||||||
// database tracker functions
|
// For use by LayoutTestController, called on the main thread.
|
||||||
|
void ClearAllDatabases();
|
||||||
|
void SetDatabaseQuota(int64 quota);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Used by our WebDatabaseObserver impl, only called on the db_thread
|
||||||
void DatabaseOpened(const string16& origin_identifier,
|
void DatabaseOpened(const string16& origin_identifier,
|
||||||
const string16& database_name,
|
const string16& database_name,
|
||||||
const string16& description,
|
const string16& description,
|
||||||
|
@ -47,38 +68,36 @@ class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
|
||||||
virtual void OnDatabaseScheduledForDeletion(const string16& origin_identifier,
|
virtual void OnDatabaseScheduledForDeletion(const string16& origin_identifier,
|
||||||
const string16& database_name);
|
const string16& database_name);
|
||||||
|
|
||||||
// WebDatabaseObserver implementation
|
// Used by our public SQLite VFS methods, only called on the db_thread.
|
||||||
virtual void databaseOpened(const WebKit::WebDatabase& database);
|
void VfsOpenFile(const string16& vfs_file_name, int desired_flags,
|
||||||
virtual void databaseModified(const WebKit::WebDatabase& database);
|
base::PlatformFile* result, base::WaitableEvent* done_event);
|
||||||
virtual void databaseClosed(const WebKit::WebDatabase& database);
|
void VfsDeleteFile(const string16& vfs_file_name, bool sync_dir,
|
||||||
|
int* result, base::WaitableEvent* done_event);
|
||||||
|
void VfsGetFileAttributes(const string16& vfs_file_name,
|
||||||
|
uint32* result, base::WaitableEvent* done_event);
|
||||||
|
void VfsGetFileSize(const string16& vfs_file_name,
|
||||||
|
int64* result, base::WaitableEvent* done_event);
|
||||||
|
|
||||||
void ClearAllDatabases();
|
|
||||||
void SetDatabaseQuota(int64 quota);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// The calls that come from the database tracker run on the main thread.
|
|
||||||
// Therefore, we can only call DatabaseUtil::GetFullFilePathForVfsFile()
|
|
||||||
// on the main thread. However, the VFS calls run on the DB thread and
|
|
||||||
// they need to crack VFS file paths. To resolve this problem, we store
|
|
||||||
// a map of vfs_file_names to file_paths. The map is updated on the main
|
|
||||||
// thread on each DatabaseOpened() call that comes from the database
|
|
||||||
// tracker, and is read on the DB thread by each VFS call.
|
|
||||||
void SetFullFilePathsForVfsFile(const string16& origin_identifier,
|
|
||||||
const string16& database_name);
|
|
||||||
FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name);
|
FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name);
|
||||||
|
|
||||||
static BrowserDatabaseSystem* instance_;
|
void ResetTracker();
|
||||||
|
void ThreadCleanup(base::WaitableEvent* done_event);
|
||||||
bool waiting_for_dbs_to_close_;
|
|
||||||
|
|
||||||
|
// Where the tracker database file and per origin database files reside.
|
||||||
ScopedTempDir temp_dir_;
|
ScopedTempDir temp_dir_;
|
||||||
|
|
||||||
|
// All access to the db_tracker (except for its construction) and
|
||||||
|
// vfs operations are serialized on a background thread.
|
||||||
|
base::Thread db_thread_;
|
||||||
|
scoped_refptr<base::MessageLoopProxy> db_thread_proxy_;
|
||||||
scoped_refptr<webkit_database::DatabaseTracker> db_tracker_;
|
scoped_refptr<webkit_database::DatabaseTracker> db_tracker_;
|
||||||
|
|
||||||
base::Lock file_names_lock_;
|
// Data members to support waiting for all connections to be closed.
|
||||||
base::hash_map<string16, FilePath> file_names_;
|
scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_;
|
||||||
|
|
||||||
webkit_database::DatabaseConnections database_connections_;
|
static BrowserDatabaseSystem* instance_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserDatabaseSystem);
|
||||||
|
|
||||||
#endif // _BROWSER_DATABASE_SYSTEM_H
|
#endif // _BROWSER_DATABASE_SYSTEM_H
|
||||||
|
|
|
@ -80,12 +80,6 @@ void BrowserDevToolsAgent::runtimePropertyChanged(
|
||||||
// TODO: Implement.
|
// TODO: Implement.
|
||||||
}
|
}
|
||||||
|
|
||||||
WebCString BrowserDevToolsAgent::debuggerScriptSource() {
|
|
||||||
base::StringPiece debuggerScriptjs =
|
|
||||||
webkit_glue::GetDataResource(IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS);
|
|
||||||
return WebCString(debuggerScriptjs.data(), debuggerScriptjs.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
|
WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
|
||||||
BrowserDevToolsAgent::createClientMessageLoop() {
|
BrowserDevToolsAgent::createClientMessageLoop() {
|
||||||
return new WebKitClientMessageLoopImpl();
|
return new WebKitClientMessageLoopImpl();
|
||||||
|
|
|
@ -34,7 +34,6 @@ class BrowserDevToolsAgent : public WebKit::WebDevToolsAgentClient {
|
||||||
virtual int hostIdentifier() { return routing_id_; }
|
virtual int hostIdentifier() { return routing_id_; }
|
||||||
virtual void runtimePropertyChanged(const WebKit::WebString& name,
|
virtual void runtimePropertyChanged(const WebKit::WebString& name,
|
||||||
const WebKit::WebString& value);
|
const WebKit::WebString& value);
|
||||||
virtual WebKit::WebCString debuggerScriptSource();
|
|
||||||
|
|
||||||
virtual WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
|
virtual WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
|
||||||
createClientMessageLoop();
|
createClientMessageLoop();
|
||||||
|
|
|
@ -454,7 +454,7 @@ void BrowserDragDelegate::PrepareDragForFileContents(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_name = file_name.ReplaceExtension(drop_data.file_extension);
|
file_name = file_name.ReplaceExtension(drop_data.file_extension);
|
||||||
data->SetFileContents(file_name.value(), drop_data.file_contents);
|
data->SetFileContents(file_name, drop_data.file_contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDragDelegate::PrepareDragForUrl(const WebDropData& drop_data,
|
void BrowserDragDelegate::PrepareDragForUrl(const WebDropData& drop_data,
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
#define _BROWSER_DRAG_DELEGATE_WIN_H
|
#define _BROWSER_DRAG_DELEGATE_WIN_H
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/threading/platform_thread.h"
|
#include "base/threading/platform_thread.h"
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
#include "third_party/skia/include/core/SkBitmap.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@
|
||||||
#include "browser_file_writer.h"
|
#include "browser_file_writer.h"
|
||||||
|
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
|
#include "base/memory/scoped_callback_factory.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
#include "base/message_loop_proxy.h"
|
#include "base/message_loop_proxy.h"
|
||||||
#include "base/scoped_callback_factory.h"
|
|
||||||
#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"
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
|
||||||
#include "webkit/fileapi/file_system_callback_dispatcher.h"
|
#include "webkit/fileapi/file_system_callback_dispatcher.h"
|
||||||
#include "webkit/fileapi/file_system_context.h"
|
#include "webkit/fileapi/file_system_context.h"
|
||||||
|
#include "webkit/fileapi/file_system_file_util.h"
|
||||||
#include "webkit/fileapi/file_system_operation.h"
|
#include "webkit/fileapi/file_system_operation.h"
|
||||||
#include "webkit/fileapi/file_system_path_manager.h"
|
#include "webkit/fileapi/file_system_path_manager.h"
|
||||||
#include "webkit/fileapi/file_system_types.h"
|
#include "webkit/fileapi/file_system_types.h"
|
||||||
|
@ -40,6 +41,7 @@ using WebKit::WebVector;
|
||||||
|
|
||||||
using fileapi::FileSystemCallbackDispatcher;
|
using fileapi::FileSystemCallbackDispatcher;
|
||||||
using fileapi::FileSystemContext;
|
using fileapi::FileSystemContext;
|
||||||
|
using fileapi::FileSystemFileUtil;
|
||||||
using fileapi::FileSystemOperation;
|
using fileapi::FileSystemOperation;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -62,13 +64,16 @@ class BrowserFileSystemCallbackDispatcher
|
||||||
callbacks_->didSucceed();
|
callbacks_->didSucceed();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DidReadMetadata(const base::PlatformFileInfo& info) {
|
virtual void DidReadMetadata(const base::PlatformFileInfo& info,
|
||||||
|
const FilePath& platform_path) {
|
||||||
DCHECK(file_system_);
|
DCHECK(file_system_);
|
||||||
WebFileInfo web_file_info;
|
WebFileInfo web_file_info;
|
||||||
web_file_info.length = info.size;
|
web_file_info.length = info.size;
|
||||||
web_file_info.modificationTime = info.last_modified.ToDoubleT();
|
web_file_info.modificationTime = info.last_modified.ToDoubleT();
|
||||||
web_file_info.type = info.is_directory ?
|
web_file_info.type = info.is_directory ?
|
||||||
WebFileInfo::TypeDirectory : WebFileInfo::TypeFile;
|
WebFileInfo::TypeDirectory : WebFileInfo::TypeFile;
|
||||||
|
web_file_info.platformPath =
|
||||||
|
webkit_glue::FilePathToWebString(platform_path);
|
||||||
callbacks_->didReadMetadata(web_file_info);
|
callbacks_->didReadMetadata(web_file_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,10 +126,11 @@ BrowserFileSystem::BrowserFileSystem() {
|
||||||
file_system_context_ = new FileSystemContext(
|
file_system_context_ = new FileSystemContext(
|
||||||
base::MessageLoopProxy::CreateForCurrentThread(),
|
base::MessageLoopProxy::CreateForCurrentThread(),
|
||||||
base::MessageLoopProxy::CreateForCurrentThread(),
|
base::MessageLoopProxy::CreateForCurrentThread(),
|
||||||
|
NULL /* special storage policy */,
|
||||||
file_system_dir_.path(),
|
file_system_dir_.path(),
|
||||||
false /* incognito */,
|
false /* incognito */,
|
||||||
true /* allow_file_access */,
|
true /* allow_file_access */,
|
||||||
false /* unlimited_quota */);
|
true /* unlimited_quota */);
|
||||||
} else {
|
} else {
|
||||||
LOG(WARNING) << "Failed to create a temp dir for the filesystem."
|
LOG(WARNING) << "Failed to create a temp dir for the filesystem."
|
||||||
"FileSystem feature will be disabled.";
|
"FileSystem feature will be disabled.";
|
||||||
|
@ -235,7 +241,7 @@ void BrowserFileSystem::readDirectory(
|
||||||
|
|
||||||
WebFileWriter* BrowserFileSystem::createFileWriter(
|
WebFileWriter* BrowserFileSystem::createFileWriter(
|
||||||
const WebString& path, WebFileWriterClient* client) {
|
const WebString& path, WebFileWriterClient* client) {
|
||||||
return new BrowserFileWriter(path, client);
|
return new BrowserFileWriter(path, client, file_system_context_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemOperation* BrowserFileSystem::GetNewOperation(
|
FileSystemOperation* BrowserFileSystem::GetNewOperation(
|
||||||
|
@ -244,6 +250,6 @@ FileSystemOperation* BrowserFileSystem::GetNewOperation(
|
||||||
new BrowserFileSystemCallbackDispatcher(AsWeakPtr(), callbacks);
|
new BrowserFileSystemCallbackDispatcher(AsWeakPtr(), callbacks);
|
||||||
FileSystemOperation* operation = new FileSystemOperation(
|
FileSystemOperation* operation = new FileSystemOperation(
|
||||||
dispatcher, base::MessageLoopProxy::CreateForCurrentThread(),
|
dispatcher, base::MessageLoopProxy::CreateForCurrentThread(),
|
||||||
file_system_context_.get());
|
file_system_context_.get(), NULL);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "base/file_util_proxy.h"
|
#include "base/file_util_proxy.h"
|
||||||
#include "base/id_map.h"
|
#include "base/id_map.h"
|
||||||
#include "base/scoped_temp_dir.h"
|
#include "base/memory/scoped_temp_dir.h"
|
||||||
#include "base/weak_ptr.h"
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h"
|
||||||
#include "webkit/fileapi/file_system_types.h"
|
#include "webkit/fileapi/file_system_types.h"
|
||||||
|
|
||||||
|
@ -36,6 +36,10 @@ class BrowserFileSystem
|
||||||
bool create,
|
bool create,
|
||||||
WebKit::WebFileSystemCallbacks* callbacks);
|
WebKit::WebFileSystemCallbacks* callbacks);
|
||||||
|
|
||||||
|
fileapi::FileSystemContext* file_system_context() {
|
||||||
|
return file_system_context_.get();
|
||||||
|
}
|
||||||
|
|
||||||
// WebKit::WebFileSystem methods.
|
// WebKit::WebFileSystem methods.
|
||||||
virtual void move(const WebKit::WebString& src_path,
|
virtual void move(const WebKit::WebString& src_path,
|
||||||
const WebKit::WebString& dest_path,
|
const WebKit::WebString& dest_path,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -9,11 +9,15 @@
|
||||||
#include "base/message_loop_proxy.h"
|
#include "base/message_loop_proxy.h"
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
#include "webkit/fileapi/file_system_callback_dispatcher.h"
|
#include "webkit/fileapi/file_system_callback_dispatcher.h"
|
||||||
|
#include "webkit/fileapi/file_system_context.h"
|
||||||
|
#include "webkit/fileapi/file_system_file_util.h"
|
||||||
#include "webkit/fileapi/file_system_operation.h"
|
#include "webkit/fileapi/file_system_operation.h"
|
||||||
#include "webkit/glue/webkit_glue.h"
|
#include "webkit/glue/webkit_glue.h"
|
||||||
|
|
||||||
using fileapi::FileSystemOperation;
|
|
||||||
using fileapi::FileSystemCallbackDispatcher;
|
using fileapi::FileSystemCallbackDispatcher;
|
||||||
|
using fileapi::FileSystemContext;
|
||||||
|
using fileapi::FileSystemFileUtil;
|
||||||
|
using fileapi::FileSystemOperation;
|
||||||
using fileapi::WebFileWriterBase;
|
using fileapi::WebFileWriterBase;
|
||||||
using WebKit::WebFileWriterClient;
|
using WebKit::WebFileWriterClient;
|
||||||
using WebKit::WebString;
|
using WebKit::WebString;
|
||||||
|
@ -27,9 +31,11 @@ net::URLRequestContext* BrowserFileWriter::request_context_ = NULL;
|
||||||
class BrowserFileWriter::IOThreadProxy
|
class BrowserFileWriter::IOThreadProxy
|
||||||
: public base::RefCountedThreadSafe<BrowserFileWriter::IOThreadProxy> {
|
: public base::RefCountedThreadSafe<BrowserFileWriter::IOThreadProxy> {
|
||||||
public:
|
public:
|
||||||
explicit IOThreadProxy(const base::WeakPtr<BrowserFileWriter>& simple_writer)
|
explicit IOThreadProxy(const base::WeakPtr<BrowserFileWriter>& simple_writer,
|
||||||
|
FileSystemContext* file_system_context)
|
||||||
: simple_writer_(simple_writer),
|
: simple_writer_(simple_writer),
|
||||||
operation_(NULL) {
|
operation_(NULL),
|
||||||
|
file_system_context_(file_system_context) {
|
||||||
io_thread_ = CefThread::GetMessageLoopProxyForThread(CefThread::IO);
|
io_thread_ = CefThread::GetMessageLoopProxyForThread(CefThread::IO);
|
||||||
main_thread_ = base::MessageLoopProxy::CreateForCurrentThread();
|
main_thread_ = base::MessageLoopProxy::CreateForCurrentThread();
|
||||||
}
|
}
|
||||||
|
@ -96,7 +102,9 @@ class BrowserFileWriter::IOThreadProxy
|
||||||
proxy_->DidWrite(bytes, complete);
|
proxy_->DidWrite(bytes, complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DidReadMetadata(const base::PlatformFileInfo&) {
|
virtual void DidReadMetadata(
|
||||||
|
const base::PlatformFileInfo&,
|
||||||
|
const FilePath&) {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +114,8 @@ class BrowserFileWriter::IOThreadProxy
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DidOpenFileSystem(const std::string& name,
|
virtual void DidOpenFileSystem(
|
||||||
|
const std::string& name,
|
||||||
const FilePath& root_path) {
|
const FilePath& root_path) {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
@ -117,7 +126,8 @@ class BrowserFileWriter::IOThreadProxy
|
||||||
FileSystemOperation* GetNewOperation() {
|
FileSystemOperation* GetNewOperation() {
|
||||||
// The FileSystemOperation takes ownership of the CallbackDispatcher.
|
// The FileSystemOperation takes ownership of the CallbackDispatcher.
|
||||||
return new FileSystemOperation(new CallbackDispatcher(this),
|
return new FileSystemOperation(new CallbackDispatcher(this),
|
||||||
io_thread_, NULL);
|
io_thread_, file_system_context_.get(),
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DidSucceed() {
|
void DidSucceed() {
|
||||||
|
@ -163,13 +173,17 @@ class BrowserFileWriter::IOThreadProxy
|
||||||
|
|
||||||
// Only used on the io thread.
|
// Only used on the io thread.
|
||||||
FileSystemOperation* operation_;
|
FileSystemOperation* operation_;
|
||||||
|
|
||||||
|
scoped_refptr<FileSystemContext> file_system_context_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
BrowserFileWriter::BrowserFileWriter(
|
BrowserFileWriter::BrowserFileWriter(
|
||||||
const WebString& path, WebFileWriterClient* client)
|
const WebString& path,
|
||||||
|
WebFileWriterClient* client,
|
||||||
|
FileSystemContext* file_system_context)
|
||||||
: WebFileWriterBase(path, client),
|
: WebFileWriterBase(path, client),
|
||||||
io_thread_proxy_(new IOThreadProxy(AsWeakPtr())) {
|
io_thread_proxy_(new IOThreadProxy(AsWeakPtr(), file_system_context)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserFileWriter::~BrowserFileWriter() {
|
BrowserFileWriter::~BrowserFileWriter() {
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef BROWSER_FILE_WRITER_H_
|
#ifndef BROWSER_FILE_WRITER_H_
|
||||||
#define BROWSER_FILE_WRITER_H_
|
#define BROWSER_FILE_WRITER_H_
|
||||||
|
|
||||||
#include "base/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/weak_ptr.h"
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "webkit/fileapi/webfilewriter_base.h"
|
#include "webkit/fileapi/webfilewriter_base.h"
|
||||||
|
|
||||||
namespace net {
|
namespace net {
|
||||||
class URLRequestContext;
|
class URLRequestContext;
|
||||||
|
} // namespace net
|
||||||
|
|
||||||
|
namespace fileapi {
|
||||||
|
class FileSystemContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
// An implementation of WebFileWriter for use in test_shell and DRT.
|
// An implementation of WebFileWriter for use in test_shell and DRT.
|
||||||
|
@ -18,10 +22,12 @@ class BrowserFileWriter : public fileapi::WebFileWriterBase,
|
||||||
public base::SupportsWeakPtr<BrowserFileWriter> {
|
public base::SupportsWeakPtr<BrowserFileWriter> {
|
||||||
public:
|
public:
|
||||||
BrowserFileWriter(
|
BrowserFileWriter(
|
||||||
const WebKit::WebString& path, WebKit::WebFileWriterClient* client);
|
const WebKit::WebString& path,
|
||||||
|
WebKit::WebFileWriterClient* client,
|
||||||
|
fileapi::FileSystemContext* file_system_context);
|
||||||
virtual ~BrowserFileWriter();
|
virtual ~BrowserFileWriter();
|
||||||
|
|
||||||
// Called by CefProcessIOThread when the thread is created and destroyed.
|
// Called by CefProcessIOThread when the context is created and destroyed.
|
||||||
static void InitializeOnIOThread(net::URLRequestContext* request_context) {
|
static void InitializeOnIOThread(net::URLRequestContext* request_context) {
|
||||||
request_context_ = request_context;
|
request_context_ = request_context;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "printing/win_printing_context.h"
|
#include "printing/win_printing_context.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "base/scoped_temp_dir.h"
|
#include "base/memory/scoped_temp_dir.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "printing/units.h"
|
#include "printing/units.h"
|
||||||
|
|
||||||
#include "skia/ext/vector_canvas.h"
|
#include "skia/ext/vector_canvas.h"
|
||||||
|
#include "skia/ext/vector_platform_device_win.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/WebRect.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
|
||||||
|
@ -261,7 +262,12 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages,
|
||||||
int saved_state = SaveDC(hDC);
|
int saved_state = SaveDC(hDC);
|
||||||
DCHECK_NE(saved_state, 0);
|
DCHECK_NE(saved_state, 0);
|
||||||
|
|
||||||
skia::VectorCanvas canvas(hDC, dest_size_x, dest_size_y);
|
skia::PlatformDevice* device =
|
||||||
|
skia::VectorPlatformDeviceFactory::CreateDevice(dest_size_x,
|
||||||
|
dest_size_y,
|
||||||
|
true, hDC);
|
||||||
|
DCHECK(device);
|
||||||
|
skia::VectorCanvas canvas(device);
|
||||||
|
|
||||||
// The hDC 0 coord is the left most printeable area and not physical area of
|
// The hDC 0 coord is the left most printeable area and not physical area of
|
||||||
// the paper so subtract that out of our canvas translate.
|
// the paper so subtract that out of our canvas translate.
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "base/linked_ptr.h"
|
#include "base/memory/linked_ptr.h"
|
||||||
#include "base/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebHTTPBody.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebHTTPBody.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "app/sql/transaction.h"
|
#include "app/sql/transaction.h"
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
|
#include "googleurl/src/gurl.h"
|
||||||
|
|
||||||
using base::Time;
|
using base::Time;
|
||||||
|
|
||||||
|
@ -178,6 +179,8 @@ bool BrowserPersistentCookieStore::Backend::Load(
|
||||||
while (smt.Step()) {
|
while (smt.Step()) {
|
||||||
scoped_ptr<net::CookieMonster::CanonicalCookie> cc(
|
scoped_ptr<net::CookieMonster::CanonicalCookie> cc(
|
||||||
new net::CookieMonster::CanonicalCookie(
|
new net::CookieMonster::CanonicalCookie(
|
||||||
|
// The "source" URL is not used with persisted cookies.
|
||||||
|
GURL(), // Source
|
||||||
smt.ColumnString(2), // name
|
smt.ColumnString(2), // name
|
||||||
smt.ColumnString(3), // value
|
smt.ColumnString(3), // value
|
||||||
smt.ColumnString(1), // domain
|
smt.ColumnString(1), // domain
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "net/base/cookie_monster.h"
|
#include "net/base/cookie_monster.h"
|
||||||
|
|
||||||
class FilePath;
|
class FilePath;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "browser_request_context.h"
|
#include "browser_request_context.h"
|
||||||
|
#include "browser_file_system.h"
|
||||||
#include "browser_persistent_cookie_store.h"
|
#include "browser_persistent_cookie_store.h"
|
||||||
#include "browser_resource_loader_bridge.h"
|
#include "browser_resource_loader_bridge.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
@ -20,7 +21,10 @@
|
||||||
#include "net/proxy/proxy_config_service.h"
|
#include "net/proxy/proxy_config_service.h"
|
||||||
#include "net/proxy/proxy_config_service_fixed.h"
|
#include "net/proxy/proxy_config_service_fixed.h"
|
||||||
#include "net/proxy/proxy_service.h"
|
#include "net/proxy/proxy_service.h"
|
||||||
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
|
||||||
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h"
|
||||||
#include "webkit/blob/blob_storage_controller.h"
|
#include "webkit/blob/blob_storage_controller.h"
|
||||||
|
#include "webkit/fileapi/file_system_context.h"
|
||||||
#include "webkit/glue/webkit_glue.h"
|
#include "webkit/glue/webkit_glue.h"
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
@ -74,12 +78,12 @@ void BrowserRequestContext::Init(
|
||||||
persistent_store = new BrowserPersistentCookieStore(cookie_path);
|
persistent_store = new BrowserPersistentCookieStore(cookie_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
cookie_store_ = new net::CookieMonster(persistent_store.get(), NULL);
|
set_cookie_store(new net::CookieMonster(persistent_store.get(), NULL));
|
||||||
cookie_policy_ = new net::StaticCookiePolicy();
|
set_cookie_policy(new net::StaticCookiePolicy());
|
||||||
|
|
||||||
// hard-code A-L and A-C for test shells
|
// hard-code A-L and A-C for test shells
|
||||||
accept_language_ = "en-us,en";
|
set_accept_language("en-us,en");
|
||||||
accept_charset_ = "iso-8859-1,*,utf-8";
|
set_accept_charset("iso-8859-1,*,utf-8");
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
// Using the system proxy resolver on Windows when "Automatically detect
|
// Using the system proxy resolver on Windows when "Automatically detect
|
||||||
|
@ -92,8 +96,8 @@ void BrowserRequestContext::Init(
|
||||||
WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = {0};
|
WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = {0};
|
||||||
if (WinHttpGetIEProxyConfigForCurrentUser(&ie_config)) {
|
if (WinHttpGetIEProxyConfigForCurrentUser(&ie_config)) {
|
||||||
if (ie_config.fAutoDetect == TRUE) {
|
if (ie_config.fAutoDetect == TRUE) {
|
||||||
proxy_service_ = net::ProxyService::CreateWithoutProxyResolver(
|
set_proxy_service(net::ProxyService::CreateWithoutProxyResolver(
|
||||||
new ProxyConfigServiceNull(), NULL);
|
new ProxyConfigServiceNull(), NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ie_config.lpszAutoConfigUrl)
|
if (ie_config.lpszAutoConfigUrl)
|
||||||
|
@ -105,20 +109,20 @@ void BrowserRequestContext::Init(
|
||||||
}
|
}
|
||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
|
|
||||||
if (!proxy_service_.get()) {
|
if (!proxy_service()) {
|
||||||
// Use the system proxy resolver.
|
// Use the system proxy resolver.
|
||||||
scoped_ptr<net::ProxyConfigService> proxy_config_service(
|
scoped_ptr<net::ProxyConfigService> proxy_config_service(
|
||||||
net::ProxyService::CreateSystemProxyConfigService(
|
net::ProxyService::CreateSystemProxyConfigService(
|
||||||
MessageLoop::current(), NULL));
|
MessageLoop::current(), NULL));
|
||||||
proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver(
|
set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver(
|
||||||
proxy_config_service.release(), 0, NULL);
|
proxy_config_service.release(), 0, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
host_resolver_ =
|
set_host_resolver(
|
||||||
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
|
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
|
||||||
NULL, NULL);
|
NULL, NULL));
|
||||||
cert_verifier_ = new net::CertVerifier;
|
set_cert_verifier(new net::CertVerifier);
|
||||||
ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService();
|
set_ssl_config_service(net::SSLConfigService::CreateSystemSSLConfigService());
|
||||||
|
|
||||||
// Add support for single sign-on.
|
// Add support for single sign-on.
|
||||||
url_security_manager_.reset(net::URLSecurityManager::Create(NULL, NULL));
|
url_security_manager_.reset(net::URLSecurityManager::Create(NULL, NULL));
|
||||||
|
@ -129,38 +133,40 @@ void BrowserRequestContext::Init(
|
||||||
supported_schemes.push_back("ntlm");
|
supported_schemes.push_back("ntlm");
|
||||||
supported_schemes.push_back("negotiate");
|
supported_schemes.push_back("negotiate");
|
||||||
|
|
||||||
http_auth_handler_factory_ =
|
set_http_auth_handler_factory(
|
||||||
net::HttpAuthHandlerRegistryFactory::Create(supported_schemes,
|
net::HttpAuthHandlerRegistryFactory::Create(supported_schemes,
|
||||||
url_security_manager_.get(),
|
url_security_manager_.get(),
|
||||||
host_resolver_,
|
host_resolver(),
|
||||||
std::string(),
|
std::string(),
|
||||||
false,
|
false,
|
||||||
false);
|
false));
|
||||||
|
|
||||||
net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend(
|
net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend(
|
||||||
cache_path_valid ? net::DISK_CACHE : net::MEMORY_CACHE,
|
cache_path_valid ? net::DISK_CACHE : net::MEMORY_CACHE,
|
||||||
cache_path, 0, BrowserResourceLoaderBridge::GetCacheThread());
|
cache_path, 0, BrowserResourceLoaderBridge::GetCacheThread());
|
||||||
|
|
||||||
net::HttpCache* cache =
|
net::HttpCache* cache =
|
||||||
new net::HttpCache(host_resolver_, cert_verifier_, NULL, NULL,
|
new net::HttpCache(host_resolver(), cert_verifier(), NULL, NULL,
|
||||||
proxy_service_, ssl_config_service_,
|
proxy_service(), ssl_config_service(),
|
||||||
http_auth_handler_factory_, NULL, NULL, backend);
|
http_auth_handler_factory(), NULL, NULL, backend);
|
||||||
|
|
||||||
cache->set_mode(cache_mode);
|
cache->set_mode(cache_mode);
|
||||||
http_transaction_factory_ = cache;
|
set_http_transaction_factory(cache);
|
||||||
|
|
||||||
ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_);
|
set_ftp_transaction_factory(new net::FtpNetworkLayer(host_resolver()));
|
||||||
|
|
||||||
blob_storage_controller_.reset(new webkit_blob::BlobStorageController());
|
blob_storage_controller_.reset(new webkit_blob::BlobStorageController());
|
||||||
|
file_system_context_ = static_cast<BrowserFileSystem*>(
|
||||||
|
WebKit::webKitClient()->fileSystem())->file_system_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserRequestContext::~BrowserRequestContext() {
|
BrowserRequestContext::~BrowserRequestContext() {
|
||||||
delete ftp_transaction_factory_;
|
delete ftp_transaction_factory();
|
||||||
delete http_transaction_factory_;
|
delete http_transaction_factory();
|
||||||
delete http_auth_handler_factory_;
|
delete http_auth_handler_factory();
|
||||||
delete static_cast<net::StaticCookiePolicy*>(cookie_policy_);
|
delete cookie_policy();
|
||||||
delete cert_verifier_;
|
delete cert_verifier();
|
||||||
delete host_resolver_;
|
delete host_resolver();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserRequestContext::SetAcceptAllCookies(bool accept_all_cookies) {
|
void BrowserRequestContext::SetAcceptAllCookies(bool accept_all_cookies) {
|
||||||
|
|
|
@ -11,6 +11,11 @@
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
|
|
||||||
class FilePath;
|
class FilePath;
|
||||||
|
|
||||||
|
namespace fileapi {
|
||||||
|
class FileSystemContext;
|
||||||
|
}
|
||||||
|
|
||||||
namespace webkit_blob {
|
namespace webkit_blob {
|
||||||
class BlobStorageController;
|
class BlobStorageController;
|
||||||
}
|
}
|
||||||
|
@ -36,11 +41,16 @@ class BrowserRequestContext : public net::URLRequestContext {
|
||||||
return blob_storage_controller_.get();
|
return blob_storage_controller_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fileapi::FileSystemContext* file_system_context() const {
|
||||||
|
return file_system_context_.get();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode,
|
void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode,
|
||||||
bool no_proxy);
|
bool no_proxy);
|
||||||
|
|
||||||
scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_;
|
scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_;
|
||||||
|
scoped_refptr<fileapi::FileSystemContext> file_system_context_;
|
||||||
scoped_ptr<net::URLSecurityManager> url_security_manager_;
|
scoped_ptr<net::URLSecurityManager> url_security_manager_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,12 +46,12 @@
|
||||||
|
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
#include "base/message_loop_proxy.h"
|
#include "base/message_loop_proxy.h"
|
||||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||||
#include "base/nss_util.h"
|
#include "base/nss_util.h"
|
||||||
#endif
|
#endif
|
||||||
#include "base/ref_counted.h"
|
|
||||||
#include "base/synchronization/waitable_event.h"
|
#include "base/synchronization/waitable_event.h"
|
||||||
#include "base/time.h"
|
#include "base/time.h"
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
|
@ -70,13 +70,13 @@
|
||||||
#include "net/http/http_request_headers.h"
|
#include "net/http/http_request_headers.h"
|
||||||
#include "net/http/http_response_headers.h"
|
#include "net/http/http_response_headers.h"
|
||||||
#include "net/proxy/proxy_service.h"
|
#include "net/proxy/proxy_service.h"
|
||||||
#if defined(OS_WIN)
|
|
||||||
#include "net/socket/ssl_client_socket_nss_factory.h"
|
|
||||||
#endif
|
|
||||||
#include "net/url_request/url_request.h"
|
#include "net/url_request/url_request.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/deletable_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"
|
||||||
#include "webkit/glue/resource_loader_bridge.h"
|
#include "webkit/glue/resource_loader_bridge.h"
|
||||||
|
|
||||||
using net::HttpResponseHeaders;
|
using net::HttpResponseHeaders;
|
||||||
|
@ -190,7 +190,6 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyReceivedResponse(const ResourceResponseInfo& info,
|
void NotifyReceivedResponse(const ResourceResponseInfo& info,
|
||||||
bool content_filtered,
|
|
||||||
const GURL& url, bool allow_download) {
|
const GURL& url, bool allow_download) {
|
||||||
|
|
||||||
if (browser_.get() && info.headers.get()) {
|
if (browser_.get() && info.headers.get()) {
|
||||||
|
@ -215,7 +214,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peer_)
|
if (peer_)
|
||||||
peer_->OnReceivedResponse(info, content_filtered);
|
peer_->OnReceivedResponse(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyReceivedData(int bytes_read) {
|
void NotifyReceivedData(int bytes_read) {
|
||||||
|
@ -376,7 +375,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||||
info.content_length = static_cast<int64>(offset);
|
info.content_length = static_cast<int64>(offset);
|
||||||
if(!mimeType.empty())
|
if(!mimeType.empty())
|
||||||
info.mime_type = mimeType;
|
info.mime_type = mimeType;
|
||||||
OnReceivedResponse(info, false);
|
OnReceivedResponse(info);
|
||||||
AsyncReadData();
|
AsyncReadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,8 +510,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnReceivedResponse(
|
virtual void OnReceivedResponse(
|
||||||
const ResourceResponseInfo& info,
|
const ResourceResponseInfo& info) {
|
||||||
bool content_filtered) {
|
|
||||||
GURL url;
|
GURL url;
|
||||||
bool allow_download(false);
|
bool allow_download(false);
|
||||||
if (request_.get()){
|
if (request_.get()){
|
||||||
|
@ -524,8 +522,8 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||||
}
|
}
|
||||||
|
|
||||||
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
|
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
|
||||||
this, &RequestProxy::NotifyReceivedResponse, info, content_filtered,
|
this, &RequestProxy::NotifyReceivedResponse, info, url,
|
||||||
url, allow_download));
|
allow_download));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnReceivedData(int bytes_read) {
|
virtual void OnReceivedData(int bytes_read) {
|
||||||
|
@ -567,7 +565,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
||||||
if (request->status().is_success()) {
|
if (request->status().is_success()) {
|
||||||
ResourceResponseInfo info;
|
ResourceResponseInfo info;
|
||||||
PopulateResponseInfo(request, &info);
|
PopulateResponseInfo(request, &info);
|
||||||
OnReceivedResponse(info, false);
|
OnReceivedResponse(info);
|
||||||
AsyncReadData(); // start reading
|
AsyncReadData(); // start reading
|
||||||
} else {
|
} else {
|
||||||
Done();
|
Done();
|
||||||
|
@ -745,9 +743,7 @@ class SyncRequestProxy : public RequestProxy {
|
||||||
result_->url = new_url;
|
result_->url = new_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnReceivedResponse(
|
virtual void OnReceivedResponse(const ResourceResponseInfo& info) {
|
||||||
const ResourceResponseInfo& info,
|
|
||||||
bool content_filtered) {
|
|
||||||
*static_cast<ResourceResponseInfo*>(result_) = info;
|
*static_cast<ResourceResponseInfo*>(result_) = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
#include "browser_socket_stream_bridge.h"
|
#include "browser_socket_stream_bridge.h"
|
||||||
|
|
||||||
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
#include "base/ref_counted.h"
|
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
#include "net/socket_stream/socket_stream_job.h"
|
#include "net/socket_stream/socket_stream_job.h"
|
||||||
#include "net/websockets/websocket_job.h"
|
#include "net/websockets/websocket_job.h"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#define _BROWSER_WEB_WORKER_H
|
#define _BROWSER_WEB_WORKER_H
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "base/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebWorker.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebWorker.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebWorkerClient.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebWorkerClient.h"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#ifndef BROWSER_WEBBLOBREGISTRY_IMPL_H_
|
#ifndef BROWSER_WEBBLOBREGISTRY_IMPL_H_
|
||||||
#define BROWSER_WEBBLOBREGISTRY_IMPL_H_
|
#define BROWSER_WEBBLOBREGISTRY_IMPL_H_
|
||||||
|
|
||||||
#include "base/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h"
|
||||||
|
|
||||||
class GURL;
|
class GURL;
|
||||||
|
|
|
@ -15,14 +15,13 @@
|
||||||
#include "browser_webstoragenamespace_impl.h"
|
#include "browser_webstoragenamespace_impl.h"
|
||||||
|
|
||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
|
#include "base/memory/scoped_temp_dir.h"
|
||||||
#include "base/metrics/stats_counters.h"
|
#include "base/metrics/stats_counters.h"
|
||||||
#include "base/path_service.h"
|
#include "base/path_service.h"
|
||||||
#include "base/scoped_temp_dir.h"
|
|
||||||
#include "base/utf_string_conversions.h"
|
#include "base/utf_string_conversions.h"
|
||||||
#include "media/base/media.h"
|
#include "media/base/media.h"
|
||||||
#include "webkit/appcache/web_application_cache_host_impl.h"
|
#include "webkit/appcache/web_application_cache_host_impl.h"
|
||||||
#include "webkit/database/vfs_backend.h"
|
#include "webkit/database/vfs_backend.h"
|
||||||
#include "webkit/extensions/v8/gears_extension.h"
|
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
|
||||||
|
@ -52,12 +51,9 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
|
||||||
|
|
||||||
WebKit::initialize(this);
|
WebKit::initialize(this);
|
||||||
WebKit::setLayoutTestMode(false);
|
WebKit::setLayoutTestMode(false);
|
||||||
WebKit::WebScriptController::registerExtension(
|
|
||||||
extensions_v8::GearsExtension::Get());
|
|
||||||
WebKit::WebRuntimeFeatures::enableSockets(true);
|
WebKit::WebRuntimeFeatures::enableSockets(true);
|
||||||
WebKit::WebRuntimeFeatures::enableApplicationCache(true);
|
WebKit::WebRuntimeFeatures::enableApplicationCache(true);
|
||||||
WebKit::WebRuntimeFeatures::enableDatabase(true);
|
WebKit::WebRuntimeFeatures::enableDatabase(true);
|
||||||
WebKit::WebRuntimeFeatures::enableWebGL(true);
|
|
||||||
WebKit::WebRuntimeFeatures::enablePushState(true);
|
WebKit::WebRuntimeFeatures::enablePushState(true);
|
||||||
WebKit::WebRuntimeFeatures::enableNotifications(false);
|
WebKit::WebRuntimeFeatures::enableNotifications(false);
|
||||||
WebKit::WebRuntimeFeatures::enableTouch(true);
|
WebKit::WebRuntimeFeatures::enableTouch(true);
|
||||||
|
@ -228,6 +224,14 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
|
||||||
keys_out.swap(keys);
|
keys_out.swap(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual WebKit::WebSerializedScriptValue injectIDBKeyIntoSerializedValue(
|
||||||
|
const WebKit::WebIDBKey& key,
|
||||||
|
const WebKit::WebSerializedScriptValue& value,
|
||||||
|
const WebKit::WebString& keyPath) {
|
||||||
|
return WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue(
|
||||||
|
key, value, WebKit::WebIDBKeyPath::create(keyPath));
|
||||||
|
}
|
||||||
|
|
||||||
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() {
|
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() {
|
||||||
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
|
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "base/scoped_ptr.h"
|
#include "base/scoped_ptr.h"
|
||||||
#include "base/weak_ptr.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.h"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "cef_context.h"
|
#include "cef_context.h"
|
||||||
#include "webwidget_host.h"
|
#include "webwidget_host.h"
|
||||||
|
|
||||||
#include "base/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.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/gfx/rect.h"
|
#include "ui/gfx/rect.h"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#define _BROWSER_ZOOM_MAP_H
|
#define _BROWSER_ZOOM_MAP_H
|
||||||
|
|
||||||
#include "include/cef_string.h"
|
#include "include/cef_string.h"
|
||||||
#include "base/singleton.h"
|
#include "base/memory/singleton.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
|
|
||||||
#include "base/at_exit.h"
|
#include "base/at_exit.h"
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
#include "base/ref_counted.h"
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
class BrowserRequestContext;
|
class BrowserRequestContext;
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
|
#include "base/memory/ref_counted.h"
|
||||||
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
#include "base/ref_counted.h"
|
|
||||||
#include "base/scoped_ptr.h"
|
|
||||||
#include "base/threading/non_thread_safe.h"
|
#include "base/threading/non_thread_safe.h"
|
||||||
#include "ipc/ipc_message.h"
|
#include "ipc/ipc_message.h"
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "browser_webkit_init.h"
|
#include "browser_webkit_init.h"
|
||||||
#include "cef_context.h"
|
#include "cef_context.h"
|
||||||
|
|
||||||
#include "app/gfx/gl/gl_implementation.h"
|
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/i18n/icu_util.h"
|
#include "base/i18n/icu_util.h"
|
||||||
#include "base/metrics/stats_table.h"
|
#include "base/metrics/stats_table.h"
|
||||||
|
@ -16,14 +15,15 @@
|
||||||
#include "base/string_number_conversions.h"
|
#include "base/string_number_conversions.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "net/base/net_module.h"
|
#include "net/base/net_module.h"
|
||||||
#if defined(OS_WIN)
|
#include "net/url_request/url_request.h"
|
||||||
#include "net/socket/ssl_client_socket_nss_factory.h"
|
#include "ui/gfx/gl/gl_implementation.h"
|
||||||
#endif
|
|
||||||
#include "webkit/blob/blob_storage_controller.h"
|
#include "webkit/blob/blob_storage_controller.h"
|
||||||
#include "webkit/blob/blob_url_request_job.h"
|
#include "webkit/blob/blob_url_request_job.h"
|
||||||
#include "webkit/extensions/v8/gc_extension.h"
|
#include "webkit/extensions/v8/gc_extension.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"
|
||||||
#include "webkit/plugins/npapi/plugin_list.h"
|
#include "webkit/plugins/npapi/plugin_list.h"
|
||||||
#include "net/url_request/url_request.h"
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
|
@ -44,7 +44,33 @@ net::URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request,
|
||||||
return new webkit_blob::BlobURLRequestJob(
|
return new webkit_blob::BlobURLRequestJob(
|
||||||
request,
|
request,
|
||||||
blob_storage_controller->GetBlobDataFromUrl(request->url()),
|
blob_storage_controller->GetBlobDataFromUrl(request->url()),
|
||||||
NULL);
|
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
|
||||||
|
}
|
||||||
|
|
||||||
|
net::URLRequestJob* FileSystemURLRequestJobFactory(net::URLRequest* request,
|
||||||
|
const std::string& scheme) {
|
||||||
|
fileapi::FileSystemContext* fs_context =
|
||||||
|
static_cast<BrowserRequestContext*>(request->context())
|
||||||
|
->file_system_context();
|
||||||
|
if (!fs_context) {
|
||||||
|
LOG(WARNING) << "No FileSystemContext found, ignoring filesystem: URL";
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the path ends with a /, we know it's a directory. If the path refers
|
||||||
|
// to a directory and gets dispatched to FileSystemURLRequestJob, that class
|
||||||
|
// redirects back here, by adding a / to the URL.
|
||||||
|
const std::string path = request->url().path();
|
||||||
|
if (!path.empty() && path[path.size() - 1] == '/') {
|
||||||
|
return new fileapi::FileSystemDirURLRequestJob(
|
||||||
|
request,
|
||||||
|
fs_context->path_manager(),
|
||||||
|
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
|
||||||
|
}
|
||||||
|
return new fileapi::FileSystemURLRequestJob(
|
||||||
|
request,
|
||||||
|
fs_context->path_manager(),
|
||||||
|
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -122,16 +148,11 @@ void CefProcessUIThread::Init() {
|
||||||
WebKit::WebScriptController::registerExtension(
|
WebKit::WebScriptController::registerExtension(
|
||||||
extensions_v8::GCExtension::Get());
|
extensions_v8::GCExtension::Get());
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
// Use NSS for SSL on Windows. TODO(wtc): this should eventually be hidden
|
|
||||||
// inside DefaultClientSocketFactory::CreateSSLClientSocket.
|
|
||||||
net::ClientSocketFactory::SetSSLClientSocketFactory(
|
|
||||||
net::SSLClientSocketNSSFactory);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL);
|
gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL);
|
||||||
|
|
||||||
net::URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory);
|
net::URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory);
|
||||||
|
net::URLRequest::RegisterProtocolFactory("filesystem",
|
||||||
|
&FileSystemURLRequestJobFactory);
|
||||||
|
|
||||||
if (!_Context->cache_path().empty()) {
|
if (!_Context->cache_path().empty()) {
|
||||||
// Create the storage context object.
|
// Create the storage context object.
|
||||||
|
|
|
@ -181,7 +181,7 @@ CefString CefDOMNodeImpl::GetValue()
|
||||||
node_.to<WebKit::WebFormControlElement>();
|
node_.to<WebKit::WebFormControlElement>();
|
||||||
|
|
||||||
webkit_glue::FormField formField(formElement);
|
webkit_glue::FormField formField(formElement);
|
||||||
str = formField.value();
|
str = formField.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
#define _DOM_STORAGE_AREA_H
|
#define _DOM_STORAGE_AREA_H
|
||||||
|
|
||||||
#include "base/hash_tables.h"
|
#include "base/hash_tables.h"
|
||||||
|
#include "base/memory/ref_counted.h"
|
||||||
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/nullable_string16.h"
|
#include "base/nullable_string16.h"
|
||||||
#include "base/ref_counted.h"
|
|
||||||
#include "base/scoped_ptr.h"
|
|
||||||
#include "base/string16.h"
|
#include "base/string16.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
#include "base/linked_ptr.h"
|
#include "base/memory/linked_ptr.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
#include "ui/base/dragdrop/download_file_interface.h"
|
#include "ui/base/dragdrop/download_file_interface.h"
|
||||||
|
|
|
@ -121,14 +121,6 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool GetContentEncodings(
|
|
||||||
std::vector<Filter::FilterType>* encoding_types)
|
|
||||||
{
|
|
||||||
DCHECK(encoding_types->empty());
|
|
||||||
|
|
||||||
return !encoding_types->empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool GetMimeType(std::string* mime_type) const
|
virtual bool GetMimeType(std::string* mime_type) const
|
||||||
{
|
{
|
||||||
DCHECK(request_);
|
DCHECK(request_);
|
||||||
|
|
|
@ -53,10 +53,14 @@ void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dcheng): Implement.
|
// TODO(dcheng): Implement.
|
||||||
bool ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
||||||
std::vector<string16>* types,
|
std::vector<string16>* types,
|
||||||
bool* contains_filenames) {
|
bool* contains_filenames) {
|
||||||
return false;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
|
||||||
|
ClipboardGetClipboard()->ReadImage(buffer, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
|
bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
|
||||||
|
|
|
@ -62,7 +62,7 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object,
|
||||||
|
|
||||||
// TODO(tc): PopulateWebDropData can be slow depending on what is in the
|
// TODO(tc): PopulateWebDropData can be slow depending on what is in the
|
||||||
// IDataObject. Maybe we can do this in a background thread.
|
// IDataObject. Maybe we can do this in a background thread.
|
||||||
WebDropData drop_data(GetDragIdentity());
|
WebDropData drop_data;
|
||||||
WebDropData::PopulateWebDropData(data_object, &drop_data);
|
WebDropData::PopulateWebDropData(data_object, &drop_data);
|
||||||
|
|
||||||
if (drop_data.url.is_empty())
|
if (drop_data.url.is_empty())
|
||||||
|
@ -74,7 +74,6 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object,
|
||||||
ScreenToClient(GetHWND(), &client_pt);
|
ScreenToClient(GetHWND(), &client_pt);
|
||||||
WebDragOperation operation = view_->dragTargetDragEnter(
|
WebDragOperation operation = view_->dragTargetDragEnter(
|
||||||
drop_data.ToDragData(),
|
drop_data.ToDragData(),
|
||||||
drop_data.identity,
|
|
||||||
WebPoint(client_pt.x, client_pt.y),
|
WebPoint(client_pt.x, client_pt.y),
|
||||||
WebPoint(cursor_position.x, cursor_position.y),
|
WebPoint(cursor_position.x, cursor_position.y),
|
||||||
web_drag_utils_win::WinDragOpMaskToWebDragOpMask(effects));
|
web_drag_utils_win::WinDragOpMaskToWebDragOpMask(effects));
|
||||||
|
|
|
@ -75,7 +75,8 @@ public:
|
||||||
|
|
||||||
// Called when following a redirect. |newRequest| contains the request
|
// Called when following a redirect. |newRequest| contains the request
|
||||||
// generated by the redirect. The client may modify |newRequest|.
|
// generated by the redirect. The client may modify |newRequest|.
|
||||||
void willSendRequest(WebKit::WebURLLoader*, WebKit::WebURLRequest& newRequest,
|
virtual void willSendRequest(WebKit::WebURLLoader*,
|
||||||
|
WebKit::WebURLRequest& newRequest,
|
||||||
const WebKit::WebURLResponse& redirectResponse)
|
const WebKit::WebURLResponse& redirectResponse)
|
||||||
{
|
{
|
||||||
REQUIRE_UIT();
|
REQUIRE_UIT();
|
||||||
|
@ -99,7 +100,7 @@ public:
|
||||||
|
|
||||||
// Called to report upload progress. The bytes reported correspond to
|
// Called to report upload progress. The bytes reported correspond to
|
||||||
// the HTTP message body.
|
// the HTTP message body.
|
||||||
void didSendData(WebKit::WebURLLoader*, unsigned long long bytesSent,
|
virtual void didSendData(WebKit::WebURLLoader*, unsigned long long bytesSent,
|
||||||
unsigned long long totalBytesToBeSent)
|
unsigned long long totalBytesToBeSent)
|
||||||
{
|
{
|
||||||
REQUIRE_UIT();
|
REQUIRE_UIT();
|
||||||
|
@ -115,7 +116,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when response headers are received.
|
// Called when response headers are received.
|
||||||
void didReceiveResponse(WebKit::WebURLLoader*,
|
virtual void didReceiveResponse(WebKit::WebURLLoader*,
|
||||||
const WebKit::WebURLResponse& response)
|
const WebKit::WebURLResponse& response)
|
||||||
{
|
{
|
||||||
REQUIRE_UIT();
|
REQUIRE_UIT();
|
||||||
|
@ -135,13 +136,15 @@ public:
|
||||||
|
|
||||||
// Called when a chunk of response data is downloaded. This is only called
|
// Called when a chunk of response data is downloaded. This is only called
|
||||||
// if WebURLRequest's downloadToFile flag was set to true.
|
// if WebURLRequest's downloadToFile flag was set to true.
|
||||||
void didDownloadData(WebKit::WebURLLoader*, int dataLength)
|
virtual void didDownloadData(WebKit::WebURLLoader*, int dataLength)
|
||||||
{
|
{
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when a chunk of response data is received.
|
// Called when a chunk of response data is received.
|
||||||
void didReceiveData(WebKit::WebURLLoader*, const char* data, int dataLength)
|
// FIXME(vsevik): rename once original didReceiveData() is removed.
|
||||||
|
virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength,
|
||||||
|
int lengthReceived)
|
||||||
{
|
{
|
||||||
REQUIRE_UIT();
|
REQUIRE_UIT();
|
||||||
if(!context_)
|
if(!context_)
|
||||||
|
@ -159,14 +162,14 @@ public:
|
||||||
|
|
||||||
// Called when a chunk of renderer-generated metadata is received from
|
// Called when a chunk of renderer-generated metadata is received from
|
||||||
// the cache.
|
// the cache.
|
||||||
void didReceiveCachedMetadata(WebKit::WebURLLoader*, const char* data,
|
virtual void didReceiveCachedMetadata(WebKit::WebURLLoader*, const char* data,
|
||||||
int dataLength)
|
int dataLength)
|
||||||
{
|
{
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the load completes successfully.
|
// Called when the load completes successfully.
|
||||||
void didFinishLoading(WebKit::WebURLLoader*, double finishTime)
|
virtual void didFinishLoading(WebKit::WebURLLoader*, double finishTime)
|
||||||
{
|
{
|
||||||
REQUIRE_UIT();
|
REQUIRE_UIT();
|
||||||
if(!context_)
|
if(!context_)
|
||||||
|
@ -180,7 +183,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the load completes with an error.
|
// Called when the load completes with an error.
|
||||||
void didFail(WebKit::WebURLLoader*, const WebKit::WebURLError& error)
|
virtual void didFail(WebKit::WebURLLoader*, const WebKit::WebURLError& error)
|
||||||
{
|
{
|
||||||
REQUIRE_UIT();
|
REQUIRE_UIT();
|
||||||
if(!context_)
|
if(!context_)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#define _WEB_URL_REQUEST_CLIENT_IMPL_H
|
#define _WEB_URL_REQUEST_CLIENT_IMPL_H
|
||||||
|
|
||||||
#include "include/cef.h"
|
#include "include/cef.h"
|
||||||
#include "base/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
|
|
||||||
class CefWebURLRequestImpl :
|
class CefWebURLRequestImpl :
|
||||||
public CefThreadSafeBase<CefWebURLRequest>
|
public CefThreadSafeBase<CefWebURLRequest>
|
||||||
|
|
|
@ -31,10 +31,11 @@ WebViewHost* WebViewHost::Create(GtkWidget* parent_view,
|
||||||
host->plugin_container_manager_.set_host_widget(host->view_);
|
host->plugin_container_manager_.set_host_widget(host->view_);
|
||||||
|
|
||||||
#if defined(WEBKIT_HAS_WEB_AUTO_FILL_CLIENT)
|
#if defined(WEBKIT_HAS_WEB_AUTO_FILL_CLIENT)
|
||||||
host->webwidget_ = WebView::create(delegate, dev_tools_client, NULL);
|
host->webwidget_ = WebView::create(delegate, NULL);
|
||||||
#else
|
#else
|
||||||
host->webwidget_ = WebView::create(delegate, dev_tools_client);
|
host->webwidget_ = WebView::create(delegate);
|
||||||
#endif
|
#endif
|
||||||
|
host->webview()->setDevToolsAgentClient(dev_tools_client);
|
||||||
prefs.Apply(host->webview());
|
prefs.Apply(host->webview());
|
||||||
host->webview()->initializeMainFrame(delegate);
|
host->webview()->initializeMainFrame(delegate);
|
||||||
host->webwidget_->layout();
|
host->webwidget_->layout();
|
||||||
|
|
|
@ -36,10 +36,11 @@ WebViewHost* WebViewHost::Create(NSView* parent_view,
|
||||||
[host->view_ release];
|
[host->view_ release];
|
||||||
|
|
||||||
#if defined(WEBKIT_HAS_WEB_AUTO_FILL_CLIENT)
|
#if defined(WEBKIT_HAS_WEB_AUTO_FILL_CLIENT)
|
||||||
host->webwidget_ = WebView::create(delegate, dev_tools_client, NULL);
|
host->webwidget_ = WebView::create(delegate, NULL);
|
||||||
#else
|
#else
|
||||||
host->webwidget_ = WebView::create(delegate, dev_tools_client);
|
host->webwidget_ = WebView::create(delegate);
|
||||||
#endif
|
#endif
|
||||||
|
host->webview()->setDevToolsAgentClient(dev_tools_client);
|
||||||
prefs.Apply(host->webview());
|
prefs.Apply(host->webview());
|
||||||
host->webview()->initializeMainFrame(delegate);
|
host->webview()->initializeMainFrame(delegate);
|
||||||
host->webwidget_->resize(WebSize(content_rect.size.width,
|
host->webwidget_->resize(WebSize(content_rect.size.width,
|
||||||
|
|
|
@ -49,10 +49,11 @@ WebViewHost* WebViewHost::Create(HWND parent_view,
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WEBKIT_HAS_WEB_AUTO_FILL_CLIENT)
|
#if defined(WEBKIT_HAS_WEB_AUTO_FILL_CLIENT)
|
||||||
host->webwidget_ = WebView::create(delegate, dev_tools_client, NULL);
|
host->webwidget_ = WebView::create(delegate, NULL);
|
||||||
#else
|
#else
|
||||||
host->webwidget_ = WebView::create(delegate, dev_tools_client);
|
host->webwidget_ = WebView::create(delegate);
|
||||||
#endif
|
#endif
|
||||||
|
host->webview()->setDevToolsAgentClient(dev_tools_client);
|
||||||
prefs.Apply(host->webview());
|
prefs.Apply(host->webview());
|
||||||
host->webview()->initializeMainFrame(delegate);
|
host->webview()->initializeMainFrame(delegate);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
Index: message_loop.cc
|
Index: message_loop.cc
|
||||||
===================================================================
|
===================================================================
|
||||||
--- message_loop.cc (revision 74933)
|
--- message_loop.cc (revision 80310)
|
||||||
+++ message_loop.cc (working copy)
|
+++ message_loop.cc (working copy)
|
||||||
@@ -287,9 +287,13 @@
|
@@ -295,9 +295,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageLoop::AssertIdle() const {
|
void MessageLoop::AssertIdle() const {
|
||||||
|
@ -19,15 +19,15 @@ Index: message_loop.cc
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Index: message_loop.h
|
Index: message_loop.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- message_loop.h (revision 74933)
|
--- message_loop.h (revision 80310)
|
||||||
+++ message_loop.h (working copy)
|
+++ message_loop.h (working copy)
|
||||||
@@ -318,6 +318,9 @@
|
@@ -320,6 +320,9 @@
|
||||||
// Asserts that the MessageLoop is "idle".
|
// Asserts that the MessageLoop is "idle".
|
||||||
void AssertIdle() const;
|
void AssertIdle() const;
|
||||||
|
|
||||||
+ // Returns true if the MessageLoop is "idle".
|
+ // Returns true if the MessageLoop is "idle".
|
||||||
+ bool IsIdle() const;
|
+ bool IsIdle() const;
|
||||||
+
|
+
|
||||||
//----------------------------------------------------------------------------
|
#if defined(OS_WIN)
|
||||||
protected:
|
void set_os_modal_loop(bool os_modal_loop) {
|
||||||
struct RunState {
|
os_modal_loop_ = os_modal_loop;
|
||||||
|
|
Loading…
Reference in New Issue