Chromium Code Reviews| Index: components/dom_distiller/core/page_distiller.cc |
| diff --git a/components/dom_distiller/core/page_distiller.cc b/components/dom_distiller/core/page_distiller.cc |
| index db941ab011fc04c6dd4dcf2c8e938c0f244f3231..cf94ec117c9d6a2aa858185b6edff4fe9c71656d 100644 |
| --- a/components/dom_distiller/core/page_distiller.cc |
| +++ b/components/dom_distiller/core/page_distiller.cc |
| @@ -63,6 +63,7 @@ void PageDistiller::OnExecuteJavaScriptDone(const GURL& page_url, |
| scoped_ptr<DistilledPageInfo> page_info(new DistilledPageInfo()); |
| std::string result; |
| const base::ListValue* result_list = NULL; |
| + bool found_content = false; |
| if (!value->GetAsList(&result_list)) { |
| base::MessageLoop::current()->PostTask( |
| FROM_HERE, |
| @@ -83,6 +84,7 @@ void PageDistiller::OnExecuteJavaScriptDone(const GURL& page_url, |
| break; |
| case 1: |
| page_info->html = item; |
| + found_content = true; |
| break; |
| case 2: |
| page_info->next_page_url = item; |
| @@ -91,12 +93,17 @@ void PageDistiller::OnExecuteJavaScriptDone(const GURL& page_url, |
| page_info->prev_page_url = item; |
| break; |
| default: |
| - page_info->image_urls.push_back(item); |
| + GURL unvalidated_gurl(item); |
| + if (!unvalidated_gurl.is_empty() && unvalidated_gurl.is_valid()) { |
|
kuan
2014/03/26 13:07:48
no need to check for is_empty; as per gurl.h, empt
Yaron
2014/03/26 17:31:50
Done.
cjhopman
2014/03/27 00:22:39
Is a patchset missing? This is still checking is_e
Yaron
2014/04/02 17:11:58
Done.
|
| + page_info->image_urls.push_back(item); |
| + } |
| } |
| } |
| base::MessageLoop::current()->PostTask( |
| FROM_HERE, |
| - base::Bind(page_distiller_callback_, base::Passed(&page_info), true)); |
| + base::Bind(page_distiller_callback_, |
| + base::Passed(&page_info), |
| + found_content)); |
| } |
| } |