projects
/
platform
/
framework
/
web
/
crosswalk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git]
/
src
/
mojo
/
services
/
surfaces
/
surfaces_service_application.cc
diff --git
a/src/mojo/services/surfaces/surfaces_service_application.cc
b/src/mojo/services/surfaces/surfaces_service_application.cc
index
3eaadd7
..
8677be4
100644
(file)
--- a/
src/mojo/services/surfaces/surfaces_service_application.cc
+++ b/
src/mojo/services/surfaces/surfaces_service_application.cc
@@
-6,10
+6,14
@@
#include "cc/surfaces/display.h"
#include "cc/surfaces/display.h"
+#include "mojo/application/application_runner_chromium.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/services/surfaces/surfaces_service_impl.h"
+
namespace mojo {
SurfacesServiceApplication::SurfacesServiceApplication()
namespace mojo {
SurfacesServiceApplication::SurfacesServiceApplication()
- : next_id_namespace_(1u), display_(NULL) {
+ : next_id_namespace_(1u), display_(NULL)
, draw_timer_(false, false)
{
}
SurfacesServiceApplication::~SurfacesServiceApplication() {
}
SurfacesServiceApplication::~SurfacesServiceApplication() {
@@
-21,24
+25,29
@@
bool SurfacesServiceApplication::ConfigureIncomingConnection(
return true;
}
return true;
}
-void SurfacesServiceApplication::Create(ApplicationConnection* connection,
- InterfaceRequest<Surface> request) {
- BindToRequest(new SurfacesImpl(&manager_, next_id_namespace_++, this),
+void SurfacesServiceApplication::Create(
+ ApplicationConnection* connection,
+ InterfaceRequest<SurfacesService> request) {
+ BindToRequest(new SurfacesServiceImpl(&manager_, &next_id_namespace_, this),
&request);
}
void SurfacesServiceApplication::FrameSubmitted() {
&request);
}
void SurfacesServiceApplication::FrameSubmitted() {
- if (display_)
- display_->Draw();
+ if (!draw_timer_.IsRunning() && display_) {
+ draw_timer_.Start(FROM_HERE,
+ base::TimeDelta::FromMilliseconds(17),
+ base::Bind(base::IgnoreResult(&cc::Display::Draw),
+ base::Unretained(display_)));
+ }
}
void SurfacesServiceApplication::SetDisplay(cc::Display* display) {
display_ = display;
}
}
void SurfacesServiceApplication::SetDisplay(cc::Display* display) {
display_ = display;
}
-// static
-ApplicationDelegate* ApplicationDelegate::Create() {
- return new SurfacesServiceApplication;
-}
-
} // namespace mojo
} // namespace mojo
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+ mojo::ApplicationRunnerChromium runner(new mojo::SurfacesServiceApplication);
+ return runner.Run(shell_handle);
+}