OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "android_webview/browser/browser_view_renderer.h" | 5 #include "android_webview/browser/browser_view_renderer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/browser_view_renderer_client.h" | 9 #include "android_webview/browser/browser_view_renderer_client.h" |
10 #include "android_webview/browser/compositor_frame_consumer.h" | 10 #include "android_webview/browser/compositor_frame_consumer.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 current_compositor_frame_consumer_ = compositor_frame_consumer; | 128 current_compositor_frame_consumer_ = compositor_frame_consumer; |
129 if (current_compositor_frame_consumer_) { | 129 if (current_compositor_frame_consumer_) { |
130 compositor_frame_consumers_.insert(current_compositor_frame_consumer_); | 130 compositor_frame_consumers_.insert(current_compositor_frame_consumer_); |
131 current_compositor_frame_consumer_->SetCompositorFrameProducer(this); | 131 current_compositor_frame_consumer_->SetCompositorFrameProducer(this); |
132 OnParentDrawConstraintsUpdated(current_compositor_frame_consumer_); | 132 OnParentDrawConstraintsUpdated(current_compositor_frame_consumer_); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 void BrowserViewRenderer::RegisterWithWebContents( | 136 void BrowserViewRenderer::RegisterWithWebContents( |
137 content::WebContents* web_contents) { | 137 content::WebContents* web_contents) { |
138 web_contents->SetUserData(kBrowserViewRendererUserDataKey, | 138 web_contents->SetUserData( |
139 new BrowserViewRendererUserData(this)); | 139 kBrowserViewRendererUserDataKey, |
| 140 base::MakeUnique<BrowserViewRendererUserData>(this)); |
140 } | 141 } |
141 | 142 |
142 void BrowserViewRenderer::TrimMemory() { | 143 void BrowserViewRenderer::TrimMemory() { |
143 DCHECK(ui_task_runner_->BelongsToCurrentThread()); | 144 DCHECK(ui_task_runner_->BelongsToCurrentThread()); |
144 TRACE_EVENT0("android_webview", "BrowserViewRenderer::TrimMemory"); | 145 TRACE_EVENT0("android_webview", "BrowserViewRenderer::TrimMemory"); |
145 // Just set the memory limit to 0 and drop all tiles. This will be reset to | 146 // Just set the memory limit to 0 and drop all tiles. This will be reset to |
146 // normal levels in the next DrawGL call. | 147 // normal levels in the next DrawGL call. |
147 if (!offscreen_pre_raster_) | 148 if (!offscreen_pre_raster_) |
148 ReleaseHardware(); | 149 ReleaseHardware(); |
149 } | 150 } |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 base::StringAppendF(&str, | 775 base::StringAppendF(&str, |
775 "overscroll_rounding_error_: %s ", | 776 "overscroll_rounding_error_: %s ", |
776 overscroll_rounding_error_.ToString().c_str()); | 777 overscroll_rounding_error_.ToString().c_str()); |
777 base::StringAppendF( | 778 base::StringAppendF( |
778 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); | 779 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); |
779 base::StringAppendF(&str, "clear_view: %d ", clear_view_); | 780 base::StringAppendF(&str, "clear_view: %d ", clear_view_); |
780 return str; | 781 return str; |
781 } | 782 } |
782 | 783 |
783 } // namespace android_webview | 784 } // namespace android_webview |
OLD | NEW |