| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 uint32_t argc, const char* argn[], const char* argv[]) { | 315 uint32_t argc, const char* argn[], const char* argv[]) { |
| 316 init_time_ = base::Time::Now(); | 316 init_time_ = base::Time::Now(); |
| 317 | 317 |
| 318 for (size_t i = 0; i < argc; ++i) { | 318 for (size_t i = 0; i < argc; ++i) { |
| 319 std::string name(argn[i]); | 319 std::string name(argn[i]); |
| 320 std::string value(argv[i]); | 320 std::string value(argv[i]); |
| 321 args_[name] = value; | 321 args_[name] = value; |
| 322 } | 322 } |
| 323 | 323 |
| 324 // Store mime_type_ at initialization time since we make it lowercase. | 324 // Store mime_type_ at initialization time since we make it lowercase. |
| 325 mime_type_ = StringToLowerASCII(LookupAttribute(args_, kTypeAttribute)); | 325 mime_type_ = base::StringToLowerASCII(LookupAttribute(args_, kTypeAttribute)); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void NexeLoadManager::ReportStartupOverhead() const { | 328 void NexeLoadManager::ReportStartupOverhead() const { |
| 329 base::TimeDelta overhead = base::Time::Now() - init_time_; | 329 base::TimeDelta overhead = base::Time::Now() - init_time_; |
| 330 HistogramStartupTimeMedium( | 330 HistogramStartupTimeMedium( |
| 331 "NaCl.Perf.StartupTime.NaClOverhead", overhead, nexe_size_); | 331 "NaCl.Perf.StartupTime.NaClOverhead", overhead, nexe_size_); |
| 332 } | 332 } |
| 333 | 333 |
| 334 bool NexeLoadManager::RequestNaClManifest(const std::string& url) { | 334 bool NexeLoadManager::RequestNaClManifest(const std::string& url) { |
| 335 if (plugin_base_url_.is_valid()) { | 335 if (plugin_base_url_.is_valid()) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // to provide error handling. | 417 // to provide error handling. |
| 418 } | 418 } |
| 419 | 419 |
| 420 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { | 420 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { |
| 421 base::StringTokenizer t(crash_log, "\n"); | 421 base::StringTokenizer t(crash_log, "\n"); |
| 422 while (t.GetNext()) | 422 while (t.GetNext()) |
| 423 LogToConsole(t.token()); | 423 LogToConsole(t.token()); |
| 424 } | 424 } |
| 425 | 425 |
| 426 } // namespace nacl | 426 } // namespace nacl |
| OLD | NEW |