diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 0daf20a89..348856e30 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -58,3 +58,4 @@ Date | CEF Revision | Chromium Revision 2010-10-21 | /trunk@122 | /trunk@63396 2010-10-26 | /trunk@127 | /trunk@63876 2010-10-28 | /trunk@129 | /trunk@64233 +2010-11-16 | /trunk@138 | /trunk@66269 diff --git a/libcef/browser_appcache_system.cc b/libcef/browser_appcache_system.cc index f890d6745..447810223 100644 --- a/libcef/browser_appcache_system.cc +++ b/libcef/browser_appcache_system.cc @@ -390,7 +390,6 @@ void BrowserAppCacheSystem::InitOnIOThread(URLRequestContext* request_context) { DCHECK(!io_message_loop_); io_message_loop_ = MessageLoop::current(); - io_message_loop_->AddDestructionObserver(this); if (!db_thread_.IsRunning()) db_thread_.Start(); @@ -406,6 +405,19 @@ void BrowserAppCacheSystem::InitOnIOThread(URLRequestContext* request_context) { AppCacheInterceptor::EnsureRegistered(); } +void BrowserAppCacheSystem::CleanupIOThread() { + DCHECK(is_io_thread()); + + delete backend_impl_; + delete service_; + backend_impl_ = NULL; + service_ = NULL; + io_message_loop_ = NULL; + + // Just in case the main thread is waiting on it. + backend_proxy_->SignalEvent(); +} + WebApplicationCacheHost* BrowserAppCacheSystem::CreateCacheHostForWebKit( WebApplicationCacheHostClient* client) { if (!is_initailized_on_ui_thread()) @@ -435,16 +447,3 @@ void BrowserAppCacheSystem::GetExtraResponseBits( request, cache_id, manifest_url); } } - -void BrowserAppCacheSystem::WillDestroyCurrentMessageLoop() { - DCHECK(is_io_thread()); - - delete backend_impl_; - delete service_; - backend_impl_ = NULL; - service_ = NULL; - io_message_loop_ = NULL; - - // Just in case the main thread is waiting on it. - backend_proxy_->SignalEvent(); -} diff --git a/libcef/browser_appcache_system.h b/libcef/browser_appcache_system.h index b03ff9e6a..1d5077522 100644 --- a/libcef/browser_appcache_system.h +++ b/libcef/browser_appcache_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_APPCACHE_SYSTEM_H #define _BROWSER_APPCACHE_SYSTEM_H @@ -28,7 +28,7 @@ class URLRequestContext; // a UI thread on which webkit runs and an IO thread on which URLRequests // are handled. This class conspires with BrowserResourceLoaderBridge to // retrieve resources from the appcache. -class BrowserAppCacheSystem : public MessageLoop::DestructionObserver { +class BrowserAppCacheSystem { public: // Should be instanced somewhere in main(). If not instanced, the public // static methods are all safe no-ops. @@ -51,6 +51,11 @@ class BrowserAppCacheSystem : public MessageLoop::DestructionObserver { instance_->InitOnIOThread(request_context); } + static void CleanupOnIOThread() { + if (instance_) + instance_->CleanupIOThread(); + } + // Called by TestShellWebKitInit to manufacture a 'host' for webcore. static WebKit::WebApplicationCacheHost* CreateApplicationCacheHost( WebKit::WebApplicationCacheHostClient* client) { @@ -108,6 +113,7 @@ class BrowserAppCacheSystem : public MessageLoop::DestructionObserver { // Instance methods called by our static public methods void InitOnUIThread(const FilePath& cache_directory); void InitOnIOThread(URLRequestContext* request_context); + void CleanupIOThread(); WebKit::WebApplicationCacheHost* CreateCacheHostForWebKit( WebKit::WebApplicationCacheHostClient* client); void SetExtraRequestBits(URLRequest* request, @@ -139,9 +145,6 @@ class BrowserAppCacheSystem : public MessageLoop::DestructionObserver { return NULL; } - // IOThread DestructionObserver - virtual void WillDestroyCurrentMessageLoop(); - FilePath cache_directory_; MessageLoop* io_message_loop_; MessageLoop* ui_message_loop_; diff --git a/libcef/browser_file_system.cc b/libcef/browser_file_system.cc index 5bcb36f9a..bed6c1c3e 100644 --- a/libcef/browser_file_system.cc +++ b/libcef/browser_file_system.cc @@ -24,26 +24,6 @@ using WebKit::WebVector; namespace { -WebKit::WebFileError PlatformFileErrorToWebFileError( - base::PlatformFileError error_code) { - switch (error_code) { - case base::PLATFORM_FILE_ERROR_NOT_FOUND: - return WebKit::WebFileErrorNotFound; - case base::PLATFORM_FILE_ERROR_INVALID_OPERATION: - case base::PLATFORM_FILE_ERROR_EXISTS: - case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY: - return WebKit::WebFileErrorInvalidModification; - case base::PLATFORM_FILE_ERROR_ACCESS_DENIED: - return WebKit::WebFileErrorNoModificationAllowed; - case base::PLATFORM_FILE_ERROR_FAILED: - return WebKit::WebFileErrorInvalidState; - case base::PLATFORM_FILE_ERROR_ABORT: - return WebKit::WebFileErrorAbort; - default: - return WebKit::WebFileErrorInvalidModification; - } -} - class BrowserFileSystemCallbackDispatcher : public fileapi::FileSystemCallbackDispatcher { public: @@ -73,10 +53,10 @@ class BrowserFileSystemCallbackDispatcher } virtual void DidReadDirectory( - const std::vector& entries, + const std::vector& entries, bool has_more) { std::vector web_entries_vector; - for (std::vector::const_iterator it = + for (std::vector::const_iterator it = entries.begin(); it != entries.end(); ++it) { WebFileSystemEntry entry; entry.name = webkit_glue::FilePathStringToWebString(it->name); @@ -94,7 +74,8 @@ class BrowserFileSystemCallbackDispatcher } virtual void DidFail(base::PlatformFileError error_code) { - callbacks_->didFail(PlatformFileErrorToWebFileError(error_code)); + callbacks_->didFail( + webkit_glue::PlatformFileErrorToWebFileError(error_code)); file_system_->RemoveCompletedOperation(request_id_); } diff --git a/libcef/browser_file_writer.cc b/libcef/browser_file_writer.cc index 929cb19b0..52439ae57 100644 --- a/libcef/browser_file_writer.cc +++ b/libcef/browser_file_writer.cc @@ -97,7 +97,7 @@ class BrowserFileWriter::IOThreadProxy } virtual void DidReadDirectory( - const std::vector& entries, + const std::vector& entries, bool has_more) { NOTREACHED(); } diff --git a/libcef/browser_request_context.cc b/libcef/browser_request_context.cc index 939257bef..07f0a73dc 100644 --- a/libcef/browser_request_context.cc +++ b/libcef/browser_request_context.cc @@ -90,7 +90,7 @@ void BrowserRequestContext::Init( host_resolver_ = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL); + NULL, NULL); ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); http_auth_handler_factory_ = diff --git a/libcef/browser_webkit_glue.cc b/libcef/browser_webkit_glue.cc index 8fa78cf8e..c93d44a8a 100644 --- a/libcef/browser_webkit_glue.cc +++ b/libcef/browser_webkit_glue.cc @@ -7,7 +7,7 @@ #include "third_party/webkit/webcore/config.h" MSVC_PUSH_WARNING_LEVEL(0); -#include "Cache.h" +#include "MemoryCache.h" #include "TextEncoding.h" #include "third_party/WebKit/WebCore/platform/network/HTTPParsers.h" #include "third_party/WebKit/WebKit/chromium/src/WebFrameImpl.h" diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index ddcc125f4..42a4574fa 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -535,7 +535,8 @@ WebWorker* BrowserWebViewDelegate::createWorker( WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer( WebFrame* frame, WebMediaPlayerClient* client) { - media::MediaFilterCollection collection; + scoped_ptr collection( + new media::MediaFilterCollection()); appcache::WebApplicationCacheHostImpl* appcache_host = appcache::WebApplicationCacheHostImpl::FromFrame(frame); @@ -559,16 +560,16 @@ WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer( appcache_host ? appcache_host->host_id() : appcache::kNoHostId, 0); - scoped_refptr video_renderer = - new webkit_glue::VideoRendererImpl(false); - collection.push_back(video_renderer); + scoped_refptr video_renderer( + new webkit_glue::VideoRendererImpl(false)); + collection->AddVideoRenderer(video_renderer); // Add the audio renderer. - collection.push_back(new media::AudioRendererImpl()); + collection->AddAudioRenderer(new media::AudioRendererImpl()); return new webkit_glue::WebMediaPlayerImpl( - client, collection, bridge_factory_simple, bridge_factory_buffered, - false, video_renderer); + client, collection.release(), bridge_factory_simple, + bridge_factory_buffered, false, video_renderer); } WebApplicationCacheHost* BrowserWebViewDelegate::createApplicationCacheHost( @@ -806,7 +807,7 @@ void BrowserWebViewDelegate::reportFindInPageSelection( } void BrowserWebViewDelegate::openFileSystem( - WebFrame* frame, WebFileSystem::Type type, long long size, + WebFrame* frame, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks) { if (browser_->file_system_root().empty()) { // The FileSystem temp directory was not initialized successfully. diff --git a/libcef/browser_webview_delegate.h b/libcef/browser_webview_delegate.h index 185fdfec2..45a428f32 100644 --- a/libcef/browser_webview_delegate.h +++ b/libcef/browser_webview_delegate.h @@ -178,6 +178,7 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, WebKit::WebFrame* frame, WebKit::WebFileSystem::Type type, long long size, + bool create, WebKit::WebFileSystemCallbacks* callbacks); // webkit_glue::WebPluginPageDelegate diff --git a/libcef/cef_process_io_thread.cc b/libcef/cef_process_io_thread.cc index 4382c0788..5dc0c7550 100644 --- a/libcef/cef_process_io_thread.cc +++ b/libcef/cef_process_io_thread.cc @@ -59,9 +59,11 @@ void CefProcessIOThread::CleanUp() { // purify leak-test results. MessageLoop::current()->RunAllPending(); - BrowserFileWriter::CleanupOnIOThread(); - BrowserSocketStreamBridge::Cleanup(); + // In reverse order of initialization. BrowserWebBlobRegistryImpl::Cleanup(); + BrowserSocketStreamBridge::Cleanup(); + BrowserFileWriter::CleanupOnIOThread(); + BrowserAppCacheSystem::CleanupOnIOThread(); _Context->set_request_context(NULL); request_context_ = NULL;