Commit a9b08ccb authored by dcarney@chromium.org's avatar dcarney@chromium.org

remove remaining calls to old style MakeWeak

R=jochen@chromium.org
TBR=jamesr@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/15952012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202980 0039d316-1c4b-4281-b951-d872f2087c98
parent b37916c9
......@@ -164,10 +164,9 @@ class ExtensionImpl : public extensions::ChromeV8Extension {
};
static void GCCallback(v8::Isolate* isolate,
v8::Persistent<v8::Value> object,
void* parameter) {
v8::Persistent<v8::Object>* object,
GCCallbackArgs* args) {
v8::HandleScope handle_scope;
GCCallbackArgs* args = static_cast<GCCallbackArgs*>(parameter);
v8::Handle<v8::Context> context = args->callback->CreationContext();
v8::Context::Scope context_scope(context);
WebKit::WebScopedMicrotaskSuppression suppression;
......
......@@ -45,7 +45,9 @@ class ScopedPersistent {
return handle_;
}
void MakeWeak(void* parameters, v8::NearDeathCallback callback) {
template<typename P>
void MakeWeak(P* parameters,
typename v8::WeakReferenceCallbacks<T, P>::Revivable callback) {
handle_.MakeWeak(GetIsolate(handle_), parameters, callback);
}
......
......@@ -1013,14 +1013,13 @@ void BrowserPlugin::PersistRequestObject(
std::make_pair(id, new_item));
CHECK(result.second); // Inserted in the map.
AliveV8PermissionRequestItem* request_item = result.first->second;
weak_request.MakeWeak(isolate, request_item, WeakCallbackForPersistObject);
weak_request.MakeWeak(
isolate, static_cast<void*>(request_item), WeakCallbackForPersistObject);
}
// static
void BrowserPlugin::WeakCallbackForPersistObject(
v8::Isolate* isolate, v8::Persistent<v8::Value> object, void* param) {
v8::Persistent<v8::Object> persistent_object =
v8::Persistent<v8::Object>::Cast(object);
v8::Isolate* isolate, v8::Persistent<v8::Value>* object, void* param) {
AliveV8PermissionRequestItem* item_ptr =
static_cast<AliveV8PermissionRequestItem*>(param);
......@@ -1028,8 +1027,7 @@ void BrowserPlugin::WeakCallbackForPersistObject(
base::WeakPtr<BrowserPlugin> plugin = item_ptr->second;
delete item_ptr;
persistent_object.Dispose(isolate);
persistent_object.Clear();
object->Dispose();
if (plugin) {
// Asynchronously remove item from |alive_v8_permission_request_objects_|.
......
......@@ -328,7 +328,7 @@ class CONTENT_EXPORT BrowserPlugin :
void OnRequestObjectGarbageCollected(int request_id);
// V8 garbage collection callback for |object|.
static void WeakCallbackForPersistObject(v8::Isolate* isolate,
v8::Persistent<v8::Value> object,
v8::Persistent<v8::Value>* object,
void* param);
// IPC message handlers.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment