From d4004fc57ebad931f9f7bdc69c88c57532444ab3 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 22 Oct 2010 00:13:43 +0000 Subject: [PATCH] Update to Chromium revision 63396. Fix crash in browser database system (issue #132). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@122 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- CHROMIUM_BUILD_COMPATIBILITY.txt | 1 + libcef/browser_database_system.cc | 18 +++++++------- libcef/browser_database_system.h | 6 ++--- libcef/browser_drag_delegate.cc | 6 ++--- libcef/browser_drag_delegate.h | 15 ++++++------ libcef/browser_drop_delegate.cc | 9 +++---- libcef/browser_drop_delegate.h | 40 ++++++++++++++----------------- libcef/browser_webkit_init.h | 7 ++++++ 8 files changed, 54 insertions(+), 48 deletions(-) diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 0e7ff7320..4659adeee 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -55,3 +55,4 @@ Date | CEF Revision | Chromium Revision 2010-09-12 | /trunk@102 | /trunk@59193 2010-10-03 | /trunk@108 | /trunk@61327 2010-10-15 | /trunk@116 | /trunk@62731 +2010-10-21 | /trunk@122 | /trunk@63396 diff --git a/libcef/browser_database_system.cc b/libcef/browser_database_system.cc index c48bb77d1..3907ce735 100644 --- a/libcef/browser_database_system.cc +++ b/libcef/browser_database_system.cc @@ -1,14 +1,12 @@ -// Copyright (c) 2009 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. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #include "browser_database_system.h" #include "base/auto_reset.h" #include "base/file_util.h" #include "base/message_loop.h" -#include "base/platform_thread.h" -#include "base/process_util.h" #include "base/utf_string_conversions.h" #include "third_party/sqlite/sqlite3.h" #include "third_party/WebKit/WebKit/chromium/public/WebDatabase.h" @@ -42,7 +40,7 @@ BrowserDatabaseSystem::~BrowserDatabaseSystem() { } base::PlatformFile BrowserDatabaseSystem::OpenFile( - const string16& vfs_file_name, int desired_flags) { + const string16& vfs_file_name, int desired_flags) { base::PlatformFile file_handle = base::kInvalidPlatformFileValue; FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name); if (file_name.empty()) { @@ -153,7 +151,8 @@ void BrowserDatabaseSystem::databaseClosed(const WebKit::WebDatabase& database) void BrowserDatabaseSystem::ClearAllDatabases() { // Wait for all databases to be closed. if (!database_connections_.IsEmpty()) { - AutoReset waiting_for_dbs_auto_reset(&waiting_for_dbs_to_close_, true); + AutoReset waiting_for_dbs_auto_reset( + &waiting_for_dbs_to_close_, true); MessageLoop::ScopedNestableTaskAllower nestable(MessageLoop::current()); MessageLoop::current()->Run(); } @@ -184,7 +183,10 @@ void BrowserDatabaseSystem::SetFullFilePathsForVfsFile( FilePath BrowserDatabaseSystem::GetFullFilePathForVfsFile( const string16& vfs_file_name) { + if (vfs_file_name.empty()) // temp file, used for vacuuming + return FilePath(); + AutoLock file_names_auto_lock(file_names_lock_); DCHECK(file_names_.find(vfs_file_name) != file_names_.end()); return file_names_[vfs_file_name]; -} \ No newline at end of file +} diff --git a/libcef/browser_database_system.h b/libcef/browser_database_system.h index c0dc22b13..eb06cb6ea 100644 --- a/libcef/browser_database_system.h +++ b/libcef/browser_database_system.h @@ -1,6 +1,6 @@ -// Copyright (c) 2009 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. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef _BROWSER_DATABASE_SYSTEM_H #define _BROWSER_DATABASE_SYSTEM_H diff --git a/libcef/browser_drag_delegate.cc b/libcef/browser_drag_delegate.cc index 1db7d13e0..44a07590b 100644 --- a/libcef/browser_drag_delegate.cc +++ b/libcef/browser_drag_delegate.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008 The Chromium Embedded Framework Authors. -// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 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. @@ -15,7 +14,8 @@ namespace { void GetCursorPositions(HWND hwnd, gfx::Point* client, gfx::Point* screen) { // GetCursorPos will fail if the input desktop isn't the current desktop. - // See http://b/1173534. (0,0) is wrong, but better than uninitialized. + // (0,0) is wrong, but better than uninitialized. + // We should clean up all callers to handle failure -- http://b/1208177 . POINT pos; if (!GetCursorPos(&pos)) { pos.x = 0; diff --git a/libcef/browser_drag_delegate.h b/libcef/browser_drag_delegate.h index 6ff9dae63..1d5323848 100644 --- a/libcef/browser_drag_delegate.h +++ b/libcef/browser_drag_delegate.h @@ -1,28 +1,27 @@ -// Copyright (c) 2008 The Chromium Embedded Framework Authors. -// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. -// -// A class that implements BaseDragSource for the test shell webview delegate. #ifndef _BROWSER_DRAG_DELEGATE_H #define _BROWSER_DRAG_DELEGATE_H -#include "base/base_drag_source.h" +#include "app/win/drag_source.h" namespace WebKit { class WebView; } -class BrowserDragDelegate : public BaseDragSource { +// A class that implements app::win::DragSource for the browser webview +// delegate. +class BrowserDragDelegate : public app::win::DragSource { public: BrowserDragDelegate(HWND source_hwnd, WebKit::WebView* webview) - : BaseDragSource(), + : app::win::DragSource(), source_hwnd_(source_hwnd), webview_(webview) { } protected: - // BaseDragSource + // app::win::DragSource virtual void OnDragSourceCancel(); virtual void OnDragSourceDrop(); virtual void OnDragSourceMove(); diff --git a/libcef/browser_drop_delegate.cc b/libcef/browser_drop_delegate.cc index 570ea5f49..a7982389f 100644 --- a/libcef/browser_drop_delegate.cc +++ b/libcef/browser_drop_delegate.cc @@ -1,5 +1,4 @@ -// Copyright (c) 2008 The Chromium Embedded Framework Authors. -// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -15,7 +14,10 @@ using WebKit::WebDragOperationCopy; using WebKit::WebPoint; using WebKit::WebView; -// BaseDropTarget methods ---------------------------------------------------- +BrowserDropDelegate::BrowserDropDelegate(HWND source_hwnd, WebKit::WebView* webview) + : app::win::DropTarget(source_hwnd), + webview_(webview) { +} DWORD BrowserDropDelegate::OnDragEnter(IDataObject* data_object, DWORD key_state, @@ -68,4 +70,3 @@ DWORD BrowserDropDelegate::OnDrop(IDataObject* data_object, // webkit win port always returns DROPEFFECT_NONE return DROPEFFECT_NONE; } - diff --git a/libcef/browser_drop_delegate.h b/libcef/browser_drop_delegate.h index 1308b7fd7..dc0afc06e 100644 --- a/libcef/browser_drop_delegate.h +++ b/libcef/browser_drop_delegate.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008 The Chromium Embedded Framework Authors. -// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. // @@ -8,34 +7,31 @@ #ifndef _BROWSER_DROP_DELEGATE_H #define _BROWSER_DROP_DELEGATE_H -#include "base/base_drop_target.h" +#include "app/win/drop_target.h" namespace WebKit { class WebView; } -class BrowserDropDelegate : public BaseDropTarget { +class BrowserDropDelegate : public app::win::DropTarget { public: - BrowserDropDelegate(HWND source_hwnd, WebKit::WebView* webview) - : BaseDropTarget(source_hwnd), - webview_(webview) { } + BrowserDropDelegate(HWND source_hwnd, WebKit::WebView* webview); protected: - // BaseDropTarget methods - virtual DWORD OnDragEnter(IDataObject* data_object, - DWORD key_state, - POINT cursor_position, - DWORD effect); - virtual DWORD OnDragOver(IDataObject* data_object, - DWORD key_state, - POINT cursor_position, - DWORD effect); - virtual void OnDragLeave(IDataObject* data_object); - virtual DWORD OnDrop(IDataObject* data_object, - DWORD key_state, - POINT cursor_position, - DWORD effect); - + // BaseDropTarget methods + virtual DWORD OnDragEnter(IDataObject* data_object, + DWORD key_state, + POINT cursor_position, + DWORD effect); + virtual DWORD OnDragOver(IDataObject* data_object, + DWORD key_state, + POINT cursor_position, + DWORD effect); + virtual void OnDragLeave(IDataObject* data_object); + virtual DWORD OnDrop(IDataObject* data_object, + DWORD key_state, + POINT cursor_position, + DWORD effect); private: WebKit::WebView* webview_; diff --git a/libcef/browser_webkit_init.h b/libcef/browser_webkit_init.h index 9432d6c8f..3622d20a2 100644 --- a/libcef/browser_webkit_init.h +++ b/libcef/browser_webkit_init.h @@ -197,6 +197,13 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl { WebKit::WebStorageNamespace::m_localStorageQuota); } + void dispatchStorageEvent(const WebKit::WebString& key, + const WebKit::WebString& old_value, const WebKit::WebString& new_value, + const WebKit::WebString& origin, const WebKit::WebURL& url, + bool is_local_storage) { + // The event is dispatched by the proxy. + } + virtual WebKit::WebIDBFactory* idbFactory() { return WebKit::WebIDBFactory::create(); }