Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: net/android/gurl_utils.cc

Issue 11416347: Adding java implementation for Geolocation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comment and copyright date Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/android/gurl_utils.cc
diff --git a/net/android/gurl_utils.cc b/net/android/gurl_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..94d8e78b7f1a3d4f954eaa27cf0cb96ea5cde934
--- /dev/null
+++ b/net/android/gurl_utils.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2012 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.
+
+#include "net/android/gurl_utils.h"
+
+#include "base/android/jni_string.h"
+#include "googleurl/src/gurl.h"
+#include "jni/GURLUtils_jni.h"
+
+namespace net {
+
+jstring GetOrigin(JNIEnv* env, jclass clazz, jstring url) {
+ GURL host(base::android::ConvertJavaStringToUTF16(env, url));
+
+ return base::android::ConvertUTF8ToJavaString(env,
+ host.GetOrigin().spec()).Release();
Yaron 2012/12/14 02:09:07 Hmm. You shouldn't need to manager this yourself.
+}
+
+bool RegisterGURLUtils(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // net namespace

Powered by Google App Engine
This is Rietveld 408576698