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

Unified Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 16256018: Update content/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrectly modified code 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_plugin/browser_plugin_embedder.cc
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc
index ba8b10a0d2f34ce1f5508d1dcdc005a3003c2585..fd79974e2e4a3e10b3f60b98cf05333d772aa779 100644
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc
@@ -48,7 +48,7 @@ void BrowserPluginEmbedder::DragEnteredGuest(BrowserPluginGuest* guest) {
void BrowserPluginEmbedder::DragLeftGuest(BrowserPluginGuest* guest) {
// Avoid race conditions in switching between guests being hovered over by
// only un-setting if the caller is marked as the guest being dragged over.
- if (guest_dragging_over_ == guest) {
+ if (guest_dragging_over_.get() == guest) {
guest_dragging_over_.reset();
}
}
@@ -58,7 +58,7 @@ void BrowserPluginEmbedder::StartDrag(BrowserPluginGuest* guest) {
}
void BrowserPluginEmbedder::StopDrag(BrowserPluginGuest* guest) {
- if (guest_started_drag_ == guest) {
+ if (guest_started_drag_.get() == guest) {
guest_started_drag_.reset();
}
}
@@ -100,7 +100,7 @@ bool BrowserPluginEmbedder::OnMessageReceived(const IPC::Message& message) {
void BrowserPluginEmbedder::DragSourceEndedAt(int client_x, int client_y,
int screen_x, int screen_y, WebKit::WebDragOperation operation) {
- if (guest_started_drag_) {
+ if (guest_started_drag_.get()) {
gfx::Point guest_offset =
guest_started_drag_->GetScreenCoordinates(gfx::Point());
guest_started_drag_->DragSourceEndedAt(client_x - guest_offset.x(),
@@ -110,7 +110,7 @@ void BrowserPluginEmbedder::DragSourceEndedAt(int client_x, int client_y,
void BrowserPluginEmbedder::DragSourceMovedTo(int client_x, int client_y,
int screen_x, int screen_y) {
- if (guest_started_drag_) {
+ if (guest_started_drag_.get()) {
gfx::Point guest_offset =
guest_started_drag_->GetScreenCoordinates(gfx::Point());
guest_started_drag_->DragSourceMovedTo(client_x - guest_offset.x(),
@@ -119,14 +119,15 @@ void BrowserPluginEmbedder::DragSourceMovedTo(int client_x, int client_y,
}
void BrowserPluginEmbedder::SystemDragEnded() {
- if (guest_started_drag_ && (guest_started_drag_ != guest_dragging_over_))
+ if (guest_started_drag_.get() &&
+ (guest_started_drag_.get() != guest_dragging_over_.get()))
guest_started_drag_->EndSystemDrag();
guest_started_drag_.reset();
guest_dragging_over_.reset();
}
void BrowserPluginEmbedder::OnUpdateDragCursor(bool* handled) {
- *handled = (guest_dragging_over_ != NULL);
+ *handled = (guest_dragging_over_.get() != NULL);
}
void BrowserPluginEmbedder::CleanUp() {
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698