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

Unified Diff: chrome/renderer/renderer_logging_mac.mm

Issue 155238: Add the page url to plugin crashes to aid debugging. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/renderer_logging_linux.cc ('k') | chrome/renderer/renderer_logging_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/renderer_logging_mac.mm
===================================================================
--- chrome/renderer/renderer_logging_mac.mm (revision 20181)
+++ chrome/renderer/renderer_logging_mac.mm (working copy)
@@ -1,71 +0,0 @@
-// Copyright (c) 2009 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/renderer/renderer_logging.h"
-
-#import <Foundation/Foundation.h>
-
-#include "base/string_util.h"
-#include "googleurl/src/gurl.h"
-#import "chrome/app/breakpad_mac.h"
-
-namespace renderer_logging {
-
-const int kMaxNumCrashURLChunks = 8;
-const int kMaxNumURLChunkValueLength = 255;
-const char *kUrlChunkFormatStr = "url-chunk-%d";
-
-void SetActiveRendererURLImpl(const GURL& url,
- SetCrashKeyValueFuncPtr set_key_func,
- ClearCrashKeyValueFuncPtr clear_key_func) {
-
- NSString *kUrlChunkFormatStr_utf8 = [NSString
- stringWithUTF8String:kUrlChunkFormatStr];
-
- // First remove any old url chunks we might have lying around.
- for (int i = 0; i < kMaxNumCrashURLChunks; i++) {
- // On Windows the url-chunk items are 1-based, so match that.
- NSString *key = [NSString stringWithFormat:kUrlChunkFormatStr_utf8, i+1];
- clear_key_func(key);
- }
-
- const std::string& raw_url_utf8 = url.possibly_invalid_spec();
- NSString *raw_url = [NSString stringWithUTF8String:raw_url_utf8.c_str()];
- size_t raw_url_length = [raw_url length];
-
- // Bail on zero-length URLs.
- if (raw_url_length == 0) {
- return;
- }
-
- // Parcel the URL up into up to 8, 255 byte segments.
- size_t start_ofs = 0;
- for (int i = 0;
- i < kMaxNumCrashURLChunks && start_ofs < raw_url_length;
- ++i) {
-
- // On Windows the url-chunk items are 1-based, so match that.
- NSString *key = [NSString stringWithFormat:kUrlChunkFormatStr_utf8, i+1];
- NSRange range;
- range.location = start_ofs;
- range.length = std::min((size_t)kMaxNumURLChunkValueLength,
- raw_url_length - start_ofs);
- NSString *value = [raw_url substringWithRange:range];
- set_key_func(key, value);
-
- // Next chunk.
- start_ofs += kMaxNumURLChunkValueLength;
- }
-}
-
-void SetActiveRendererURL(const GURL& url) {
- // If Breakpad isn't initialized then bail.
- if (IsCrashReporterDisabled()) {
- return;
- }
-
- SetActiveRendererURLImpl(url, SetCrashKeyValue, ClearCrashKeyValue);
-}
-
-} // namespace renderer_logging
« no previous file with comments | « chrome/renderer/renderer_logging_linux.cc ('k') | chrome/renderer/renderer_logging_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698