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

Side by Side Diff: android_webview/native/aw_dev_tools_server.cc

Issue 147533004: Remove unneeded JNI registrations. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Fix android webview build issues. Created 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "android_webview/native/aw_dev_tools_server.h" 5 #include "android_webview/native/aw_dev_tools_server.h"
6 6
7 #include "android_webview/native/aw_contents.h" 7 #include "android_webview/native/aw_contents.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Note that the call to Stop() below takes care of |protocol_handler_| 188 // Note that the call to Stop() below takes care of |protocol_handler_|
189 // deletion. 189 // deletion.
190 protocol_handler_->Stop(); 190 protocol_handler_->Stop();
191 protocol_handler_ = NULL; 191 protocol_handler_ = NULL;
192 } 192 }
193 193
194 bool AwDevToolsServer::IsStarted() const { 194 bool AwDevToolsServer::IsStarted() const {
195 return protocol_handler_; 195 return protocol_handler_;
196 } 196 }
197 197
198 bool RegisterAwDevToolsServer(JNIEnv* env) {
199 return RegisterNativesImpl(env);
200 }
201
202 static jlong InitRemoteDebugging(JNIEnv* env, 198 static jlong InitRemoteDebugging(JNIEnv* env,
203 jobject obj) { 199 jobject obj) {
204 AwDevToolsServer* server = new AwDevToolsServer(); 200 AwDevToolsServer* server = new AwDevToolsServer();
205 return reinterpret_cast<intptr_t>(server); 201 return reinterpret_cast<intptr_t>(server);
206 } 202 }
207 203
208 static void DestroyRemoteDebugging(JNIEnv* env, jobject obj, jlong server) { 204 static void DestroyRemoteDebugging(JNIEnv* env, jobject obj, jlong server) {
209 delete reinterpret_cast<AwDevToolsServer*>(server); 205 delete reinterpret_cast<AwDevToolsServer*>(server);
210 } 206 }
211 207
212 static void SetRemoteDebuggingEnabled(JNIEnv* env, 208 static void SetRemoteDebuggingEnabled(JNIEnv* env,
213 jobject obj, 209 jobject obj,
214 jlong server, 210 jlong server,
215 jboolean enabled) { 211 jboolean enabled) {
216 AwDevToolsServer* devtools_server = 212 AwDevToolsServer* devtools_server =
217 reinterpret_cast<AwDevToolsServer*>(server); 213 reinterpret_cast<AwDevToolsServer*>(server);
218 if (enabled) { 214 if (enabled) {
219 devtools_server->Start(); 215 devtools_server->Start();
220 } else { 216 } else {
221 devtools_server->Stop(); 217 devtools_server->Stop();
222 } 218 }
223 } 219 }
224 220
225 } // namespace android_webview 221 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698