Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Side by Side Diff: base/mac/crash_logging.mm

Issue 7849011: Refactor Mac crash key reporting - move to base/mac/crash_logging.{h,mm} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 #include "base/mac/crash_logging.h"
6
7 #import <Foundation/Foundation.h>
8
9 namespace base {
10 namespace mac {
11
12 static SetCrashKeyValueFuncPtr g_set_key_func;
13 static ClearCrashKeyValueFuncPtr g_clear_key_func;
14
15 void SetCrashKeyFunctions(SetCrashKeyValueFuncPtr set_key_func,
16 ClearCrashKeyValueFuncPtr clear_key_func) {
17 g_set_key_func = set_key_func;
18 g_clear_key_func = clear_key_func;
19 }
20
21 void SetCrashKeyValue(NSString* key, NSString* val) {
22 if (g_set_key_func)
23 g_set_key_func(key, val);
24 }
25
26 void ClearCrashKey(NSString* key) {
27 if (g_clear_key_func)
28 g_clear_key_func(key);
29 }
30
31 ScopedCrashKey::ScopedCrashKey(NSString* key, NSString* value)
32 : crash_key_([key retain]) {
33 if (g_set_key_func)
34 g_set_key_func(crash_key_, value);
35 }
36
37 ScopedCrashKey::~ScopedCrashKey() {
38 if (g_clear_key_func)
39 g_clear_key_func(crash_key_);
40 }
41
42 } // namespace mac
43 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698