Codebase list mozc / a78116f
Rename InitGoogle to mozc::InitMozc. Currently flags.cc defines InitGoogle in which logging is initialized. This is causing circular dependency between logging.cc and flags.cc. This CL addresses the issue. This CL also renames InitGoogle to mozc::InitMozc to make it clear that the function is responsible for initializing only Mozc-related components, and has nothing to do with any other libraries even if they were developed by Google. BUG= TEST=unittest REF_BUG=19010851 REF_CL=85680996,85596766,85688252,85688262,85688306,85689019 Noriyuki Takahashi authored 8 years ago Yohei Yukawa committed 8 years ago
75 changed file(s) with 312 addition(s) and 199 deletion(s). Raw diff Collapse all Expand all
105105 'flags.cc',
106106 'hash.cc',
107107 'init.cc',
108 'init_mozc.cc',
108109 'japanese_util_rule.cc',
109110 'logging.cc',
110111 'mmap.cc',
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "base/cpu_stats.h"
30
3129 #include <iostream>
3230 #include <memory>
3331 #include <string>
3432
33 #include "base/cpu_stats.h"
3534 #include "base/flags.h"
35 #include "base/init_mozc.h"
3636 #include "base/port.h"
3737 #include "base/thread.h"
3838 #include "base/util.h"
5959 } // namespace
6060
6161 int main(int argc, char **argv) {
62 InitGoogle(argv[0], &argc, &argv, false);
62 mozc::InitMozc(argv[0], &argc, &argv, false);
6363
6464 std::unique_ptr<DummyThread[]> threads;
6565
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "base/encryptor.h"
30
3129 #include <iostream>
3230 #include <string>
31
32 #include "base/encryptor.h"
3333 #include "base/file_stream.h"
3434 #include "base/flags.h"
35 #include "base/init_mozc.h"
3536 #include "base/logging.h"
3637 #include "base/mmap.h"
3738 #include "base/util.h"
6061 } // namespace
6162
6263 int main(int argc, char **argv) {
63 InitGoogle(argv[0], &argc, &argv, false);
64 mozc::InitMozc(argv[0], &argc, &argv, false);
6465
6566 if (!FLAGS_iv.empty()) {
6667 CHECK_EQ(16, FLAGS_iv.size()) << "iv size must be 16 byte";
2929
3030 #include "base/flags.h"
3131
32 #include <stdlib.h> // for atexit, getenv
33 #ifdef OS_WIN
34 #include <windows.h>
35 #endif // OS_WIN
32 #include <cstdlib> // for getenv
3633 #include <cstring>
3734 #include <map>
3835 #include <sstream>
3936 #include <string>
4037 #include <vector>
4138
42 #include "base/crash_report_handler.h"
43 #include "base/init.h"
4439 #include "base/number_util.h"
4540 #include "base/singleton.h"
4641 #include "base/system_util.h"
4742 #include "base/util.h"
48
49 DEFINE_string(program_invocation_name, "", "Program name copied from argv[0].");
5043
5144 namespace mozc_flags {
5245 namespace {
258251
259252 } // namespace mozc_flags
260253
261 namespace {
262
263 #ifdef OS_WIN
264 LONG CALLBACK ExitProcessExceptionFilter(
265 EXCEPTION_POINTERS *ExceptionInfo) {
266 // Currently, we haven't found good way to perform both
267 // "send mininump" and "exit the process gracefully".
268 ::ExitProcess(static_cast<UINT>(-1));
269 return EXCEPTION_EXECUTE_HANDLER;
270 }
271 #endif // OS_WIN
272
273 void InitGoogleInternal(const char *argv0,
274 int *argc, char ***argv,
275 bool remove_flags) {
276 mozc_flags::FlagUtil::SetFlag("program_invocation_name", *argv[0]);
277 mozc_flags::ParseCommandLineFlags(argc, argv, remove_flags);
278 if (*argc > 0) {
279 mozc::Logging::InitLogStream((*argv)[0]);
280 } else {
281 mozc::Logging::InitLogStream();
282 }
283
284 mozc::RunInitializers(); // do all static initialization
285 }
286
287 } // namespace
288
289 // not install breakpad
290 // This function is defined in global namespace.
291 void InitGoogle(const char *arg0,
292 int *argc, char ***argv,
293 bool remove_flags) {
294 #ifdef OS_WIN
295 // InitGoogle() is supposed to be used for code generator or
296 // other programs which are not included in the production code.
297 // In these code, we don't want to show any error messages when
298 // exceptions are raised. This is important to keep
299 // our continuous build stable.
300 ::SetUnhandledExceptionFilter(ExitProcessExceptionFilter);
301 #endif // OS_WIN
302
303 InitGoogleInternal(arg0, argc, argv, remove_flags);
304 }
305
3333
3434
3535 #include <string>
36
3637 #include "base/port.h"
3738
3839 namespace mozc_flags {
4849 const void *default_storage,
4950 int shorttpe,
5051 const char *help);
51 virtual ~FlagRegister();
52 ~FlagRegister();
53
5254 private:
5355 Flag *flag_;
5456 };
5557
56 uint32 ParseCommandLineFlags(int *argc, char*** argv,
57 bool remove_flags);
58 uint32 ParseCommandLineFlags(int *argc, char*** argv, bool remove_flags);
59
5860 } // mozc_flags
59
60 void InitGoogle(const char *arg0,
61 int *argc, char ***argv,
62 bool remove_flags);
6361
6462 #define DEFINE_VARIABLE(type, shorttype, name, value, help) \
6563 namespace mozc_flags_fL##shorttype { \
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 #include "base/init_mozc.h"
30
31 #ifdef OS_WIN
32 #include <windows.h>
33 #endif // OS_WIN
34
35 #include "base/flags.h"
36 #include "base/init.h"
37 #include "base/logging.h"
38
39 DEFINE_string(program_invocation_name, "", "Program name copied from argv[0].");
40
41 namespace mozc {
42
43 #ifdef OS_WIN
44 namespace {
45
46 LONG CALLBACK ExitProcessExceptionFilter(EXCEPTION_POINTERS *ExceptionInfo) {
47 // Currently, we haven't found a good way to perform both
48 // "send mininump" and "exit the process gracefully".
49 ::ExitProcess(static_cast<UINT>(-1));
50 return EXCEPTION_EXECUTE_HANDLER;
51 }
52
53 } // namespace
54 #endif // OS_WIN
55
56 void InitMozc(const char *arg0, int *argc, char ***argv, bool remove_flags) {
57 #ifdef OS_WIN
58 // InitMozc() is supposed to be used for code generator or
59 // other programs which are not included in the production code.
60 // In these code, we don't want to show any error messages when
61 // exceptions are raised. This is important to keep
62 // our continuous build stable.
63 ::SetUnhandledExceptionFilter(ExitProcessExceptionFilter);
64 #endif // OS_WIN
65 FLAGS_program_invocation_name = *argv[0];
66 mozc_flags::ParseCommandLineFlags(argc, argv, remove_flags);
67
68 if (*argc > 0) {
69 Logging::InitLogStream((*argv)[0]);
70 } else {
71 Logging::InitLogStream();
72 }
73
74 RunInitializers();
75 }
76
77 } // namespace mozc
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 #ifndef MOZC_BASE_INIT_MOZC_H_
30 #define MOZC_BASE_INIT_MOZC_H_
31
32 namespace mozc {
33
34 // Initializes all the modules, such as flags and logging.
35 void InitMozc(const char *arg0, int *argc, char ***argv, bool remove_flags);
36
37 } // namespace mozc
38
39 #endif // MOZC_BASE_INIT_MOZC_H_
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "base/mac_util.h"
30
3129 #include <string>
3230 #include <vector>
3331
3432 #include "base/flags.h"
33 #include "base/init_mozc.h"
34 #include "base/mac_util.h"
3535 #include "base/util.h"
3636
3737 DEFINE_bool(label_for_suffix, false,
5555 using mozc::MacUtil;
5656
5757 int main(int argc, char **argv) {
58 InitGoogle(argv[0], &argc, &argv, false);
58 mozc::InitMozc(argv[0], &argc, &argv, false);
5959
6060 if (FLAGS_label_for_suffix) {
6161 cout << MacUtil::GetLabelForSuffix(FLAGS_suffix) << endl;
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "base/flags.h"
30 #include "base/init_mozc.h"
31 #include "base/logging.h"
2932 #include "base/password_manager.h"
30
31 #include "base/flags.h"
32 #include "base/logging.h"
3333 #include "base/util.h"
3434
3535 int main(int argc,char **argv) {
36 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3737 string password;
3838 if (!mozc::PasswordManager::GetPassword(&password)) {
3939 LOG(INFO) << "GetPassword failed";
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "base/process.h"
30
3129 #include <string>
3230
3331 #include "base/flags.h"
32 #include "base/init_mozc.h"
3433 #include "base/logging.h"
34 #include "base/process.h"
3535
3636 DEFINE_string(open_browser, "", "URL");
3737 DEFINE_string(spawn_process, "", "path");
3838
3939 int main(int argc, char **argv) {
40 InitGoogle(argv[0], &argc, &argv, false);
40 mozc::InitMozc(argv[0], &argc, &argv, false);
4141 if (!FLAGS_open_browser.empty()) {
4242 if (!mozc::Process::OpenBrowser(FLAGS_open_browser)) {
4343 LOG(INFO) << "Failed to open: " << FLAGS_open_browser;
3434 #include <string>
3535
3636 #include "base/flags.h"
37 #include "base/init_mozc.h"
3738 #include "base/logging.h"
3839
3940 DEFINE_int32(sleep_time, 30, "sleep 30 sec");
4041 DEFINE_string(name, "named_event_test", "name for named event");
4142
4243 int main(int argc, char **argv) {
43 InitGoogle(argv[0], &argc, &argv, false);
44 mozc::InitMozc(argv[0], &argc, &argv, false);
4445
4546 mozc::ProcessMutex mutex(FLAGS_name.c_str());
4647
5151 // return the runlevel of current process
5252 // NOTE:
5353 // DO NOT USE logging library inside this method,
54 // since GetRunLevel() is called before InitGoogle().
54 // since GetRunLevel() is called before mozc::InitMozc().
5555 // Logging stream and flags may not be initialized.
5656 // Also, make sure that the code inside this function
5757 // never raises any exceptions. Exception handler is installed
58 // inside InitGoogle().
58 // inside mozc::InitMozc().
5959 static RunLevelType GetRunLevel(RunLevel::RequestType type);
6060
6161 static bool IsValidClientRunLevel() {
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "base/run_level.h"
30
3129 #include <iostream>
3230 #include <string>
3331 #include <vector>
3432
3533 #include "base/flags.h"
34 #include "base/init_mozc.h"
35 #include "base/run_level.h"
3636
3737 DEFINE_bool(server, false, "server mode");
3838 DEFINE_bool(client, false, "client mode");
4040 // This is a simple command line tool
4141 // too check RunLevel class
4242 int main(int argc, char **argv) {
43 InitGoogle(argv[0], &argc, &argv, false);
43 mozc::InitMozc(argv[0], &argc, &argv, false);
4444
4545 mozc::RunLevel::RequestType type = mozc::RunLevel::SERVER;
4646
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "base/stopwatch.h"
30
29 #include <iostream>
3130 #include <string>
32 #include <iostream>
3331
3432 #include "base/flags.h"
33 #include "base/init_mozc.h"
34 #include "base/stopwatch.h"
3535 #include "base/util.h"
3636
3737 DEFINE_int32(sleep_time, 1000, "sleep time");
3838
3939 int main(int argc, char **argv) {
40 InitGoogle(argv[0], &argc, &argv, false);
40 mozc::InitMozc(argv[0], &argc, &argv, false);
4141
4242 mozc::Stopwatch stopwatch;
4343 stopwatch.Start();
3232 #include "base/double_array.h"
3333 #include "base/file_stream.h"
3434 #include "base/flags.h"
35 #include "base/init_mozc.h"
3536 #include "base/logging.h"
3637 #include "base/util.h"
3738 #include "third_party/darts/v0_32/darts.h"
133134 } // namespace mozc
134135
135136 int main(int argc, char **argv) {
136 InitGoogle(argv[0], &argc, &argv, false);
137 mozc::InitMozc(argv[0], &argc, &argv, false);
137138 mozc::Compile(FLAGS_input, FLAGS_output);
138139 return 0;
139140 }
3939
4040 #include "base/clock.h"
4141 #include "base/flags.h"
42 #include "base/init_mozc.h"
4243 #include "base/logging.h"
4344 #include "base/mutex.h"
4445 #include "base/pepper_file_util.h"
469470 namespace pp {
470471
471472 Module *CreateModule() {
472 // We use dummy argc and argv to call InitGoogle().
473 // We use dummy argc and argv to call mozc::InitMozc().
473474 int argc = 1;
474475 char argv0[] = "NaclModule";
475476 char *argv_body[] = {argv0, NULL};
476477 char **argv = argv_body;
477 InitGoogle(argv[0], &argc, &argv, true);
478 mozc::InitMozc(argv[0], &argc, &argv, true);
478479
479480 return new mozc::session::NaclSessionHandlerModule();
480481 }
3030 #include <cmath>
3131 #include <iostream> // NOLINT
3232 #include <iterator>
33 #include <string>
3334 #include <vector>
34 #include <string>
3535
3636 #include "base/file_stream.h"
3737 #include "base/flags.h"
38 #include "base/init_mozc.h"
3839 #include "base/logging.h"
3940 #include "base/port.h"
4041 #include "base/singleton.h"
364365 } // namespace mozc
365366
366367 int main(int argc, char **argv) {
367 InitGoogle(argv[0], &argc, &argv, false);
368 mozc::InitMozc(argv[0], &argc, &argv, false);
368369
369370 vector<mozc::TestScenarioInterface *> tests;
370371 vector<mozc::Result *> results;
3434
3535 #include "base/file_stream.h"
3636 #include "base/flags.h"
37 #include "base/init_mozc.h"
3738 #include "base/logging.h"
3839 #include "base/multifile.h"
3940 #include "base/port.h"
199200
200201
201202 int main(int argc, char* argv[]) {
202 InitGoogle(argv[0], &argc, &argv, true);
203 mozc::InitMozc(argv[0], &argc, &argv, true);
203204
204205 mozc::client::Client client;
205206 if (!FLAGS_server_path.empty()) {
3838 #include "base/file_stream.h"
3939 #include "base/file_util.h"
4040 #include "base/flags.h"
41 #include "base/init_mozc.h"
4142 #include "base/logging.h"
4243 #include "base/port.h"
4344 #include "base/system_util.h"
168169 } // namespace mozc
169170
170171 int main(int argc, char **argv) {
171 InitGoogle(argv[0], &argc, &argv, false);
172 mozc::InitMozc(argv[0], &argc, &argv, false);
172173
173174 if (!FLAGS_profile_dir.empty()) {
174175 mozc::FileUtil::CreateDirectory(FLAGS_profile_dir);
3939
4040 #include "base/file_stream.h"
4141 #include "base/flags.h"
42 #include "base/init_mozc.h"
4243 #include "base/logging.h"
4344 #include "base/port.h"
4445 #include "base/util.h"
6061 DECLARE_bool(logtostderr);
6162
6263 int main(int argc, char **argv) {
63 InitGoogle(argv[0], &argc, &argv, false);
64 mozc::InitMozc(argv[0], &argc, &argv, false);
6465
6566 FLAGS_logtostderr = true;
6667
2929 #include <iostream> // NOLINT
3030
3131 #include "base/flags.h"
32 #include "base/init_mozc.h"
3233 #include "base/logging.h"
3334 #include "client/client.h"
3435
3536 // Simple command line tool to ping mozc server
3637 int main(int argc, char **argv) {
37 InitGoogle(argv[0], &argc, &argv, false);
38 mozc::InitMozc(argv[0], &argc, &argv, false);
3839 mozc::client::Client client;
3940
4041 if (client.PingServer()) {
2929 #include <iostream> // NOLINT
3030
3131 #include "base/flags.h"
32 #include "base/init_mozc.h"
3233 #include "base/logging.h"
3334 #include "client/client.h"
3435
3738
3839 // simple command line tool to launch mozc server
3940 int main(int argc, char **argv) {
40 InitGoogle(argv[0], &argc, &argv, false);
41 mozc::InitMozc(argv[0], &argc, &argv, false);
4142 mozc::client::Client client;
4243
4344 if (FLAGS_shutdown) {
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "composer/composer.h"
30
3129 #include <iostream> // NOLINT
3230 #include <memory>
3331 #include <string>
3432
3533 #include "base/flags.h"
34 #include "base/init_mozc.h"
35 #include "composer/composer.h"
3636 #include "composer/composition_interface.h"
3737 #include "composer/table.h"
3838 #include "protocol/commands.pb.h"
4444 using ::mozc::commands::Request;
4545
4646 int main(int argc, char **argv) {
47 InitGoogle(argv[0], &argc, &argv, false);
47 mozc::InitMozc(argv[0], &argc, &argv, false);
4848
4949 mozc::composer::Table table;
5050 table.LoadFromFile(FLAGS_table.c_str());
3030 #include <sstream>
3131
3232 #include "base/flags.h"
33 #include "base/init_mozc.h"
3334 #include "composer/internal/composition.h"
3435 #include "composer/table.h"
3536
3839
3940
4041 int main(int argc, char **argv) {
41 InitGoogle(argv[0], &argc, &argv, false);
42 mozc::InitMozc(argv[0], &argc, &argv, false);
4243
4344 mozc::composer::Table table;
4445 table.LoadFromFile(FLAGS_table.c_str());
3030 #include <string>
3131
3232 #include "base/flags.h"
33 #include "base/init_mozc.h"
3334 #include "composer/internal/converter.h"
3435 #include "composer/table.h"
3536
3738 "preedit conversion table file.");
3839
3940 int main(int argc, char **argv) {
40 InitGoogle(argv[0], &argc, &argv, false);
41 mozc::InitMozc(argv[0], &argc, &argv, false);
4142
4243 mozc::composer::Table table;
4344 table.LoadFromFile(FLAGS_table.c_str());
3434
3535 #include "base/file_stream.h"
3636 #include "base/flags.h"
37 #include "base/init_mozc.h"
3738 #include "base/logging.h"
3839 #include "base/number_util.h"
3940 #include "base/port.h"
376377 } // namespace mozc
377378
378379 int main(int argc, char **argv) {
379 InitGoogle(argv[0], &argc, &argv, false);
380 mozc::InitMozc(argv[0], &argc, &argv, false);
380381
381382 if (!FLAGS_user_profile_dir.empty()) {
382383 mozc::SystemUtil::SetUserProfileDirectory(FLAGS_user_profile_dir);
3232 #include <vector>
3333
3434 #include "base/flags.h"
35 #include "base/init_mozc.h"
3536 #include "base/util.h"
3637 #include "converter/quality_regression_util.h"
3738 #include "engine/engine_factory.h"
4445 using mozc::quality_regression::QualityRegressionUtil;
4546
4647 int main(int argc, char **argv) {
47 InitGoogle(argv[0], &argc, &argv, false);
48 mozc::InitMozc(argv[0], &argc, &argv, false);
4849
4950 std::unique_ptr<EngineInterface> engine(EngineFactory::Create());
5051 QualityRegressionUtil util(engine->GetConverter());
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "converter/gen_segmenter_bitarray.h"
3132
3233 namespace {
3637 DEFINE_string(output, "", "header filename for chromeos segmenter");
3738
3839 int main(int argc, char **argv) {
39 InitGoogle(argv[0], &argc, &argv, true);
40 mozc::InitMozc(argv[0], &argc, &argv, true);
4041 mozc::SegmenterBitarrayGenerator::GenerateBitarray(
4142 kLSize, kRSize, &IsBoundaryInternal, FLAGS_output);
4243 return 0;
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "converter/gen_segmenter_bitarray.h"
3132
3233 namespace {
3637 DEFINE_string(output, "", "header filename for google segmenter");
3738
3839 int main(int argc, char **argv) {
39 InitGoogle(argv[0], &argc, &argv, true);
40 mozc::InitMozc(argv[0], &argc, &argv, true);
4041 mozc::SegmenterBitarrayGenerator::GenerateBitarray(
4142 kLSize, kRSize, &IsBoundaryInternal, FLAGS_output);
4243 return 0;
2929 #include <string>
3030
3131 #include "base/flags.h"
32 #include "base/init_mozc.h"
3233 #include "base/logging.h"
3334 #include "base/version.h"
3435 #include "converter/boundary_struct.h"
4243 namespace mozc {
4344 namespace {
4445
46 #include "data_manager/@DIR@/pos_matcher_data.h"
4547 #include "data_manager/@DIR@/user_pos_data.h"
46 #include "data_manager/@DIR@/pos_matcher_data.h"
4748
4849 } // namespace
4950
6162 } // namespace mozc
6263
6364 int main(int argc, char **argv) {
64 InitGoogle(argv[0], &argc, &argv, false);
65 mozc::InitMozc(argv[0], &argc, &argv, false);
6566
6667 if (FLAGS_output.empty()) {
6768 LOG(FATAL) << "output flag is needed";
2929 #include <string>
3030
3131 #include "base/flags.h"
32 #include "base/init_mozc.h"
3233 #include "base/logging.h"
3334 #include "base/version.h"
3435 #include "converter/boundary_struct.h"
3536 #include "data_manager/packed/system_dictionary_data_packer.h"
36 #include "dictionary/suffix_dictionary_token.h"
3737 #include "dictionary/pos_group.h"
3838 #include "dictionary/pos_matcher.h"
39 #include "dictionary/suffix_dictionary_token.h"
3940 #include "dictionary/user_pos.h"
4041 #include "rewriter/correction_rewriter.h"
4142 #include "rewriter/counter_suffix.h"
5253 namespace mozc {
5354 namespace {
5455
55 #include "data_manager/@DIR@/user_pos_data.h"
56 #include "data_manager/@DIR@/boundary_data.h"
57 #include "data_manager/@DIR@/embedded_collocation_data.h"
58 #include "data_manager/@DIR@/embedded_collocation_suppression_data.h"
59 #include "data_manager/@DIR@/embedded_connection_data.h"
60 #include "data_manager/@DIR@/embedded_dictionary_data.h"
61 #include "data_manager/@DIR@/pos_group_data.h"
5662 #include "data_manager/@DIR@/pos_matcher_data.h"
57 #include "data_manager/@DIR@/pos_group_data.h"
58 #include "data_manager/@DIR@/boundary_data.h"
59 #include "data_manager/@DIR@/suffix_data.h"
6063 #include "data_manager/@DIR@/reading_correction_data.h"
6164 #include "data_manager/@DIR@/segmenter_data.h"
62 #include "data_manager/@DIR@/embedded_collocation_suppression_data.h"
65 #include "data_manager/@DIR@/suffix_data.h"
6366 #include "data_manager/@DIR@/suggestion_filter_data.h"
64 #include "data_manager/@DIR@/embedded_connection_data.h"
65 #include "data_manager/@DIR@/embedded_dictionary_data.h"
66 #include "data_manager/@DIR@/embedded_collocation_data.h"
6767 #include "data_manager/@DIR@/symbol_rewriter_data.h"
68 #include "data_manager/@DIR@/user_pos_data.h"
6869 #ifndef NO_USAGE_REWRITER
6970 #include "rewriter/usage_rewriter_data.h"
7071 #endif // NO_USAGE_REWRITER
127128 } // namespace mozc
128129
129130 int main(int argc, char **argv) {
130 InitGoogle(argv[0], &argc, &argv, false);
131 mozc::InitMozc(argv[0], &argc, &argv, false);
131132
132133 if (FLAGS_output.empty()) {
133134 LOG(FATAL) << "output flag is needed";
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "converter/gen_segmenter_bitarray.h"
3132
3233 namespace {
3637 DEFINE_string(output, "", "header filename for mock segmenter");
3738
3839 int main(int argc, char **argv) {
39 InitGoogle(argv[0], &argc, &argv, true);
40 mozc::InitMozc(argv[0], &argc, &argv, true);
4041 mozc::SegmenterBitarrayGenerator::GenerateBitarray(
4142 kLSize, kRSize, &IsBoundaryInternal, FLAGS_output);
4243 return 0;
4040 #include "base/codegen_bytearray_stream.h"
4141 #include "base/file_stream.h"
4242 #include "base/flags.h"
43 #include "base/init_mozc.h"
4344 #include "base/util.h"
4445 #include "data_manager/testing/mock_user_pos_manager.h"
4546 #include "data_manager/user_pos_manager.h"
9293 } // namespace mozc
9394
9495 int main(int argc, char **argv) {
95 InitGoogle(argv[0], &argc, &argv, false);
96 mozc::InitMozc(argv[0], &argc, &argv, false);
9697
9798 string system_dictionary_input, reading_correction_input;
9899 mozc::GetInputFileName(FLAGS_input,
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include <iostream>
2930 #include <string>
30 #include <iostream>
3131
3232 #include "base/flags.h"
33 #include "base/init_mozc.h"
3334 #include "dictionary/user_dictionary_importer.h"
3435 #include "protocol/user_dictionary_storage.pb.h"
3536
3637 int main(int argc, char **argv) {
37 InitGoogle(argv[0], &argc, &argv, false);
38 mozc::InitMozc(argv[0], &argc, &argv, false);
3839
3940 mozc::user_dictionary::UserDictionary user_dic;
4041 mozc::UserDictionaryImporter::ImportFromMSIME(&user_dic);
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunAboutDialog(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunAboutDialog(argc, argv);
3738 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunAdministrationDialog(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunAdministrationDialog(argc, argv);
3738 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunCharacterPalette(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunCharacterPalette(argc, argv);
3738 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunHandWriting(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunHandWriting(argc, argv);
3738 }
2929 // The main function of configure dialog for Mozc.
3030
3131 #include "base/flags.h"
32 #include "base/init_mozc.h"
3233 #include "base/winmain.h"
3334
3435 int RunConfigDialog(int argc, char *argv[]);
3536
3637 int main(int argc, char *argv[]) {
37 InitGoogle(argv[0], &argc, &argv, false);
38 mozc::InitMozc(argv[0], &argc, &argv, false);
3839 return RunConfigDialog(argc, argv);
3940 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunConfirmationDialog(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunConfirmationDialog(argc, argv);
3738 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunDictionaryTool(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunDictionaryTool(argc, argv);
3738 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunErrorMessageDialog(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunErrorMessageDialog(argc, argv);
3738 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunPostInstallDialog(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunPostInstallDialog(argc, argv);
3738 }
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunSetDefaultDialog(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunSetDefaultDialog(argc, argv);
3738 }
4242 #include "base/crash_report_handler.h"
4343 #include "base/file_util.h"
4444 #include "base/flags.h"
45 #include "base/init_mozc.h"
4546 #include "base/logging.h"
4647 #include "base/password_manager.h"
4748 #include "base/run_level.h"
99100 "--fromenv=mode,error_type,confirmation_type,register_prelauncher");
100101 int new_argc = 2;
101102 char **new_argv = tmp.get();
102 InitGoogle(new_argv[0], &new_argc, &new_argv, false);
103 mozc::InitMozc(new_argv[0], &new_argc, &new_argv, false);
103104 delete [] tmp[0];
104105 delete [] tmp[1];
105106 #else // OS_MACOSX
106 InitGoogle(argv[0], &argc, &argv, false);
107 mozc::InitMozc(argv[0], &argc, &argv, false);
107108 #endif // OS_MACOSX
108109
109110 #ifdef OS_MACOSX
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "base/winmain.h"
3132
3233 int RunWordRegisterDialog(int argc, char *argv[]);
3334
3435 int main(int argc, char *argv[]) {
35 InitGoogle(argv[0], &argc, &argv, false);
36 mozc::InitMozc(argv[0], &argc, &argv, false);
3637 return RunWordRegisterDialog(argc, argv);
3738 }
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "ipc/ipc.h"
30
3129 #include <cstring>
3230 #include <iostream> // NOLINT
3331 #include <string>
3432 #include <vector>
3533
3634 #include "base/flags.h"
35 #include "base/init_mozc.h"
3736 #include "base/logging.h"
3837 #include "base/port.h"
3938 #include "base/thread.h"
39 #include "ipc/ipc.h"
4040
4141 DEFINE_string(server_address, "ipc_test", "");
4242 DEFINE_bool(test, false, "automatic test mode");
9595 } // namespace mozc
9696
9797 int main(int argc, char **argv) {
98 InitGoogle(argv[0], &argc, &argv, false);
98 mozc::InitMozc(argv[0], &argc, &argv, false);
9999
100100 if (FLAGS_test) {
101101 mozc::EchoServer con(FLAGS_server_address, 10, 1000);
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "ipc/ipc_path_manager.h"
30
3129 #include <string>
3230
3331 #include "base/flags.h"
32 #include "base/init_mozc.h"
3433 #include "base/logging.h"
3534 #include "base/port.h"
3635 #include "base/util.h"
36 #include "ipc/ipc_path_manager.h"
3737
3838 DEFINE_bool(client, false, "client mode");
3939 DEFINE_bool(server, false, "server mode");
4141
4242 // command line tool to check the behavior of IPCPathManager
4343 int main(int argc, char **argv) {
44 InitGoogle(argv[0], &argc, &argv, false);
44 mozc::InitMozc(argv[0], &argc, &argv, false);
4545
4646 mozc::IPCPathManager *manager =
4747 mozc::IPCPathManager::GetIPCPathManager(FLAGS_name);
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "ipc/named_event.h"
30
3129 #include <string>
3230
3331 #include "base/flags.h"
32 #include "base/init_mozc.h"
3433 #include "base/logging.h"
3534 #include "base/port.h"
35 #include "ipc/named_event.h"
3636
3737 DEFINE_bool(listener, true, "listener mode");
3838 DEFINE_bool(notifier, false, "notifier mode");
4141 DEFINE_string(name, "named_event_test", "name for named event");
4242
4343 int main(int argc, char **argv) {
44 InitGoogle(argv[0], &argc, &argv, false);
44 mozc::InitMozc(argv[0], &argc, &argv, false);
4545
4646 if (FLAGS_notifier) {
4747 mozc::NamedEventNotifier notifier(FLAGS_name.c_str());
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "ipc/process_watch_dog.h"
30
3129 #include <iostream> // NOLINT
3230 #include <string>
3331 #include <vector>
3432
3533 #include "base/flags.h"
34 #include "base/init_mozc.h"
3635 #include "base/logging.h"
3736 #include "base/port.h"
3837 #include "base/util.h"
38 #include "ipc/process_watch_dog.h"
3939
4040 DEFINE_int32(timeout, -1, "set timeout");
4141
4949 } // namespace mozc
5050
5151 int main(int argc, char **argv) {
52 InitGoogle(argv[0], &argc, &argv, false);
52 mozc::InitMozc(argv[0], &argc, &argv, false);
5353
5454 mozc::TestProcessWatchDog dog;
5555
3131 #import "DialogsController.h"
3232
3333 #include "base/flags.h"
34 #include "base/init_mozc.h"
3435
3536 int main(int argc, char *argv[]) {
3637 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
37 InitGoogle(argv[0], &argc, &argv, false);
38 mozc::InitMozc(argv[0], &argc, &argv, false);
3839
3940 DialogsController *dialogs = [[[DialogsController alloc] init] autorelease];
4041 [NSBundle loadNibNamed:@"Dialogs" owner:dialogs];
3838 #include "base/const.h"
3939 #include "base/crash_report_handler.h"
4040 #include "base/flags.h"
41 #include "base/init_mozc.h"
4142 #include "base/logging.h"
4243 #include "base/run_level.h"
4344 #include "client/client.h"
5455 mozc::CrashReportHandler::Initialize(false);
5556 }
5657 #endif
57 InitGoogle(argv[0], &argc, &argv, false);
58 mozc::InitMozc(argv[0], &argc, &argv, false);
5859
5960 IMKServer *imkServer = [GoogleJapaneseInputServer getServer];
6061 if (!imkServer) {
00 MAJOR=2
11 MINOR=17
2 BUILD=2167
2 BUILD=2168
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "net/http_client.h"
30
3129 #include <iostream> // NOLINT
3230 #include <string>
3331
3432 #include "base/file_stream.h"
3533 #include "base/flags.h"
34 #include "base/init_mozc.h"
3635 #include "base/port.h"
36 #include "net/http_client.h"
3737 #include "net/proxy_manager.h"
3838
3939 DEFINE_string(url, "", "url");
4747 DEFINE_bool(use_proxy, true, "use the proxy or not");
4848
4949 int main(int argc, char **argv) {
50 InitGoogle(argv[0], &argc, &argv, false);
50 mozc::InitMozc(argv[0], &argc, &argv, false);
5151
5252 mozc::HTTPClient::Option option;
5353 option.include_header = FLAGS_include_header;
3434 #include "base/file_stream.h"
3535 #include "base/flags.h"
3636 #include "base/hash.h"
37 #include "base/init_mozc.h"
3738 #include "base/logging.h"
3839 #include "base/util.h"
3940 #include "storage/existence_filter.h"
6768 // read per-line word list and generate
6869 // bloom filter in raw byte array or header file format
6970 int main(int argc, char **argv) {
70 InitGoogle(argv[0], &argc, &argv, true);
71 mozc::InitMozc(argv[0], &argc, &argv, true);
7172
7273 if ((FLAGS_input.empty() ||
7374 FLAGS_output.empty()) && argc > 2) {
3434
3535 #include "base/crash_report_handler.h"
3636 #include "base/flags.h"
37 #include "base/init_mozc.h"
3738 #include "base/run_level.h"
3839 #include "base/system_util.h"
3940 #include "base/util.h"
4041 #include "config/stats_config_util.h"
4142
4243 #ifdef OS_WIN
44 #include "base/win_util.h"
4345 #include "base/winmain.h"
44 #include "base/win_util.h"
4546 #include "renderer/win32/win32_server.h"
4647 #elif defined(OS_MACOSX)
48 #include "renderer/mac/CandidateController.h"
4749 #include "renderer/mac/mac_server.h"
4850 #include "renderer/mac/mac_server_send_command.h"
49 #include "renderer/mac/CandidateController.h"
5051 #elif defined(ENABLE_GTK_RENDERER)
5152 #include "renderer/renderer_client.h"
5253 #include "renderer/table_layout.h"
9596 if (mozc::config::StatsConfigUtil::IsEnabled()) {
9697 mozc::CrashReportHandler::Initialize(false);
9798 }
98 InitGoogle(argv[0], &argc, &argv, false);
99 mozc::InitMozc(argv[0], &argc, &argv, false);
99100
100101 int result_code = 0;
101102
4141
4242 #include "base/file_stream.h"
4343 #include "base/flags.h"
44 #include "base/init_mozc.h"
4445 #include "base/logging.h"
4546 #include "rewriter/gen_existence_data.h"
4647
8788 } // namespace mozc
8889
8990 int main(int argc, char *argv[]) {
90 InitGoogle(argv[0], &argc, &argv, true);
91 mozc::InitMozc(argv[0], &argc, &argv, true);
9192
9293 if (FLAGS_collocation_data.empty() && argc > 1) {
9394 FLAGS_collocation_data = argv[1];
4444
4545 #include "base/file_stream.h"
4646 #include "base/flags.h"
47 #include "base/init_mozc.h"
4748 #include "base/logging.h"
4849 #include "base/util.h"
4950 #include "rewriter/gen_existence_data.h"
102103 } // namespace mozc
103104
104105 int main(int argc, char *argv[]) {
105 InitGoogle(argv[0], &argc, &argv, true);
106 mozc::InitMozc(argv[0], &argc, &argv, true);
106107
107108 LOG(INFO) << FLAGS_suppression_data;
108109
3232 // --ordering_rule=ordering_rule_file
3333 // --input=input.tsv --output=output_header
3434
35 #include <algorithm>
3536 #include <climits>
3637 #include <map>
37 #include <vector>
3838 #include <set>
3939 #include <string>
40 #include <algorithm>
40 #include <vector>
4141
4242 #include "base/file_stream.h"
4343 #include "base/file_util.h"
4444 #include "base/flags.h"
45 #include "base/init_mozc.h"
4546 #include "base/logging.h"
4647 #include "base/util.h"
4748 #include "rewriter/dictionary_generator.h"
196197 } // namespace mozc
197198
198199 int main(int argc, char **argv) {
199 InitGoogle(argv[0], &argc, &argv, true);
200 mozc::InitMozc(argv[0], &argc, &argv, true);
200201
201202 if ((FLAGS_input.empty() ||
202203 FLAGS_sorting_table.empty() ||
4141
4242 #include "base/file_stream.h"
4343 #include "base/flags.h"
44 #include "base/init_mozc.h"
4445 #include "base/logging.h"
4546 #include "base/util.h"
4647
292293 } // namespace mozc
293294
294295 int main(int argc, char **argv) {
295 InitGoogle(argv[0], &argc, &argv, true);
296 mozc::InitMozc(argv[0], &argc, &argv, true);
296297 mozc::Convert();
297298 return 0;
298299 }
8585 RewriterInterface() {}
8686 };
8787
88
8988 } // namespace mozc
9089
9190 #endif // MOZC_REWRITER_REWRITER_INTERFACE_H_
4747 #include <vector>
4848
4949 #include "base/flags.h"
50 #include "base/init_mozc.h"
5051 #include "base/number_util.h"
5152 #include "base/singleton.h"
5253 #include "base/system_util.h"
356357 } // namespace mozc
357358
358359 int main(int argc, char *argv[]) {
359 InitGoogle(argv[0], &argc, &argv, false);
360 mozc::InitMozc(argv[0], &argc, &argv, false);
360361
361362 mozc::ScopedWSAData wsadata;
362363
3939 #include "base/crash_report_handler.h"
4040 #include "base/flags.h"
4141 #include "base/init.h"
42 #include "base/init_mozc.h"
4243 #include "base/logging.h"
4344 #include "base/process_mutex.h"
4445 #include "base/run_level.h"
7576
7677 namespace server {
7778
78 void InitGoogleAndMozcServer(const char *arg0,
79 int *argc,
80 char ***argv,
81 bool remove_flags) {
79 void InitMozcAndMozcServer(const char *arg0,
80 int *argc,
81 char ***argv,
82 bool remove_flags) {
8283 mozc::SystemUtil::DisableIME();
8384
8485 // Big endian is not supported. The storage for user history is endian
9192 ::SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY);
9293 #endif
9394
94 // call GetRunLevel before InitGoogle().
95 // InitGoogle() will do all static initialization and may access
95 // call GetRunLevel before mozc::InitMozc().
96 // mozc::InitMozc() will do all static initialization and may access
9697 // local resources.
9798 const mozc::RunLevel::RunLevelType run_level =
9899 mozc::RunLevel::GetRunLevel(mozc::RunLevel::SERVER);
105106 if (mozc::config::StatsConfigUtil::IsEnabled()) {
106107 mozc::CrashReportHandler::Initialize(false);
107108 }
108 InitGoogle(arg0, argc, argv, remove_flags);
109 mozc::InitMozc(arg0, argc, argv, remove_flags);
109110
110111 if (run_level == mozc::RunLevel::RESTRICTED) {
111112 VLOG(1) << "Mozc server starts with timeout mode";
3434 namespace mozc {
3535 namespace server {
3636
37 void InitGoogleAndMozcServer(const char *arg0,
38 int *argc,
39 char ***argv,
40 bool remove_flags);
37 void InitMozcAndMozcServer(const char *arg0,
38 int *argc,
39 char ***argv,
40 bool remove_flags);
4141
4242 class MozcServer {
4343 public:
3131 #include "server/mozc_server.h"
3232
3333 int main(int argc, char* argv[]) {
34 mozc::server::InitGoogleAndMozcServer(argv[0], &argc, &argv, false);
34 mozc::server::InitMozcAndMozcServer(argv[0], &argc, &argv, false);
3535
3636 const int return_value = mozc::server::MozcServer::Run();
3737 mozc::server::MozcServer::Finalize();
3333 #include "base/file_stream.h"
3434 #include "base/file_util.h"
3535 #include "base/flags.h"
36 #include "base/init_mozc.h"
3637 #include "base/logging.h"
3738 #include "base/port.h"
3839 #include "base/system_util.h"
8586 } // namespace mozc
8687
8788 int main(int argc, char **argv) {
88 InitGoogle(argv[0], &argc, &argv, false);
89 mozc::InitMozc(argv[0], &argc, &argv, false);
8990 std::unique_ptr<mozc::InputFileStream> input_file;
9091 std::unique_ptr<mozc::OutputFileStream> output_file;
9192 istream *input = NULL;
3030 #include <cstdio>
3131
3232 #include "base/flags.h"
33 #include "base/init_mozc.h"
3334 #include "protocol/commands.pb.h"
3435 #include "session/session_server.h"
3536
5455 } // namespace mozc
5556
5657 int main(int argc, char **argv) {
57 InitGoogle(argv[0], &argc, &argv, false);
58 mozc::InitMozc(argv[0], &argc, &argv, false);
5859
5960 mozc::SessionServer server;
6061 mozc::commands::Input input;
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "storage/existence_filter.h"
30
3129 #include <string>
3230
3331 #include "base/flags.h"
32 #include "base/init_mozc.h"
3433 #include "base/logging.h"
3534 #include "base/port.h"
3635 #include "base/util.h"
36 #include "storage/existence_filter.h"
3737
3838 using mozc::storage::ExistenceFilter;
3939
4040 int main(int argc, char **argv) {
41 InitGoogle(argv[0], &argc, &argv, false);
41 mozc::InitMozc(argv[0], &argc, &argv, false);
4242
4343 int n = 500;
4444 int m = ExistenceFilter::MinFilterSizeInBytesForErrorRate(0.01, n);
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include <iostream> // NOLINT
30 #include <string>
31
32 #include "base/flags.h"
33 #include "base/init_mozc.h"
34 #include "base/util.h"
2935 #include "storage/lru_cache.h"
3036
31 #include <string>
32 #include <iostream> // NOLINT
33
34 #include "base/flags.h"
35 #include "base/util.h"
36
3737 int main(int argc, char **argv) {
38 InitGoogle(argv[0], &argc, &argv, false);
38 mozc::InitMozc(argv[0], &argc, &argv, false);
3939 mozc::storage::LRUCache<string, string> cache(5);
4040
4141 string line;
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "storage/lru_storage.h"
30
3129 #include <string>
3230
3331 #include "base/logging.h"
3432 #include "base/port.h"
3533 #include "base/util.h"
34 #include "storage/lru_storage.h"
3635
3736 DEFINE_bool(create_db, false, "initialize database");
3837 DEFINE_string(file, "test.db", "");
4140 using mozc::storage::LRUStorage;
4241
4342 int main(int argc, char **argv) {
44 InitGoogle(argv[0], &argc, &argv, false);
43 mozc::InitMozc(argv[0], &argc, &argv, false);
4544
4645 if (FLAGS_create_db) {
4746 CHECK(LRUStorage::CreateStorageFile(
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include "base/flags.h"
30 #include "base/init_mozc.h"
3031 #include "testing/base/public/googletest.h"
3132 #include "testing/base/public/gunit.h"
3233
3940 int main(int argc, char **argv) {
4041 // TODO(yukawa, team): Implement b/2805528 so that you can specify any option
4142 // given by gunit.
42 InitGoogle(argv[0], &argc, &argv, false);
43 mozc::InitMozc(argv[0], &argc, &argv, false);
4344 mozc::InitTestFlags();
4445 testing::InitGoogleTest(&argc, argv);
4546
3939 #include <cstring>
4040 #include <memory>
4141
42 #include "base/port.h"
42 #include "base/init_mozc.h"
4343 #include "base/logging.h"
4444 #include "base/pepper_file_util.h"
45 #include "base/port.h"
4546 #include "net/http_client_pepper.h"
4647 #include "testing/base/public/googletest.h"
4748 #include "testing/base/public/gunit.h"
135136 char argv0[] = "NaclModule";
136137 char *argv_body[] = {argv0, NULL};
137138 char **argv = argv_body;
138 InitGoogle(argv[0], &argc, &argv, true);
139 mozc::InitMozc(argv[0], &argc, &argv, true);
139140 testing::InitGoogleTest(&argc, argv);
140141
141142 return new NaclTestModule();
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "unix/emacs/mozc_emacs_helper_lib.h"
30
3129 #include <cstdio>
3230 #include <iostream>
3331
3432 #include "base/flags.h"
33 #include "base/init_mozc.h"
3534 #include "base/logging.h"
3635 #include "base/protobuf/descriptor.h"
3736 #include "base/protobuf/message.h"
4140 #include "config/config_handler.h"
4241 #include "protocol/commands.pb.h"
4342 #include "unix/emacs/client_pool.h"
43 #include "unix/emacs/mozc_emacs_helper_lib.h"
4444
4545 DEFINE_bool(suppress_stderr, false,
4646 "Discards all the output to stderr.");
126126
127127
128128 int main(int argc, char **argv) {
129 InitGoogle(argv[0], &argc, &argv, true);
129 mozc::InitMozc(argv[0], &argc, &argv, true);
130130 if (FLAGS_suppress_stderr) {
131131 #ifdef OS_WIN
132132 const char path[] = "NUL";
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include <cstddef>
2930 #include <cstdio>
3031
3132 #include "base/flags.h"
33 #include "base/init_mozc.h"
3234 #include "base/logging.h"
3335 #include "base/version.h"
3436 #include "unix/ibus/main.h"
122124 } // namespace
123125
124126 int main(gint argc, gchar **argv) {
125 InitGoogle(argv[0], &argc, &argv, true);
127 mozc::InitMozc(argv[0], &argc, &argv, true);
126128 ibus_init();
127129 InitIBusComponent(FLAGS_ibus);
128130 mozc::ibus::MozcEngine::InitConfig(g_config);
3232
3333 #include "base/crash_report_handler.h"
3434 #include "base/flags.h"
35 #include "base/init_mozc.h"
3536 #include "base/system_util.h"
3637 #ifdef OS_WIN
3738 #include "base/winmain.h"
6061 if (mozc::config::StatsConfigUtil::IsEnabled()) {
6162 mozc::CrashReportHandler::Initialize(false);
6263 }
63 InitGoogle(argv[0], &argc, &argv, false);
64 mozc::InitMozc(argv[0], &argc, &argv, false);
6465
6566 int result = 0;
6667 #ifdef OS_WIN