Update to Chromium revision 91424.

- Add tools/gyp_cef to satisfy grit_info.py module load requirement.
- Add skia_gpu.patch to work around skia/Angle/WebGL bug.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@263 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-07-03 00:03:30 +00:00
parent 64d64738b9
commit da210afca7
34 changed files with 451 additions and 184 deletions

View File

@ -65,3 +65,4 @@ Date | CEF Revision | Chromium Revision
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 2011-05-16 | /trunk@233 | /trunk@85305
2011-07-02 | /trunk@263 | /trunk@91424

View File

@ -408,7 +408,7 @@ void BrowserAppCacheSystem::InitOnIOThread(
db_thread_.Start(); db_thread_.Start();
// Recreate and initialize per each IO thread. // Recreate and initialize per each IO thread.
service_ = new appcache::AppCacheService(); service_ = new appcache::AppCacheService(NULL);
backend_impl_ = new appcache::AppCacheBackendImpl(); backend_impl_ = new appcache::AppCacheBackendImpl();
service_->Initialize(cache_directory_, service_->Initialize(cache_directory_,
BrowserResourceLoaderBridge::GetCacheThread()); BrowserResourceLoaderBridge::GetCacheThread());

View File

@ -19,6 +19,7 @@
using webkit_database::DatabaseTracker; using webkit_database::DatabaseTracker;
using webkit_database::DatabaseUtil; using webkit_database::DatabaseUtil;
using webkit_database::OriginInfo;
using webkit_database::VfsBackend; using webkit_database::VfsBackend;
BrowserDatabaseSystem* BrowserDatabaseSystem::instance_ = NULL; BrowserDatabaseSystem* BrowserDatabaseSystem::instance_ = NULL;
@ -30,6 +31,7 @@ BrowserDatabaseSystem* BrowserDatabaseSystem::GetInstance() {
BrowserDatabaseSystem::BrowserDatabaseSystem() BrowserDatabaseSystem::BrowserDatabaseSystem()
: db_thread_("BrowserDBThread"), : db_thread_("BrowserDBThread"),
quota_per_origin_(5 * 1024 * 1024),
open_connections_(new webkit_database::DatabaseConnectionsWrapper) { open_connections_(new webkit_database::DatabaseConnectionsWrapper) {
DCHECK(!instance_); DCHECK(!instance_);
instance_ = this; instance_ = this;
@ -120,6 +122,17 @@ int64 BrowserDatabaseSystem::GetFileSize(const string16& vfs_file_name) {
return result; return result;
} }
int64 BrowserDatabaseSystem::GetSpaceAvailable(
const string16& origin_identifier) {
int64 result = 0;
base::WaitableEvent done_event(false, false);
db_thread_proxy_->PostTask(FROM_HERE,
NewRunnableMethod(this, &BrowserDatabaseSystem::VfsGetSpaceAvailable,
origin_identifier, &result, &done_event));
done_event.Wait();
return result;
}
void BrowserDatabaseSystem::ClearAllDatabases() { void BrowserDatabaseSystem::ClearAllDatabases() {
open_connections_->WaitForAllDatabasesToClose(); open_connections_->WaitForAllDatabasesToClose();
db_thread_proxy_->PostTask(FROM_HERE, db_thread_proxy_->PostTask(FROM_HERE,
@ -133,7 +146,7 @@ void BrowserDatabaseSystem::SetDatabaseQuota(int64 quota) {
quota)); quota));
return; return;
} }
db_tracker_->SetDefaultQuota(quota); quota_per_origin_ = quota;
} }
void BrowserDatabaseSystem::DatabaseOpened(const string16& origin_identifier, void BrowserDatabaseSystem::DatabaseOpened(const string16& origin_identifier,
@ -142,12 +155,11 @@ void BrowserDatabaseSystem::DatabaseOpened(const string16& origin_identifier,
int64 estimated_size) { int64 estimated_size) {
DCHECK(db_thread_proxy_->BelongsToCurrentThread()); DCHECK(db_thread_proxy_->BelongsToCurrentThread());
int64 database_size = 0; int64 database_size = 0;
int64 space_available = 0;
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);
OnDatabaseSizeChanged(origin_identifier, database_name, OnDatabaseSizeChanged(origin_identifier, database_name,
database_size, space_available); database_size);
} }
void BrowserDatabaseSystem::DatabaseModified(const string16& origin_identifier, void BrowserDatabaseSystem::DatabaseModified(const string16& origin_identifier,
@ -166,14 +178,13 @@ void BrowserDatabaseSystem::DatabaseClosed(const string16& origin_identifier,
void BrowserDatabaseSystem::OnDatabaseSizeChanged( void BrowserDatabaseSystem::OnDatabaseSizeChanged(
const string16& origin_identifier, const string16& origin_identifier,
const string16& database_name, const string16& database_name,
int64 database_size, int64 database_size) {
int64 space_available) {
DCHECK(db_thread_proxy_->BelongsToCurrentThread()); DCHECK(db_thread_proxy_->BelongsToCurrentThread());
// We intentionally call into webkit on our background db_thread_ // We intentionally call into webkit on our background db_thread_
// to better emulate what happens in chrome where this method is // to better emulate what happens in chrome where this method is
// invoked on the background ipc thread. // 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);
} }
void BrowserDatabaseSystem::OnDatabaseScheduledForDeletion( void BrowserDatabaseSystem::OnDatabaseScheduledForDeletion(
@ -238,6 +249,23 @@ void BrowserDatabaseSystem::VfsGetFileSize(
done_event->Signal(); done_event->Signal();
} }
void BrowserDatabaseSystem::VfsGetSpaceAvailable(
const string16& origin_identifier,
int64* result, base::WaitableEvent* done_event) {
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
// This method isn't actually part of the "vfs" interface, but it is
// used from within webcore and handled here in the same fashion.
OriginInfo info;
if (db_tracker_->GetOriginInfo(origin_identifier, &info)) {
int64 space_available = quota_per_origin_ - info.TotalSize();
*result = space_available < 0 ? 0 : space_available;
} else {
NOTREACHED();
*result = 0;
}
done_event->Signal();
}
FilePath BrowserDatabaseSystem::GetFullFilePathForVfsFile( FilePath BrowserDatabaseSystem::GetFullFilePathForVfsFile(
const string16& vfs_file_name) { const string16& vfs_file_name) {
DCHECK(db_thread_proxy_->BelongsToCurrentThread()); DCHECK(db_thread_proxy_->BelongsToCurrentThread());

View File

@ -8,8 +8,8 @@
#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/ref_counted.h"
#include "base/memory/scoped_temp_dir.h"
#include "base/platform_file.h" #include "base/platform_file.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/task.h"
@ -29,7 +29,7 @@ class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
static BrowserDatabaseSystem* GetInstance(); static BrowserDatabaseSystem* GetInstance();
BrowserDatabaseSystem(); BrowserDatabaseSystem();
~BrowserDatabaseSystem(); virtual ~BrowserDatabaseSystem();
// WebDatabaseObserver implementation, these are called on the script // WebDatabaseObserver implementation, these are called on the script
// execution context thread on which the database is opened. This may be // execution context thread on which the database is opened. This may be
@ -44,6 +44,7 @@ class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
int DeleteFile(const string16& vfs_file_name, bool sync_dir); int DeleteFile(const string16& vfs_file_name, bool sync_dir);
uint32 GetFileAttributes(const string16& vfs_file_name); uint32 GetFileAttributes(const string16& vfs_file_name);
int64 GetFileSize(const string16& vfs_file_name); int64 GetFileSize(const string16& vfs_file_name);
int64 GetSpaceAvailable(const string16& origin_identifier);
// For use by LayoutTestController, called on the main thread. // For use by LayoutTestController, called on the main thread.
void ClearAllDatabases(); void ClearAllDatabases();
@ -63,8 +64,7 @@ class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
// DatabaseTracker::Observer implementation // DatabaseTracker::Observer implementation
virtual void OnDatabaseSizeChanged(const string16& origin_identifier, virtual void OnDatabaseSizeChanged(const string16& origin_identifier,
const string16& database_name, const string16& database_name,
int64 database_size, int64 database_size);
int64 space_available);
virtual void OnDatabaseScheduledForDeletion(const string16& origin_identifier, virtual void OnDatabaseScheduledForDeletion(const string16& origin_identifier,
const string16& database_name); const string16& database_name);
@ -77,6 +77,8 @@ class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
uint32* result, base::WaitableEvent* done_event); uint32* result, base::WaitableEvent* done_event);
void VfsGetFileSize(const string16& vfs_file_name, void VfsGetFileSize(const string16& vfs_file_name,
int64* result, base::WaitableEvent* done_event); int64* result, base::WaitableEvent* done_event);
void VfsGetSpaceAvailable(const string16& origin_identifier,
int64* result, base::WaitableEvent* done_event);
FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name); FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name);
@ -91,6 +93,7 @@ class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
base::Thread db_thread_; base::Thread db_thread_;
scoped_refptr<base::MessageLoopProxy> db_thread_proxy_; scoped_refptr<base::MessageLoopProxy> db_thread_proxy_;
scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; scoped_refptr<webkit_database::DatabaseTracker> db_tracker_;
int64 quota_per_origin_;
// Data members to support waiting for all connections to be closed. // Data members to support waiting for all connections to be closed.
scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_; scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_;

View File

@ -137,14 +137,6 @@ void BrowserDevToolsAgent::frontendLoaded() {
0); 0);
} }
bool BrowserDevToolsAgent::setTimelineProfilingEnabled(bool enabled) {
WebDevToolsAgent* agent = GetWebAgent();
if (!agent)
return false;
agent->setTimelineProfilingEnabled(enabled);
return true;
}
bool BrowserDevToolsAgent::evaluateInWebInspector( bool BrowserDevToolsAgent::evaluateInWebInspector(
long call_id, long call_id,
const std::string& script) { const std::string& script) {

View File

@ -45,7 +45,6 @@ class BrowserDevToolsAgent : public WebKit::WebDevToolsAgentClient {
void frontendLoaded(); void frontendLoaded();
bool evaluateInWebInspector(long call_id, const std::string& script); bool evaluateInWebInspector(long call_id, const std::string& script);
bool setTimelineProfilingEnabled(bool enable);
BrowserDevToolsClient* client() { return dev_tools_client_; } BrowserDevToolsClient* client() { return dev_tools_client_; }

View File

@ -28,6 +28,7 @@
#include "net/base/file_stream.h" #include "net/base/file_stream.h"
#include "net/base/mime_util.h" #include "net/base/mime_util.h"
#include "net/base/net_util.h" #include "net/base/net_util.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "views/drag_utils.h" #include "views/drag_utils.h"
@ -259,6 +260,7 @@ void GenerateFileName(const GURL& url,
string16 new_name = net::GetSuggestedFilename(GURL(url), string16 new_name = net::GetSuggestedFilename(GURL(url),
content_disposition, content_disposition,
referrer_charset, referrer_charset,
"",
string16(L"download")); string16(L"download"));
// TODO(evan): this code is totally wrong -- we should just generate // TODO(evan): this code is totally wrong -- we should just generate
@ -332,8 +334,9 @@ void BrowserDragDelegate::StartDragging(const WebDropData& drop_data,
drag_source_ = new WebDragSource(browser->UIT_GetWebViewWndHandle(), drag_source_ = new WebDragSource(browser->UIT_GetWebViewWndHandle(),
web_view); web_view);
const GURL& page_url = web_view->mainFrame()->url(); const GURL& page_url = web_view->mainFrame()->document().url();
const std::string& page_encoding = web_view->mainFrame()->encoding().utf8(); const std::string& page_encoding =
web_view->mainFrame()->document().encoding().utf8();
// If it is not drag-out, do the drag-and-drop in the current UI thread. // If it is not drag-out, do the drag-and-drop in the current UI thread.
if (drop_data.download_metadata.empty()) { if (drop_data.download_metadata.empty()) {
@ -446,7 +449,7 @@ void BrowserDragDelegate::PrepareDragForFileContents(
if (file_name.value().empty()) { if (file_name.value().empty()) {
// Retrieve the name from the URL. // Retrieve the name from the URL.
file_name = FilePath( file_name = FilePath(
net::GetSuggestedFilename(drop_data.url, "", "", string16())); net::GetSuggestedFilename(drop_data.url, "", "", "", string16()));
if (file_name.value().size() + drop_data.file_extension.size() + 1 > if (file_name.value().size() + drop_data.file_extension.size() + 1 >
MAX_PATH) { MAX_PATH) {
file_name = FilePath(file_name.value().substr( file_name = FilePath(file_name.value().substr(

View File

@ -12,11 +12,13 @@
#include "base/time.h" #include "base/time.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemEntry.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemEntry.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/WebSecurityOrigin.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
#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"
@ -37,6 +39,7 @@ using WebKit::WebFileWriterClient;
using WebKit::WebFrame; using WebKit::WebFrame;
using WebKit::WebSecurityOrigin; using WebKit::WebSecurityOrigin;
using WebKit::WebString; using WebKit::WebString;
using WebKit::WebURL;
using WebKit::WebVector; using WebKit::WebVector;
using fileapi::FileSystemCallbackDispatcher; using fileapi::FileSystemCallbackDispatcher;
@ -64,11 +67,6 @@ 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_);
@ -105,8 +103,13 @@ class BrowserFileSystemCallbackDispatcher
if (!root.is_valid()) if (!root.is_valid())
callbacks_->didFail(WebKit::WebFileErrorSecurity); callbacks_->didFail(WebKit::WebFileErrorSecurity);
else else
// Temporary hack to ease a 4-phase Chromium/WebKit commit.
#ifdef WEBFILESYSTEMCALLBACKS_USE_URL_NOT_STRING
callbacks_->didOpenFileSystem(WebString::fromUTF8(name), root);
#else
callbacks_->didOpenFileSystem( callbacks_->didOpenFileSystem(
WebString::fromUTF8(name), WebString::fromUTF8(root.spec())); WebString::fromUTF8(name), WebString::fromUTF8(root.spec()));
#endif
} }
virtual void DidFail(base::PlatformFileError error_code) { virtual void DidFail(base::PlatformFileError error_code) {
@ -170,65 +173,124 @@ void BrowserFileSystem::OpenFileSystem(
return; return;
} }
GURL origin_url(frame->securityOrigin().toString()); GURL origin_url(frame->document().securityOrigin().toString());
GetNewOperation(callbacks)->OpenFileSystem(origin_url, type, create); GetNewOperation(callbacks)->OpenFileSystem(origin_url, type, create);
} }
void BrowserFileSystem::move(const WebString& src_path,
const WebString& dest_path,
WebFileSystemCallbacks* callbacks) {
move(GURL(src_path), GURL(dest_path), callbacks);
}
void BrowserFileSystem::copy(const WebString& src_path,
const WebString& dest_path,
WebFileSystemCallbacks* callbacks) {
copy(GURL(src_path), GURL(dest_path), callbacks);
}
void BrowserFileSystem::remove(const WebString& path,
WebFileSystemCallbacks* callbacks) {
remove(GURL(path), callbacks);
}
void BrowserFileSystem::removeRecursively(const WebString& path,
WebFileSystemCallbacks* callbacks) {
removeRecursively(GURL(path), callbacks);
}
void BrowserFileSystem::readMetadata(const WebString& path,
WebFileSystemCallbacks* callbacks) {
readMetadata(GURL(path), callbacks);
}
void BrowserFileSystem::createFile(const WebString& path,
bool exclusive,
WebFileSystemCallbacks* callbacks) {
createFile(GURL(path), exclusive, callbacks);
}
void BrowserFileSystem::createDirectory(const WebString& path,
bool exclusive,
WebFileSystemCallbacks* callbacks) {
createDirectory(GURL(path), exclusive, callbacks);
}
void BrowserFileSystem::fileExists(const WebString& path,
WebFileSystemCallbacks* callbacks) {
fileExists(GURL(path), callbacks);
}
void BrowserFileSystem::directoryExists(const WebString& path,
WebFileSystemCallbacks* callbacks) {
directoryExists(GURL(path), callbacks);
}
void BrowserFileSystem::readDirectory(const WebString& path,
WebFileSystemCallbacks* callbacks) {
readDirectory(GURL(path), callbacks);
}
WebKit::WebFileWriter* BrowserFileSystem::createFileWriter(
const WebString& path, WebKit::WebFileWriterClient* client) {
return createFileWriter(GURL(path), client);
}
void BrowserFileSystem::move( void BrowserFileSystem::move(
const WebString& src_path, const WebURL& src_path,
const WebString& dest_path, WebFileSystemCallbacks* callbacks) { const WebURL& dest_path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path)); GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path));
} }
void BrowserFileSystem::copy( void BrowserFileSystem::copy(
const WebString& src_path, const WebString& dest_path, const WebURL& src_path, const WebURL& dest_path,
WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->Copy(GURL(src_path), GURL(dest_path)); GetNewOperation(callbacks)->Copy(GURL(src_path), GURL(dest_path));
} }
void BrowserFileSystem::remove( void BrowserFileSystem::remove(
const WebString& path, WebFileSystemCallbacks* callbacks) { const WebURL& path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->Remove(GURL(path), false /* recursive */); GetNewOperation(callbacks)->Remove(path, false /* recursive */);
} }
void BrowserFileSystem::removeRecursively( void BrowserFileSystem::removeRecursively(
const WebString& path, WebFileSystemCallbacks* callbacks) { const WebURL& path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->Remove(GURL(path), true /* recursive */); GetNewOperation(callbacks)->Remove(path, true /* recursive */);
} }
void BrowserFileSystem::readMetadata( void BrowserFileSystem::readMetadata(
const WebString& path, WebFileSystemCallbacks* callbacks) { const WebURL& path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->GetMetadata(GURL(path)); GetNewOperation(callbacks)->GetMetadata(path);
} }
void BrowserFileSystem::createFile( void BrowserFileSystem::createFile(
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) { const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->CreateFile(GURL(path), exclusive); GetNewOperation(callbacks)->CreateFile(path, exclusive);
} }
void BrowserFileSystem::createDirectory( void BrowserFileSystem::createDirectory(
const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) { const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->CreateDirectory(GURL(path), exclusive, false); GetNewOperation(callbacks)->CreateDirectory(path, exclusive, false);
} }
void BrowserFileSystem::fileExists( void BrowserFileSystem::fileExists(
const WebString& path, WebFileSystemCallbacks* callbacks) { const WebURL& path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->FileExists(GURL(path)); GetNewOperation(callbacks)->FileExists(path);
} }
void BrowserFileSystem::directoryExists( void BrowserFileSystem::directoryExists(
const WebString& path, WebFileSystemCallbacks* callbacks) { const WebURL& path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->DirectoryExists(GURL(path)); GetNewOperation(callbacks)->DirectoryExists(path);
} }
void BrowserFileSystem::readDirectory( void BrowserFileSystem::readDirectory(
const WebString& path, WebFileSystemCallbacks* callbacks) { const WebURL& path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->ReadDirectory(GURL(path)); GetNewOperation(callbacks)->ReadDirectory(path);
} }
WebFileWriter* BrowserFileSystem::createFileWriter( WebFileWriter* BrowserFileSystem::createFileWriter(
const WebString& path, WebFileWriterClient* client) { const WebURL& path, WebFileWriterClient* client) {
return new BrowserFileWriter(GURL(path), client, file_system_context_.get()); return new BrowserFileWriter(path, client, file_system_context_.get());
} }
FileSystemOperation* BrowserFileSystem::GetNewOperation( FileSystemOperation* BrowserFileSystem::GetNewOperation(

View File

@ -5,17 +5,18 @@
#ifndef BROWSER_FILE_SYSTEM_H_ #ifndef BROWSER_FILE_SYSTEM_H_
#define BROWSER_FILE_SYSTEM_H_ #define BROWSER_FILE_SYSTEM_H_
#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/memory/scoped_temp_dir.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/scoped_temp_dir.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"
#include <vector>
namespace WebKit { namespace WebKit {
class WebFileSystemCallbacks; class WebFileSystemCallbacks;
class WebFrame; class WebFrame;
class WebURL;
} }
namespace fileapi { namespace fileapi {
@ -40,7 +41,55 @@ class BrowserFileSystem
return file_system_context_.get(); return file_system_context_.get();
} }
// WebKit::WebFileSystem methods. // New WebKit::WebFileSystem overrides.
virtual void move(
const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path,
WebKit::WebFileSystemCallbacks*);
virtual void copy(
const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path,
WebKit::WebFileSystemCallbacks*);
virtual void remove(
const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*);
virtual void removeRecursively(
const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*);
virtual void readMetadata(
const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*);
virtual void createFile(
const WebKit::WebURL& path,
bool exclusive,
WebKit::WebFileSystemCallbacks*);
virtual void createDirectory(
const WebKit::WebURL& path,
bool exclusive,
WebKit::WebFileSystemCallbacks*);
virtual void fileExists(
const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*);
virtual void directoryExists(
const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*);
virtual void readDirectory(
const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*);
virtual WebKit::WebFileWriter* createFileWriter(
const WebKit::WebURL& path, WebKit::WebFileWriterClient*);
// Old WebKit::WebFileSystem overrides, soon to go away.
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,
WebKit::WebFileSystemCallbacks* callbacks); WebKit::WebFileSystemCallbacks* callbacks);

View File

@ -94,10 +94,6 @@ 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);
} }

View File

@ -586,7 +586,7 @@ CefString CefBrowserImpl::GetURL(CefRefPtr<CefFrame> frame)
WebFrame* web_frame = UIT_GetWebFrame(frame); WebFrame* web_frame = UIT_GetWebFrame(frame);
if(web_frame) if(web_frame)
return std::string(web_frame->url().spec()); return std::string(web_frame->document().url().spec());
return CefString(); return CefString();
} }
@ -1411,7 +1411,7 @@ void CefBrowserImpl::UIT_SetZoomLevel(double zoomLevel)
WebKit::WebFrame* web_frame = UIT_GetMainWebFrame(); WebKit::WebFrame* web_frame = UIT_GetMainWebFrame();
if(web_frame) { if(web_frame) {
web_frame->view()->setZoomLevel(false, zoomLevel); web_frame->view()->setZoomLevel(false, zoomLevel);
ZoomMap::GetInstance()->set(web_frame->url(), zoomLevel); ZoomMap::GetInstance()->set(web_frame->document().url(), zoomLevel);
set_zoom_level(zoomLevel); set_zoom_level(zoomLevel);
} }
} }

View File

@ -19,7 +19,7 @@
#include "printing/win_printing_context.h" #include "printing/win_printing_context.h"
#endif #endif
#include "base/memory/scoped_temp_dir.h" #include "base/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 {

View File

@ -10,6 +10,7 @@
#include "skia/ext/vector_canvas.h" #include "skia/ext/vector_canvas.h"
#include "skia/ext/vector_platform_device_emf_win.h" #include "skia/ext/vector_platform_device_emf_win.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/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"
@ -350,7 +351,7 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages,
printInfo.m_Rect = rect; printInfo.m_Rect = rect;
printInfo.m_Scale = scale; printInfo.m_Scale = scale;
CefString url(frame->url().spec()); CefString url(frame->document().url().spec());
CefString title = title_; CefString title = title_;
CefString topLeft, topCenter, topRight; CefString topLeft, topCenter, topRight;

View File

@ -7,11 +7,12 @@
#include "browser_file_system.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 "cef_thread.h"
#include "base/compiler_specific.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 "build/build_config.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"
@ -21,10 +22,13 @@
#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 "net/url_request/url_request_job_factory.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.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/blob/blob_url_request_job_factory.h"
#include "webkit/fileapi/file_system_context.h" #include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_url_request_job_factory.h"
#include "webkit/glue/webkit_glue.h" #include "webkit/glue/webkit_glue.h"
#if defined(OS_WIN) #if defined(OS_WIN)
@ -126,6 +130,7 @@ void BrowserRequestContext::Init(
storage_.set_host_resolver( storage_.set_host_resolver(
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
net::HostResolver::kDefaultRetryAttempts,
NULL)); NULL));
storage_.set_cert_verifier(new net::CertVerifier); storage_.set_cert_verifier(new net::CertVerifier);
storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults);
@ -165,6 +170,19 @@ void BrowserRequestContext::Init(
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*>(
WebKit::webKitClient()->fileSystem())->file_system_context(); WebKit::webKitClient()->fileSystem())->file_system_context();
net::URLRequestJobFactory* job_factory = new net::URLRequestJobFactory;
job_factory->SetProtocolHandler(
"blob",
new webkit_blob::BlobProtocolHandler(
blob_storage_controller_.get(),
CefThread::GetMessageLoopProxyForThread(CefThread::FILE)));
job_factory->SetProtocolHandler(
"filesystem",
fileapi::CreateFileSystemProtocolHandler(
file_system_context_.get(),
CefThread::GetMessageLoopProxyForThread(CefThread::FILE)));
storage_.set_job_factory(job_factory);
} }
BrowserRequestContext::~BrowserRequestContext() { BrowserRequestContext::~BrowserRequestContext() {

View File

@ -26,7 +26,7 @@ class BrowserRequestContext : public net::URLRequestContext {
public: public:
// Use an in-memory cache // Use an in-memory cache
BrowserRequestContext(); BrowserRequestContext();
~BrowserRequestContext(); virtual ~BrowserRequestContext();
// Use an on-disk cache at the specified location. Optionally, use the cache // Use an on-disk cache at the specified location. Optionally, use the cache
// in playback or record mode. // in playback or record mode.

View File

@ -227,7 +227,7 @@ class RequestProxy : public net::URLRequest::Delegate,
if (allow_download && if (allow_download &&
webkit_glue::ShouldDownload(content_disposition, info.mime_type)) { webkit_glue::ShouldDownload(content_disposition, info.mime_type)) {
string16 filename = net::GetSuggestedFilename(url, string16 filename = net::GetSuggestedFilename(url,
content_disposition, info.charset, ASCIIToUTF16("download")); content_disposition, info.charset, "", ASCIIToUTF16("download"));
CefRefPtr<CefDownloadHandler> dl_handler; CefRefPtr<CefDownloadHandler> dl_handler;
if (handler->GetDownloadHandler(browser_, info.mime_type, if (handler->GetDownloadHandler(browser_, info.mime_type,
filename, info.content_length, filename, info.content_length,
@ -714,7 +714,7 @@ class RequestProxy : public net::URLRequest::Delegate,
StaticCookiePolicy policy(policy_type); StaticCookiePolicy policy(policy_type);
int rv = policy.CanSetCookie( int rv = policy.CanSetCookie(
request->url(), request->first_party_for_cookies(), cookie_line); request->url(), request->first_party_for_cookies());
return rv == net::OK; return rv == net::OK;
} }

View File

@ -31,6 +31,7 @@ MSVC_POP_WARNING();
#include "net/base/mime_util.h" #include "net/base/mime_util.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "webkit/glue/user_agent.h"
#include "webkit/glue/webkit_glue.h" #include "webkit/glue/webkit_glue.h"
#include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/plugin_list.h"
@ -45,31 +46,11 @@ bool IsMediaPlayerAvailable() {
return true; return true;
} }
bool GetApplicationDirectory(FilePath* path) {
return PathService::Get(base::DIR_EXE, path);
}
bool GetExeDirectory(FilePath* path) {
return PathService::Get(base::DIR_EXE, path);
}
bool IsPluginRunningInRendererProcess() {
return true;
}
bool GetPluginFinderURL(std::string* plugin_finder_url) {
return false;
}
void GetPlugins(bool refresh, void GetPlugins(bool refresh,
std::vector<webkit::npapi::WebPluginInfo>* plugins) { std::vector<webkit::npapi::WebPluginInfo>* plugins) {
webkit::npapi::PluginList::Singleton()->GetPlugins(refresh, plugins); webkit::npapi::PluginList::Singleton()->GetPlugins(refresh, plugins);
} }
bool IsDefaultPluginEnabled() {
return false;
}
bool IsProtocolSupportedForMedia(const GURL& url) { bool IsProtocolSupportedForMedia(const GURL& url) {
if (url.SchemeIsFile() || url.SchemeIs("http") || url.SchemeIs("https")) if (url.SchemeIsFile() || url.SchemeIs("http") || url.SchemeIs("https"))
return true; return true;
@ -115,14 +96,19 @@ void ClearCache()
WebCore::CrossOriginPreflightResultCache::shared().empty(); WebCore::CrossOriginPreflightResultCache::shared().empty();
} }
std::string GetProductVersion() { std::string BuildUserAgent(bool mimic_windows) {
std::string product_version;
const CefSettings& settings = _Context->settings(); const CefSettings& settings = _Context->settings();
if (settings.product_version.length > 0) { if (settings.product_version.length > 0) {
return CefString(&settings.product_version); product_version = CefString(&settings.product_version).ToString();
} } else {
// Keep synchronized with the newest Beta Channel release announced at // Keep synchronized with the newest Beta Channel release announced at
// http://googlechromereleases.blogspot.com/ // http://googlechromereleases.blogspot.com/
return "Chrome/12.0.742.53"; product_version = "Chrome/13.0.782.41";
}
return webkit_glue::BuildUserAgentHelper(mimic_windows, product_version);
} }
bool IsSingleProcess() { bool IsSingleProcess() {

View File

@ -45,10 +45,6 @@ string16 GetLocalizedString(int message_id) {
return string16(image->achString, image->nLength); return string16(image->achString, image->nLength);
} }
HCURSOR LoadCursor(int cursor_id) {
return NULL;
}
base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { base::StringPiece GetRawDataResource(HMODULE module, int resource_id) {
void* data_ptr; void* data_ptr;
size_t data_size; size_t data_size;

View File

@ -15,9 +15,9 @@
#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"
@ -91,7 +91,7 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
file_utilities_.set_sandbox_enabled(false); file_utilities_.set_sandbox_enabled(false);
} }
~BrowserWebKitInit() { virtual ~BrowserWebKitInit() {
WebKit::shutdown(); WebKit::shutdown();
} }
@ -150,6 +150,12 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
return BrowserDatabaseSystem::GetInstance()->GetFileSize(vfs_file_name); return BrowserDatabaseSystem::GetInstance()->GetFileSize(vfs_file_name);
} }
virtual long long databaseGetSpaceAvailableForOrigin(
const WebKit::WebString& origin_identifier) {
return BrowserDatabaseSystem::GetInstance()->GetSpaceAvailable(
origin_identifier);
}
virtual unsigned long long visitedLinkHash(const char* canonicalURL, virtual unsigned long long visitedLinkHash(const char* canonicalURL,
size_t length) OVERRIDE { size_t length) OVERRIDE {
return 0; return 0;

View File

@ -40,8 +40,7 @@ WebString BrowserWebStorageAreaImpl::getItem(const WebString& key) {
void BrowserWebStorageAreaImpl::setItem( void BrowserWebStorageAreaImpl::setItem(
const WebString& key, const WebString& value, const WebURL& url, const WebString& key, const WebString& value, const WebURL& url,
WebStorageArea::Result& result, WebString& old_value_webkit, WebStorageArea::Result& result, WebString& old_value_webkit) {
WebFrame* web_frame) {
old_value_webkit = area_->SetItem(key, value, &result); old_value_webkit = area_->SetItem(key, value, &result);
} }

View File

@ -23,7 +23,7 @@ class BrowserWebStorageAreaImpl : public WebKit::WebStorageArea {
virtual void setItem( virtual void setItem(
const WebKit::WebString& key, const WebKit::WebString& value, const WebKit::WebString& key, const WebKit::WebString& value,
const WebKit::WebURL& url, WebStorageArea::Result& result, const WebKit::WebURL& url, WebStorageArea::Result& result,
WebKit::WebString& old_value, WebKit::WebFrame* web_view); WebKit::WebString& old_value);
virtual void removeItem( virtual void removeItem(
const WebKit::WebString& key, const WebKit::WebURL& url, const WebKit::WebString& key, const WebKit::WebURL& url,
WebKit::WebString& old_value); WebKit::WebString& old_value);

View File

@ -33,6 +33,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.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/WebDataSource.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h"
@ -849,7 +850,7 @@ void BrowserWebViewDelegate::didCommitProvisionalLoad(
if (is_main_frame) { if (is_main_frame) {
// Restore the zoom value that we have for this URL, if any. // Restore the zoom value that we have for this URL, if any.
double zoomLevel = 0.0; double zoomLevel = 0.0;
ZoomMap::GetInstance()->get(frame->url(), zoomLevel); ZoomMap::GetInstance()->get(frame->document().url(), zoomLevel);
frame->view()->setZoomLevel(false, zoomLevel); frame->view()->setZoomLevel(false, zoomLevel);
browser_->set_zoom_level(zoomLevel); browser_->set_zoom_level(zoomLevel);
} }

View File

@ -206,7 +206,7 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient,
virtual WebKit::WebCookieJar* GetCookieJar() OVERRIDE; virtual WebKit::WebCookieJar* GetCookieJar() OVERRIDE;
BrowserWebViewDelegate(CefBrowserImpl* browser); BrowserWebViewDelegate(CefBrowserImpl* browser);
~BrowserWebViewDelegate(); virtual ~BrowserWebViewDelegate();
void Reset(); void Reset();
void SetSmartInsertDeleteEnabled(bool enabled); void SetSmartInsertDeleteEnabled(bool enabled);

View File

@ -15,15 +15,9 @@
#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"
#include "net/url_request/url_request.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifier.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifier.h"
#include "ui/gfx/gl/gl_implementation.h" #include "ui/gfx/gl/gl_implementation.h"
#include "webkit/blob/blob_storage_controller.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"
#if defined(OS_WIN) #if defined(OS_WIN)
@ -35,48 +29,6 @@ static const char* kStatsFilePrefix = "libcef_";
static int kStatsFileThreads = 20; static int kStatsFileThreads = 20;
static int kStatsFileCounters = 200; static int kStatsFileCounters = 200;
namespace {
net::URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request,
const std::string& scheme) {
webkit_blob::BlobStorageController* blob_storage_controller =
static_cast<BrowserRequestContext*>(request->context())->
blob_storage_controller();
return new webkit_blob::BlobURLRequestJob(
request,
blob_storage_controller->GetBlobDataFromUrl(request->url()),
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,
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
}
return new fileapi::FileSystemURLRequestJob(
request,
fs_context,
CefThread::GetMessageLoopProxyForThread(CefThread::FILE));
}
} // namespace
CefProcessUIThread::CefProcessUIThread() CefProcessUIThread::CefProcessUIThread()
: CefThread(CefThread::UI), statstable_(NULL), webkit_init_(NULL) {} : CefThread(CefThread::UI), statstable_(NULL), webkit_init_(NULL) {}
@ -155,10 +107,6 @@ void CefProcessUIThread::Init() {
gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL); gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL);
#endif #endif
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.
_Context->set_storage_context(new DOMStorageContext()); _Context->set_storage_context(new DOMStorageContext());

View File

@ -350,7 +350,7 @@ bool PrintingContext::InitializeSettings(const DEVMODE& dev_mode,
int number_ranges, int number_ranges,
bool selection_only, bool selection_only,
bool to_file) { bool to_file) {
skia::PlatformDevice::InitializeDC(hdc_); skia::InitializeDC(hdc_);
DCHECK(GetDeviceCaps(hdc_, CLIPCAPS)); DCHECK(GetDeviceCaps(hdc_, CLIPCAPS));
DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_STRETCHDIB); DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_STRETCHDIB);
DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_BITMAP64); DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_BITMAP64);

View File

@ -94,4 +94,8 @@ bool ClipboardReadFilenames(ui::Clipboard::Buffer buffer,
return false; return false;
} }
uint64 ClipboardGetSequenceNumber() {
return 0;
}
} // namespace webkit_glue } // namespace webkit_glue

View File

@ -369,7 +369,11 @@ void WebWidgetHost::Paint() {
} }
} }
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0);
#else
webwidget_->animate(); webwidget_->animate();
#endif
// This may result in more invalidation // This may result in more invalidation
webwidget_->layout(); webwidget_->layout();
@ -406,7 +410,8 @@ void WebWidgetHost::Paint() {
gdk_window_begin_paint_rect(window, &grect); gdk_window_begin_paint_rect(window, &grect);
// BitBlit to the gdk window. // BitBlit to the gdk window.
cairo_t* source_surface = canvas_->beginPlatformPaint(); skia::ScopedPlatformPaint scoped_platform_paint(canvas_.get());
cairo_t* source_surface = scoped_platform_paint.GetPlatformSurface();
cairo_t* cairo_drawable = gdk_cairo_create(window); cairo_t* cairo_drawable = gdk_cairo_create(window);
cairo_set_source_surface(cairo_drawable, cairo_get_target(source_surface), cairo_set_source_surface(cairo_drawable, cairo_get_target(source_surface),
0, 0); 0, 0);

View File

@ -164,12 +164,16 @@ void WebWidgetHost::Paint() {
// make sure webkit draws into our bitmap, not the window // make sure webkit draws into our bitmap, not the window
CGContextRef bitmap_context = CGContextRef bitmap_context =
canvas_->getTopPlatformDevice().GetBitmapContext(); skia::GetBitmapContext(skia::GetTopDevice(*canvas_));
[NSGraphicsContext setCurrentContext: [NSGraphicsContext setCurrentContext:
[NSGraphicsContext graphicsContextWithGraphicsPort:bitmap_context [NSGraphicsContext graphicsContextWithGraphicsPort:bitmap_context
flipped:YES]]; flipped:YES]];
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0);
#else
webwidget_->animate(); webwidget_->animate();
#endif
// This may result in more invalidation // This may result in more invalidation
webwidget_->layout(); webwidget_->layout();
@ -206,8 +210,8 @@ void WebWidgetHost::Paint() {
int bitmap_width = CGBitmapContextGetWidth(bitmap_context); int bitmap_width = CGBitmapContextGetWidth(bitmap_context);
CGRect bitmap_rect = { { 0, 0 }, CGRect bitmap_rect = { { 0, 0 },
{ bitmap_width, bitmap_height } }; { bitmap_width, bitmap_height } };
canvas_->getTopPlatformDevice().DrawToContext( skia::DrawToNativeContext(canvas_.get(), context, 0,
context, 0, client_rect.height() - bitmap_height, &bitmap_rect); client_rect.height() - bitmap_height, &bitmap_rect);
[view_ unlockFocus]; [view_ unlockFocus];
} }

View File

@ -366,7 +366,11 @@ void WebWidgetHost::Paint() {
paint_rect_.width(), paint_rect_.height(), true)); paint_rect_.width(), paint_rect_.height(), true));
} }
#ifdef WEBWIDGET_HAS_ANIMATE_CHANGES
webwidget_->animate(0.0);
#else
webwidget_->animate(); webwidget_->animate();
#endif
// This may result in more invalidation // This may result in more invalidation
webwidget_->layout(); webwidget_->layout();
@ -374,13 +378,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_->beginPlatformPaint(); skia::ScopedPlatformPaint scoped_platform_paint(canvas_.get());
HDC hdc = scoped_platform_paint.GetPlatformSurface();
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();
@ -412,7 +416,8 @@ void WebWidgetHost::Paint() {
} }
if (!visible_plugins.empty()) { if (!visible_plugins.empty()) {
HDC drawDC = canvas_->beginPlatformPaint(); skia::ScopedPlatformPaint scoped_platform_paint(canvas_.get());
HDC drawDC = scoped_platform_paint.GetPlatformSurface();
HRGN oldRGN, newRGN; HRGN oldRGN, newRGN;
POINT oldViewport; POINT oldViewport;
@ -447,8 +452,6 @@ void WebWidgetHost::Paint() {
damaged_rect = damaged_rect.Union(geom->window_rect); damaged_rect = damaged_rect.Union(geom->window_rect);
} }
canvas_->endPlatformPaint();
// Make sure the damaged rectangle is inside the client rectangle. // Make sure the damaged rectangle is inside the client rectangle.
damaged_rect = damaged_rect.Intersect(client_rect); damaged_rect = damaged_rect.Intersect(client_rect);
} }
@ -458,10 +461,8 @@ void WebWidgetHost::Paint() {
// Paint to the window. // Paint to the window.
PAINTSTRUCT ps; PAINTSTRUCT ps;
BeginPaint(view_, &ps); BeginPaint(view_, &ps);
canvas_->getTopPlatformDevice().drawToHDC(ps.hdc, skia::DrawToNativeContext(canvas_.get(), ps.hdc, ps.rcPaint.left,
ps.rcPaint.left, ps.rcPaint.top, &ps.rcPaint);
ps.rcPaint.top,
&ps.rcPaint);
EndPaint(view_, &ps); EndPaint(view_, &ps);
// Draw children // Draw children
@ -469,8 +470,7 @@ void WebWidgetHost::Paint() {
} else { } else {
// Paint to the delegate. // Paint to the delegate.
DCHECK(paint_delegate_); DCHECK(paint_delegate_);
const SkBitmap& bitmap = const SkBitmap& bitmap = canvas_->getDevice()->accessBitmap(false);
canvas_->getTopPlatformDevice().accessBitmap(false);
DCHECK(bitmap.config() == SkBitmap::kARGB_8888_Config); DCHECK(bitmap.config() == SkBitmap::kARGB_8888_Config);
const void* pixels = bitmap.getPixels(); const void* pixels = bitmap.getPixels();
paint_delegate_->Paint(popup_, damaged_rect, pixels); paint_delegate_->Paint(popup_, damaged_rect, pixels);
@ -502,10 +502,10 @@ bool WebWidgetHost::GetImage(int width, int height, void* buffer)
if (!canvas_.get()) if (!canvas_.get())
return false; return false;
DCHECK(width == canvas_->getTopPlatformDevice().width()); DCHECK(width == canvas_->getDevice()->width());
DCHECK(height == canvas_->getTopPlatformDevice().height()); DCHECK(height == canvas_->getDevice()->height());
const SkBitmap& bitmap = canvas_->getTopPlatformDevice().accessBitmap(false); const SkBitmap& bitmap = canvas_->getDevice()->accessBitmap(false);
DCHECK(bitmap.config() == SkBitmap::kARGB_8888_Config); DCHECK(bitmap.config() == SkBitmap::kARGB_8888_Config);
const void* pixels = bitmap.getPixels(); const void* pixels = bitmap.getPixels();
memcpy(buffer, pixels, width * height * 4); memcpy(buffer, pixels, width * height * 4);

View File

@ -4,5 +4,7 @@
# relates to. # relates to.
patches = { patches = {
# http://codereview.chromium.org/6730028/ # http://codereview.chromium.org/6730028/
'base' : '../base/' 'base' : '../base/',
# http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/3d1f12409578cbf4
'skia_gpu' : '../third_party/skia/gpu/',
} }

View File

@ -1,8 +1,8 @@
Index: message_loop.cc Index: message_loop.cc
=================================================================== ===================================================================
--- message_loop.cc (revision 85124) --- message_loop.cc (revision 91424)
+++ message_loop.cc (working copy) +++ message_loop.cc (working copy)
@@ -387,9 +387,13 @@ @@ -401,9 +401,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 85124) --- message_loop.h (revision 91424)
+++ message_loop.h (working copy) +++ message_loop.h (working copy)
@@ -351,6 +351,9 @@ @@ -349,6 +349,9 @@
// Asserts that the MessageLoop is "idle". // Asserts that the MessageLoop is "idle".
void AssertIdle() const; void AssertIdle() const;

View File

@ -0,0 +1,12 @@
Index: src/GrGpuGL.cpp
===================================================================
--- src/GrGpuGL.cpp (revision 1763)
+++ src/GrGpuGL.cpp (working copy)
@@ -707,7 +707,6 @@
static const StencilFormat esStencilFormats[] = {
{GR_GL_STENCIL_INDEX8, 8, false},
{GR_GL_DEPTH24_STENCIL8, 8, true },
- {GR_GL_STENCIL_INDEX4, 4, false},
};
if (GR_GL_SUPPORT_DESKTOP) {

View File

@ -54,7 +54,5 @@ RunAction(cef_dir, patcher);
print "\nGenerating CEF project files..." print "\nGenerating CEF project files..."
os.environ['CEF_DIRECTORY'] = os.path.basename(cef_dir); os.environ['CEF_DIRECTORY'] = os.path.basename(cef_dir);
gyper = [ 'python', '../tools/gyp/gyp', 'cef.gyp', '-I', '../build/common.gypi', gyper = [ 'python', 'tools/gyp_cef', 'cef.gyp', '-I', 'cef.gypi' ]
'-I', '../build/features_override.gypi', '-I', 'cef.gypi',
'--no-circular-check' ]
RunAction(cef_dir, gyper); RunAction(cef_dir, gyper);

154
tools/gyp_cef Normal file
View File

@ -0,0 +1,154 @@
#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Embedded Framework Authors.
# Portions copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script is wrapper for CEF/Chromium that adds some support for how GYP
# is invoked by Chromium beyond what can be done in the gclient hooks.
import glob
import os
import shlex
import subprocess
import sys
# The CEF root directory is the parent directory of _this_ script.
cef_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
# The Chromium source directory is the parent directory of CEF.
chrome_src = os.path.abspath(os.path.join(cef_dir, os.pardir))
sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib'))
import gyp
# Add tools/grit so that pymod_do_main(grit_info ...) can find grit_info.py.
sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit'))
# On Windows, Psyco shortens warm runs of build/gyp_chromium by about
# 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70
# seconds. Conversely, memory usage of build/gyp_chromium with Psyco
# maxes out at about 158 MB vs. 132 MB without it.
#
# Psyco uses native libraries, so we need to load a different
# installation depending on which OS we are running under. It has not
# been tested whether using Psyco on our Mac and Linux builds is worth
# it (the GYP running time is a lot shorter, so the JIT startup cost
# may not be worth it).
if sys.platform == 'win32':
try:
sys.path.insert(0, os.path.join(chrome_src, 'third_party', 'psyco_win32'))
import psyco
except:
psyco = None
else:
psyco = None
def apply_gyp_environment(file_path=None):
"""
Reads in a *.gyp_env file and applies the valid keys to os.environ.
"""
if not file_path or not os.path.exists(file_path):
return
file_contents = open(file_path).read()
try:
file_data = eval(file_contents, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = os.path.abspath(file_path)
raise
supported_vars = ( 'CHROMIUM_GYP_SYNTAX_CHECK',
'GYP_DEFINES',
'GYP_GENERATOR_FLAGS',
'GYP_GENERATOR_OUTPUT', )
for var in supported_vars:
val = file_data.get(var)
if val:
if var in os.environ:
print 'INFO: Environment value for "%s" overrides value in %s.' % (
var, os.path.abspath(file_path)
)
else:
os.environ[var] = val
def additional_include_files(args=[]):
"""
Returns a list of additional (.gypi) files to include, without
duplicating ones that are already specified on the command line.
"""
# Determine the include files specified on the command line.
# This doesn't cover all the different option formats you can use,
# but it's mainly intended to avoid duplicating flags on the automatic
# makefile regeneration which only uses this format.
specified_includes = set()
for arg in args:
if arg.startswith('-I') and len(arg) > 2:
specified_includes.add(os.path.realpath(arg[2:]))
result = []
def AddInclude(path):
if os.path.realpath(path) not in specified_includes:
result.append(path)
# Always include common.gypi.
AddInclude(os.path.join(chrome_src, 'build', 'common.gypi'))
# Optionally add supplemental .gypi files if present.
supplements = glob.glob(os.path.join(chrome_src, '*', 'supplement.gypi'))
for supplement in supplements:
AddInclude(supplement)
return result
if __name__ == '__main__':
args = sys.argv[1:]
# Use the Psyco JIT if available.
if psyco:
psyco.profile()
print "Enabled Psyco JIT."
# Fall back on hermetic python if we happen to get run under cygwin.
# TODO(bradnelson): take this out once this issue is fixed:
# http://code.google.com/p/gyp/issues/detail?id=177
if sys.platform == 'cygwin':
python_dir = os.path.join(chrome_src, 'third_party', 'python_26')
env = os.environ.copy()
env['PATH'] = python_dir + os.pathsep + env.get('PATH', '')
p = subprocess.Popen(
[os.path.join(python_dir, 'python.exe')] + sys.argv,
env=env, shell=False)
p.communicate()
sys.exit(p.returncode)
if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ:
# Update the environment based on chromium.gyp_env
gyp_env_path = os.path.join(os.path.dirname(chrome_src), 'chromium.gyp_env')
apply_gyp_environment(gyp_env_path)
args.extend(['-I' + i for i in additional_include_files(args)])
# There shouldn't be a circular dependency relationship between .gyp files,
# but in Chromium's .gyp files, on non-Mac platforms, circular relationships
# currently exist. The check for circular dependencies is currently
# bypassed on other platforms, but is left enabled on the Mac, where a
# violation of the rule causes Xcode to misbehave badly.
# TODO(mark): Find and kill remaining circular dependencies, and remove this
# option. http://crbug.com/35878.
# TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the
# list.
if sys.platform not in ('darwin',):
args.append('--no-circular-check')
# If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check
# to enfore syntax checking.
syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK')
if syntax_check and int(syntax_check):
args.append('--check')
print 'Updating projects from gyp files...'
sys.stdout.flush()
# Off we go...
sys.exit(gyp.main(args))