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

Unified Diff: ppapi/native_client/src/trusted/plugin/plugin.cc

Issue 8951014: Change the DidChangeView update to take a new ViewChanged resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New patch Created 9 years 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: ppapi/native_client/src/trusted/plugin/plugin.cc
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 9fb83560e75a17896b443c3456734b3f43dd07ae..97fbc736d7fcd983e6285cec102b447ec9eb2fe5 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -992,8 +992,6 @@ Plugin::Plugin(PP_Instance pp_instance)
last_error_string_(""),
ppapi_proxy_(NULL),
enable_dev_interfaces_(false),
- replayDidChangeView(false),
- replayHandleDocumentLoad(false),
init_time_(0),
ready_time_(0),
nexe_size_(0),
@@ -1071,19 +1069,16 @@ Plugin::~Plugin() {
}
-void Plugin::DidChangeView(const pp::Rect& position, const pp::Rect& clip) {
+void Plugin::DidChangeView(const pp::View& view) {
PLUGIN_PRINTF(("Plugin::DidChangeView (this=%p)\n",
static_cast<void*>(this)));
if (!BrowserPpp::is_valid(ppapi_proxy_)) {
// Store this event and replay it when the proxy becomes available.
- replayDidChangeView = true;
- replayDidChangeViewPosition = position;
- replayDidChangeViewClip = clip;
- return;
+ view_to_replay_ = view;
} else {
ppapi_proxy_->ppp_instance_interface()->DidChangeView(
- pp_instance(), &(position.pp_rect()), &(clip.pp_rect()));
+ pp_instance(), view.pp_resource());
dmichael (off chromium) 2011/12/20 19:01:34 Wait, I thought you needed to pass the resource as
brettw 2011/12/21 23:55:29 This is on the browser side. Everything about NaCl
}
}
@@ -1091,9 +1086,7 @@ void Plugin::DidChangeView(const pp::Rect& position, const pp::Rect& clip) {
void Plugin::DidChangeFocus(bool has_focus) {
PLUGIN_PRINTF(("Plugin::DidChangeFocus (this=%p)\n",
static_cast<void*>(this)));
- if (!BrowserPpp::is_valid(ppapi_proxy_)) {
- return;
- } else {
+ if (BrowserPpp::is_valid(ppapi_proxy_)) {
ppapi_proxy_->ppp_instance_interface()->DidChangeFocus(
pp_instance(), PP_FromBool(has_focus));
}
@@ -1121,8 +1114,7 @@ bool Plugin::HandleDocumentLoad(const pp::URLLoader& url_loader) {
static_cast<void*>(this)));
if (!BrowserPpp::is_valid(ppapi_proxy_)) {
// Store this event and replay it when the proxy becomes available.
- replayHandleDocumentLoad = true;
- replayHandleDocumentLoadURLLoader = url_loader;
+ document_load_to_replay_ = url_loader;
// Return true so that the browser keeps servicing this loader so we can
// perform requests on it later.
return true;
@@ -1412,15 +1404,13 @@ bool Plugin::StartProxiedExecution(NaClSrpcChannel* srpc_channel,
zoom_adapter_.reset(new(std::nothrow) ZoomAdapter(this));
// Replay missed events.
- if (replayDidChangeView) {
- replayDidChangeView = false;
- DidChangeView(replayDidChangeViewPosition, replayDidChangeViewClip);
- }
- if (replayHandleDocumentLoad) {
- replayHandleDocumentLoad = false;
- HandleDocumentLoad(replayHandleDocumentLoadURLLoader);
- // Release our reference on this loader.
- replayHandleDocumentLoadURLLoader = pp::URLLoader();
+ if (!view_to_replay_.is_null()) {
+ DidChangeView(view_to_replay_);
+ view_to_replay_ = pp::View();
+ }
+ if (!document_load_to_replay_.is_null()) {
+ HandleDocumentLoad(document_load_to_replay_);
+ document_load_to_replay_ = pp::URLLoader();
}
bool is_valid_proxy = BrowserPpp::is_valid(ppapi_proxy_);
PLUGIN_PRINTF(("Plugin::StartProxiedExecution (is_valid_proxy=%d)\n",

Powered by Google App Engine
This is Rietveld 408576698