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

Side by Side Diff: ppapi/proxy/ppb_var_deprecated_proxy.cc

Issue 14273043: ppapi: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.cc ('k') | ppapi/proxy/proxy_completion_callback_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/ppb_var_deprecated_proxy.h" 5 #include "ppapi/proxy/ppb_var_deprecated_proxy.h"
6 6
7 #include <stdlib.h> // For malloc 7 #include <stdlib.h> // For malloc
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // returned (see ipc_sync_channel.cc). In this case, that means it could 385 // returned (see ipc_sync_channel.cc). In this case, that means it could
386 // release the object before it is AddRef'ed on the browser side. 386 // release the object before it is AddRef'ed on the browser side.
387 // To work around this, we post a task here, that will not execute before 387 // To work around this, we post a task here, that will not execute before
388 // control goes back to the main message loop, that will ensure the sync send 388 // control goes back to the main message loop, that will ensure the sync send
389 // has returned and the browser side can take its reference before we Release. 389 // has returned and the browser side can take its reference before we Release.
390 // Note: if the instance is gone by the time the task is executed, then it 390 // Note: if the instance is gone by the time the task is executed, then it
391 // will Release the objects itself and this Release will be a NOOP (aside of a 391 // will Release the objects itself and this Release will be a NOOP (aside of a
392 // spurious warning). 392 // spurious warning).
393 // TODO(piman): See if we can fix the IPC code to enforce strict ordering, and 393 // TODO(piman): See if we can fix the IPC code to enforce strict ordering, and
394 // then remove this. 394 // then remove this.
395 MessageLoop::current()->PostNonNestableTask(FROM_HERE, 395 base::MessageLoop::current()->PostNonNestableTask(
396 FROM_HERE,
396 RunWhileLocked(base::Bind(&PPB_Var_Deprecated_Proxy::DoReleaseObject, 397 RunWhileLocked(base::Bind(&PPB_Var_Deprecated_Proxy::DoReleaseObject,
397 task_factory_.GetWeakPtr(), 398 task_factory_.GetWeakPtr(),
398 object_id))); 399 object_id)));
399 } 400 }
400 401
401 void PPB_Var_Deprecated_Proxy::OnMsgHasProperty( 402 void PPB_Var_Deprecated_Proxy::OnMsgHasProperty(
402 SerializedVarReceiveInput var, 403 SerializedVarReceiveInput var,
403 SerializedVarReceiveInput name, 404 SerializedVarReceiveInput name,
404 SerializedVarOutParam exception, 405 SerializedVarOutParam exception,
405 PP_Bool* result) { 406 PP_Bool* result) {
406 SetAllowPluginReentrancy(); 407 SetAllowPluginReentrancy();
407 *result = PP_FromBool(ppb_var_impl_->HasProperty( 408 *result = PP_FromBool(ppb_var_impl_->HasProperty(
408 var.Get(dispatcher()), 409 var.Get(dispatcher()),
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } 529 }
529 530
530 void PPB_Var_Deprecated_Proxy::DoReleaseObject(int64 object_id) { 531 void PPB_Var_Deprecated_Proxy::DoReleaseObject(int64 object_id) {
531 PP_Var var = { PP_VARTYPE_OBJECT }; 532 PP_Var var = { PP_VARTYPE_OBJECT };
532 var.value.as_id = object_id; 533 var.value.as_id = object_id;
533 ppb_var_impl_->Release(var); 534 ppb_var_impl_->Release(var);
534 } 535 }
535 536
536 } // namespace proxy 537 } // namespace proxy
537 } // namespace ppapi 538 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.cc ('k') | ppapi/proxy/proxy_completion_callback_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698