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

Unified Diff: media/capture/content/video_capture_oracle.cc

Issue 2888783004: NOINLINE in VideoCaptureOracle::IsFrameInRecentHistory to address issue 723090 (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/content/video_capture_oracle.cc
diff --git a/media/capture/content/video_capture_oracle.cc b/media/capture/content/video_capture_oracle.cc
index 1a4ed3750c727708fccea44c4753be47e7ecfda1..e6793906d14e2f77dcc89d3f25b05f0d23d478d1 100644
--- a/media/capture/content/video_capture_oracle.cc
+++ b/media/capture/content/video_capture_oracle.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
@@ -384,9 +385,11 @@ void VideoCaptureOracle::SetFrameTimestamp(int frame_number,
frame_timestamps_[frame_number % kMaxFrameTimestamps] = timestamp;
}
-bool VideoCaptureOracle::IsFrameInRecentHistory(int frame_number) const {
+NOINLINE bool VideoCaptureOracle::IsFrameInRecentHistory(
+ int frame_number) const {
// Adding (next_frame_number_ >= 0) helps the compiler deduce that there
- // is no possibility of overflow here.
+ // is no possibility of overflow here. NOINLINE is also required to ensure the
+ // compiler can make this deduction (some compilers fail to otherwise...).
return (frame_number >= 0 && next_frame_number_ >= 0 &&
frame_number <= next_frame_number_ &&
(next_frame_number_ - frame_number) < kMaxFrameTimestamps);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698