mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
libcef: Update due to underlying chromium changes.
- WebKit API upstreamed requiring header include path changes. - AppCache, Database and ResourceLoader updates. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@65 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -7,9 +7,11 @@
|
||||
|
||||
#include "base/file_path.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/thread.h"
|
||||
#include "webkit/appcache/appcache_backend_impl.h"
|
||||
#include "webkit/appcache/appcache_frontend_impl.h"
|
||||
#include "webkit/appcache/appcache_service.h"
|
||||
#include "webkit/appcache/appcache_thread.h"
|
||||
#include "webkit/glue/resource_type.h"
|
||||
|
||||
namespace WebKit {
|
||||
@ -71,12 +73,37 @@ class BrowserAppCacheSystem : public MessageLoop::DestructionObserver {
|
||||
instance_->GetExtraResponseBits(request, cache_id, manifest_url);
|
||||
}
|
||||
|
||||
// Some unittests create their own IO and DB threads.
|
||||
|
||||
enum AppCacheThreadID {
|
||||
DB_THREAD_ID,
|
||||
IO_THREAD_ID,
|
||||
};
|
||||
|
||||
class ThreadProvider {
|
||||
public:
|
||||
virtual ~ThreadProvider() {}
|
||||
virtual bool PostTask(
|
||||
int id,
|
||||
const tracked_objects::Location& from_here,
|
||||
Task* task) = 0;
|
||||
virtual bool CurrentlyOn(int id) = 0;
|
||||
};
|
||||
|
||||
static void set_thread_provider(ThreadProvider* provider) {
|
||||
DCHECK(instance_);
|
||||
DCHECK(!provider || !instance_->thread_provider_);
|
||||
instance_->thread_provider_ = provider;
|
||||
}
|
||||
|
||||
static ThreadProvider* thread_provider() {
|
||||
return instance_ ? instance_->thread_provider_ : NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class BrowserBackendProxy;
|
||||
friend class BrowserFrontendProxy;
|
||||
|
||||
// A low-tech singleton.
|
||||
static BrowserAppCacheSystem* instance_;
|
||||
friend class appcache::AppCacheThread;
|
||||
|
||||
// Instance methods called by our static public methods
|
||||
void InitOnUIThread(const FilePath& cache_directory);
|
||||
@ -101,6 +128,16 @@ class BrowserAppCacheSystem : public MessageLoop::DestructionObserver {
|
||||
bool is_initailized_on_ui_thread() {
|
||||
return ui_message_loop_ && !cache_directory_.empty();
|
||||
}
|
||||
static MessageLoop* GetMessageLoop(int id) {
|
||||
if (instance_) {
|
||||
if (id == IO_THREAD_ID)
|
||||
return instance_->io_message_loop_;
|
||||
if (id == DB_THREAD_ID)
|
||||
return instance_->db_thread_.message_loop();
|
||||
NOTREACHED() << "Invalid AppCacheThreadID value";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// IOThread DestructionObserver
|
||||
virtual void WillDestroyCurrentMessageLoop();
|
||||
@ -117,6 +154,15 @@ class BrowserAppCacheSystem : public MessageLoop::DestructionObserver {
|
||||
// is started new instances will be created.
|
||||
appcache::AppCacheBackendImpl* backend_impl_;
|
||||
appcache::AppCacheService* service_;
|
||||
|
||||
// We start a thread for use as the DB thread.
|
||||
base::Thread db_thread_;
|
||||
|
||||
// Some unittests create there own IO and DB threads.
|
||||
ThreadProvider* thread_provider_;
|
||||
|
||||
// A low-tech singleton.
|
||||
static BrowserAppCacheSystem* instance_;
|
||||
};
|
||||
|
||||
#endif // _BROWSER_APPCACHE_SYSTEM_H
|
||||
|
Reference in New Issue
Block a user