OLD | NEW |
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 "content/browser/renderer_host/render_widget_helper.h" | 5 #include "content/browser/renderer_host/render_widget_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 RenderWidgetHelper::BackingStoreMsgProxy::BackingStoreMsgProxy( | 56 RenderWidgetHelper::BackingStoreMsgProxy::BackingStoreMsgProxy( |
57 RenderWidgetHelper* h, const IPC::Message& m) | 57 RenderWidgetHelper* h, const IPC::Message& m) |
58 : helper_(h), | 58 : helper_(h), |
59 message_(m), | 59 message_(m), |
60 cancelled_(false) { | 60 cancelled_(false) { |
61 } | 61 } |
62 | 62 |
63 RenderWidgetHelper::BackingStoreMsgProxy::~BackingStoreMsgProxy() { | 63 RenderWidgetHelper::BackingStoreMsgProxy::~BackingStoreMsgProxy() { |
64 // If the paint message was never dispatched, then we need to let the | 64 // If the paint message was never dispatched, then we need to let the |
65 // helper know that we are going away. | 65 // helper know that we are going away. |
66 if (!cancelled_ && helper_) | 66 if (!cancelled_ && helper_.get()) |
67 helper_->OnDiscardBackingStoreMsg(this); | 67 helper_->OnDiscardBackingStoreMsg(this); |
68 } | 68 } |
69 | 69 |
70 void RenderWidgetHelper::BackingStoreMsgProxy::Run() { | 70 void RenderWidgetHelper::BackingStoreMsgProxy::Run() { |
71 if (!cancelled_) { | 71 if (!cancelled_) { |
72 helper_->OnDispatchBackingStoreMsg(this); | 72 helper_->OnDispatchBackingStoreMsg(this); |
73 helper_ = NULL; | 73 helper_ = NULL; |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { | 393 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { |
394 if (HANDLE_EINTR(close(i->second)) < 0) | 394 if (HANDLE_EINTR(close(i->second)) < 0) |
395 PLOG(ERROR) << "close: " << i->first; | 395 PLOG(ERROR) << "close: " << i->first; |
396 } | 396 } |
397 | 397 |
398 allocated_dibs_.clear(); | 398 allocated_dibs_.clear(); |
399 } | 399 } |
400 #endif | 400 #endif |
401 | 401 |
402 } // namespace content | 402 } // namespace content |
OLD | NEW |