Fix cpplint warnings

This commit is contained in:
Cheng Zhao 2015-09-18 14:12:48 +08:00
parent c550546ff1
commit 9e7de78231
3 changed files with 15 additions and 15 deletions

View file

@ -8,7 +8,6 @@
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/browser.h"
#include "atom/browser/native_window.h"
#include "atom/common/node_includes.h"
#include "atom/common/native_mate_converters/blink_converter.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/gfx_converter.h"

View file

@ -107,9 +107,8 @@ NativeWindow* NativeWindow::FromWebContents(
content::WebContents* web_contents) {
WindowList& window_list = *WindowList::GetInstance();
for (NativeWindow* window : window_list) {
if (window->web_contents() == web_contents){
if (window->web_contents() == web_contents)
return window;
}
}
return nullptr;
}
@ -290,16 +289,12 @@ void NativeWindow::SetAspectRatio(double aspect_ratio,
void NativeWindow::SetFrameSubscription(bool isOffscreen) {
const auto view = web_contents()->GetRenderWidgetHostView();
if (view) {
if (isOffscreen) {
scoped_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber(
new RenderSubscriber(
view->GetVisibleViewportSize(),
base::Bind(&NativeWindow::OnFrameReceived, base::Unretained(this))
)
);
base::Bind(&NativeWindow::OnFrameReceived, base::Unretained(this))));
view->BeginFrameSubscription(subscriber.Pass());
} else {
view->EndFrameSubscription();
@ -593,7 +588,8 @@ bool RenderSubscriber::ShouldCaptureFrame(
gfx::Rect(size_), size_,
base::TimeDelta());
*callback = base::Bind(&RenderSubscriber::CallbackMethod, callback_, *storage);
*callback =
base::Bind(&RenderSubscriber::CallbackMethod, callback_, *storage);
return true;
}

View file

@ -313,10 +313,14 @@ class NativeWindow : public content::WebContentsObserver,
DISALLOW_COPY_AND_ASSIGN(NativeWindow);
};
//This class provides a way to listen to frame renders and to use the rendered frames for offscreen rendering
// This class provides a way to listen to frame renders and to use the rendered
// frames for offscreen rendering
class RenderSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
public:
RenderSubscriber(gfx::Size size, base::Callback<void(bool, scoped_refptr<media::VideoFrame>)> callback) : size_(size), callback_(callback) {}
RenderSubscriber(
gfx::Size size,
base::Callback<void(bool, scoped_refptr<media::VideoFrame>)> callback)
: size_(size), callback_(callback) {}
bool ShouldCaptureFrame(const gfx::Rect& damage_rect,
base::TimeTicks present_time,
@ -325,10 +329,11 @@ class RenderSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
base::TimeTicks last_present_time() const { return last_present_time_; }
static void CallbackMethod(base::Callback<void(bool, scoped_refptr<media::VideoFrame>)> callback,
scoped_refptr<media::VideoFrame> frame,
base::TimeTicks present_time,
bool success) {
static void CallbackMethod(
base::Callback<void(bool, scoped_refptr<media::VideoFrame>)> callback,
scoped_refptr<media::VideoFrame> frame,
base::TimeTicks present_time,
bool success) {
callback.Run(success, frame);
}