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

Side by Side Diff: mojo/services/network/android_hooks.cc

Issue 1873463003: Remove mojo network service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « mojo/services/network/DEPS ('k') | mojo/services/network/cookie_store_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <vector>
6
7 #include "base/android/base_jni_onload.h"
8 #include "base/android/context_utils.h"
9 #include "base/android/jni_android.h"
10 #include "base/android/library_loader/library_loader_hooks.h"
11 #include "base/bind.h"
12 #include "net/android/net_jni_registrar.h"
13
14 namespace {
15 bool RegisterJNI(JNIEnv* env) {
16 return net::android::RegisterJni(env);
17 }
18
19 bool Init() {
20 return true;
21 }
22 } // namespace
23
24
25 // This is called by the VM when the shared library is first loaded.
26 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
27 std::vector<base::android::RegisterCallback> register_callbacks;
28 register_callbacks.push_back(base::Bind(&RegisterJNI));
29
30 std::vector<base::android::InitCallback> init_callbacks;
31 init_callbacks.push_back(base::Bind(&Init));
32
33 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
34 !base::android::OnJNIOnLoadInit(init_callbacks)) {
35 return -1;
36 }
37
38 // There cannot be two AtExitManagers at the same time. Remove the one from
39 // LibraryLoader as ApplicationRunner also uses one.
40 base::android::LibraryLoaderExitHook();
41
42 return JNI_VERSION_1_4;
43 }
44
45 extern "C" JNI_EXPORT void InitApplicationContext(
46 const base::android::JavaRef<jobject>& context) {
47 JNIEnv* env = base::android::AttachCurrentThread();
48 base::android::InitApplicationContext(env, context);
49 }
OLDNEW
« no previous file with comments | « mojo/services/network/DEPS ('k') | mojo/services/network/cookie_store_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698