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

Side by Side Diff: chrome/browser/android/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 (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 "chrome/browser/android/dev_tools_server.h" 5 #include "chrome/browser/android/dev_tools_server.h"
6 6
7 #include <pwd.h> 7 #include <pwd.h>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 // Note that the call to Stop() below takes care of |protocol_handler_| 424 // Note that the call to Stop() below takes care of |protocol_handler_|
425 // deletion. 425 // deletion.
426 protocol_handler_->Stop(); 426 protocol_handler_->Stop();
427 protocol_handler_ = NULL; 427 protocol_handler_ = NULL;
428 } 428 }
429 429
430 bool DevToolsServer::IsStarted() const { 430 bool DevToolsServer::IsStarted() const {
431 return protocol_handler_; 431 return protocol_handler_;
432 } 432 }
433 433
434 bool RegisterDevToolsServer(JNIEnv* env) {
435 return RegisterNativesImpl(env);
436 }
437
438 static jlong InitRemoteDebugging(JNIEnv* env, 434 static jlong InitRemoteDebugging(JNIEnv* env,
439 jobject obj, 435 jobject obj,
440 jstring socket_name_prefix) { 436 jstring socket_name_prefix) {
441 DevToolsServer* server = new DevToolsServer( 437 DevToolsServer* server = new DevToolsServer(
442 base::android::ConvertJavaStringToUTF8(env, socket_name_prefix)); 438 base::android::ConvertJavaStringToUTF8(env, socket_name_prefix));
443 return reinterpret_cast<intptr_t>(server); 439 return reinterpret_cast<intptr_t>(server);
444 } 440 }
445 441
446 static void DestroyRemoteDebugging(JNIEnv* env, jobject obj, jlong server) { 442 static void DestroyRemoteDebugging(JNIEnv* env, jobject obj, jlong server) {
447 delete reinterpret_cast<DevToolsServer*>(server); 443 delete reinterpret_cast<DevToolsServer*>(server);
448 } 444 }
449 445
450 static jboolean IsRemoteDebuggingEnabled(JNIEnv* env, 446 static jboolean IsRemoteDebuggingEnabled(JNIEnv* env,
451 jobject obj, 447 jobject obj,
452 jlong server) { 448 jlong server) {
453 return reinterpret_cast<DevToolsServer*>(server)->IsStarted(); 449 return reinterpret_cast<DevToolsServer*>(server)->IsStarted();
454 } 450 }
455 451
456 static void SetRemoteDebuggingEnabled(JNIEnv* env, 452 static void SetRemoteDebuggingEnabled(JNIEnv* env,
457 jobject obj, 453 jobject obj,
458 jlong server, 454 jlong server,
459 jboolean enabled) { 455 jboolean enabled) {
460 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); 456 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server);
461 if (enabled) { 457 if (enabled) {
462 devtools_server->Start(); 458 devtools_server->Start();
463 } else { 459 } else {
464 devtools_server->Stop(); 460 devtools_server->Stop();
465 } 461 }
466 } 462 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698