Update to Chromium revision 102269.

- Disable use of clang on Mac for the time being.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@292 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-09-23 00:16:03 +00:00
parent 32402b2287
commit 0fc3af0dbb
26 changed files with 253 additions and 213 deletions

View File

@ -1,8 +1,8 @@
// 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
// found in the LICENSE file.
#ifndef _BROWSER_APPCACHE_SYSTEM_H
#ifndef WEBKIT_TOOLS_TEST_SHELL_Browser_APPCACHE_SYSTEM_H_
#define _BROWSER_APPCACHE_SYSTEM_H
#include "base/file_path.h"
@ -11,25 +11,23 @@
#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 net {
class URLRequest;
class URLRequestContext;
}
namespace WebKit {
class WebApplicationCacheHost;
class WebApplicationCacheHostClient;
}
class BrowserBackendProxy;
class BrowserFrontendProxy;
namespace net {
class URLRequest;
class URLRequestContext;
} // namespace net
// A class that composes the constituent parts of an appcache system
// together for use in a single process with two relavant threads,
// a UI thread on which webkit runs and an IO thread on which net::URLRequests
// 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 {
@ -76,43 +74,15 @@ class BrowserAppCacheSystem {
// Called by BrowserResourceLoaderBridge extract extra response bits.
static void GetExtraResponseInfo(net::URLRequest* request,
int64* cache_id,
GURL* manifest_url) {
int64* cache_id,
GURL* manifest_url) {
if (instance_)
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;
friend class appcache::AppCacheThread;
// Instance methods called by our static public methods
void InitOnUIThread(const FilePath& cache_directory);
@ -138,16 +108,6 @@ class BrowserAppCacheSystem {
bool is_initailized_on_ui_thread() {
return ui_message_loop_ ? true : false;
}
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;
}
FilePath cache_directory_;
MessageLoop* io_message_loop_;
@ -165,9 +125,6 @@ class BrowserAppCacheSystem {
// 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_;
};