OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 // RenderView navigated, and |view_count| is the number of RenderViews in | 375 // RenderView navigated, and |view_count| is the number of RenderViews in |
376 // this process. | 376 // this process. |
377 void RenderViewNavigatedToHost(const std::string& host, size_t view_count); | 377 void RenderViewNavigatedToHost(const std::string& host, size_t view_count); |
378 | 378 |
379 // Used for customizing some histograms if all RenderViews share the same | 379 // Used for customizing some histograms if all RenderViews share the same |
380 // host. Returns the current custom histogram name to use for | 380 // host. Returns the current custom histogram name to use for |
381 // |histogram_name|, or |histogram_name| if it shouldn't be customized. | 381 // |histogram_name|, or |histogram_name| if it shouldn't be customized. |
382 std::string ConvertToCustomHistogramName(const char* histogram_name) const; | 382 std::string ConvertToCustomHistogramName(const char* histogram_name) const; |
383 | 383 |
384 private: | 384 private: |
| 385 FRIEND_TEST_ALL_PREFIXES(RenderThreadImplUnittest, |
| 386 IdentifyAlexaTop10NonGoogleSite); |
385 friend class RenderThreadImplUnittest; | 387 friend class RenderThreadImplUnittest; |
386 | 388 |
| 389 // Converts a host name to a suffix for histograms |
| 390 std::string HostToCustomHistogramSuffix(const std::string& host); |
| 391 |
| 392 // Helper function to identify a certain set of top pages |
| 393 bool IsAlexaTop10NonGoogleSite(const std::string& host); |
| 394 |
387 // Used for updating the information on which is the common host which all | 395 // Used for updating the information on which is the common host which all |
388 // RenderView's share (if any). If there is no common host, this function is | 396 // RenderView's share (if any). If there is no common host, this function is |
389 // called with an empty string. | 397 // called with an empty string. |
390 void SetCommonHost(const std::string& host); | 398 void SetCommonHost(const std::string& host); |
391 | 399 |
392 // The current common host of the RenderViews; empty string if there is no | 400 // The current common host of the RenderViews; empty string if there is no |
393 // common host. | 401 // common host. |
394 std::string common_host_; | 402 std::string common_host_; |
395 // The corresponding suffix. | 403 // The corresponding suffix. |
396 std::string common_host_histogram_suffix_; | 404 std::string common_host_histogram_suffix_; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 674 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
667 }; | 675 }; |
668 | 676 |
669 #if defined(COMPILER_MSVC) | 677 #if defined(COMPILER_MSVC) |
670 #pragma warning(pop) | 678 #pragma warning(pop) |
671 #endif | 679 #endif |
672 | 680 |
673 } // namespace content | 681 } // namespace content |
674 | 682 |
675 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 683 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
OLD | NEW |