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

Side by Side Diff: services/js/js_app.cc

Issue 703023004: Move the JS content handler et al from mojo/apps/js to mojo/services (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixed DEPS gl build Created 6 years, 1 month 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
« no previous file with comments | « services/js/js_app.h ('k') | services/js/modules/clock/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/apps/js/js_app.h" 5 #include "services/js/js_app.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "gin/array_buffer.h" 8 #include "gin/array_buffer.h"
9 #include "gin/converter.h" 9 #include "gin/converter.h"
10 #include "mojo/apps/js/mojo_bridge_module.h"
11 #include "mojo/common/data_pipe_utils.h" 10 #include "mojo/common/data_pipe_utils.h"
11 #include "services/js/mojo_bridge_module.h"
12 12
13 namespace mojo { 13 namespace mojo {
14 namespace apps { 14 namespace js {
15 15
16 JSApp::JSApp(ShellPtr shell, URLResponsePtr response) : shell_(shell.Pass()) { 16 JSApp::JSApp(ShellPtr shell, URLResponsePtr response) : shell_(shell.Pass()) {
17 // TODO(hansmuller): handle load failure here and below. 17 // TODO(hansmuller): handle load failure here and below.
18 DCHECK(!response.is_null()); 18 DCHECK(!response.is_null());
19 file_name_ = response->url; 19 file_name_ = response->url;
20 bool result = common::BlockingCopyToString(response->body.Pass(), &source_); 20 bool result = common::BlockingCopyToString(response->body.Pass(), &source_);
21 DCHECK(result); 21 DCHECK(result);
22 22
23 runner_delegate.AddBuiltinModule(MojoInternals::kModuleName, 23 runner_delegate.AddBuiltinModule(MojoInternals::kModuleName,
24 base::Bind(MojoInternals::GetModule, this)); 24 base::Bind(MojoInternals::GetModule, this));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 void JSApp::Initialize(Array<String> args) { 61 void JSApp::Initialize(Array<String> args) {
62 } 62 }
63 63
64 void JSApp::QuitInternal() { 64 void JSApp::QuitInternal() {
65 shell_runner_.reset(); 65 shell_runner_.reset();
66 base::MessageLoop::current()->QuitWhenIdle(); 66 base::MessageLoop::current()->QuitWhenIdle();
67 } 67 }
68 68
69 } // namespace apps 69 } // namespace js
70 } // namespace mojo 70 } // namespace mojo
OLDNEW
« no previous file with comments | « services/js/js_app.h ('k') | services/js/modules/clock/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698