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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 726343002: OOP PDF: Add whether a resource is embedded to StreamInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@embedded-pdfs
Patch Set: address comment Created 6 years, 1 month 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
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index 6188b5e7ae01d74f95374f8834e4f1b2f2131d99..5bdadad5096d7611992a888bae1725873a7ae1eb 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -176,7 +176,8 @@ void SendExecuteMimeTypeHandlerEvent(scoped_ptr<content::StreamInfo> stream,
int render_process_id,
int render_view_id,
const std::string& extension_id,
- const std::string& view_id) {
+ const std::string& view_id,
+ bool embedded) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
content::WebContents* web_contents =
@@ -199,9 +200,9 @@ void SendExecuteMimeTypeHandlerEvent(scoped_ptr<content::StreamInfo> stream,
StreamsPrivateAPI* streams_private = StreamsPrivateAPI::Get(profile);
if (!streams_private)
return;
- streams_private->ExecuteMimeTypeHandler(
- extension_id, web_contents, stream.Pass(), view_id,
- expected_content_size);
+ streams_private->ExecuteMimeTypeHandler(extension_id, web_contents,
+ stream.Pass(), view_id,
+ expected_content_size, embedded);
}
#endif // !defined(ENABLE_EXTENSIONS)
@@ -631,12 +632,13 @@ void ChromeResourceDispatcherHostDelegate::OnStreamCreated(
std::map<net::URLRequest*, StreamTargetInfo>::iterator ix =
stream_target_info_.find(request);
CHECK(ix != stream_target_info_.end());
+ bool embedded = info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME;
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream),
- request->GetExpectedContentSize(),
- info->GetChildID(), info->GetRouteID(),
- ix->second.extension_id, ix->second.view_id));
+ request->GetExpectedContentSize(), info->GetChildID(),
+ info->GetRouteID(), ix->second.extension_id,
+ ix->second.view_id, embedded));
stream_target_info_.erase(request);
#endif
}
« no previous file with comments | « chrome/browser/extensions/api/streams_private/streams_private_api.cc ('k') | chrome/browser/resources/pdf/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698