Commit 114290f6 authored by raymes's avatar raymes Committed by Commit bot

Take useful code out of DCHECKS in mime_handler_view_guest.cc

A mistake I've made in the past! Not sure if it's possible to test this code
in release builds.

BUG=303491

Review URL: https://codereview.chromium.org/547283002

Cr-Commit-Position: refs/heads/master@{#293751}
parent 7510b835
...@@ -55,9 +55,9 @@ void MimeHandlerViewGuest::CreateWebContents( ...@@ -55,9 +55,9 @@ void MimeHandlerViewGuest::CreateWebContents(
const base::DictionaryValue& create_params, const base::DictionaryValue& create_params,
const WebContentsCreatedCallback& callback) { const WebContentsCreatedCallback& callback) {
std::string orig_mime_type; std::string orig_mime_type;
DCHECK( bool success =
create_params.GetString(mime_handler_view::kMimeType, &orig_mime_type) && create_params.GetString(mime_handler_view::kMimeType, &orig_mime_type);
!orig_mime_type.empty()); DCHECK(success && !orig_mime_type.empty());
std::string guest_site_str; std::string guest_site_str;
// Note that we put a prefix "mime-" before the mime type so that this // Note that we put a prefix "mime-" before the mime type so that this
// can never collide with an extension ID. // can never collide with an extension ID.
...@@ -85,8 +85,8 @@ void MimeHandlerViewGuest::CreateWebContents( ...@@ -85,8 +85,8 @@ void MimeHandlerViewGuest::CreateWebContents(
void MimeHandlerViewGuest::DidAttachToEmbedder() { void MimeHandlerViewGuest::DidAttachToEmbedder() {
std::string src; std::string src;
DCHECK(attach_params()->GetString(mime_handler_view::kSrc, &src) && bool success = attach_params()->GetString(mime_handler_view::kSrc, &src);
!src.empty()); DCHECK(success && !src.empty());
web_contents()->GetController().LoadURL( web_contents()->GetController().LoadURL(
GURL(src), GURL(src),
content::Referrer(), content::Referrer(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment