OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/app/android/child_process_service.h" | 5 #include "content/app/android/child_process_service.h" |
6 | 6 |
7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
8 #include <cpu-features.h> | 8 #include <cpu-features.h> |
9 | 9 |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 using base::android::JavaIntArrayToIntVector; | 25 using base::android::JavaIntArrayToIntVector; |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 class SurfaceTexturePeerChildImpl : public content::SurfaceTexturePeer, | 31 class SurfaceTexturePeerChildImpl : public content::SurfaceTexturePeer, |
32 public content::GpuSurfaceLookup { | 32 public content::GpuSurfaceLookup { |
33 public: | 33 public: |
34 // |service| is the instance of | 34 // |service| is the instance of |
35 // org.chromium.content.app.ChildProcessService. | 35 // org.chromium.content_public.app.ChildProcessService. |
36 explicit SurfaceTexturePeerChildImpl( | 36 explicit SurfaceTexturePeerChildImpl( |
37 const base::android::ScopedJavaLocalRef<jobject>& service) | 37 const base::android::ScopedJavaLocalRef<jobject>& service) |
38 : service_(service) { | 38 : service_(service) { |
39 GpuSurfaceLookup::InitInstance(this); | 39 GpuSurfaceLookup::InitInstance(this); |
40 } | 40 } |
41 | 41 |
42 virtual ~SurfaceTexturePeerChildImpl() { | 42 virtual ~SurfaceTexturePeerChildImpl() { |
43 GpuSurfaceLookup::InitInstance(NULL); | 43 GpuSurfaceLookup::InitInstance(NULL); |
44 } | 44 } |
45 | 45 |
(...skipping 19 matching lines...) Expand all Loading... |
65 if (surface.j_surface().is_null()) | 65 if (surface.j_surface().is_null()) |
66 return NULL; | 66 return NULL; |
67 | 67 |
68 ANativeWindow* native_window = ANativeWindow_fromSurface( | 68 ANativeWindow* native_window = ANativeWindow_fromSurface( |
69 env, surface.j_surface().obj()); | 69 env, surface.j_surface().obj()); |
70 | 70 |
71 return native_window; | 71 return native_window; |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 // The instance of org.chromium.content.app.ChildProcessService. | 75 // The instance of org.chromium.content_public.app.ChildProcessService. |
76 base::android::ScopedJavaGlobalRef<jobject> service_; | 76 base::android::ScopedJavaGlobalRef<jobject> service_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(SurfaceTexturePeerChildImpl); | 78 DISALLOW_COPY_AND_ASSIGN(SurfaceTexturePeerChildImpl); |
79 }; | 79 }; |
80 | 80 |
81 // Chrome actually uses the renderer code path for all of its child | 81 // Chrome actually uses the renderer code path for all of its child |
82 // processes such as renderers, plugins, etc. | 82 // processes such as renderers, plugins, etc. |
83 void InternalInitChildProcess(const std::vector<int>& file_ids, | 83 void InternalInitChildProcess(const std::vector<int>& file_ids, |
84 const std::vector<int>& file_fds, | 84 const std::vector<int>& file_fds, |
85 JNIEnv* env, | 85 JNIEnv* env, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 bool RegisterChildProcessService(JNIEnv* env) { | 134 bool RegisterChildProcessService(JNIEnv* env) { |
135 return RegisterNativesImpl(env); | 135 return RegisterNativesImpl(env); |
136 } | 136 } |
137 | 137 |
138 void ShutdownMainThread(JNIEnv* env, jobject obj) { | 138 void ShutdownMainThread(JNIEnv* env, jobject obj) { |
139 ChildThread::ShutdownThread(); | 139 ChildThread::ShutdownThread(); |
140 } | 140 } |
141 | 141 |
142 } // namespace content | 142 } // namespace content |
OLD | NEW |