OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_RENDERER_RENDERER_LOGGING_H_ | |
6 #define CHROME_RENDERER_RENDERER_LOGGING_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "googleurl/src/gurl.h" | |
10 | |
11 namespace renderer_logging { | |
12 | |
13 // Sets the URL that is logged if the renderer crashes. Use GURL() to clear | |
14 // the URL. | |
15 void SetActiveRendererURL(const GURL& url); | |
16 | |
17 // Simple wrapper class that sets the active rendering URL in it's constructor | |
18 // and clears the active rendering URL in the destructor. | |
19 class ScopedActiveRenderingURLSetter { | |
20 public: | |
21 explicit ScopedActiveRenderingURLSetter(const GURL& url) { | |
22 SetActiveRendererURL(url); | |
23 } | |
24 | |
25 ~ScopedActiveRenderingURLSetter() { | |
26 SetActiveRendererURL(GURL()); | |
27 } | |
28 | |
29 private: | |
30 DISALLOW_COPY_AND_ASSIGN(ScopedActiveRenderingURLSetter); | |
31 }; | |
32 | |
33 } // namespace renderer_logging | |
34 | |
35 #if defined(OS_MACOSX) && __OBJC__ | |
36 // Exported for testing purposes. | |
37 | |
38 @class NSString; | |
39 | |
40 typedef void (*SetCrashKeyValueFuncPtr)(NSString*, NSString*); | |
41 typedef void (*ClearCrashKeyValueFuncPtr)(NSString*); | |
42 | |
43 namespace renderer_logging { | |
44 void SetActiveRendererURLImpl(const GURL& url, | |
45 SetCrashKeyValueFuncPtr set_key_func, | |
46 ClearCrashKeyValueFuncPtr clear_key_func); | |
47 | |
48 extern const int kMaxNumCrashURLChunks; | |
49 extern const int kMaxNumURLChunkValueLength; | |
50 extern const char *kUrlChunkFormatStr; | |
51 } // namespace renderer_logging | |
52 | |
53 #endif // defined(OS_MACOSX) && __OBJC__ | |
54 | |
55 #endif // CHROME_RENDERER_RENDERER_LOGGING_H_ | |
OLD | NEW |