diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-16 03:30:09 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-16 03:30:09 +0000 |
commit | 937365f442a193e0b212fc670ef306ea08c4bef7 (patch) | |
tree | 138db84548c632efab9135b5e89db7ea45e2214e /chrome | |
parent | c31130204459b6c4392ebca7f80cdb49fb04114b (diff) | |
download | chromium_src-937365f442a193e0b212fc670ef306ea08c4bef7.zip chromium_src-937365f442a193e0b212fc670ef306ea08c4bef7.tar.gz chromium_src-937365f442a193e0b212fc670ef306ea08c4bef7.tar.bz2 |
Revert "[Mac] Breakpad key to help track web-drag crash."
Unfortunately, clang complained.
Original CL http://codereview.chromium.org/6861004/
http://src.chromium.org/viewvc/chrome?view=rev&revision=81855
BUG=78782
TBR=rsesek@chromium.org
TEST=waterfall
Review URL: http://codereview.chromium.org/6870024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/scoped_crash_key_mac.h | 32 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_application_mac.mm | 19 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm | 15 | ||||
-rw-r--r-- | chrome/chrome_dll.gypi | 1 |
4 files changed, 19 insertions, 48 deletions
diff --git a/chrome/app/scoped_crash_key_mac.h b/chrome/app/scoped_crash_key_mac.h deleted file mode 100644 index 3eedc0b..0000000 --- a/chrome/app/scoped_crash_key_mac.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2011 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. - -#ifndef CHROME_APP_SCOPED_CRASH_KEY_MAC_H_ -#define CHROME_APP_SCOPED_CRASH_KEY_MAC_H_ -#pragma once - -#import <Foundation/Foundation.h> - -#import "base/memory/scoped_nsobject.h" -#import "chrome/app/breakpad_mac.h" - -// This helper can be used to add additional breakpad keys when some -// code is known to crash. It should only be used when more -// traditional debugging has not been able to reproduce the problem. - -class ScopedCrashKey { - public: - ScopedCrashKey(NSString* key, NSString* value) - : crash_key_([key retain]) { - SetCrashKeyValue(crash_key_.get(), value); - } - ~ScopedCrashKey() { - ClearCrashKeyValue(crash_key_.get()); - } - - private: - scoped_nsobject<NSString> crash_key_; -}; - -#endif // CHROME_APP_SCOPED_CRASH_KEY_MAC_H_ diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm index 0c2ac3c..8e605ee 100644 --- a/chrome/browser/chrome_browser_application_mac.mm +++ b/chrome/browser/chrome_browser_application_mac.mm @@ -8,7 +8,7 @@ #import "base/metrics/histogram.h" #import "base/memory/scoped_nsobject.h" #import "base/sys_string_conversions.h" -#import "chrome/app/scoped_crash_key_mac.h" +#import "chrome/app/breakpad_mac.h" #import "chrome/browser/app_controller_mac.h" #import "chrome/browser/ui/cocoa/objc_method_swizzle.h" #import "chrome/browser/ui/cocoa/objc_zombie.h" @@ -178,6 +178,23 @@ void CancelTerminate() { namespace { +// Helper to make it easy to get crash keys right. +// TODO(shess): Find a better home for this. app/breakpad_mac.h +// doesn't work. +class ScopedCrashKey { + public: + ScopedCrashKey(NSString* key, NSString* value) + : crash_key_([key retain]) { + SetCrashKeyValue(crash_key_.get(), value); + } + ~ScopedCrashKey() { + ClearCrashKeyValue(crash_key_.get()); + } + + private: + scoped_nsobject<NSString> crash_key_; +}; + // Do-nothing wrapper so that we can arrange to only swizzle // -[NSException raise] when DCHECK() is turned on (as opposed to // replicating the preprocess logic which turns DCHECK() on). diff --git a/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm b/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm index 0a883df..a655473 100644 --- a/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm +++ b/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -10,9 +10,7 @@ #include "base/sys_string_conversions.h" #include "base/task.h" #include "base/threading/thread.h" -#include "base/threading/thread_restrictions.h" #include "base/utf_string_conversions.h" -#import "chrome/app/scoped_crash_key_mac.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_util.h" @@ -42,12 +40,6 @@ NSString* const kNSURLTitlePboardType = @"public.url-name"; // TODO(viettrungluu): Refactor to make it common across platforms, // and move it somewhere sensible. FilePath GetFileNameFromDragData(const WebDropData& drop_data) { - // Set a breakpad key for the scope of this function to help debug - // http://crbug.com/78782 - static NSString* const kUrlKey = @"drop_data_url"; - NSString* value = SysUTF8ToNSString(drop_data.url.spec()); - ScopedCrashKey key(kUrlKey, value); - // Images without ALT text will only have a file extension so we need to // synthesize one from the provided extension and URL. FilePath file_name([SysUTF16ToNSString(drop_data.file_description_filename) @@ -315,11 +307,6 @@ void PromiseWriterTask::Run() { GetFileNameFromDragData(*dropData_) : downloadFileName_; FilePath filePath(SysNSStringToUTF8(path)); filePath = filePath.Append(fileName); - - // CreateFileStreamForDrop() will call file_util::PathExists(), - // which is blocking. Since this operation is already blocking the - // UI thread on OSX, it should be reasonable to let it happen. - base::ThreadRestrictions::ScopedAllowIO allow_io; FileStream* fileStream = drag_download_util::CreateFileStreamForDrop(&filePath); if (!fileStream) diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index 1057a1f..e8a7fa1 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -179,7 +179,6 @@ 'app/chrome_main_app_mode_mac.mm', 'app/chrome_main_mac.mm', 'app/chrome_main_posix.cc', - 'app/scoped_crash_key_mac.h', ], 'include_dirs': [ '<(grit_out_dir)', |