OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
6 | 6 |
7 #include <v8.h> | 7 #include <v8.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 std::set<std::string> active_extensions; | 498 std::set<std::string> active_extensions; |
499 user_script_slave_->GetActiveExtensions(&active_extensions); | 499 user_script_slave_->GetActiveExtensions(&active_extensions); |
500 ExtensionProcessBindings::GetActiveExtensions(&active_extensions); | 500 ExtensionProcessBindings::GetActiveExtensions(&active_extensions); |
501 child_process_logging::SetActiveExtensions(active_extensions); | 501 child_process_logging::SetActiveExtensions(active_extensions); |
502 } | 502 } |
503 | 503 |
504 static void* CreateHistogram( | 504 static void* CreateHistogram( |
505 const char *name, int min, int max, size_t buckets) { | 505 const char *name, int min, int max, size_t buckets) { |
506 if (min <= 0) | 506 if (min <= 0) |
507 min = 1; | 507 min = 1; |
508 scoped_refptr<Histogram> histogram = | 508 scoped_refptr<Histogram> histogram = Histogram::FactoryGet( |
509 Histogram::HistogramFactoryGet(name, min, max, buckets); | 509 name, min, max, buckets, Histogram::kUmaTargetedHistogramFlag); |
510 // We verify this was not being destructed by setting a novel "PlannedLeak" | |
511 // flag and watching out for the flag in the destructor. | |
512 histogram->SetFlags(kUmaTargetedHistogramFlag | kPlannedLeakFlag); | |
513 // We'll end up leaking these histograms, unless there is some code hiding in | 510 // We'll end up leaking these histograms, unless there is some code hiding in |
514 // there to do the dec-ref. | 511 // there to do the dec-ref. |
| 512 // TODO(jar): Handle reference counting in webkit glue. |
515 histogram->AddRef(); | 513 histogram->AddRef(); |
516 return histogram.get(); | 514 return histogram.get(); |
517 } | 515 } |
518 | 516 |
519 static void AddHistogramSample(void* hist, int sample) { | 517 static void AddHistogramSample(void* hist, int sample) { |
520 Histogram* histogram = static_cast<Histogram *>(hist); | 518 Histogram* histogram = static_cast<Histogram *>(hist); |
521 histogram->Add(sample); | 519 histogram->Add(sample); |
522 } | 520 } |
523 | 521 |
524 void RenderThread::EnsureWebKitInitialized() { | 522 void RenderThread::EnsureWebKitInitialized() { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 spellchecker_->EnableAutoSpellCorrect(auto_spell_correct); | 733 spellchecker_->EnableAutoSpellCorrect(auto_spell_correct); |
736 } | 734 } |
737 | 735 |
738 void RenderThread::OnSpellCheckWordAdded(const std::string& word) { | 736 void RenderThread::OnSpellCheckWordAdded(const std::string& word) { |
739 spellchecker_->WordAdded(word); | 737 spellchecker_->WordAdded(word); |
740 } | 738 } |
741 | 739 |
742 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { | 740 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { |
743 spellchecker_->EnableAutoSpellCorrect(enable); | 741 spellchecker_->EnableAutoSpellCorrect(enable); |
744 } | 742 } |
OLD | NEW |