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

Unified Diff: content/child/resource_dispatcher.cc

Issue 242103007: NOT FOR REVIEW - prioritize fonts Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 | « content/child/resource_dispatcher.h ('k') | content/content_renderer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index b6a877fa65d5f8b9b91658ac2d14d5e01bb74680..a14c80bfab1473cedc3cdd1271dd35be9dfced9b 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -277,6 +277,22 @@ ResourceDispatcher::~ResourceDispatcher() {
// ResourceDispatcher implementation ------------------------------------------
+bool ResourceDispatcher::IsPendingRequestFontType(const IPC::Message& message) {
+ if (!IsResourceDispatcherMessage(message))
+ return false;
+
+ int request_id;
+
+ PickleIterator iter(message);
+ if (!message.ReadInt(&iter, &request_id)) {
+ NOTREACHED() << "malformed resource message";
+ return false;
+ }
+
+ base::AutoLock lock(font_lock_);
+ return font_requests_.find(request_id) != font_requests_.end();
+}
+
bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) {
if (!IsResourceDispatcherMessage(message)) {
return false;
@@ -566,6 +582,12 @@ int ResourceDispatcher::AddPendingRequest(RequestPeer* callback,
int id = MakeRequestID();
pending_requests_[id] = PendingRequestInfo(
callback, resource_type, origin_pid, frame_origin, request_url);
+ {
+ if (resource_type == ResourceType::FONT_RESOURCE) {
+ base::AutoLock lock(font_lock_);
+ font_requests_.insert(id);
+ }
+ }
return id;
}
@@ -575,6 +597,12 @@ bool ResourceDispatcher::RemovePendingRequest(int request_id) {
return false;
PendingRequestInfo& request_info = it->second;
+
+ {
+ base::AutoLock lock(font_lock_);
+ font_requests_.erase(request_id);
+ }
+
ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue);
pending_requests_.erase(it);
« no previous file with comments | « content/child/resource_dispatcher.h ('k') | content/content_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698