OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 TEST_SHELL_DEVTOOLS_CALLARGS_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_DEVTOOLS_CALLARGS_H_ |
6 #define TEST_SHELL_DEVTOOLS_CALLARGS_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_DEVTOOLS_CALLARGS_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
11 | 11 |
12 class TestShellDevToolsCallArgs { | 12 class TestShellDevToolsCallArgs { |
13 public: | 13 public: |
14 TestShellDevToolsCallArgs(const WebKit::WebString& data) | 14 explicit TestShellDevToolsCallArgs(const WebKit::WebString& data); |
15 : data_(data) { | |
16 ++calls_count_; | |
17 } | |
18 | 15 |
19 TestShellDevToolsCallArgs(const TestShellDevToolsCallArgs& args) | 16 TestShellDevToolsCallArgs(const TestShellDevToolsCallArgs& args); |
20 : data_(args.data_) { | |
21 ++calls_count_; | |
22 } | |
23 | 17 |
24 ~TestShellDevToolsCallArgs() { | 18 ~TestShellDevToolsCallArgs(); |
25 --calls_count_; | |
26 DCHECK(calls_count_ >= 0); | |
27 } | |
28 | 19 |
29 static int calls_count() { return calls_count_; } | 20 static int calls_count() { return calls_count_; } |
30 | 21 |
31 WebKit::WebString data_; | 22 WebKit::WebString data_; |
32 | 23 |
33 private: | 24 private: |
34 static int calls_count_; | 25 static int calls_count_; |
35 }; | 26 }; |
36 | 27 |
37 #endif // TEST_SHELL_DEVTOOLS_CALLARGS_H_ | 28 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_DEVTOOLS_CALLARGS_H_ |
OLD | NEW |