diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-17 00:34:38 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-17 00:34:38 +0000 |
commit | 9db9c91eb1db09e024449309f0383932eb69a0ed (patch) | |
tree | 4795a8031a5a9e8646fa7b9c7402b5c5daaf4e62 /chrome_frame/test | |
parent | 88dcdb78847445fb487e849d987c15694cf109cb (diff) | |
download | chromium_src-9db9c91eb1db09e024449309f0383932eb69a0ed.zip chromium_src-9db9c91eb1db09e024449309f0383932eb69a0ed.tar.gz chromium_src-9db9c91eb1db09e024449309f0383932eb69a0ed.tar.bz2 |
base: Split logging functions and PerfTimeLogger out of perftimer.h
Soon PerfTimer will move into base/timer/ directory as it is already used by
production code.
This splits the logging stuff into their owns files and also moves
PerfTimeLogger into its own files.
BUG=None
TEST=base_unittests, ipc_perftests, etc...
R=brettw@chromium.org
Review URL: https://chromiumcodereview.appspot.com/23985006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r-- | chrome_frame/test/perf/chrome_frame_perftest.cc | 12 | ||||
-rw-r--r-- | chrome_frame/test/perf/chrome_frame_perftest.h | 4 | ||||
-rw-r--r-- | chrome_frame/test/perf/silverlight.cc | 22 |
3 files changed, 23 insertions, 15 deletions
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc index c12c2c9..31f9ac1 100644 --- a/chrome_frame/test/perf/chrome_frame_perftest.cc +++ b/chrome_frame/test/perf/chrome_frame_perftest.cc @@ -1,6 +1,7 @@ // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. + #include "chrome_frame/test/perf/chrome_frame_perftest.h" #include <atlhost.h> @@ -21,6 +22,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/perf_time_logger.h" #include "base/test/test_file_util.h" #include "base/threading/platform_thread.h" #include "base/time/time.h" @@ -230,8 +232,8 @@ class ChromeFrameActiveXContainerPerf : public ChromeFrameActiveXContainer { ChromeFrameActiveXContainerPerf() {} void CreateControl(bool setup_event_sinks) { - perf_initialize_.reset(new PerfTimeLogger("Fully initialized")); - PerfTimeLogger perf_create("Create Control"); + perf_initialize_.reset(new base::PerfTimeLogger("Fully initialized")); + base::PerfTimeLogger perf_create("Create Control"); HRESULT hr = chromeview_.CreateControl(L"ChromeTab.ChromeFrame"); EXPECT_HRESULT_SUCCEEDED(hr); @@ -272,11 +274,11 @@ class ChromeFrameActiveXContainerPerf : public ChromeFrameActiveXContainer { virtual void BeforeNavigateImpl(const char* url ) { std::string test_name = "Navigate "; test_name += url; - perf_navigate_.reset(new PerfTimeLogger(test_name.c_str())); + perf_navigate_.reset(new base::PerfTimeLogger(test_name.c_str())); } - scoped_ptr<PerfTimeLogger> perf_initialize_; - scoped_ptr<PerfTimeLogger> perf_navigate_; + scoped_ptr<base::PerfTimeLogger> perf_initialize_; + scoped_ptr<base::PerfTimeLogger> perf_navigate_; }; // This class provides common functionality which can be used for most of the diff --git a/chrome_frame/test/perf/chrome_frame_perftest.h b/chrome_frame/test/perf/chrome_frame_perftest.h index 8209846..4fb979c 100644 --- a/chrome_frame/test/perf/chrome_frame_perftest.h +++ b/chrome_frame/test/perf/chrome_frame_perftest.h @@ -1,10 +1,11 @@ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. + #ifndef CHROME_FRAME_TEST_PERF_CHROME_FRAME_PERFTEST_H_ #define CHROME_FRAME_TEST_PERF_CHROME_FRAME_PERFTEST_H_ + #include <atlbase.h> -#include "base/test/perftimer.h" #include "testing/gtest/include/gtest/gtest.h" class SimpleModule : public CAtlExeModuleT<SimpleModule> { @@ -16,4 +17,5 @@ class SimpleModule : public CAtlExeModuleT<SimpleModule> { _pAtlModule = NULL; } }; + #endif // CHROME_FRAME_TEST_PERF_CHROME_FRAME_PERFTEST_H_ diff --git a/chrome_frame/test/perf/silverlight.cc b/chrome_frame/test/perf/silverlight.cc index 6ce7a0e..9fb164a 100644 --- a/chrome_frame/test/perf/silverlight.cc +++ b/chrome_frame/test/perf/silverlight.cc @@ -6,6 +6,7 @@ #include <atlwin.h> #include <atlhost.h> +#include "base/test/perf_time_logger.h" #include "base/win/scoped_comptr.h" #include "chrome_frame/test/perf/chrome_frame_perftest.h" @@ -73,13 +74,16 @@ class IXcpControlHostImpl : public IXcpControlHost { // Silverlight container. Supports do-nothing implementation of IXcpControlHost. // Should be extended to do some real movie-or-something download. -class SilverlightContainer : - public IServiceProviderImpl<SilverlightContainer>, - public IXcpControlHostImpl, - public CWindowImpl<SilverlightContainer, CWindow, CWinTraits< - WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, - WS_EX_APPWINDOW | WS_EX_WINDOWEDGE> >, - public CComObjectRootEx<CComSingleThreadModel> { +class SilverlightContainer + : public IServiceProviderImpl<SilverlightContainer>, + public IXcpControlHostImpl, + public CWindowImpl< + SilverlightContainer, + CWindow, + CWinTraits<WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CLIPSIBLINGS, + WS_EX_APPWINDOW | WS_EX_WINDOWEDGE> >, + public CComObjectRootEx<CComSingleThreadModel> { public: DECLARE_WND_CLASS_EX(L"Silverlight_container", 0, 0) BEGIN_COM_MAP(SilverlightContainer) @@ -141,7 +145,7 @@ TEST(ChromeFramePerf, DISABLED_HostSilverlight2) { CComObjectStackEx<SilverlightContainer> wnd; RECT rc = {0, 0, 800, 600}; wnd.CreateWndAndHost(&rc); - PerfTimeLogger perf_create("Create Silverlight Control2"); + base::PerfTimeLogger perf_create("Create Silverlight Control2"); wnd.CreateControl(); perf_create.Done(); wnd.DestroyWindow(); @@ -153,7 +157,7 @@ TEST(ChromeFramePerf, DISABLED_HostSilverlight) { AtlAxWinInit(); CAxWindow host; RECT rc = {0, 0, 800, 600}; - PerfTimeLogger perf_create("Create Silverlight Control"); + base::PerfTimeLogger perf_create("Create Silverlight Control"); host.Create(NULL, rc, L"AgControl.AgControl", WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE); |