-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Very much work-in-progress towards #159. The idea is to marshal the J…
…avascript execution over to the CefFrame in the render process, but it doesn't seem to work yet… Have to check with Marshall & friends.
- Loading branch information
Showing
9 changed files
with
135 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright © 2013 The CefSharp Project. All rights reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | ||
|
||
#define DECL __declspec(dllexport) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright © 2013 The CefSharp Project. All rights reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | ||
|
||
#pragma once | ||
|
||
#include "Program.h" | ||
#include "SubprocessCefApp.h" | ||
|
||
SubprocessCefApp* SubprocessCefApp::_instance = nullptr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright © 2013 The CefSharp Project. All rights reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | ||
|
||
#pragma once | ||
|
||
#include <list> | ||
#include "include/cef_app.h" | ||
|
||
private class SubprocessCefApp : public CefApp, | ||
public CefRenderProcessHandler | ||
{ | ||
static SubprocessCefApp* _instance; | ||
std::list<CefRefPtr<CefBrowser>> _browsers; | ||
|
||
public: | ||
|
||
static SubprocessCefApp* GetInstance() | ||
{ | ||
if (_instance == nullptr) | ||
{ | ||
_instance = new SubprocessCefApp(); | ||
} | ||
|
||
return _instance; | ||
} | ||
|
||
virtual DECL CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() OVERRIDE | ||
{ | ||
return this; | ||
} | ||
|
||
virtual DECL void OnBrowserCreated(CefRefPtr<CefBrowser> browser) OVERRIDE | ||
{ | ||
_browsers.push_back(browser); | ||
} | ||
|
||
virtual DECL void OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) OVERRIDE | ||
{ | ||
_browsers.remove(browser); | ||
} | ||
|
||
virtual DECL CefRefPtr<CefBrowser> GetBrowserById(int browser_id) | ||
{ | ||
// FIXME: Doesn't seem to work. Our list contains a browser w/ ID == 0, and the parameter we get is 1. How come? | ||
// We could experiment with OnContextCreated() to see if it would work better... | ||
for (auto browser : _browsers) | ||
{ | ||
if (browser->GetIdentifier() == browser_id) | ||
{ | ||
return browser; | ||
} | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
IMPLEMENT_REFCOUNTING(SubprocessCefApp); | ||
}; |