| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ | 5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ |
| 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ | 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 class HEADLESS_EXPORT HeadlessBrowserContext::Builder { | 77 class HEADLESS_EXPORT HeadlessBrowserContext::Builder { |
| 78 public: | 78 public: |
| 79 Builder(Builder&&); | 79 Builder(Builder&&); |
| 80 ~Builder(); | 80 ~Builder(); |
| 81 | 81 |
| 82 // Set custom network protocol handlers. These can be used to override URL | 82 // Set custom network protocol handlers. These can be used to override URL |
| 83 // fetching for different network schemes. | 83 // fetching for different network schemes. |
| 84 Builder& SetProtocolHandlers(ProtocolHandlerMap protocol_handlers); | 84 Builder& SetProtocolHandlers(ProtocolHandlerMap protocol_handlers); |
| 85 | 85 |
| 86 // DEPRECATED. Specify JS mojo module bindings to be installed, one per mojom | |
| 87 // file. Note a single mojom file could potentially define many interfaces. | |
| 88 // |mojom_name| the name including path of the .mojom file. | |
| 89 // |js_bindings| compiletime generated javascript bindings. Typically loaded | |
| 90 // from gen/path/name.mojom.js. | |
| 91 // TODO(alexclarke): Remove this. | |
| 92 Builder& AddJsMojoBindings(const std::string& mojom_name, | |
| 93 const std::string& js_bindings); | |
| 94 | |
| 95 Builder& AddTabSocketMojoBindings(); | 86 Builder& AddTabSocketMojoBindings(); |
| 96 | 87 |
| 97 // By default if you add mojo bindings, http and https are disabled because | 88 // By default if you add mojo bindings, http and https are disabled because |
| 98 // its almost certinly unsafe for arbitary sites on the internet to have | 89 // its almost certinly unsafe for arbitary sites on the internet to have |
| 99 // access to these bindings. If you know what you're doing it may be OK to | 90 // access to these bindings. If you know what you're doing it may be OK to |
| 100 // turn them back on. E.g. if headless_lib is being used in a testing | 91 // turn them back on. E.g. if headless_lib is being used in a testing |
| 101 // framework which serves the web content from disk that's likely ok. | 92 // framework which serves the web content from disk that's likely ok. |
| 102 // | 93 // |
| 103 // That said, best pratice is to add a ProtocolHandler to serve the | 94 // That said, best pratice is to add a ProtocolHandler to serve the |
| 104 // webcontent over a custom protocol. That way you can be sure that only the | 95 // webcontent over a custom protocol. That way you can be sure that only the |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 136 |
| 146 std::list<MojoBindings> mojo_bindings_; | 137 std::list<MojoBindings> mojo_bindings_; |
| 147 bool enable_http_and_https_if_mojo_used_; | 138 bool enable_http_and_https_if_mojo_used_; |
| 148 | 139 |
| 149 DISALLOW_COPY_AND_ASSIGN(Builder); | 140 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 150 }; | 141 }; |
| 151 | 142 |
| 152 } // namespace headless | 143 } // namespace headless |
| 153 | 144 |
| 154 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ | 145 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ |
| OLD | NEW |