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

Unified Diff: ppapi/proxy/serialized_var.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « ppapi/proxy/serialized_var.h ('k') | ppapi/proxy/var_serialization_rules.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/serialized_var.cc
===================================================================
--- ppapi/proxy/serialized_var.cc (revision 71973)
+++ ppapi/proxy/serialized_var.cc (working copy)
@@ -225,9 +225,9 @@
SerializedVarSendInput::SerializedVarSendInput(Dispatcher* dispatcher,
const PP_Var& var)
- : SerializedVar(dispatcher->serialization_rules(), var) {
- dispatcher->serialization_rules()->SendCallerOwned(var,
- inner_->GetStringPtr());
+ : SerializedVar(dispatcher->serialization_rules()) {
+ inner_->SetVar(dispatcher->serialization_rules()->SendCallerOwned(
+ var, inner_->GetStringPtr()));
}
// static
@@ -237,9 +237,10 @@
std::vector<SerializedVar>* output) {
output->resize(input_count);
for (size_t i = 0; i < input_count; i++) {
- (*output)[i] = SerializedVar(dispatcher->serialization_rules(), input[i]);
- dispatcher->serialization_rules()->SendCallerOwned(
- input[i], (*output)[i].inner_->GetStringPtr());
+ SerializedVar& cur = (*output)[i];
+ cur = SerializedVar(dispatcher->serialization_rules());
+ cur.inner_->SetVar(dispatcher->serialization_rules()->SendCallerOwned(
+ input[i], cur.inner_->GetStringPtr()));
}
}
@@ -251,7 +252,7 @@
PP_Var ReceiveSerializedVarReturnValue::Return(Dispatcher* dispatcher) {
inner_->set_serialization_rules(dispatcher->serialization_rules());
inner_->SetVar(inner_->serialization_rules()->ReceivePassRef(
- inner_->GetIncompleteVar(), inner_->GetString()));
+ inner_->GetIncompleteVar(), inner_->GetString(), dispatcher));
return inner_->GetVar();
}
@@ -260,6 +261,7 @@
ReceiveSerializedException::ReceiveSerializedException(Dispatcher* dispatcher,
PP_Var* exception)
: SerializedVar(dispatcher->serialization_rules()),
+ dispatcher_(dispatcher),
exception_(exception) {
}
@@ -268,7 +270,7 @@
// When an output exception is specified, it will take ownership of the
// reference.
inner_->SetVar(inner_->serialization_rules()->ReceivePassRef(
- inner_->GetIncompleteVar(), inner_->GetString()));
+ inner_->GetIncompleteVar(), inner_->GetString(), dispatcher_));
*exception_ = inner_->GetVar();
} else {
// When no output exception is specified, the browser thinks we have a ref
@@ -342,7 +344,8 @@
serialized_.inner_->SetVar(
serialized_.inner_->serialization_rules()->BeginReceiveCallerOwned(
serialized_.inner_->GetIncompleteVar(),
- serialized_.inner_->GetStringPtr()));
+ serialized_.inner_->GetStringPtr(),
+ dispatcher));
return serialized_.inner_->GetVar();
}
@@ -372,7 +375,8 @@
serialized_[i].inner_->SetVar(
serialized_[i].inner_->serialization_rules()->BeginReceiveCallerOwned(
serialized_[i].inner_->GetIncompleteVar(),
- serialized_[i].inner_->GetStringPtr()));
+ serialized_[i].inner_->GetStringPtr(),
+ dispatcher));
deserialized_[i] = serialized_[i].inner_->GetVar();
}
@@ -390,14 +394,14 @@
const PP_Var& var) {
serialized_->inner_->set_serialization_rules(
dispatcher->serialization_rules());
- serialized_->inner_->SetVar(var);
// Var must clean up after our BeginSendPassRef call.
serialized_->inner_->set_cleanup_mode(SerializedVar::END_SEND_PASS_REF);
- dispatcher->serialization_rules()->BeginSendPassRef(
- serialized_->inner_->GetIncompleteVar(),
- serialized_->inner_->GetStringPtr());
+ serialized_->inner_->SetVar(
+ dispatcher->serialization_rules()->BeginSendPassRef(
+ var,
+ serialized_->inner_->GetStringPtr()));
}
// SerializedVarOutParam -------------------------------------------------------
@@ -411,9 +415,9 @@
if (serialized_->inner_->serialization_rules()) {
// When unset, OutParam wasn't called. We'll just leave the var untouched
// in that case.
- serialized_->inner_->SetVar(writable_var_);
- serialized_->inner_->serialization_rules()->BeginSendPassRef(
- writable_var_, serialized_->inner_->GetStringPtr());
+ serialized_->inner_->SetVar(
+ serialized_->inner_->serialization_rules()->BeginSendPassRef(
+ writable_var_, serialized_->inner_->GetStringPtr()));
// Normally the current object will be created on the stack to wrap a
// SerializedVar and won't have a scope around the actual IPC send. So we
« no previous file with comments | « ppapi/proxy/serialized_var.h ('k') | ppapi/proxy/var_serialization_rules.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698