Shorten method names
This commit is contained in:
@@ -131,10 +131,10 @@ void SQLiteCache::get(const Resource &resource, Callback callback) {
|
||||
// Will try to load the URL from the SQLite database and call the callback when done.
|
||||
// Note that the callback is probably going to invoked from another thread, so the caller
|
||||
// must make sure that it can run in that thread.
|
||||
thread->invokeWithResult(&Impl::processGet, callback, resource);
|
||||
thread->invokeWithResult(&Impl::get, callback, resource);
|
||||
}
|
||||
|
||||
std::unique_ptr<Response> SQLiteCache::Impl::processGet(const Resource &resource) {
|
||||
std::unique_ptr<Response> SQLiteCache::Impl::get(const Resource &resource) {
|
||||
try {
|
||||
// This is called in the SQLite event loop.
|
||||
if (!db) {
|
||||
@@ -183,13 +183,13 @@ void SQLiteCache::put(const Resource &resource, std::shared_ptr<const Response>
|
||||
// storing a new response or updating the currently stored response, potentially setting a new
|
||||
// expiry date.
|
||||
if (hint == Hint::Full) {
|
||||
thread->invoke(&Impl::processPut, resource, std::move(response));
|
||||
thread->invoke(&Impl::put, resource, std::move(response));
|
||||
} else if (hint == Hint::Refresh) {
|
||||
thread->invoke(&Impl::processRefresh, resource, int64_t(response->expires));
|
||||
thread->invoke(&Impl::refresh, resource, int64_t(response->expires));
|
||||
}
|
||||
}
|
||||
|
||||
void SQLiteCache::Impl::processPut(const Resource& resource, std::shared_ptr<const Response> response) {
|
||||
void SQLiteCache::Impl::put(const Resource& resource, std::shared_ptr<const Response> response) {
|
||||
try {
|
||||
if (!db) {
|
||||
createDatabase();
|
||||
@@ -238,7 +238,7 @@ void SQLiteCache::Impl::processPut(const Resource& resource, std::shared_ptr<con
|
||||
}
|
||||
}
|
||||
|
||||
void SQLiteCache::Impl::processRefresh(const Resource& resource, int64_t expires) {
|
||||
void SQLiteCache::Impl::refresh(const Resource& resource, int64_t expires) {
|
||||
try {
|
||||
if (!db) {
|
||||
createDatabase();
|
||||
|
||||
@@ -17,9 +17,9 @@ public:
|
||||
Impl(const std::string &path = ":memory:");
|
||||
~Impl();
|
||||
|
||||
std::unique_ptr<Response> processGet(const Resource&);
|
||||
void processPut(const Resource& resource, std::shared_ptr<const Response> response);
|
||||
void processRefresh(const Resource& resource, int64_t expires);
|
||||
std::unique_ptr<Response> get(const Resource&);
|
||||
void put(const Resource& resource, std::shared_ptr<const Response> response);
|
||||
void refresh(const Resource& resource, int64_t expires);
|
||||
|
||||
private:
|
||||
void createDatabase();
|
||||
|
||||
@@ -60,7 +60,7 @@ Request* DefaultFileSource::request(const Resource& resource,
|
||||
|
||||
// This function can be called from any thread. Make sure we're executing the actual call in the
|
||||
// file source loop by sending it over the queue.
|
||||
thread->invoke(&Impl::processAdd, std::move(req), thread->get());
|
||||
thread->invoke(&Impl::add, std::move(req), thread->get());
|
||||
|
||||
return req;
|
||||
}
|
||||
@@ -74,14 +74,14 @@ void DefaultFileSource::cancel(Request *req) {
|
||||
|
||||
// This function can be called from any thread. Make sure we're executing the actual call in the
|
||||
// file source loop by sending it over the queue.
|
||||
thread->invoke(&Impl::processCancel, std::move(req));
|
||||
thread->invoke(&Impl::cancel, std::move(req));
|
||||
}
|
||||
|
||||
void DefaultFileSource::abort(const Environment &env) {
|
||||
thread->invoke(&Impl::processAbort, std::ref(env));
|
||||
thread->invoke(&Impl::abort, std::ref(env));
|
||||
}
|
||||
|
||||
void DefaultFileSource::Impl::processAdd(Request* req, uv_loop_t* loop) {
|
||||
void DefaultFileSource::Impl::add(Request* req, uv_loop_t* loop) {
|
||||
const Resource &resource = req->resource;
|
||||
|
||||
// We're adding a new Request.
|
||||
@@ -112,7 +112,7 @@ void DefaultFileSource::Impl::processAdd(Request* req, uv_loop_t* loop) {
|
||||
sharedRequest->subscribe(req);
|
||||
}
|
||||
|
||||
void DefaultFileSource::Impl::processCancel(Request* req) {
|
||||
void DefaultFileSource::Impl::cancel(Request* req) {
|
||||
SharedRequestBase *sharedRequest = find(req->resource);
|
||||
if (sharedRequest) {
|
||||
// If the number of dependent requests of the SharedRequestBase drops to zero, the
|
||||
@@ -156,7 +156,7 @@ void DefaultFileSource::Impl::processResult(const Resource& resource, std::share
|
||||
}
|
||||
|
||||
// Aborts all requests that are part of the current environment.
|
||||
void DefaultFileSource::Impl::processAbort(const Environment& env) {
|
||||
void DefaultFileSource::Impl::abort(const Environment& env) {
|
||||
// Construct a cancellation response.
|
||||
auto res = util::make_unique<Response>();
|
||||
res->status = Response::Error;
|
||||
|
||||
@@ -18,9 +18,9 @@ public:
|
||||
std::shared_ptr<const Response> response, FileCache::Hint hint);
|
||||
SharedRequestBase *find(const Resource &resource);
|
||||
|
||||
void processAdd(Request* request, uv_loop_t* loop);
|
||||
void processCancel(Request* request);
|
||||
void processAbort(const Environment& env);
|
||||
void add(Request* request, uv_loop_t* loop);
|
||||
void cancel(Request* request);
|
||||
void abort(const Environment& env);
|
||||
|
||||
const std::string assetRoot;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user