| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/nacl/renderer/nexe_load_manager.h" | 5 #include "components/nacl/renderer/nexe_load_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 init_time_ = base::Time::Now(); | 412 init_time_ = base::Time::Now(); |
| 413 | 413 |
| 414 for (size_t i = 0; i < argc; ++i) { | 414 for (size_t i = 0; i < argc; ++i) { |
| 415 std::string name(argn[i]); | 415 std::string name(argn[i]); |
| 416 std::string value(argv[i]); | 416 std::string value(argv[i]); |
| 417 args_[name] = value; | 417 args_[name] = value; |
| 418 } | 418 } |
| 419 | 419 |
| 420 // Store mime_type_ at initialization time since we make it lowercase. | 420 // Store mime_type_ at initialization time since we make it lowercase. |
| 421 mime_type_ = StringToLowerASCII(LookupAttribute(args_, kTypeAttribute)); | 421 mime_type_ = StringToLowerASCII(LookupAttribute(args_, kTypeAttribute)); |
| 422 |
| 423 #if defined(OS_MACOSX) |
| 424 // TODO(kochi): For crbug.com/102808, this is a stopgap solution for Lion |
| 425 // until we expose IME API to .nexe. This disables any IME interference |
| 426 // against key inputs, so you cannot use off-the-spot IME input for NaCl |
| 427 // apps. |
| 428 // This makes discrepancy among platforms and therefore we should remove |
| 429 // this hack when IME API is made available. |
| 430 // The default for non-Mac platforms is still off-the-spot IME mode. |
| 431 plugin_instance_->SetTextInputType(ui::TEXT_INPUT_TYPE_NONE); |
| 432 #endif // defined(OS_MACOSX) |
| 422 } | 433 } |
| 423 | 434 |
| 424 void NexeLoadManager::ReportStartupOverhead() const { | 435 void NexeLoadManager::ReportStartupOverhead() const { |
| 425 base::TimeDelta overhead = base::Time::Now() - init_time_; | 436 base::TimeDelta overhead = base::Time::Now() - init_time_; |
| 426 HistogramStartupTimeMedium( | 437 HistogramStartupTimeMedium( |
| 427 "NaCl.Perf.StartupTime.NaClOverhead", overhead, nexe_size_); | 438 "NaCl.Perf.StartupTime.NaClOverhead", overhead, nexe_size_); |
| 428 } | 439 } |
| 429 | 440 |
| 430 bool NexeLoadManager::RequestNaClManifest(const std::string& url, | 441 bool NexeLoadManager::RequestNaClManifest(const std::string& url, |
| 431 bool* is_data_uri) { | 442 bool* is_data_uri) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // to provide error handling. | 536 // to provide error handling. |
| 526 } | 537 } |
| 527 | 538 |
| 528 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { | 539 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { |
| 529 base::StringTokenizer t(crash_log, "\n"); | 540 base::StringTokenizer t(crash_log, "\n"); |
| 530 while (t.GetNext()) | 541 while (t.GetNext()) |
| 531 LogToConsole(t.token()); | 542 LogToConsole(t.token()); |
| 532 } | 543 } |
| 533 | 544 |
| 534 } // namespace nacl | 545 } // namespace nacl |
| OLD | NEW |