Index: content/renderer/browser_plugin/browser_plugin.cc |
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc |
index a7c0c7125d0aee08180bada2dbf98229c91be878..758de690c51d1332986af11328ea58eab833495c 100644 |
--- a/content/renderer/browser_plugin/browser_plugin.cc |
+++ b/content/renderer/browser_plugin/browser_plugin.cc |
@@ -997,14 +997,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); |
@@ -1012,8 +1011,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_|. |