WebProcessHelperMac.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
  2. // reserved. Use of this source code is governed by a BSD-style license that can
  3. // be found in the LICENSE file.
  4. #include <AtomicWebView/Internal/WebAppOther.h>
  5. #include <AtomicWebView/Internal/WebAppRenderer.h>
  6. using namespace Atomic;
  7. #include "include/cef_app.h"
  8. // Entry point function for sub-processes.
  9. int main(int argc, char* argv[])
  10. {
  11. // Provide CEF with command-line arguments.
  12. CefMainArgs main_args(argc, argv);
  13. // Parse command-line arguments.
  14. CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine();
  15. command_line->InitFromArgv(argc, argv);
  16. // Create a ClientApp of the correct type.
  17. CefRefPtr<CefApp> app;
  18. WebApp::ProcessType process_type = WebApp::GetProcessType(command_line);
  19. if (process_type == WebApp::RendererProcess)
  20. app = new WebAppRenderer();
  21. else if (process_type == WebApp::OtherProcess)
  22. app = new WebAppOther();
  23. // Execute the secondary process.
  24. return CefExecuteProcess(main_args, app, NULL);
  25. }