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

Unified Diff: trunk/src/content/renderer/pepper/pepper_browser_connection.cc

Issue 23647008: Revert 221284 "Pepper: Move FileRef to the "new" resource proxy." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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
Index: trunk/src/content/renderer/pepper/pepper_browser_connection.cc
===================================================================
--- trunk/src/content/renderer/pepper/pepper_browser_connection.cc (revision 221543)
+++ trunk/src/content/renderer/pepper/pepper_browser_connection.cc (working copy)
@@ -36,6 +36,7 @@
OnMsgCreateResourceHostsFromHostReply)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
return handled;
}
@@ -73,6 +74,16 @@
nested_msgs));
}
+void PepperBrowserConnection::SendBrowserFileRefGetInfo(
+ int child_process_id,
+ const std::vector<PP_Resource>& resources,
+ const FileRefGetInfoCallback& callback) {
+ int32_t sequence_number = GetNextSequence();
+ get_info_map_[sequence_number] = callback;
+ Send(new PpapiHostMsg_FileRef_GetInfoForRenderer(
+ routing_id(), child_process_id, sequence_number, resources));
+}
+
void PepperBrowserConnection::OnMsgCreateResourceHostsFromHostReply(
int32_t sequence_number,
const std::vector<int>& pending_resource_host_ids) {
@@ -88,6 +99,25 @@
}
}
+void PepperBrowserConnection::OnMsgFileRefGetInfoReply(
+ int32_t sequence_number,
+ const std::vector<PP_Resource>& resources,
+ const std::vector<PP_FileSystemType>& types,
+ const std::vector<std::string>& file_system_url_specs,
+ const std::vector<base::FilePath>& external_paths) {
+ // Check that the message is destined for the plugin this object is associated
+ // with.
+ std::map<int32_t, FileRefGetInfoCallback>::iterator it =
+ get_info_map_.find(sequence_number);
+ if (it != get_info_map_.end()) {
+ FileRefGetInfoCallback callback = it->second;
+ get_info_map_.erase(it);
+ callback.Run(resources, types, file_system_url_specs, external_paths);
+ } else {
+ NOTREACHED();
+ }
+}
+
int32_t PepperBrowserConnection::GetNextSequence() {
// Return the value with wraparound, making sure we don't make a sequence
// number with a 0 ID. Note that signed wraparound is undefined in C++ so we

Powered by Google App Engine
This is Rietveld 408576698