summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/tab_contents
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 04:10:50 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 04:10:50 +0000
commita359a5c1f988d3fd438d4f8931175b96c1ea092d (patch)
treef2952912a58aae1672f4422aa6f0e1d1a0758994 /chrome/browser/ui/cocoa/tab_contents
parent71d25564754fa5c49acdd9730ae4996daff097b4 (diff)
downloadchromium_src-a359a5c1f988d3fd438d4f8931175b96c1ea092d.zip
chromium_src-a359a5c1f988d3fd438d4f8931175b96c1ea092d.tar.gz
chromium_src-a359a5c1f988d3fd438d4f8931175b96c1ea092d.tar.bz2
[Mac] Breakpad key to help track web-drag crash.
BUG=78782 TEST=Monitor crashes. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=81855 Review URL: http://codereview.chromium.org/6861004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/tab_contents')
-rw-r--r--chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm15
1 files changed, 14 insertions, 1 deletions
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 a655473..98cee59 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) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -10,7 +10,9 @@
#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/breakpad_mac.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/download/download_util.h"
@@ -40,6 +42,12 @@ 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)
@@ -307,6 +315,11 @@ 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 allowIO;
FileStream* fileStream =
drag_download_util::CreateFileStreamForDrop(&filePath);
if (!fileStream)