summaryrefslogtreecommitdiff
path: root/platform/android/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-12-23 14:16:15 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-12-23 14:30:20 -0800
commitc972a251da6e6bc5dadf243045181462ffb01700 (patch)
treef409b2cca1bbbd0fd825c98996d4c7879c5069e7 /platform/android/src
parent16de579d7cfc2960793cbcb5e95741f22ab73768 (diff)
downloadqtlocation-mapboxgl-c972a251da6e6bc5dadf243045181462ffb01700.tar.gz
[core] Remove `Resource` dependency from low-level classes
These classes should not be coupled to domain-specific resource types.
Diffstat (limited to 'platform/android/src')
-rw-r--r--platform/android/src/http_request_android.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/platform/android/src/http_request_android.cpp b/platform/android/src/http_request_android.cpp
index 03f4f8061f..a3803ee11d 100644
--- a/platform/android/src/http_request_android.cpp
+++ b/platform/android/src/http_request_android.cpp
@@ -1,6 +1,5 @@
#include <mbgl/storage/http_context_base.hpp>
#include <mbgl/storage/http_request_base.hpp>
-#include <mbgl/storage/resource.hpp>
#include <mbgl/storage/response.hpp>
#include <mbgl/platform/log.hpp>
#include "jni.hpp"
@@ -25,7 +24,7 @@ public:
explicit HTTPAndroidContext();
~HTTPAndroidContext();
- HTTPRequestBase* createRequest(const Resource&,
+ HTTPRequestBase* createRequest(const std::string& url,
RequestBase::Callback,
std::shared_ptr<const Response>) final;
@@ -36,7 +35,7 @@ public:
class HTTPAndroidRequest : public HTTPRequestBase {
public:
HTTPAndroidRequest(HTTPAndroidContext*,
- const Resource&,
+ const std::string& url,
Callback,
std::shared_ptr<const Response>);
~HTTPAndroidRequest();
@@ -110,14 +109,14 @@ HTTPAndroidContext::~HTTPAndroidContext() {
vm = nullptr;
}
-HTTPRequestBase* HTTPAndroidContext::createRequest(const Resource& resource,
+HTTPRequestBase* HTTPAndroidContext::createRequest(const std::string& url,
RequestBase::Callback callback,
std::shared_ptr<const Response> response) {
- return new HTTPAndroidRequest(this, resource, callback, response);
+ return new HTTPAndroidRequest(this, url, callback, response);
}
-HTTPAndroidRequest::HTTPAndroidRequest(HTTPAndroidContext* context_, const Resource& resource_, Callback callback_, std::shared_ptr<const Response> response_)
- : HTTPRequestBase(resource_, callback_),
+HTTPAndroidRequest::HTTPAndroidRequest(HTTPAndroidContext* context_, const std::string& url_, Callback callback_, std::shared_ptr<const Response> response_)
+ : HTTPRequestBase(url_, callback_),
context(context_),
existingResponse(response_),
async([this] { finish(); }) {
@@ -135,7 +134,7 @@ HTTPAndroidRequest::HTTPAndroidRequest(HTTPAndroidContext* context_, const Resou
JNIEnv *env = nullptr;
bool detach = mbgl::android::attach_jni_thread(context->vm, &env, "HTTPAndroidContext::HTTPAndroidRequest()");
- jstring resourceUrl = mbgl::android::std_string_to_jstring(env, resource.url);
+ jstring resourceUrl = mbgl::android::std_string_to_jstring(env, url);
jstring userAgent = mbgl::android::std_string_to_jstring(env, "MapboxGL/1.0");
jstring etag = mbgl::android::std_string_to_jstring(env, etagStr);
jstring modified = mbgl::android::std_string_to_jstring(env, modifiedStr);