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

Side by Side Diff: content/browser/frame_host/navigation_entry_screenshot_manager.cc

Issue 593503003: Support error handling for Surface readbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary headers. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/navigation_entry_screenshot_manager.h" 5 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/threading/worker_pool.h" 8 #include "base/threading/worker_pool.h"
9 #include "content/browser/frame_host/navigation_controller_impl.h" 9 #include "content/browser/frame_host/navigation_controller_impl.h"
10 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 kAlpha_8_SkColorType); 129 kAlpha_8_SkColorType);
130 } 130 }
131 131
132 void NavigationEntryScreenshotManager::SetMinScreenshotIntervalMS( 132 void NavigationEntryScreenshotManager::SetMinScreenshotIntervalMS(
133 int interval_ms) { 133 int interval_ms) {
134 DCHECK_GE(interval_ms, 0); 134 DCHECK_GE(interval_ms, 0);
135 min_screenshot_interval_ms_ = interval_ms; 135 min_screenshot_interval_ms_ = interval_ms;
136 } 136 }
137 137
138 void NavigationEntryScreenshotManager::OnScreenshotTaken(int unique_id, 138 void NavigationEntryScreenshotManager::OnScreenshotTaken(int unique_id,
139 bool success, 139 bool success,
140 const SkBitmap& bitmap) { 140 const SkBitmap& bitmap,
141 const int& response) {
141 NavigationEntryImpl* entry = NULL; 142 NavigationEntryImpl* entry = NULL;
142 int entry_count = owner_->GetEntryCount(); 143 int entry_count = owner_->GetEntryCount();
143 for (int i = 0; i < entry_count; ++i) { 144 for (int i = 0; i < entry_count; ++i) {
144 NavigationEntry* iter = owner_->GetEntryAtIndex(i); 145 NavigationEntry* iter = owner_->GetEntryAtIndex(i);
145 if (iter->GetUniqueID() == unique_id) { 146 if (iter->GetUniqueID() == unique_id) {
146 entry = NavigationEntryImpl::FromNavigationEntry(iter); 147 entry = NavigationEntryImpl::FromNavigationEntry(iter);
147 break; 148 break;
148 } 149 }
149 } 150 }
150 151
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 owner_->GetEntryAtIndex(forward)); 273 owner_->GetEntryAtIndex(forward));
273 if (ClearScreenshot(entry)) 274 if (ClearScreenshot(entry))
274 --screenshot_count; 275 --screenshot_count;
275 ++forward; 276 ++forward;
276 } 277 }
277 CHECK_GE(screenshot_count, 0); 278 CHECK_GE(screenshot_count, 0);
278 CHECK_LE(screenshot_count, kMaxScreenshots); 279 CHECK_LE(screenshot_count, kMaxScreenshots);
279 } 280 }
280 281
281 } // namespace content 282 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698