web_message_host_factory_proxy.cc 867 B

12345678910111213141516171819202122232425
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "weblayer/browser/js_communication/web_message_host_factory_proxy.h"
  5. #include "weblayer/browser/js_communication/web_message_reply_proxy_impl.h"
  6. namespace weblayer {
  7. WebMessageHostFactoryProxy::WebMessageHostFactoryProxy(
  8. const base::android::JavaParamRef<jobject>& client)
  9. : client_(client) {}
  10. WebMessageHostFactoryProxy::~WebMessageHostFactoryProxy() = default;
  11. std::unique_ptr<WebMessageHost> WebMessageHostFactoryProxy::CreateHost(
  12. const std::string& origin_string,
  13. bool is_main_frame,
  14. WebMessageReplyProxy* proxy) {
  15. return std::make_unique<WebMessageReplyProxyImpl>(
  16. ++next_id_, client_, origin_string, is_main_frame, proxy);
  17. }
  18. } // namespace weblayer