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

Side by Side Diff: content/app/android/content_main.cc

Issue 10444121: Added android_browser_process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Init Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/app/android/content_main.h"
6
7 #include "base/base_switches.h"
8 #include "base/at_exit.h"
9 #include "base/command_line.h"
10 #include "content/common/android/process_main.h"
11 #include "content/public/app/content_main_runner.h"
12 #include "content/public/common/content_switches.h"
13 #include "jni/content_main_jni.h"
14
15 namespace {
16 content::ContentMainRunner* g_content_runner = NULL;
17
18 void AtExitCallback(void * para) {
19 if (g_content_runner) {
20 delete g_content_runner;
21 g_content_runner = NULL;
22 }
23 }
24
25 } // namespace
26
27 static jint Start(JNIEnv* env, jclass clazz, jobject context) {
28 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
29
30 // This is only for browser process. We want to start waiting as early as
31 // possible though here is the common initialization code.
32 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger) &&
33 "" == parsed_command_line.GetSwitchValueASCII(switches::kProcessType)) {
34 LOG(ERROR) << "Browser waiting for GDB because flag "
35 << switches::kWaitForDebugger << " was supplied.";
36 base::debug::WaitForDebugger(24*60*60, false);
37 }
38
39 DCHECK(!g_content_runner);
40 base::AtExitManager::RegisterCallback(AtExitCallback, NULL);
41 g_content_runner = content::ContentMainRunner::Create();
42 g_content_runner->Initialize(0, NULL, content::g_content_main_delegate);
43 return g_content_runner->Run();
44 }
45
46 namespace content {
47
48 bool RegisterContentMain(JNIEnv* env) {
49 return RegisterNativesImpl(env);
50 }
51
52 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698