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

Side by Side Diff: chrome/common/child_process_logging_win.cc

Issue 448006: Revert 33255 - Report active extensions in crash reports. This only implement... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years 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
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 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 #include "chrome/common/child_process_logging.h" 5 #include "chrome/common/child_process_logging.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/app/breakpad_win.h"
11 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
12 #include "chrome/installer/util/google_update_settings.h" 11 #include "chrome/installer/util/google_update_settings.h"
13 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
14 13
15 namespace child_process_logging { 14 namespace child_process_logging {
16 // exported in breakpad_win.cc: void __declspec(dllexport) __cdecl SetActiveURL. 15 // exported in breakpad_win.cc: void __declspec(dllexport) __cdecl SetActiveURL.
17 typedef void (__cdecl *MainSetActiveURL)(const wchar_t*); 16 typedef void (__cdecl *MainSetActiveURL)(const wchar_t*);
18 17
19 // exported in breakpad_win.cc: void __declspec(dllexport) __cdecl SetClientId. 18 // exported in breakpad_win.cc: void __declspec(dllexport) __cdecl SetClientId.
20 typedef void (__cdecl *MainSetClientId)(const wchar_t*); 19 typedef void (__cdecl *MainSetClientId)(const wchar_t*);
21 20
22 // exported in breakpad_win.cc:
23 // void __declspec(dllexport) __cdecl SetExtensionID.
24 typedef void (__cdecl *MainSetExtensionID)(size_t, const wchar_t*);
25
26 void SetActiveURL(const GURL& url) { 21 void SetActiveURL(const GURL& url) {
27 static MainSetActiveURL set_active_url = NULL; 22 static MainSetActiveURL set_active_url = NULL;
28 // note: benign race condition on set_active_url. 23 // note: benign race condition on set_active_url.
29 if (!set_active_url) { 24 if (!set_active_url) {
30 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); 25 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
31 if (!exe_module) 26 if (!exe_module)
32 return; 27 return;
33 set_active_url = reinterpret_cast<MainSetActiveURL>( 28 set_active_url = reinterpret_cast<MainSetActiveURL>(
34 GetProcAddress(exe_module, "SetActiveURL")); 29 GetProcAddress(exe_module, "SetActiveURL"));
35 if (!set_active_url) 30 if (!set_active_url)
(...skipping 23 matching lines...) Expand all
59 if (!exe_module) 54 if (!exe_module)
60 return; 55 return;
61 set_client_id = reinterpret_cast<MainSetClientId>( 56 set_client_id = reinterpret_cast<MainSetClientId>(
62 GetProcAddress(exe_module, "SetClientId")); 57 GetProcAddress(exe_module, "SetClientId"));
63 if (!set_client_id) 58 if (!set_client_id)
64 return; 59 return;
65 } 60 }
66 (set_client_id)(wstr.c_str()); 61 (set_client_id)(wstr.c_str());
67 } 62 }
68 63
69 void SetActiveExtensions(const std::vector<std::string>& extension_ids) {
70 static MainSetExtensionID set_extension_id = NULL;
71 if (!set_extension_id) {
72 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
73 if (!exe_module)
74 return;
75 set_extension_id = reinterpret_cast<MainSetExtensionID>(
76 GetProcAddress(exe_module, "SetExtensionID"));
77 if (!set_extension_id)
78 return;
79 }
80
81 for (size_t i = 0; i < kMaxReportedActiveExtensions; ++i) {
82 if (i < extension_ids.size())
83 (set_extension_id)(i, ASCIIToWide(extension_ids[i].c_str()).c_str());
84 else
85 (set_extension_id)(i, L"");
86 }
87 }
88
89 } // namespace child_process_logging 64 } // namespace child_process_logging
OLDNEW
« no previous file with comments | « chrome/common/child_process_logging_mac.mm ('k') | chrome/renderer/extensions/extension_process_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698