[sql] Remove _HAS_EXCEPTIONS=0 from build info.
[chromium-blink-merge.git] / chrome / browser / net / net_error_diagnostics_dialog_mac.cc
blobe83329dcab78a218fa1b8f015504885fcd6b61da
1 // Copyright 2015 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.
5 #include "chrome/browser/net/net_error_diagnostics_dialog.h"
7 #include <CoreFoundation/CoreFoundation.h>
8 #include <CoreServices/CoreServices.h>
10 #include "base/logging.h"
11 #include "base/mac/scoped_cftyperef.h"
12 #include "base/strings/sys_string_conversions.h"
13 #include "url/gurl.h"
15 void ShowNetworkDiagnosticsDialogMac(content::WebContents* web_contents,
16 const GURL& failed_url) {
17 base::ScopedCFTypeRef<CFStringRef> url_string_ref(
18 base::SysUTF8ToCFStringRef(failed_url.spec()));
19 base::ScopedCFTypeRef<CFURLRef> url_ref(
20 CFURLCreateWithString(kCFAllocatorDefault, url_string_ref.get(),
21 nullptr));
22 if (!url_ref.get())
23 return;
25 base::ScopedCFTypeRef<CFNetDiagnosticRef> diagnostic_ref(
26 CFNetDiagnosticCreateWithURL(kCFAllocatorDefault, url_ref.get()));
27 if (!diagnostic_ref.get())
28 return;
30 CFNetDiagnosticDiagnoseProblemInteractively(diagnostic_ref.get());