mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-18 05:00:48 +01:00
- Update to Chromium revision 85305.
- Use the angle library for GL support (issue #136). - Add a workaround for the SyncRequestProxy deadlock problem (issue #192). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@233 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
2c0f941830
commit
abfc77abd1
@ -64,3 +64,4 @@ Date | CEF Revision | Chromium Revision
|
|||||||
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
|
2011-04-05 | /trunk@213 | /trunk@80310
|
||||||
|
2011-05-16 | /trunk@233 | /trunk@85305
|
||||||
|
6
cef.gyp
6
cef.gyp
@ -268,6 +268,7 @@
|
|||||||
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
|
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
|
||||||
'../third_party/icu/icu.gyp:icui18n',
|
'../third_party/icu/icu.gyp:icui18n',
|
||||||
'../third_party/icu/icu.gyp:icuuc',
|
'../third_party/icu/icu.gyp:icuuc',
|
||||||
|
'../third_party/leveldb/leveldb.gyp:leveldb',
|
||||||
'../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
|
'../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
|
||||||
'../third_party/libpng/libpng.gyp:libpng',
|
'../third_party/libpng/libpng.gyp:libpng',
|
||||||
'../third_party/libxml/libxml.gyp:libxml',
|
'../third_party/libxml/libxml.gyp:libxml',
|
||||||
@ -395,6 +396,8 @@
|
|||||||
['OS=="win"', {
|
['OS=="win"', {
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'../breakpad/breakpad.gyp:breakpad_handler',
|
'../breakpad/breakpad.gyp:breakpad_handler',
|
||||||
|
'../third_party/angle/src/build_angle.gyp:libEGL',
|
||||||
|
'../third_party/angle/src/build_angle.gyp:libGLESv2',
|
||||||
'../views/views.gyp:views',
|
'../views/views.gyp:views',
|
||||||
],
|
],
|
||||||
'sources': [
|
'sources': [
|
||||||
@ -526,6 +529,7 @@
|
|||||||
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
|
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
|
||||||
'../third_party/icu/icu.gyp:icui18n',
|
'../third_party/icu/icu.gyp:icui18n',
|
||||||
'../third_party/icu/icu.gyp:icuuc',
|
'../third_party/icu/icu.gyp:icuuc',
|
||||||
|
'../third_party/leveldb/leveldb.gyp:leveldb',
|
||||||
'../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
|
'../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
|
||||||
'../third_party/libpng/libpng.gyp:libpng',
|
'../third_party/libpng/libpng.gyp:libpng',
|
||||||
'../third_party/libxml/libxml.gyp:libxml',
|
'../third_party/libxml/libxml.gyp:libxml',
|
||||||
@ -662,6 +666,8 @@
|
|||||||
['OS=="win"', {
|
['OS=="win"', {
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'../breakpad/breakpad.gyp:breakpad_handler',
|
'../breakpad/breakpad.gyp:breakpad_handler',
|
||||||
|
'../third_party/angle/src/build_angle.gyp:libEGL',
|
||||||
|
'../third_party/angle/src/build_angle.gyp:libGLESv2',
|
||||||
'../views/views.gyp:views',
|
'../views/views.gyp:views',
|
||||||
],
|
],
|
||||||
'sources': [
|
'sources': [
|
||||||
|
@ -29,12 +29,12 @@ BrowserDatabaseSystem* BrowserDatabaseSystem::GetInstance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BrowserDatabaseSystem::BrowserDatabaseSystem()
|
BrowserDatabaseSystem::BrowserDatabaseSystem()
|
||||||
: db_thread_("SimpleDBThread"),
|
: db_thread_("BrowserDBThread"),
|
||||||
open_connections_(new webkit_database::DatabaseConnectionsWrapper) {
|
open_connections_(new webkit_database::DatabaseConnectionsWrapper) {
|
||||||
DCHECK(!instance_);
|
DCHECK(!instance_);
|
||||||
instance_ = this;
|
instance_ = this;
|
||||||
CHECK(temp_dir_.CreateUniqueTempDir());
|
CHECK(temp_dir_.CreateUniqueTempDir());
|
||||||
db_tracker_ = new DatabaseTracker(temp_dir_.path(), false, NULL);
|
db_tracker_ = 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();
|
||||||
|
@ -64,6 +64,11 @@ class BrowserFileSystemCallbackDispatcher
|
|||||||
callbacks_->didSucceed();
|
callbacks_->didSucceed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Callback to report information for a file.
|
||||||
|
virtual void DidGetLocalPath(const FilePath& local_path) {
|
||||||
|
NOTREACHED();
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DidReadMetadata(const base::PlatformFileInfo& info,
|
virtual void DidReadMetadata(const base::PlatformFileInfo& info,
|
||||||
const FilePath& platform_path) {
|
const FilePath& platform_path) {
|
||||||
DCHECK(file_system_);
|
DCHECK(file_system_);
|
||||||
@ -95,13 +100,13 @@ class BrowserFileSystemCallbackDispatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void DidOpenFileSystem(
|
virtual void DidOpenFileSystem(
|
||||||
const std::string& name, const FilePath& path) {
|
const std::string& name, const GURL& root) {
|
||||||
DCHECK(file_system_);
|
DCHECK(file_system_);
|
||||||
if (path.empty())
|
if (!root.is_valid())
|
||||||
callbacks_->didFail(WebKit::WebFileErrorSecurity);
|
callbacks_->didFail(WebKit::WebFileErrorSecurity);
|
||||||
else
|
else
|
||||||
callbacks_->didOpenFileSystem(
|
callbacks_->didOpenFileSystem(
|
||||||
UTF8ToUTF16(name), webkit_glue::FilePathToWebString(path));
|
WebString::fromUTF8(name), WebString::fromUTF8(root.spec()));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DidFail(base::PlatformFileError error_code) {
|
virtual void DidFail(base::PlatformFileError error_code) {
|
||||||
@ -127,10 +132,12 @@ BrowserFileSystem::BrowserFileSystem() {
|
|||||||
base::MessageLoopProxy::CreateForCurrentThread(),
|
base::MessageLoopProxy::CreateForCurrentThread(),
|
||||||
base::MessageLoopProxy::CreateForCurrentThread(),
|
base::MessageLoopProxy::CreateForCurrentThread(),
|
||||||
NULL /* special storage policy */,
|
NULL /* special storage policy */,
|
||||||
|
NULL /* quota manager */,
|
||||||
file_system_dir_.path(),
|
file_system_dir_.path(),
|
||||||
false /* incognito */,
|
false /* incognito */,
|
||||||
true /* allow_file_access */,
|
true /* allow_file_access */,
|
||||||
true /* unlimited_quota */);
|
true /* unlimited_quota */,
|
||||||
|
NULL);
|
||||||
} 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.";
|
||||||
@ -155,6 +162,8 @@ void BrowserFileSystem::OpenFileSystem(
|
|||||||
type = fileapi::kFileSystemTypeTemporary;
|
type = fileapi::kFileSystemTypeTemporary;
|
||||||
else if (web_filesystem_type == WebFileSystem::TypePersistent)
|
else if (web_filesystem_type == WebFileSystem::TypePersistent)
|
||||||
type = fileapi::kFileSystemTypePersistent;
|
type = fileapi::kFileSystemTypePersistent;
|
||||||
|
else if (web_filesystem_type == WebFileSystem::TypeExternal)
|
||||||
|
type = fileapi::kFileSystemTypeExternal;
|
||||||
else {
|
else {
|
||||||
// Unknown type filesystem is requested.
|
// Unknown type filesystem is requested.
|
||||||
callbacks->didFail(WebKit::WebFileErrorSecurity);
|
callbacks->didFail(WebKit::WebFileErrorSecurity);
|
||||||
@ -168,80 +177,58 @@ void BrowserFileSystem::OpenFileSystem(
|
|||||||
void BrowserFileSystem::move(
|
void BrowserFileSystem::move(
|
||||||
const WebString& src_path,
|
const WebString& src_path,
|
||||||
const WebString& dest_path, WebFileSystemCallbacks* callbacks) {
|
const WebString& dest_path, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath dest_filepath(webkit_glue::WebStringToFilePath(dest_path));
|
GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path));
|
||||||
FilePath src_filepath(webkit_glue::WebStringToFilePath(src_path));
|
|
||||||
|
|
||||||
GetNewOperation(callbacks)->Move(src_filepath, dest_filepath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::copy(
|
void BrowserFileSystem::copy(
|
||||||
const WebString& src_path, const WebString& dest_path,
|
const WebString& src_path, const WebString& dest_path,
|
||||||
WebFileSystemCallbacks* callbacks) {
|
WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath dest_filepath(webkit_glue::WebStringToFilePath(dest_path));
|
GetNewOperation(callbacks)->Copy(GURL(src_path), GURL(dest_path));
|
||||||
FilePath src_filepath(webkit_glue::WebStringToFilePath(src_path));
|
|
||||||
|
|
||||||
GetNewOperation(callbacks)->Copy(src_filepath, dest_filepath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::remove(
|
void BrowserFileSystem::remove(
|
||||||
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->Remove(GURL(path), false /* recursive */);
|
||||||
|
|
||||||
GetNewOperation(callbacks)->Remove(filepath, false /* recursive */);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::removeRecursively(
|
void BrowserFileSystem::removeRecursively(
|
||||||
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->Remove(GURL(path), true /* recursive */);
|
||||||
|
|
||||||
GetNewOperation(callbacks)->Remove(filepath, true /* recursive */);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::readMetadata(
|
void BrowserFileSystem::readMetadata(
|
||||||
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->GetMetadata(GURL(path));
|
||||||
|
|
||||||
GetNewOperation(callbacks)->GetMetadata(filepath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::createFile(
|
void BrowserFileSystem::createFile(
|
||||||
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->CreateFile(GURL(path), exclusive);
|
||||||
|
|
||||||
GetNewOperation(callbacks)->CreateFile(filepath, exclusive);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::createDirectory(
|
void BrowserFileSystem::createDirectory(
|
||||||
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->CreateDirectory(GURL(path), exclusive, false);
|
||||||
|
|
||||||
GetNewOperation(callbacks)->CreateDirectory(filepath, exclusive, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::fileExists(
|
void BrowserFileSystem::fileExists(
|
||||||
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->FileExists(GURL(path));
|
||||||
|
|
||||||
GetNewOperation(callbacks)->FileExists(filepath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::directoryExists(
|
void BrowserFileSystem::directoryExists(
|
||||||
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->DirectoryExists(GURL(path));
|
||||||
|
|
||||||
GetNewOperation(callbacks)->DirectoryExists(filepath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileSystem::readDirectory(
|
void BrowserFileSystem::readDirectory(
|
||||||
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
const WebString& path, WebFileSystemCallbacks* callbacks) {
|
||||||
FilePath filepath(webkit_glue::WebStringToFilePath(path));
|
GetNewOperation(callbacks)->ReadDirectory(GURL(path));
|
||||||
|
|
||||||
GetNewOperation(callbacks)->ReadDirectory(filepath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebFileWriter* BrowserFileSystem::createFileWriter(
|
WebFileWriter* BrowserFileSystem::createFileWriter(
|
||||||
const WebString& path, WebFileWriterClient* client) {
|
const WebString& path, WebFileWriterClient* client) {
|
||||||
return new BrowserFileWriter(path, client, file_system_context_.get());
|
return new BrowserFileWriter(GURL(path), client, file_system_context_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemOperation* BrowserFileSystem::GetNewOperation(
|
FileSystemOperation* BrowserFileSystem::GetNewOperation(
|
||||||
|
@ -43,7 +43,7 @@ class BrowserFileWriter::IOThreadProxy
|
|||||||
virtual ~IOThreadProxy() {
|
virtual ~IOThreadProxy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Truncate(const FilePath& path, int64 offset) {
|
void Truncate(const GURL& path, int64 offset) {
|
||||||
if (!io_thread_->BelongsToCurrentThread()) {
|
if (!io_thread_->BelongsToCurrentThread()) {
|
||||||
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
|
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
|
||||||
this, &IOThreadProxy::Truncate, path, offset));
|
this, &IOThreadProxy::Truncate, path, offset));
|
||||||
@ -54,7 +54,7 @@ class BrowserFileWriter::IOThreadProxy
|
|||||||
operation_->Truncate(path, offset);
|
operation_->Truncate(path, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(const FilePath& path, const GURL& blob_url, int64 offset) {
|
void Write(const GURL& path, const GURL& blob_url, int64 offset) {
|
||||||
if (!io_thread_->BelongsToCurrentThread()) {
|
if (!io_thread_->BelongsToCurrentThread()) {
|
||||||
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
|
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
|
||||||
this, &IOThreadProxy::Write, path, blob_url, offset));
|
this, &IOThreadProxy::Write, path, blob_url, offset));
|
||||||
@ -94,6 +94,10 @@ class BrowserFileWriter::IOThreadProxy
|
|||||||
proxy_->DidSucceed();
|
proxy_->DidSucceed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void DidGetLocalPath(const FilePath& local_path) {
|
||||||
|
NOTREACHED();
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DidFail(base::PlatformFileError error_code) {
|
virtual void DidFail(base::PlatformFileError error_code) {
|
||||||
proxy_->DidFail(error_code);
|
proxy_->DidFail(error_code);
|
||||||
}
|
}
|
||||||
@ -116,7 +120,7 @@ class BrowserFileWriter::IOThreadProxy
|
|||||||
|
|
||||||
virtual void DidOpenFileSystem(
|
virtual void DidOpenFileSystem(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const FilePath& root_path) {
|
const GURL& root) {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +183,7 @@ class BrowserFileWriter::IOThreadProxy
|
|||||||
|
|
||||||
|
|
||||||
BrowserFileWriter::BrowserFileWriter(
|
BrowserFileWriter::BrowserFileWriter(
|
||||||
const WebString& path,
|
const GURL& path,
|
||||||
WebFileWriterClient* client,
|
WebFileWriterClient* client,
|
||||||
FileSystemContext* file_system_context)
|
FileSystemContext* file_system_context)
|
||||||
: WebFileWriterBase(path, client),
|
: WebFileWriterBase(path, client),
|
||||||
@ -189,12 +193,12 @@ BrowserFileWriter::BrowserFileWriter(
|
|||||||
BrowserFileWriter::~BrowserFileWriter() {
|
BrowserFileWriter::~BrowserFileWriter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileWriter::DoTruncate(const FilePath& path, int64 offset) {
|
void BrowserFileWriter::DoTruncate(const GURL& path, int64 offset) {
|
||||||
io_thread_proxy_->Truncate(path, offset);
|
io_thread_proxy_->Truncate(path, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserFileWriter::DoWrite(
|
void BrowserFileWriter::DoWrite(
|
||||||
const FilePath& path, const GURL& blob_url, int64 offset) {
|
const GURL& path, const GURL& blob_url, int64 offset) {
|
||||||
io_thread_proxy_->Write(path, blob_url, offset);
|
io_thread_proxy_->Write(path, blob_url, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +19,10 @@ class FileSystemContext;
|
|||||||
|
|
||||||
// An implementation of WebFileWriter for use in test_shell and DRT.
|
// An implementation of WebFileWriter for use in test_shell and DRT.
|
||||||
class BrowserFileWriter : public fileapi::WebFileWriterBase,
|
class BrowserFileWriter : public fileapi::WebFileWriterBase,
|
||||||
public base::SupportsWeakPtr<BrowserFileWriter> {
|
public base::SupportsWeakPtr<BrowserFileWriter> {
|
||||||
public:
|
public:
|
||||||
BrowserFileWriter(
|
BrowserFileWriter(
|
||||||
const WebKit::WebString& path,
|
const GURL& path,
|
||||||
WebKit::WebFileWriterClient* client,
|
WebKit::WebFileWriterClient* client,
|
||||||
fileapi::FileSystemContext* file_system_context);
|
fileapi::FileSystemContext* file_system_context);
|
||||||
virtual ~BrowserFileWriter();
|
virtual ~BrowserFileWriter();
|
||||||
@ -37,8 +37,8 @@ class BrowserFileWriter : public fileapi::WebFileWriterBase,
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// WebFileWriterBase overrides
|
// WebFileWriterBase overrides
|
||||||
virtual void DoTruncate(const FilePath& path, int64 offset);
|
virtual void DoTruncate(const GURL& path, int64 offset);
|
||||||
virtual void DoWrite(const FilePath& path, const GURL& blob_url,
|
virtual void DoWrite(const GURL& path, const GURL& blob_url,
|
||||||
int64 offset);
|
int64 offset);
|
||||||
virtual void DoCancel();
|
virtual void DoCancel();
|
||||||
|
|
||||||
|
@ -9,7 +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 "skia/ext/vector_platform_device_emf_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"
|
||||||
@ -263,9 +263,9 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages,
|
|||||||
DCHECK_NE(saved_state, 0);
|
DCHECK_NE(saved_state, 0);
|
||||||
|
|
||||||
skia::PlatformDevice* device =
|
skia::PlatformDevice* device =
|
||||||
skia::VectorPlatformDeviceFactory::CreateDevice(dest_size_x,
|
skia::VectorPlatformDeviceEmfFactory::CreateDevice(dest_size_x,
|
||||||
dest_size_y,
|
dest_size_y,
|
||||||
true, hDC);
|
true, hDC);
|
||||||
DCHECK(device);
|
DCHECK(device);
|
||||||
skia::VectorCanvas canvas(device);
|
skia::VectorCanvas canvas(device);
|
||||||
|
|
||||||
|
@ -185,12 +185,14 @@ bool BrowserPersistentCookieStore::Backend::Load(
|
|||||||
smt.ColumnString(3), // value
|
smt.ColumnString(3), // value
|
||||||
smt.ColumnString(1), // domain
|
smt.ColumnString(1), // domain
|
||||||
smt.ColumnString(4), // path
|
smt.ColumnString(4), // path
|
||||||
|
std::string(), // TODO(abarth): Persist mac_key
|
||||||
|
std::string(), // TODO(abarth): Persist mac_algorithm
|
||||||
|
Time::FromInternalValue(smt.ColumnInt64(0)), // creation_utc
|
||||||
|
Time::FromInternalValue(smt.ColumnInt64(5)), // expires_utc
|
||||||
|
Time::FromInternalValue(smt.ColumnInt64(8)), // last_access_utc
|
||||||
smt.ColumnInt(6) != 0, // secure
|
smt.ColumnInt(6) != 0, // secure
|
||||||
smt.ColumnInt(7) != 0, // httponly
|
smt.ColumnInt(7) != 0, // httponly
|
||||||
Time::FromInternalValue(smt.ColumnInt64(0)), // creation_utc
|
true)); // has_
|
||||||
Time::FromInternalValue(smt.ColumnInt64(8)), // last_access_utc
|
|
||||||
true, // has_expires
|
|
||||||
Time::FromInternalValue(smt.ColumnInt64(5)))); // expires_utc
|
|
||||||
DLOG_IF(WARNING,
|
DLOG_IF(WARNING,
|
||||||
cc->CreationDate() > Time::Now()) << L"CreationDate too recent";
|
cc->CreationDate() > Time::Now()) << L"CreationDate too recent";
|
||||||
cookies->push_back(cc.release());
|
cookies->push_back(cc.release());
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
#include "browser_resource_loader_bridge.h"
|
#include "browser_resource_loader_bridge.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
#include "base/compiler_specific.h"
|
||||||
#include "base/file_path.h"
|
#include "base/file_path.h"
|
||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
#include "net/base/cert_verifier.h"
|
#include "net/base/cert_verifier.h"
|
||||||
#include "net/base/cookie_monster.h"
|
#include "net/base/cookie_monster.h"
|
||||||
#include "net/base/host_resolver.h"
|
#include "net/base/host_resolver.h"
|
||||||
#include "net/base/ssl_config_service.h"
|
#include "net/base/ssl_config_service_defaults.h"
|
||||||
#include "net/base/static_cookie_policy.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"
|
||||||
#include "net/proxy/proxy_config_service.h"
|
#include "net/proxy/proxy_config_service.h"
|
||||||
@ -40,7 +40,9 @@ public:
|
|||||||
ProxyConfigServiceNull() {}
|
ProxyConfigServiceNull() {}
|
||||||
virtual void AddObserver(Observer* observer) {}
|
virtual void AddObserver(Observer* observer) {}
|
||||||
virtual void RemoveObserver(Observer* observer) {}
|
virtual void RemoveObserver(Observer* observer) {}
|
||||||
virtual bool GetLatestProxyConfig(net::ProxyConfig* config) { return true; }
|
virtual ProxyConfigService::ConfigAvailability
|
||||||
|
GetLatestProxyConfig(net::ProxyConfig* config)
|
||||||
|
{ return ProxyConfigService::CONFIG_VALID; }
|
||||||
virtual void OnLazyPoll() {}
|
virtual void OnLazyPoll() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -48,14 +50,18 @@ public:
|
|||||||
|
|
||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
|
|
||||||
BrowserRequestContext::BrowserRequestContext() {
|
BrowserRequestContext::BrowserRequestContext()
|
||||||
|
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)),
|
||||||
|
accept_all_cookies_(true) {
|
||||||
Init(FilePath(), net::HttpCache::NORMAL, false);
|
Init(FilePath(), net::HttpCache::NORMAL, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserRequestContext::BrowserRequestContext(
|
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)),
|
||||||
|
accept_all_cookies_(true) {
|
||||||
Init(cache_path, cache_mode, no_proxy);
|
Init(cache_path, cache_mode, no_proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +84,8 @@ void BrowserRequestContext::Init(
|
|||||||
persistent_store = new BrowserPersistentCookieStore(cookie_path);
|
persistent_store = new BrowserPersistentCookieStore(cookie_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_cookie_store(new net::CookieMonster(persistent_store.get(), NULL));
|
storage_.set_cookie_store(
|
||||||
set_cookie_policy(new net::StaticCookiePolicy());
|
new net::CookieMonster(persistent_store.get(), 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");
|
||||||
@ -96,7 +102,7 @@ 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) {
|
||||||
set_proxy_service(net::ProxyService::CreateWithoutProxyResolver(
|
storage_.set_proxy_service(net::ProxyService::CreateWithoutProxyResolver(
|
||||||
new ProxyConfigServiceNull(), NULL));
|
new ProxyConfigServiceNull(), NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,15 +120,15 @@ void BrowserRequestContext::Init(
|
|||||||
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));
|
||||||
set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver(
|
storage_.set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver(
|
||||||
proxy_config_service.release(), 0, NULL));
|
proxy_config_service.release(), 0, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
set_host_resolver(
|
storage_.set_host_resolver(
|
||||||
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
|
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
|
||||||
NULL, NULL));
|
NULL));
|
||||||
set_cert_verifier(new net::CertVerifier);
|
storage_.set_cert_verifier(new net::CertVerifier);
|
||||||
set_ssl_config_service(net::SSLConfigService::CreateSystemSSLConfigService());
|
storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults);
|
||||||
|
|
||||||
// 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));
|
||||||
@ -133,7 +139,7 @@ void BrowserRequestContext::Init(
|
|||||||
supported_schemes.push_back("ntlm");
|
supported_schemes.push_back("ntlm");
|
||||||
supported_schemes.push_back("negotiate");
|
supported_schemes.push_back("negotiate");
|
||||||
|
|
||||||
set_http_auth_handler_factory(
|
storage_.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(),
|
||||||
@ -151,9 +157,10 @@ void BrowserRequestContext::Init(
|
|||||||
http_auth_handler_factory(), NULL, NULL, backend);
|
http_auth_handler_factory(), NULL, NULL, backend);
|
||||||
|
|
||||||
cache->set_mode(cache_mode);
|
cache->set_mode(cache_mode);
|
||||||
set_http_transaction_factory(cache);
|
storage_.set_http_transaction_factory(cache);
|
||||||
|
|
||||||
set_ftp_transaction_factory(new net::FtpNetworkLayer(host_resolver()));
|
storage_.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*>(
|
file_system_context_ = static_cast<BrowserFileSystem*>(
|
||||||
@ -161,19 +168,14 @@ void BrowserRequestContext::Init(
|
|||||||
}
|
}
|
||||||
|
|
||||||
BrowserRequestContext::~BrowserRequestContext() {
|
BrowserRequestContext::~BrowserRequestContext() {
|
||||||
delete ftp_transaction_factory();
|
|
||||||
delete http_transaction_factory();
|
|
||||||
delete http_auth_handler_factory();
|
|
||||||
delete cookie_policy();
|
|
||||||
delete cert_verifier();
|
|
||||||
delete host_resolver();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserRequestContext::SetAcceptAllCookies(bool accept_all_cookies) {
|
void BrowserRequestContext::SetAcceptAllCookies(bool accept_all_cookies) {
|
||||||
net::StaticCookiePolicy::Type policy_type = accept_all_cookies ?
|
accept_all_cookies_ = accept_all_cookies;
|
||||||
net::StaticCookiePolicy::ALLOW_ALL_COOKIES :
|
}
|
||||||
net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES;
|
|
||||||
static_cast<net::StaticCookiePolicy*>(cookie_policy())->set_type(policy_type);
|
bool BrowserRequestContext::AcceptAllCookies() {
|
||||||
|
return accept_all_cookies_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& BrowserRequestContext::GetUserAgent(
|
const std::string& BrowserRequestContext::GetUserAgent(
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "net/http/http_cache.h"
|
#include "net/http/http_cache.h"
|
||||||
#include "net/http/url_security_manager.h"
|
#include "net/http/url_security_manager.h"
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
|
#include "net/url_request/url_request_context_storage.h"
|
||||||
|
|
||||||
class FilePath;
|
class FilePath;
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ class BrowserRequestContext : public net::URLRequestContext {
|
|||||||
virtual const std::string& GetUserAgent(const GURL& url) const;
|
virtual const std::string& GetUserAgent(const GURL& url) const;
|
||||||
|
|
||||||
void SetAcceptAllCookies(bool accept_all_cookies);
|
void SetAcceptAllCookies(bool accept_all_cookies);
|
||||||
|
bool AcceptAllCookies();
|
||||||
|
|
||||||
webkit_blob::BlobStorageController* blob_storage_controller() const {
|
webkit_blob::BlobStorageController* blob_storage_controller() const {
|
||||||
return blob_storage_controller_.get();
|
return blob_storage_controller_.get();
|
||||||
@ -49,9 +51,11 @@ class BrowserRequestContext : public net::URLRequestContext {
|
|||||||
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);
|
||||||
|
|
||||||
|
net::URLRequestContextStorage storage_;
|
||||||
scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_;
|
scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_;
|
||||||
scoped_refptr<fileapi::FileSystemContext> file_system_context_;
|
scoped_refptr<fileapi::FileSystemContext> file_system_context_;
|
||||||
scoped_ptr<net::URLSecurityManager> url_security_manager_;
|
scoped_ptr<net::URLSecurityManager> url_security_manager_;
|
||||||
|
bool accept_all_cookies_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _BROWSER_REQUEST_CONTEXT_H
|
#endif // _BROWSER_REQUEST_CONTEXT_H
|
||||||
|
@ -50,9 +50,6 @@
|
|||||||
#include "base/memory/ref_counted.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)
|
|
||||||
#include "base/nss_util.h"
|
|
||||||
#endif
|
|
||||||
#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"
|
||||||
@ -80,6 +77,10 @@
|
|||||||
#include "webkit/fileapi/file_system_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"
|
||||||
|
|
||||||
|
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||||
|
#include "crypto/nss_util.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using net::HttpResponseHeaders;
|
using net::HttpResponseHeaders;
|
||||||
using net::StaticCookiePolicy;
|
using net::StaticCookiePolicy;
|
||||||
using net::URLRequestStatus;
|
using net::URLRequestStatus;
|
||||||
@ -243,7 +244,7 @@ class RequestProxy : public net::URLRequest::Delegate,
|
|||||||
this, &RequestProxy::AsyncCancel));
|
this, &RequestProxy::AsyncCancel));
|
||||||
}
|
}
|
||||||
|
|
||||||
peer_->OnReceivedData(buf_copy.get(), bytes_read);
|
peer_->OnReceivedData(buf_copy.get(), bytes_read, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyDownloadedData(int bytes_read) {
|
void NotifyDownloadedData(int bytes_read) {
|
||||||
@ -622,6 +623,32 @@ class RequestProxy : public net::URLRequest::Delegate,
|
|||||||
request->ContinueDespiteLastError();
|
request->ContinueDespiteLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool CanGetCookies(net::URLRequest* request) {
|
||||||
|
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(net::URLRequest* request,
|
||||||
|
const std::string& cookie_line,
|
||||||
|
net::CookieOptions* options) {
|
||||||
|
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(), cookie_line);
|
||||||
|
return rv == net::OK;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) {
|
virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) {
|
||||||
if (request->status().is_success() && bytes_read > 0) {
|
if (request->status().is_success() && bytes_read > 0) {
|
||||||
OnReceivedData(bytes_read);
|
OnReceivedData(bytes_read);
|
||||||
|
@ -157,7 +157,9 @@ void WebSocketStreamHandleBridgeImpl::OnClose(net::SocketStream* socket) {
|
|||||||
|
|
||||||
void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) {
|
void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) {
|
||||||
DCHECK(MessageLoop::current() == g_io_thread);
|
DCHECK(MessageLoop::current() == g_io_thread);
|
||||||
socket_ = net::SocketStreamJob::CreateSocketStreamJob(url, this);
|
socket_ = net::SocketStreamJob::CreateSocketStreamJob(
|
||||||
|
url, this, g_request_context->transport_security_state(),
|
||||||
|
g_request_context->ssl_config_service());
|
||||||
socket_->set_context(g_request_context);
|
socket_->set_context(g_request_context);
|
||||||
socket_->Connect();
|
socket_->Connect();
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#include "browser_webblobregistry_impl.h"
|
#include "browser_webblobregistry_impl.h"
|
||||||
|
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
|
#include "base/task.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobData.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobData.h"
|
||||||
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
|
||||||
#include "webkit/blob/blob_data.h"
|
#include "webkit/blob/blob_data.h"
|
||||||
@ -21,6 +23,17 @@ namespace {
|
|||||||
MessageLoop* g_io_thread;
|
MessageLoop* g_io_thread;
|
||||||
webkit_blob::BlobStorageController* g_blob_storage_controller;
|
webkit_blob::BlobStorageController* g_blob_storage_controller;
|
||||||
|
|
||||||
|
// WebURL contains a WebCString object that is ref-counted,
|
||||||
|
// but not thread-safe ref-counted.
|
||||||
|
// "Normal" copying of WebURL results in a copy that is not thread-safe.
|
||||||
|
// This method creates a deep copy of WebURL.
|
||||||
|
WebURL GetWebURLThreadsafeCopy(const WebURL& source) {
|
||||||
|
const WebKit::WebCString spec(source.spec());
|
||||||
|
const url_parse::Parsed& parsed(source.parsed());
|
||||||
|
const bool is_valid = source.isValid();
|
||||||
|
return WebURL(spec, parsed, is_valid);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
@ -42,34 +55,55 @@ BrowserWebBlobRegistryImpl::BrowserWebBlobRegistryImpl() {
|
|||||||
void BrowserWebBlobRegistryImpl::registerBlobURL(
|
void BrowserWebBlobRegistryImpl::registerBlobURL(
|
||||||
const WebURL& url, WebBlobData& data) {
|
const WebURL& url, WebBlobData& data) {
|
||||||
DCHECK(g_io_thread);
|
DCHECK(g_io_thread);
|
||||||
// Note: BlobData is not refcounted thread safe.
|
CancelableTask* task;
|
||||||
scoped_refptr<webkit_blob::BlobData> blob_data(
|
{
|
||||||
|
scoped_refptr<webkit_blob::BlobData> blob_data(
|
||||||
new webkit_blob::BlobData(data));
|
new webkit_blob::BlobData(data));
|
||||||
g_io_thread->PostTask(
|
WebURL url_copy = GetWebURLThreadsafeCopy(url);
|
||||||
FROM_HERE,
|
task =
|
||||||
NewRunnableMethod(
|
NewRunnableMethod(
|
||||||
this, &BrowserWebBlobRegistryImpl::DoRegisterBlobUrl, url,
|
this, &BrowserWebBlobRegistryImpl::DoRegisterBlobUrl, url_copy,
|
||||||
blob_data));
|
blob_data);
|
||||||
|
// After this block exits, url_copy is disposed, and
|
||||||
|
// the underlying WebCString will have a refcount=1 and will
|
||||||
|
// only be accessible from the task object.
|
||||||
|
}
|
||||||
|
g_io_thread->PostTask(FROM_HERE, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebBlobRegistryImpl::registerBlobURL(
|
void BrowserWebBlobRegistryImpl::registerBlobURL(
|
||||||
const WebURL& url, const WebURL& src_url) {
|
const WebURL& url, const WebURL& src_url) {
|
||||||
DCHECK(g_io_thread);
|
DCHECK(g_io_thread);
|
||||||
g_io_thread->PostTask(
|
CancelableTask* task;
|
||||||
FROM_HERE,
|
{
|
||||||
|
WebURL url_copy = GetWebURLThreadsafeCopy(url);
|
||||||
|
WebURL src_url_copy = GetWebURLThreadsafeCopy(src_url);
|
||||||
|
task =
|
||||||
NewRunnableMethod(this,
|
NewRunnableMethod(this,
|
||||||
&BrowserWebBlobRegistryImpl::DoRegisterBlobUrlFrom,
|
&BrowserWebBlobRegistryImpl::DoRegisterBlobUrlFrom,
|
||||||
url,
|
url_copy,
|
||||||
src_url));
|
src_url_copy);
|
||||||
|
// After this block exits, url_copy and src_url_copy are disposed, and
|
||||||
|
// the underlying WebCStrings will have a refcount=1 and will
|
||||||
|
// only be accessible from the task object.
|
||||||
|
}
|
||||||
|
g_io_thread->PostTask(FROM_HERE, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebBlobRegistryImpl::unregisterBlobURL(const WebURL& url) {
|
void BrowserWebBlobRegistryImpl::unregisterBlobURL(const WebURL& url) {
|
||||||
DCHECK(g_io_thread);
|
DCHECK(g_io_thread);
|
||||||
g_io_thread->PostTask(
|
CancelableTask* task;
|
||||||
FROM_HERE,
|
{
|
||||||
|
WebURL url_copy = GetWebURLThreadsafeCopy(url);
|
||||||
|
task =
|
||||||
NewRunnableMethod(this,
|
NewRunnableMethod(this,
|
||||||
&BrowserWebBlobRegistryImpl::DoUnregisterBlobUrl,
|
&BrowserWebBlobRegistryImpl::DoUnregisterBlobUrl,
|
||||||
url));
|
url_copy);
|
||||||
|
// After this block exits, url_copy is disposed, and
|
||||||
|
// the underlying WebCString will have a refcount=1 and will
|
||||||
|
// only be accessible from the task object.
|
||||||
|
}
|
||||||
|
g_io_thread->PostTask(FROM_HERE, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebBlobRegistryImpl::DoRegisterBlobUrl(
|
void BrowserWebBlobRegistryImpl::DoRegisterBlobUrl(
|
||||||
|
@ -45,12 +45,6 @@ bool IsMediaPlayerAvailable() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrecacheUrl(const char16* url, int url_length) {}
|
|
||||||
|
|
||||||
void AppendToLog(const char* file, int line, const char* msg) {
|
|
||||||
logging::LogMessage(file, line).stream() << msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GetApplicationDirectory(FilePath* path) {
|
bool GetApplicationDirectory(FilePath* path) {
|
||||||
return PathService::Get(base::DIR_EXE, path);
|
return PathService::Get(base::DIR_EXE, path);
|
||||||
}
|
}
|
||||||
@ -126,7 +120,9 @@ std::string GetProductVersion() {
|
|||||||
if (settings.product_version.length > 0) {
|
if (settings.product_version.length > 0) {
|
||||||
return CefString(&settings.product_version);
|
return CefString(&settings.product_version);
|
||||||
}
|
}
|
||||||
return "Chrome/7.0.517.0";
|
// Keep synchronized with the newest Beta Channel release announced at
|
||||||
|
// http://googlechromereleases.blogspot.com/
|
||||||
|
return "Chrome/12.0.742.53";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSingleProcess() {
|
bool IsSingleProcess() {
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptValue.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptValue.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
|
||||||
|
#include "ui/gfx/gl/gl_bindings_skia_in_process.h"
|
||||||
#include "webkit/glue/simple_webmimeregistry_impl.h"
|
#include "webkit/glue/simple_webmimeregistry_impl.h"
|
||||||
#include "webkit/glue/webclipboard_impl.h"
|
#include "webkit/glue/webclipboard_impl.h"
|
||||||
#include "webkit/glue/webfileutilities_impl.h"
|
#include "webkit/glue/webfileutilities_impl.h"
|
||||||
@ -233,6 +234,7 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() {
|
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() {
|
||||||
|
gfx::BindSkiaToInProcessGL();
|
||||||
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
|
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -818,7 +818,7 @@ void BrowserWebViewDelegate::didClearWindowObject(WebFrame* frame) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWebViewDelegate::didReceiveTitle(
|
void BrowserWebViewDelegate::didReceiveTitle(
|
||||||
WebFrame* frame, const WebString& title) {
|
WebFrame* frame, const WebString& title, WebTextDirection direction) {
|
||||||
bool is_main_frame = (frame->parent() == 0);
|
bool is_main_frame = (frame->parent() == 0);
|
||||||
if (is_main_frame) {
|
if (is_main_frame) {
|
||||||
CefString titleStr = string16(title);
|
CefString titleStr = string16(title);
|
||||||
|
@ -164,7 +164,8 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient,
|
|||||||
WebKit::WebFrame*, bool is_new_navigation);
|
WebKit::WebFrame*, bool is_new_navigation);
|
||||||
virtual void didClearWindowObject(WebKit::WebFrame*);
|
virtual void didClearWindowObject(WebKit::WebFrame*);
|
||||||
virtual void didReceiveTitle(
|
virtual void didReceiveTitle(
|
||||||
WebKit::WebFrame*, const WebKit::WebString& title);
|
WebKit::WebFrame*, const WebKit::WebString& title,
|
||||||
|
WebKit::WebTextDirection direction);
|
||||||
virtual void didFailLoad(
|
virtual void didFailLoad(
|
||||||
WebKit::WebFrame*, const WebKit::WebURLError&);
|
WebKit::WebFrame*, const WebKit::WebURLError&);
|
||||||
virtual void didFinishLoad(WebKit::WebFrame*);
|
virtual void didFinishLoad(WebKit::WebFrame*);
|
||||||
|
@ -10,13 +10,15 @@
|
|||||||
#include "../include/cef_nplugin.h"
|
#include "../include/cef_nplugin.h"
|
||||||
|
|
||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
|
||||||
#include "base/nss_util.h"
|
|
||||||
#endif
|
|
||||||
#include "base/stringprintf.h"
|
#include "base/stringprintf.h"
|
||||||
|
#include "base/synchronization/waitable_event.h"
|
||||||
#include "net/base/cookie_monster.h"
|
#include "net/base/cookie_monster.h"
|
||||||
#include "webkit/plugins/npapi/plugin_list.h"
|
#include "webkit/plugins/npapi/plugin_list.h"
|
||||||
|
|
||||||
|
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||||
|
#include "crypto/nss_util.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Both the CefContext constuctor and the CefContext::RemoveBrowser method need
|
// Both the CefContext constuctor and the CefContext::RemoveBrowser method need
|
||||||
// to initialize or reset to the same value.
|
// to initialize or reset to the same value.
|
||||||
const int kNextBrowserIdReset = 1;
|
const int kNextBrowserIdReset = 1;
|
||||||
@ -485,7 +487,7 @@ bool CefContext::Initialize(const CefSettings& settings,
|
|||||||
|
|
||||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||||
// We want to be sure to init NSPR on the main thread.
|
// We want to be sure to init NSPR on the main thread.
|
||||||
base::EnsureNSPRInit();
|
crypto::EnsureNSPRInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
process_ = new CefProcess(settings_.multi_threaded_message_loop);
|
process_ = new CefProcess(settings_.multi_threaded_message_loop);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "browser_webblobregistry_impl.h"
|
#include "browser_webblobregistry_impl.h"
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
#include "net/socket/client_socket_pool_manager.h"
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#include <Objbase.h>
|
#include <Objbase.h>
|
||||||
@ -34,7 +35,11 @@ void CefProcessIOThread::Init() {
|
|||||||
// Initializes the COM library on the current thread.
|
// Initializes the COM library on the current thread.
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Increase max sockets per group as a workaround for the SyncRequestProxy
|
||||||
|
// deadlock problem (issue #192).
|
||||||
|
net::ClientSocketPoolManager::set_max_sockets_per_group(15);
|
||||||
|
|
||||||
FilePath cache_path(_Context->cache_path());
|
FilePath cache_path(_Context->cache_path());
|
||||||
request_context_ = new BrowserRequestContext(cache_path,
|
request_context_ = new BrowserRequestContext(cache_path,
|
||||||
net::HttpCache::NORMAL, false);
|
net::HttpCache::NORMAL, false);
|
||||||
|
@ -64,12 +64,12 @@ net::URLRequestJob* FileSystemURLRequestJobFactory(net::URLRequest* request,
|
|||||||
if (!path.empty() && path[path.size() - 1] == '/') {
|
if (!path.empty() && path[path.size() - 1] == '/') {
|
||||||
return new fileapi::FileSystemDirURLRequestJob(
|
return new fileapi::FileSystemDirURLRequestJob(
|
||||||
request,
|
request,
|
||||||
fs_context->path_manager(),
|
fs_context,
|
||||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
|
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
|
||||||
}
|
}
|
||||||
return new fileapi::FileSystemURLRequestJob(
|
return new fileapi::FileSystemURLRequestJob(
|
||||||
request,
|
request,
|
||||||
fs_context->path_manager(),
|
fs_context,
|
||||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
|
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ void CefProcessUIThread::Init() {
|
|||||||
WebKit::WebScriptController::registerExtension(
|
WebKit::WebScriptController::registerExtension(
|
||||||
extensions_v8::GCExtension::Get());
|
extensions_v8::GCExtension::Get());
|
||||||
|
|
||||||
gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL);
|
gfx::InitializeGLBindings(gfx::kGLImplementationEGLGLES2);
|
||||||
|
|
||||||
net::URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory);
|
net::URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory);
|
||||||
net::URLRequest::RegisterProtocolFactory("filesystem",
|
net::URLRequest::RegisterProtocolFactory("filesystem",
|
||||||
|
@ -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.
|
||||||
|
|
||||||
@ -50,11 +50,6 @@ NullableString16 DOMStorageArea::GetItem(const string16& key) {
|
|||||||
NullableString16 DOMStorageArea::SetItem(
|
NullableString16 DOMStorageArea::SetItem(
|
||||||
const string16& key, const string16& value,
|
const string16& key, const string16& value,
|
||||||
WebStorageArea::Result* result) {
|
WebStorageArea::Result* result) {
|
||||||
if (!CheckContentSetting(key, value)) {
|
|
||||||
*result = WebStorageArea::ResultBlockedByPolicy;
|
|
||||||
return NullableString16(true); // Ignored if the content was blocked.
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateWebStorageAreaIfNecessary();
|
CreateWebStorageAreaIfNecessary();
|
||||||
WebString old_value;
|
WebString old_value;
|
||||||
storage_area_->setItem(key, value, WebURL(), *result, old_value);
|
storage_area_->setItem(key, value, WebURL(), *result, old_value);
|
||||||
@ -83,9 +78,3 @@ void DOMStorageArea::CreateWebStorageAreaIfNecessary() {
|
|||||||
if (!storage_area_.get())
|
if (!storage_area_.get())
|
||||||
storage_area_.reset(owner_->CreateWebStorageArea(origin_));
|
storage_area_.reset(owner_->CreateWebStorageArea(origin_));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DOMStorageArea::CheckContentSetting(
|
|
||||||
const string16& key, const string16& value) {
|
|
||||||
// TODO(cef): Potentially give the host an option to deny write access.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
// 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 _DOM_STORAGE_AREA_H
|
#ifndef _DOM_STORAGE_AREA_H
|
||||||
#define _DOM_STORAGE_AREA_H
|
#define _DOM_STORAGE_AREA_H
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "base/hash_tables.h"
|
#include "base/hash_tables.h"
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
@ -14,7 +15,6 @@
|
|||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
|
||||||
|
|
||||||
class DOMStorageNamespace;
|
class DOMStorageNamespace;
|
||||||
|
|
||||||
// Only use on the WebKit thread. DOMStorageNamespace manages our registration
|
// Only use on the WebKit thread. DOMStorageNamespace manages our registration
|
||||||
// with DOMStorageContext.
|
// with DOMStorageContext.
|
||||||
class DOMStorageArea {
|
class DOMStorageArea {
|
||||||
@ -42,9 +42,6 @@ class DOMStorageArea {
|
|||||||
// Creates the underlying WebStorageArea on demand.
|
// Creates the underlying WebStorageArea on demand.
|
||||||
void CreateWebStorageAreaIfNecessary();
|
void CreateWebStorageAreaIfNecessary();
|
||||||
|
|
||||||
// Used to see if setItem has permission to do its thing.
|
|
||||||
bool CheckContentSetting(const string16& key, const string16& value);
|
|
||||||
|
|
||||||
// The origin this storage area represents.
|
// The origin this storage area represents.
|
||||||
string16 origin_;
|
string16 origin_;
|
||||||
GURL origin_url_;
|
GURL origin_url_;
|
||||||
|
@ -7,10 +7,14 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/lazy_instance.h"
|
#include "base/lazy_instance.h"
|
||||||
|
#include "base/stl_util-inl.h"
|
||||||
#include "base/string16.h"
|
#include "base/string16.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
#include "third_party/skia/include/core/SkBitmap.h"
|
||||||
|
#include "third_party/zlib/zlib.h"
|
||||||
#include "ui/base/clipboard/clipboard.h"
|
#include "ui/base/clipboard/clipboard.h"
|
||||||
|
#include "ui/gfx/codec/png_codec.h"
|
||||||
|
#include "ui/gfx/size.h"
|
||||||
#include "webkit/glue/scoped_clipboard_writer_glue.h"
|
#include "webkit/glue/scoped_clipboard_writer_glue.h"
|
||||||
|
|
||||||
// Clipboard glue
|
// Clipboard glue
|
||||||
@ -36,6 +40,13 @@ bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format,
|
|||||||
return ClipboardGetClipboard()->IsFormatAvailable(format, buffer);
|
return ClipboardGetClipboard()->IsFormatAvailable(format, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(dcheng): Implement.
|
||||||
|
void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
||||||
|
std::vector<string16>* types,
|
||||||
|
bool* contains_filenames) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result) {
|
void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result) {
|
||||||
ClipboardGetClipboard()->ReadText(buffer, result);
|
ClipboardGetClipboard()->ReadText(buffer, result);
|
||||||
}
|
}
|
||||||
@ -52,15 +63,25 @@ void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup,
|
|||||||
*url = GURL(url_str);
|
*url = GURL(url_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dcheng): Implement.
|
|
||||||
void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
|
|
||||||
std::vector<string16>* types,
|
|
||||||
bool* contains_filenames) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
|
void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
|
||||||
ClipboardGetClipboard()->ReadImage(buffer, data);
|
SkBitmap bitmap = ClipboardGetClipboard()->ReadImage(buffer);
|
||||||
|
if (bitmap.isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::vector<unsigned char> png_data;
|
||||||
|
SkAutoLockPixels lock(bitmap);
|
||||||
|
if (gfx::PNGCodec::EncodeWithCompressionLevel(
|
||||||
|
static_cast<const unsigned char*>(bitmap.getPixels()),
|
||||||
|
gfx::PNGCodec::FORMAT_BGRA,
|
||||||
|
gfx::Size(bitmap.width(), bitmap.height()),
|
||||||
|
bitmap.rowBytes(),
|
||||||
|
false,
|
||||||
|
std::vector<gfx::PNGCodec::Comment>(),
|
||||||
|
Z_BEST_SPEED,
|
||||||
|
&png_data)) {
|
||||||
|
data->assign(reinterpret_cast<char*>(vector_as_array(&png_data)),
|
||||||
|
png_data.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
|
bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
|
||||||
|
@ -142,9 +142,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Called when a chunk of response data is received.
|
// Called when a chunk of response data is received.
|
||||||
// FIXME(vsevik): rename once original didReceiveData() is removed.
|
virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength,
|
||||||
virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength,
|
int lengthReceived)
|
||||||
int lengthReceived)
|
|
||||||
{
|
{
|
||||||
REQUIRE_UIT();
|
REQUIRE_UIT();
|
||||||
if(!context_)
|
if(!context_)
|
||||||
|
@ -304,12 +304,13 @@ void WebWidgetHost::Paint() {
|
|||||||
// Scroll the canvas if necessary
|
// Scroll the canvas if necessary
|
||||||
scroll_rect_ = client_rect.Intersect(scroll_rect_);
|
scroll_rect_ = client_rect.Intersect(scroll_rect_);
|
||||||
if (!scroll_rect_.IsEmpty()) {
|
if (!scroll_rect_.IsEmpty()) {
|
||||||
HDC hdc = canvas_->getTopPlatformDevice().getBitmapDC();
|
HDC hdc = canvas_->beginPlatformPaint();
|
||||||
|
|
||||||
RECT damaged_scroll_rect, r = scroll_rect_.ToRECT();
|
RECT damaged_scroll_rect, r = scroll_rect_.ToRECT();
|
||||||
ScrollDC(hdc, scroll_dx_, scroll_dy_, NULL, &r, NULL, &damaged_scroll_rect);
|
ScrollDC(hdc, scroll_dx_, scroll_dy_, NULL, &r, NULL, &damaged_scroll_rect);
|
||||||
|
|
||||||
PaintRect(gfx::Rect(damaged_scroll_rect));
|
PaintRect(gfx::Rect(damaged_scroll_rect));
|
||||||
|
canvas_->endPlatformPaint();
|
||||||
}
|
}
|
||||||
ResetScrollRect();
|
ResetScrollRect();
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Index: message_loop.cc
|
Index: message_loop.cc
|
||||||
===================================================================
|
===================================================================
|
||||||
--- message_loop.cc (revision 80310)
|
--- message_loop.cc (revision 85124)
|
||||||
+++ message_loop.cc (working copy)
|
+++ message_loop.cc (working copy)
|
||||||
@@ -295,9 +295,13 @@
|
@@ -387,9 +387,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageLoop::AssertIdle() const {
|
void MessageLoop::AssertIdle() const {
|
||||||
@ -19,9 +19,9 @@ Index: message_loop.cc
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Index: message_loop.h
|
Index: message_loop.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- message_loop.h (revision 80310)
|
--- message_loop.h (revision 85124)
|
||||||
+++ message_loop.h (working copy)
|
+++ message_loop.h (working copy)
|
||||||
@@ -320,6 +320,9 @@
|
@@ -351,6 +351,9 @@
|
||||||
// Asserts that the MessageLoop is "idle".
|
// Asserts that the MessageLoop is "idle".
|
||||||
void AssertIdle() const;
|
void AssertIdle() const;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Index: common.gypi
|
Index: common.gypi
|
||||||
===================================================================
|
===================================================================
|
||||||
--- common.gypi (revision 70742)
|
--- common.gypi (revision 85124)
|
||||||
+++ common.gypi (working copy)
|
+++ common.gypi (working copy)
|
||||||
@@ -9,6 +9,9 @@
|
@@ -9,6 +9,9 @@
|
||||||
# Variables expected to be overriden on the GYP command line (-D) or by
|
# Variables expected to be overriden on the GYP command line (-D) or by
|
||||||
@ -14,7 +14,7 @@ Index: common.gypi
|
|||||||
# variables within the outer variables dict here. This is necessary
|
# variables within the outer variables dict here. This is necessary
|
||||||
Index: win/system.gyp
|
Index: win/system.gyp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- win/system.gyp (revision 70742)
|
--- win/system.gyp (revision 85124)
|
||||||
+++ win/system.gyp (working copy)
|
+++ win/system.gyp (working copy)
|
||||||
@@ -22,6 +22,13 @@
|
@@ -22,6 +22,13 @@
|
||||||
'action': ['', '<@(_inputs)'],
|
'action': ['', '<@(_inputs)'],
|
||||||
|
@ -10,9 +10,10 @@
|
|||||||
// Initialized in NP_Initialize.
|
// Initialized in NP_Initialize.
|
||||||
NPNetscapeFuncs* g_browser = NULL;
|
NPNetscapeFuncs* g_browser = NULL;
|
||||||
|
|
||||||
static
|
namespace {
|
||||||
NPError NPP_New(NPMIMEType plugin_type, NPP instance, uint16 mode, int16 argc,
|
|
||||||
char* argn[], char* argv[], NPSavedData* saved) {
|
NPError NPP_ClientNew(NPMIMEType plugin_type, NPP instance, uint16_t mode,
|
||||||
|
int16_t argc, char* argn[], char* argv[], NPSavedData* saved) {
|
||||||
if (instance == NULL)
|
if (instance == NULL)
|
||||||
return NPERR_INVALID_INSTANCE_ERROR;
|
return NPERR_INVALID_INSTANCE_ERROR;
|
||||||
|
|
||||||
@ -23,8 +24,7 @@ NPError NPP_New(NPMIMEType plugin_type, NPP instance, uint16 mode, int16 argc,
|
|||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
NPError NPP_ClientDestroy(NPP instance, NPSavedData** save) {
|
||||||
NPError NPP_Destroy(NPP instance, NPSavedData** save) {
|
|
||||||
ClientPlugin* plugin_impl = reinterpret_cast<ClientPlugin*>(instance->pdata);
|
ClientPlugin* plugin_impl = reinterpret_cast<ClientPlugin*>(instance->pdata);
|
||||||
|
|
||||||
if (plugin_impl) {
|
if (plugin_impl) {
|
||||||
@ -35,8 +35,7 @@ NPError NPP_Destroy(NPP instance, NPSavedData** save) {
|
|||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
NPError NPP_ClientSetWindow(NPP instance, NPWindow* window_info) {
|
||||||
NPError NPP_SetWindow(NPP instance, NPWindow* window_info) {
|
|
||||||
if (instance == NULL)
|
if (instance == NULL)
|
||||||
return NPERR_INVALID_INSTANCE_ERROR;
|
return NPERR_INVALID_INSTANCE_ERROR;
|
||||||
|
|
||||||
@ -57,21 +56,23 @@ NPError NPP_SetWindow(NPP instance, NPWindow* window_info) {
|
|||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* pFuncs)
|
} // anonymous
|
||||||
|
|
||||||
|
NPError API_CALL NP_ClientGetEntryPoints(NPPluginFuncs* pFuncs)
|
||||||
{
|
{
|
||||||
pFuncs->newp = NPP_New;
|
pFuncs->newp = NPP_ClientNew;
|
||||||
pFuncs->destroy = NPP_Destroy;
|
pFuncs->destroy = NPP_ClientDestroy;
|
||||||
pFuncs->setwindow = NPP_SetWindow;
|
pFuncs->setwindow = NPP_ClientSetWindow;
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
NPError API_CALL NP_Initialize(NPNetscapeFuncs* pFuncs)
|
NPError API_CALL NP_ClientInitialize(NPNetscapeFuncs* pFuncs)
|
||||||
{
|
{
|
||||||
g_browser = pFuncs;
|
g_browser = pFuncs;
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
NPError API_CALL NP_Shutdown(void)
|
NPError API_CALL NP_ClientShutdown(void)
|
||||||
{
|
{
|
||||||
g_browser = NULL;
|
g_browser = NULL;
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
extern NPNetscapeFuncs* g_browser;
|
extern NPNetscapeFuncs* g_browser;
|
||||||
|
|
||||||
NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
|
NPError API_CALL NP_ClientGetEntryPoints(NPPluginFuncs* pFuncs);
|
||||||
NPError API_CALL NP_Initialize(NPNetscapeFuncs* pFuncs);
|
NPError API_CALL NP_ClientInitialize(NPNetscapeFuncs* pFuncs);
|
||||||
NPError API_CALL NP_Shutdown(void);
|
NPError API_CALL NP_ClientShutdown(void);
|
||||||
|
|
||||||
|
|
||||||
// Provides the client plugin functionality.
|
// Provides the client plugin functionality.
|
||||||
|
@ -14,9 +14,9 @@ void InitPluginTest()
|
|||||||
CefString(&plugin_info.description).FromASCII("My Example Client Plugin");
|
CefString(&plugin_info.description).FromASCII("My Example Client Plugin");
|
||||||
CefString(&plugin_info.mime_type).FromASCII("application/x-client-plugin");
|
CefString(&plugin_info.mime_type).FromASCII("application/x-client-plugin");
|
||||||
|
|
||||||
plugin_info.np_getentrypoints = NP_GetEntryPoints;
|
plugin_info.np_getentrypoints = NP_ClientGetEntryPoints;
|
||||||
plugin_info.np_initialize = NP_Initialize;
|
plugin_info.np_initialize = NP_ClientInitialize;
|
||||||
plugin_info.np_shutdown = NP_Shutdown;
|
plugin_info.np_shutdown = NP_ClientShutdown;
|
||||||
|
|
||||||
// Register the internal client plugin
|
// Register the internal client plugin
|
||||||
CefRegisterPlugin(plugin_info);
|
CefRegisterPlugin(plugin_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user