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

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

Issue 2857983003: Use constexpr TaskTraits constructor in content. (Closed)
Patch Set: CR gab #8 Created 3 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 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/macros.h" 8 #include "base/macros.h"
9 #include "base/task_scheduler/post_task.h" 9 #include "base/task_scheduler/post_task.h"
10 #include "content/browser/frame_host/navigation_controller_impl.h" 10 #include "content/browser/frame_host/navigation_controller_impl.h"
(...skipping 15 matching lines...) Expand all
26 namespace content { 26 namespace content {
27 27
28 // Encodes the A8 SkBitmap to grayscale PNG in a worker thread. 28 // Encodes the A8 SkBitmap to grayscale PNG in a worker thread.
29 class ScreenshotData : public base::RefCountedThreadSafe<ScreenshotData> { 29 class ScreenshotData : public base::RefCountedThreadSafe<ScreenshotData> {
30 public: 30 public:
31 ScreenshotData() { 31 ScreenshotData() {
32 } 32 }
33 33
34 void EncodeScreenshot(const SkBitmap& bitmap, base::Closure callback) { 34 void EncodeScreenshot(const SkBitmap& bitmap, base::Closure callback) {
35 base::PostTaskWithTraitsAndReply( 35 base::PostTaskWithTraitsAndReply(
36 FROM_HERE, base::TaskTraits().WithShutdownBehavior( 36 FROM_HERE, {base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
37 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
38 base::Bind(&ScreenshotData::EncodeOnWorker, this, bitmap), callback); 37 base::Bind(&ScreenshotData::EncodeOnWorker, this, bitmap), callback);
39 } 38 }
40 39
41 scoped_refptr<base::RefCountedBytes> data() const { return data_; } 40 scoped_refptr<base::RefCountedBytes> data() const { return data_; }
42 41
43 private: 42 private:
44 friend class base::RefCountedThreadSafe<ScreenshotData>; 43 friend class base::RefCountedThreadSafe<ScreenshotData>;
45 virtual ~ScreenshotData() { 44 virtual ~ScreenshotData() {
46 } 45 }
47 46
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 NavigationEntryImpl* entry = owner_->GetEntryAtIndex(forward); 240 NavigationEntryImpl* entry = owner_->GetEntryAtIndex(forward);
242 if (ClearScreenshot(entry)) 241 if (ClearScreenshot(entry))
243 --screenshot_count; 242 --screenshot_count;
244 ++forward; 243 ++forward;
245 } 244 }
246 CHECK_GE(screenshot_count, 0); 245 CHECK_GE(screenshot_count, 0);
247 CHECK_LE(screenshot_count, kMaxScreenshots); 246 CHECK_LE(screenshot_count, kMaxScreenshots);
248 } 247 }
249 248
250 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.cc ('k') | content/browser/net/quota_policy_cookie_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698