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

Unified Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc

Issue 547283002: Take useful code out of DCHECKS in mime_handler_view_guest.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 41e076000f5b74660cef82ba4fa8b7c978f51ee4..3a31d102b16b98af427e4c97e14961a9b1c1b514 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -55,9 +55,9 @@ void MimeHandlerViewGuest::CreateWebContents(
const base::DictionaryValue& create_params,
const WebContentsCreatedCallback& callback) {
std::string orig_mime_type;
- DCHECK(
- create_params.GetString(mime_handler_view::kMimeType, &orig_mime_type) &&
- !orig_mime_type.empty());
+ bool success =
+ create_params.GetString(mime_handler_view::kMimeType, &orig_mime_type);
+ DCHECK(success && !orig_mime_type.empty());
std::string guest_site_str;
// Note that we put a prefix "mime-" before the mime type so that this
// can never collide with an extension ID.
@@ -85,8 +85,8 @@ void MimeHandlerViewGuest::CreateWebContents(
void MimeHandlerViewGuest::DidAttachToEmbedder() {
std::string src;
- DCHECK(attach_params()->GetString(mime_handler_view::kSrc, &src) &&
- !src.empty());
+ bool success = attach_params()->GetString(mime_handler_view::kSrc, &src);
+ DCHECK(success && !src.empty());
web_contents()->GetController().LoadURL(
GURL(src),
content::Referrer(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698