OLD | NEW |
---|---|
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 #ifndef SKY_VIEWER_INTERNALS_H_ | 5 #ifndef SKY_VIEWER_INTERNALS_H_ |
6 #define SKY_VIEWER_INTERNALS_H_ | 6 #define SKY_VIEWER_INTERNALS_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "gin/handle.h" | 9 #include "gin/handle.h" |
10 #include "gin/object_template_builder.h" | 10 #include "gin/object_template_builder.h" |
11 #include "gin/wrappable.h" | 11 #include "gin/wrappable.h" |
12 #include "sky/services/testing/test_harness.mojom.h" | 12 #include "sky/services/testing/test_harness.mojom.h" |
13 | 13 |
14 namespace sky { | 14 namespace sky { |
15 class DocumentView; | 15 class DocumentView; |
16 class JSShellProxy; | |
16 | 17 |
17 class Internals : public gin::Wrappable<Internals> { | 18 class Internals : public gin::Wrappable<Internals> { |
19 friend class JSShellProxy; | |
abarth-chromium
2015/01/07 22:52:01
Why friend?
hansmuller1
2015/01/07 23:33:04
I'm referring to the document_view_ weak pointer f
| |
18 public: | 20 public: |
19 static gin::WrapperInfo kWrapperInfo; | 21 static gin::WrapperInfo kWrapperInfo; |
20 static gin::Handle<Internals> Create(v8::Isolate*, DocumentView*); | 22 static gin::Handle<Internals> Create(v8::Isolate*, DocumentView*); |
21 | 23 |
22 virtual ~Internals(); | 24 virtual ~Internals(); |
23 | 25 |
24 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( | 26 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( |
25 v8::Isolate* isolate) override; | 27 v8::Isolate* isolate) override; |
26 | 28 |
27 private: | 29 private: |
28 explicit Internals(DocumentView* document_view); | 30 explicit Internals(DocumentView* document_view); |
29 | 31 |
32 mojo::Handle ShellProxyHandle(); | |
30 std::string RenderTreeAsText(); | 33 std::string RenderTreeAsText(); |
31 std::string ContentAsText(); | 34 std::string ContentAsText(); |
32 void NotifyTestComplete(const std::string& test_result); | 35 void NotifyTestComplete(const std::string& test_result); |
33 | 36 |
34 mojo::Handle ConnectToService( | 37 mojo::Handle ConnectToService( |
35 const std::string& application_url, const std::string& interface_name); | 38 const std::string& application_url, const std::string& interface_name); |
36 | 39 |
37 void pauseAnimations(double pauseTime); | 40 void pauseAnimations(double pauseTime); |
38 | 41 |
39 base::WeakPtr<DocumentView> document_view_; | 42 base::WeakPtr<DocumentView> document_view_; |
43 std::vector<JSShellProxy*> js_shell_proxies_; | |
40 TestHarnessPtr test_harness_; | 44 TestHarnessPtr test_harness_; |
41 | 45 |
42 MOJO_DISALLOW_COPY_AND_ASSIGN(Internals); | 46 MOJO_DISALLOW_COPY_AND_ASSIGN(Internals); |
43 }; | 47 }; |
44 | 48 |
45 } // namespace sky | 49 } // namespace sky |
46 | 50 |
47 #endif // SKY_VIEWER_INTERNALS_H_ | 51 #endif // SKY_VIEWER_INTERNALS_H_ |
OLD | NEW |